protected AbstractRenderer(ITimeline timeline) { if (timeline == null) { throw new ArgumentNullException(TimelineParameterName); } _timeline = timeline; int hr = 0; // create the render engine _renderEngine = (IRenderEngine) new RenderEngine(); _cleanup.Add(_renderEngine); // tell the render engine about the timeline it should use hr = _renderEngine.SetTimelineObject(_timeline.DesTimeline); DESError.ThrowExceptionForHR(hr); // connect up the front end hr = _renderEngine.ConnectFrontEnd(); DESError.ThrowExceptionForHR(hr); // Get the filtergraph - used all over the place hr = _renderEngine.GetFilterGraph(out _graph); _cleanup.Add(Graph); DESError.ThrowExceptionForHR(hr); // find the first (and usually last) audio and video group, we use these // when rendering to track progress _firstAudioGroup = _timeline.FindFirstGroupOfType(GroupType.Audio); _firstVideoGroup = _timeline.FindFirstGroupOfType(GroupType.Video); }
protected AbstractRenderer(ITimeline timeline) { if (timeline == null) throw new ArgumentNullException(TimelineParameterName); _timeline = timeline; int hr = 0; // create the render engine _renderEngine = (IRenderEngine) new RenderEngine(); _cleanup.Add(_renderEngine); // tell the render engine about the timeline it should use hr = _renderEngine.SetTimelineObject(_timeline.DesTimeline); DESError.ThrowExceptionForHR(hr); // connect up the front end hr = _renderEngine.ConnectFrontEnd(); DESError.ThrowExceptionForHR(hr); // Get the filtergraph - used all over the place hr = _renderEngine.GetFilterGraph(out _graph); _cleanup.Add(Graph); DESError.ThrowExceptionForHR(hr); // find the first (and usually last) audio and video group, we use these // when rendering to track progress _firstAudioGroup = _timeline.FindFirstGroupOfType(GroupType.Audio); _firstVideoGroup = _timeline.FindFirstGroupOfType(GroupType.Video); }