Z
zlkxzy
Unregistered / Unconfirmed
GUEST, unregistred user!
pMPEG4SourceFilter: IBaseFilter ;
pMPEG2Decoder:IBaseFilter;
pFileSource:IFileSourceFilter;
pimc:IMediaControl;
pPin,pPin1:IPin;
pGraph:=nil;
pMPEG4SourceFilter:=nil;
pFileSource:=nil;
if FAILED(CoCreateInstance(CLSID_FilterGraph,nil,CLSCTX_INPROC_SERVER,
IID_IGraphBuilder,pGraph)) then
begin
// pGraph:=nil;
exit;
end;
dlgOpen1.Execute;
if dlgOpen1.FileName <> ''then
begin
k:= uppercase(ExtractFileExt(dlgOpen1.FileName));
if (k='.MP4') or (k='.3GP') then
begin
CoCreateInstance(CLSID_SDMP4FileSource, nil, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, pMPEG4SourceFilter);
CoCreateInstance(CLSID_RM_MPEG2_VIDEO_SUBPICTURE, nil, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, pMPEG2Decoder);
pGraph.AddFilter(pMPEG4SourceFilter,'MPEG4 Source');
pGraph.AddFilter(pMPEG2Decoder,'Sigma Designs MPEG-2 hardware Decoder');
pMPEG4SourceFilter.QueryInterface(IID_IFileSourceFilter,pFileSource);
pFileSource.Load(PWideChar(WideString(dlgOpen1.FileName)),nil);
pFileSource:=nil;
pPin:=GetOutPin(pMPEG4SourceFilter,-1);
pMPEG2Decoder.FindPin('Audio In',pPin1);
pGraph.Connect(pPin,pPin1);
pPin:=nil;
pPin1:=nil;
pPin:=GetOutPin(pMPEG4SourceFilter,0);
pMPEG2Decoder.FindPin('Video In',pPin1);
pGraph.Connect(pPin,pPin1);
pMPEG2Decoder:=nil;
pMPEG4SourceFilter:=nil;
pPin:=nil;
pPin1:=nil;
pGraph.QueryInterface(IID_IMediaControl,pimc);
pimc.Run;
pimc:=nil;
end;
CLSID_SDMP4FileSource
CLSID_RM_MPEG2_VIDEO_SUBPICTURE
这两个是神龙卡的 对应的clsid
我每次播放的时候,程序不出错,但神龙卡就是不播放,是我那连接错了呀,谢谢大家啦!
我的QQ 87797301
pMPEG2Decoder:IBaseFilter;
pFileSource:IFileSourceFilter;
pimc:IMediaControl;
pPin,pPin1:IPin;
pGraph:=nil;
pMPEG4SourceFilter:=nil;
pFileSource:=nil;
if FAILED(CoCreateInstance(CLSID_FilterGraph,nil,CLSCTX_INPROC_SERVER,
IID_IGraphBuilder,pGraph)) then
begin
// pGraph:=nil;
exit;
end;
dlgOpen1.Execute;
if dlgOpen1.FileName <> ''then
begin
k:= uppercase(ExtractFileExt(dlgOpen1.FileName));
if (k='.MP4') or (k='.3GP') then
begin
CoCreateInstance(CLSID_SDMP4FileSource, nil, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, pMPEG4SourceFilter);
CoCreateInstance(CLSID_RM_MPEG2_VIDEO_SUBPICTURE, nil, CLSCTX_INPROC_SERVER,
IID_IBaseFilter, pMPEG2Decoder);
pGraph.AddFilter(pMPEG4SourceFilter,'MPEG4 Source');
pGraph.AddFilter(pMPEG2Decoder,'Sigma Designs MPEG-2 hardware Decoder');
pMPEG4SourceFilter.QueryInterface(IID_IFileSourceFilter,pFileSource);
pFileSource.Load(PWideChar(WideString(dlgOpen1.FileName)),nil);
pFileSource:=nil;
pPin:=GetOutPin(pMPEG4SourceFilter,-1);
pMPEG2Decoder.FindPin('Audio In',pPin1);
pGraph.Connect(pPin,pPin1);
pPin:=nil;
pPin1:=nil;
pPin:=GetOutPin(pMPEG4SourceFilter,0);
pMPEG2Decoder.FindPin('Video In',pPin1);
pGraph.Connect(pPin,pPin1);
pMPEG2Decoder:=nil;
pMPEG4SourceFilter:=nil;
pPin:=nil;
pPin1:=nil;
pGraph.QueryInterface(IID_IMediaControl,pimc);
pimc.Run;
pimc:=nil;
end;
CLSID_SDMP4FileSource
CLSID_RM_MPEG2_VIDEO_SUBPICTURE
这两个是神龙卡的 对应的clsid
我每次播放的时候,程序不出错,但神龙卡就是不播放,是我那连接错了呀,谢谢大家啦!
我的QQ 87797301