title: GMFBridge with GMF GDCL MPEG 4 Mux Filter
body: <p>I try to use GDCL MPEG 4 Mux  with GMFBridge. </p>
  
  <p>My original graph is:</p>
  
  <pre><code>SourceFilter ---&gt; GDCL MPEG 4 Mux Filter ---&gt; FileWriter
  </code></pre>
  
  <p>I want to give new file name based on my special criteria (such as time , for example every five minute) but not want to create whole graph again. So i try to use GMFBridge.</p>
  
  <p>I does not work. I really can not figure out how to use GMFBridge or it does not work.</p>
  
  <p><strong>Note:</strong> Here is what i do with GMFBridge</p>
  
  <p>In order to use , i divide my graph into two pieces:</p>
  
  <pre><code>FirstPart ==&gt;  SourceFilter---&gt; GDCL MPEG 4 Mux Filter--&gt; BridgeSinkFilter
  </code></pre>
  
  <p>and </p>
  
  <pre><code>SecondPart ==&gt; BridgeSourceFilter ---&gt; FileWriter 
  </code></pre>
  
  <p>My Program Pseudo Code</p>
  
  <pre><code>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-&gt;Run(); 
  
   IMediaControl mediaControlForPartSecond = (IMediaControl)secondPartGraph;
   mediaControlForPartSecond-&gt;Run();
  </code></pre>
  
  <p>Now how to stop the second graph part and set new file name and then reconnect graphs using bridge?</p>
  
  <p><strong>FIX IT:</strong></p>
  
  <p>Thanks.</p>
  
  <p>I just change my grapg divison and Now work:</p>
  
  <pre><code>  FirstPart ==&gt;  SourceFilter--&gt; BridgeSinkFilter
    SecondPart ==&gt; BridgeSourceFilter ---&gt; GDCL MPEG 4 Mux Filter---&gt; FileWriter 
  </code></pre>