Combining Video Capture and Preview (Windows CE 5.0)

Send Feedback

Applies to: Devices based on Windows Mobile Version 5.0 and later

The section Capturing Video to a File describes how to capture video to various file formats. The section Video Previews describes how to build a live preview graph. However, many applications must do both at once. To build a combined preview and file-writing graph, make two calls to ICaptureGraphBuilder2::RenderStream as shown in the following code.

// Render the preview stream to the video renderer.
hr = pBuild->RenderStream(&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, pCap, 
    NULL, NULL);

// Render the capture stream to the mux.
hr = pBuild->RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, pCap, 
    NULL, pMux);

In the above code, the Capture Graph Builder is hiding some details:

  • If the capture filter has a preview pin and a capture pin, the ICaptureGraphBuilder2::RenderStream method simply renders both pins, as shown in the following illustration.

ms940052.dshow_capture_and_preview1(en-us,MSDN.10).gif

  • If the filter has only a capture pin, the Capture Graph Builder uses the Smart Tee Filter to split the capture stream. The following illustration shows the graph with a Smart Tee.

ms940052.dshow_capture_and_preview2(en-us,MSDN.10).gif

The Smart Tee filter has a capture pin and a preview pin. It takes a single video stream from the capture filter and splits it into two streams, one for capture and one for preview. To maintain throughput on the capture pin, the preview pin drops frames as needed. It also strips the time stamps from each sample before delivering it, for the reasons discussed in the topic Video Capture Filters.

Although the Smart Tee splits the stream, it does not physically duplicate the video data. Instead, it uses custom media sample objects that share the buffers. The samples are marked "read-only" to ensure that downstream filters do not write on the data.

See Also

Capturing Video to a File

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.