Hier das test Prg,
Code:
if( fMPEG2 )
{
hr = pBuilder->RenderStream(&PIN_CATEGORY_PREVIEW,
&MEDIATYPE_Stream, pVCap, pGrabBase, NULL);
if( FAILED( hr ) )
{
ErrMsg(TEXT("Cannot build MPEG2 preview graph!"));
}
}
else
{
hr = pBuilder->RenderStream(&PIN_CATEGORY_PREVIEW,
&MEDIATYPE_Interleaved, pVCap, pGrabBase, NULL);
if(hr == VFW_S_NOPREVIEWPIN)
{
// preview was faked up for us using the (only) capture pin
fPreviewFaked = TRUE;
}
else if(hr != S_OK)
{
// maybe it's DV?
hr = pBuilder->RenderStream(&PIN_CATEGORY_PREVIEW,
&MEDIATYPE_Video, pVCap, pGrabBase, NULL);
if(hr == VFW_S_NOPREVIEWPIN)
{
// preview was faked up for us using the (only) capture pin
fPreviewFaked = TRUE;
}
else if(hr != S_OK)
{
ErrMsg(TEXT("This graph cannot preview!"));
fPreviewGraphBuilt = FALSE;
return FALSE;
}
}
//
// Render the closed captioning pin? It could be a CC or a VBI category pin,
// depending on the capture driver
//
if(fCapCC)
{
hr = pBuilder->RenderStream(&PIN_CATEGORY_CC, NULL,
pVCap, NULL, NULL);
if(hr != NOERROR)
{
hr = pBuilder->RenderStream(&PIN_CATEGORY_VBI, NULL,
pVCap, NULL, NULL);
if(hr != NOERROR)
{
ErrMsg(TEXT("Cannot render closed captioning"));
}
}
}
}
MS:
// build the preview graph!
//
// !!! PLEASE NOTE !!! Some new WDM devices have totally separate capture
// and preview settings. An application that wishes to preview and then
// capture may have to set the preview pin format using IAMStreamConfig on the
// preview pin, and then again on the capture pin to capture with that format.
// In this sample app, there is a separate page to set the settings on the
// capture pin and one for the preview pin. To avoid the user
// having to enter the same settings in 2 dialog boxes, an app can have its own
// UI for choosing a format (the possible formats can be enumerated using
// IAMStreamConfig) and then the app can programmatically call IAMStreamConfig
Lesezeichen