Microsoft DirectX 8.1 (C++)

Type-2 Transmit with Preview

To transmit a type-2 file from disk to the camcorder while previewing, use the filter graph shown in the following diagram.

Type-2 Transmit with Preview

This graph uses the DV Muxer filter to combine the audio and video streams. It sends the interleaved stream to the MSDV filter, but splits the stream again for preview. To build this graph, use the following code:

// Add the DV Mux filter to the graph.
IBaseFilter *pDVMux;
hr = CoCreateInstance(CLSID_InfTee, 0, CLSCTX_INPROC_SERVER
    IID_IBaseFilter, reinterpret_cast<void**>)(&pDVMux));
hr = pGraph->AddFilter(pDVMux, L"DV Mux");

// Add the File Source filter to the graph.
IBaseFilter *pFileSource;
hr = pGraph->AddSourceFilter(L"C:\\Example2.avi", L"Source", 
    &pFileSource);

hr = pBuilder->RenderStream(0, 0, pFileSource, 0, pDVMux);
hr = pBuilder->RenderStream(0, 0, pFileSource, 0, pDVMux);

// Add the Infinite Pin Tee filter to the graph.
IBaseFilter *pTee;
hr = CoCreateInstance(CLSID_InfTee, 0, CLSCTX_INPROC_SERVER
    IID_IBaseFilter, reinterpret_cast<void**>)(&pTee));
hr = pGraph->AddFilter(pTee, L"Tee");

hr = pBuilder->RenderStream(0, 0, pDVMux, 0, pTee);
hr = pBuilder->RenderStream(0, 0, pTee, 0, pDV);
hr = pBuilder->RenderStream(0, &MEDIATYPE_Interleaved, pTee, 0, 0);

The first two calls to RenderStream route the stream from the source filter to the DV Muxer. In the first call, the Capture Graph Builder automatically adds the AVI Splitter to the graph and connects the AVI Splitter's first output pin to the DV Muxer. In the second call, the Capture Graph Builder finds the AVI Splitter's second output pin and connects that. The DV Muxer produces an interleaved audio/video stream.

The third call to RenderStream connects the DV Muxer to the Infinite Pin Tee filter. The next call connects one stream from the Infinite Pin Tee to the MSDV filter, for transmit. The final call to RenderStream builds the preview section of the graph.