Microsoft DirectX 8.1 (C++)

Type-1 Transmit with Preview

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

Type-1 Transmit with Preview

There is no danger of dropping frames when reading from a file, as there is with live capture, so this graph uses the Infinite Pin Tee filter instead of the Smart Tee filter. To build this graph, use the following code:

// 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");

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

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

Call the IGraphBuilder::AddSourceFilter method to add the source filter. The first call to RenderStream connects the source filter to the Infinite Pin Tee. The second call routes the interleaved stream to the MSDV filter for transmit. By specifying MEDIATYPE_Interleaved, you ensure that the method fails if the source file is not a type-1 DV file. In that case, you can back out and attempt to build a type-2 transmit graph instead. The second call to RenderStream builds the preview section of the graph.

Transmit can only function if the camcorder is in VTR mode. For information about controlling the external transport on the camcorder, see Controlling a DV Camcorder.