带有GMF GDCL MPEG 4 Mux滤波器的GMFBridge
|
我尝试将GMCLridge与GDCL MPEG 4 Mux一起使用。
我的原始图形是:
SourceFilter ---> GDCL MPEG 4 Mux Filter ---> FileWriter
我想根据自己的特殊标准(例如time,例如每五分钟一次)指定新的文件名,但不想再次创建整个图形。所以我尝试使用GMFBridge。
我不工作。我真的不知道如何使用GMFBridge或它不起作用。
注意:这是我对GMFBridge的处理
为了使用,我将图形分为两部分:
FirstPart ==> SourceFilter---> GDCL MPEG 4 Mux Filter--> BridgeSinkFilter
和
SecondPart ==> BridgeSourceFilter ---> FileWriter
我的程序伪代码
IGraphBuilder firstPartGraph = (IGraphBuilder) new FilterGraph();
IGraphBuilder secondPartGraph = (IGraphBuilder) new FilterGraph();
IBaseFilter bridgeSinkFilter;
IBaseFilter bridgeSourceFilter;
IBaseFilter sourceFilter;
IBaseFilter muxerFilter;
IBaseFilter fileWriterFilter;
// Create bridge controller and init
IGMFBridgeController bridge = (IGMFBridgeController)new GMFBridgeController();
bridge.AddStream(true,eFormatType.MuxInputs, true);
// Then insert Sink filter
bridge.InsertSinkFilter(firstPartGraph, bridgeSinkFilter);
// Configure first part filters
firstPartGraph.AddFilter(sourceFilter);
firstPartGraph.AddFilter(muxerFilter);
firstPartGraph.AddFilter(bridgeSinkFilter); // Have to add this??
ConnectFilters(firstPartGraph,sourceFilter,muxerFilter);
ConnectFilters(firstPartGraph,muxerFilter,bridgeSinkFilter);
// Now add bridge sourceFilter
bridge.InsertSourceFilter(bridgeSinkFilter,secondPartGraph,bridgeSourceFilter);
// Then configure second part graph
secondPartGraph.AddFilter(bridgeSourceFilter); // Have to add this??
secondPartGraph.AddFilter(fileWriterFilter);
ConnectFilters(secondPartGraph,bridgeSourceFilter,fileWriterFilter);
// Now bridge two graphs
bridge.BridgeGraphs(bridgeSinkFilter,fileWriterFilter,bridgeSourceFilter);
// Execute both graphs
IMediaControl mediaControlForPartOne = (IMediaControl)firstPartGraph;
mediaControlForPartOne->Run();
IMediaControl mediaControlForPartSecond = (IMediaControl)secondPartGraph;
mediaControlForPartSecond->Run();
现在如何停止第二个图形部分并设置新文件名,然后使用网桥重新连接图形?
修理它:
谢谢。
我只是更改了grapg的区分,然后开始工作:
FirstPart ==> SourceFilter--> BridgeSinkFilter
SecondPart ==> BridgeSourceFilter ---> GDCL MPEG 4 Mux Filter---> FileWriter
没有找到相关结果
已邀请:
2 个回复
翰冒绢县
现在,您可以停止第二张图,将其删除并创建一个新图。启动新图,然后再次连接它们:
佬棠