Microsoft DirectX 8.0 Project Introduction Microsoft COM DirectShow Instruction: Hsiao Kung Wu...
-
Upload
neil-merritt -
Category
Documents
-
view
224 -
download
0
Transcript of Microsoft DirectX 8.0 Project Introduction Microsoft COM DirectShow Instruction: Hsiao Kung Wu...
Microsoft DirectX 8.0
Project Introduction
Microsoft COM
DirectShow
Instruction: Hsiao Kung Wu
Students: 賴建利、林廷駿、楊惟仁
Project Introduction I
DiskR
TP
RTP
ReceiverPlayer
Split AVI
DiskJRTP
Multicast
search
Network
COMBINE
Project Introduction II
DiskR
TP
RTP
ReceiverPlayer
Sender
Disk
JRTP
Multicast
search
Network
COMBINE
Capture
COMBINE
Project Introduction III
MEMR
TP
RTP
ReceiverPlayer
Sender
MEM
JRTP
Multicast
search
Network
COMBINE
Capture
COMBINE
RTC
P
RTCP
Microsoft COM( Component Object Model)
Single Program
A B
C
A-B
A-C B-C
Small mini program Small mini program
Small mini program
Microsoft COM( Component Object Model)
COM is a spec, it defines methods of dynamic changing components and standards of cooperation between components and client programs.
COM is not… A programming language DLLs 、 MFC Must be implemented by C++
Microsoft COM( Component Object Model)
COM Components is an executing code in the form of WIN32 DLL or EXE, and it must satisfy COM spec.
DirectShow
FilterThe basic building block of DirectShow is a software component called a filter. DirectShow separates the processing of multimedia data into discrete steps, and a filter represents one (or sometimes more than one) processing step. All DirectShow filters fall into one of these three categories: source filters, transform filters, and renderer filters.
DirectShow
Source FilterSource filters present the raw multimedia data for processing.
Transform FilterTransform filters accept either raw or partially-processed data and process it further before passing it on.
Render FilterRenderer filters generally accept fully-processed data and play it on the system's monitor or through the speakers or possibly through some external device.
DirectShow
Filter GraphWhenever a media file or stream is played, recorded, captured, broadcast, or processed in any way, it is done by means of connecting one or more filters together in a
configuration called a filter graph.
PIN
DirectShow
Initial COM Library
Create Filter Graph Manager
Configure Filter Graph
Control Media Stream
Handle Events
#include <dshow.h>
void main(void)
{
IGraphBuilder *pGraph;
IMediaControl *pMediaControl;
IMediaEvent *pEvent;
CoInitialize(NULL);
// Create the filter graph manager and query for interfaces.
CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&pGraph);
pGraph->QueryInterface(IID_IMediaControl, (void **)&pMediaControl);
pGraph->QueryInterface(IID_IMediaEvent, (void **)&pEvent);
// Build the graph. IMPORTANT: Change string to a file on your system.
pGraph->RenderFile(L"C:\\Hello_World.avi", NULL);
// Run the graph.
pMediaControl->Run();
// Wait for completion. long evCode;
pEvent->WaitForCompletion(INFINITE, &evCode);
// Clean up.
pMediaControl->Release();
pEvent->Release();
pGraph->Release();
CoUninitialize(); }
STEP 1
STEP 2
STEP 3
DirectShow
Our Program
DirectShow In Our Project
Video CaptureFilter
Video CompressorFilter
File WriterFilter
Video RenderFilter
AVI MUXFilter
Optional
Receiver SenderNetwork
File Source Filter
AVI Splitter Filter
Audio Render Filter
Video Render Filter
Problems
Performance of Play Because I/O overhead when render files. Solution: Write a source filter for network stream.
Delay of Real Time Compression , network transporting data and rendering
multiple files cause the delay.
Summary
Using DirectShow is easy. If we want to make it flexible, we must learn how to create filter.
The real time problem must depend on RTP control.
Reference
Inside COM--Microsoft Microsoft DirectX8.0 SDK Document Online MSDN
Appendix
Sender圖片
Appendix
Receiver 圖片
PS.畫面抓不下來