本文整理汇总了C++中SmartPtr::MapStreamId方法的典型用法代码示例。如果您正苦于以下问题:C++ SmartPtr::MapStreamId方法的具体用法?C++ SmartPtr::MapStreamId怎么用?C++ SmartPtr::MapStreamId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SmartPtr
的用法示例。
在下文中一共展示了SmartPtr::MapStreamId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateVideoPin
HRESULT CSampleCGB::CreateVideoPin( IMpeg2Demultiplexer *pIMpeg2Demux )
{
if(!pIMpeg2Demux)return E_INVALIDARG;
AM_MEDIA_TYPE amTypeVideo;
amTypeVideo.majortype = MEDIATYPE_Video;
amTypeVideo.subtype = MEDIASUBTYPE_MPEG2_VIDEO;
amTypeVideo.bFixedSizeSamples = TRUE;
amTypeVideo.bTemporalCompression = 0;
amTypeVideo.formattype = FORMAT_MPEG2_VIDEO;
amTypeVideo.pUnk = NULL;
amTypeVideo.cbFormat = sizeof(Mpeg2ProgramVideo);
amTypeVideo.pbFormat = Mpeg2ProgramVideo;
//
// Create video pin
//
SmartPtr<IPin> pVideoOutPin;
HRESULT hr = pIMpeg2Demux->CreateOutputPin(&amTypeVideo,L"MpegVideo",&pVideoOutPin);
if(FAILED(hr))return hr;
SmartPtr<IMPEG2StreamIdMap> pIVideoPIDMap;
hr = pVideoOutPin->QueryInterface(&pIVideoPIDMap);
if(FAILED(hr))return hr;
hr = pIVideoPIDMap->MapStreamId(VidPID_,MPEG2_PROGRAM_ELEMENTARY_STREAM,0,0);
if(FAILED(hr))return hr;
return hr;
}
示例2: CreateAudioPin
HRESULT CSampleCGB::CreateAudioPin( IMpeg2Demultiplexer *pIMpeg2Demux )
{
if(!pIMpeg2Demux)return E_INVALIDARG;
//
// for audio: could be Mpeg1, Mpeg2, AC3: if Mpeg1 failed (connect failed) try Mpeg2.if failed tried AC3
// Audio struct of AC3 can be copied from dev code.
//
AM_MEDIA_TYPE amTypeAudio;
amTypeAudio.majortype = MEDIATYPE_Audio;
amTypeAudio.subtype = MEDIASUBTYPE_MPEG2_AUDIO;
amTypeAudio.bFixedSizeSamples = TRUE;
amTypeAudio.bTemporalCompression = 0;
amTypeAudio.formattype = FORMAT_WaveFormatEx;
amTypeAudio.pUnk = NULL;
amTypeAudio.cbFormat = sizeof( MPEG1AudioFormat );
amTypeAudio.pbFormat = MPEG1AudioFormat;
SmartPtr<IPin> pAudioOutPin;
HRESULT hr = pIMpeg2Demux->CreateOutputPin(&amTypeAudio,L"MpegAudio",&pAudioOutPin);
if(FAILED(hr))return hr;
SmartPtr<IMPEG2StreamIdMap> pIAudioPIDMap;
hr = pAudioOutPin->QueryInterface(&pIAudioPIDMap);
if(FAILED(hr))return hr;
hr = pIAudioPIDMap->MapStreamId(AudPID_,MPEG2_PROGRAM_ELEMENTARY_STREAM,0,0);
if(FAILED(hr))return hr;
return hr;
}
示例3: sizeof
HRESULT
ISampleCaptureGraphBuilder::CreateVideoPin(
IMpeg2Demultiplexer *pIMpeg2Demux )
{
if( !pIMpeg2Demux )
{
return E_INVALIDARG;
}
AM_MEDIA_TYPE amTypeVideo;
amTypeVideo.majortype = MEDIATYPE_Video;
amTypeVideo.subtype = MEDIASUBTYPE_MPEG2_VIDEO;
amTypeVideo.bFixedSizeSamples = TRUE;
amTypeVideo.bTemporalCompression = 0;
amTypeVideo.formattype = FORMAT_MPEG2Video;
amTypeVideo.pUnk = NULL;
amTypeVideo.cbFormat = sizeof( Mpeg2ProgramVideo );
amTypeVideo.pbFormat = Mpeg2ProgramVideo;
//
// Create video pin
//
SmartPtr<IPin> pVideoOutPin;
HRESULT hr = pIMpeg2Demux->CreateOutputPin( &amTypeVideo, L"MpegVideo", &pVideoOutPin );
if( FAILED( hr ) )
{
return hr;
}
SmartPtr<IMPEG2StreamIdMap> pIVideoPIDMap;
hr = pVideoOutPin->QueryInterface( &pIVideoPIDMap );
if( FAILED( hr ) )
{
return hr;
}
hr = pIVideoPIDMap->MapStreamId(VidPID_, MPEG2_PROGRAM_ELEMENTARY_STREAM , 0, 0);
if( FAILED( hr ) )
{
return hr;
}
#ifdef USE_VMR
//
// Get the VMR interface and add it to the graph
//
SmartPtr<IBaseFilter> pVMR;
hr = pVMR.CoCreateInstance( CLSID_VideoMixingRenderer );
if( FAILED( hr ) )
{
return hr;
}
hr = graph_->AddFilter( pVMR, L"VMR" );
if( FAILED( hr ) )
{
return hr;
}
//
//before rendering the VMR, make the number of streams 1
//
SmartPtr<IVMRFilterConfig> pConfig;
hr = pVMR.QueryInterface( &pConfig );
if( FAILED( hr ) )
{
return hr;
}
hr = pConfig->SetNumberOfStreams( 1 );
if( FAILED( hr ) )
{
return hr;
}
//
// Get the input pin from the VMR
//
SmartPtr<IPin> pInputPin;
hr = graphBuilder2_->FindPin(
static_cast<IBaseFilter *>( pVMR ),
PINDIR_INPUT,
NULL,
NULL,
TRUE,
0,
&pInputPin
);
if( FAILED( hr ) )
{
hr = pIMpeg2Demux->DeleteOutputPin(L"MpegVideo");
graph_->RemoveFilter( pVMR );
return hr;
}
return graph_->Connect( pVideoOutPin, pInputPin );
//.........这里部分代码省略.........