private void Configure2() { int hr; IBaseFilter pFilter; IBaseFilter ibf; ICaptureGraphBuilder2 icgb = (ICaptureGraphBuilder2) new CaptureGraphBuilder2(); IFilterGraph2 FilterGraph = (IFilterGraph2) new FilterGraph(); DsROTEntry ds = new DsROTEntry(FilterGraph); hr = icgb.SetFiltergraph(FilterGraph); DsError.ThrowExceptionForHR(hr); hr = FilterGraph.AddSourceFilter(FileName, "foo", out pFilter); DsError.ThrowExceptionForHR(hr); hr = icgb.RenderStream(null, null, pFilter, null, null); DsError.ThrowExceptionForHR(hr); hr = FilterGraph.FindFilterByName("AVI Splitter", out ibf); DsError.ThrowExceptionForHR(hr); m_pPersist2 = (IPersistMediaPropertyBag)ibf; Marshal.ReleaseComObject(pFilter); Marshal.ReleaseComObject(icgb); }
private void Configure2() { // In order to lock a profile, you have to have at least one stream // connected to the sink. I connect a video thru the DVVideoEnc into // the StreamBufferSink. int hr; IBaseFilter pFilter; IBaseFilter ibf; ICaptureGraphBuilder2 icgb = (ICaptureGraphBuilder2) new CaptureGraphBuilder2(); m_FilterGraph = (IFilterGraph2) new FilterGraph(); DsROTEntry ds = new DsROTEntry(m_FilterGraph); hr = icgb.SetFiltergraph(m_FilterGraph); DsError.ThrowExceptionForHR(hr); hr = m_FilterGraph.AddSourceFilter(FileName, "foo", out pFilter); DsError.ThrowExceptionForHR(hr); hr = icgb.RenderStream(null, null, pFilter, null, null); DsError.ThrowExceptionForHR(hr); hr = m_FilterGraph.FindFilterByName("AVI Splitter", out ibf); DsError.ThrowExceptionForHR(hr); m_imc = (IAMMediaContent)ibf; Marshal.ReleaseComObject(pFilter); Marshal.ReleaseComObject(icgb); }
public CameraPropertySettings GetCameraControlPropertySettings(CameraControlProperty property) { int filterHandle; IBaseFilter captureFilter = null; filterHandle = filterGraph.FindFilterByName("Video input", out captureFilter); if (captureFilter != null) { int min = 0; int max = 0; int stepDelta = 1; int defaultValue = 0; CameraControlFlags cameraControlFlags; IAMCameraControl iC = captureFilter as IAMCameraControl; ((IAMCameraControl)iC).GetRange(property, out min, out max, out stepDelta, out defaultValue, out cameraControlFlags); CameraPropertySettings videoPropertySettings = new CameraPropertySettings(); videoPropertySettings.Minimum = min; videoPropertySettings.Maximum = max; videoPropertySettings.Step = stepDelta; videoPropertySettings.DefaultValue = defaultValue; return(videoPropertySettings); } else { return(null); } }
private void Config() { int hr; IBaseFilter pFilter; IFilterGraph2 m_FilterGraph = (IFilterGraph2) new FilterGraph(); DsROTEntry rot = new DsROTEntry(m_FilterGraph); hr = m_FilterGraph.RenderFile(@"p.wmv", null); DsError.ThrowExceptionForHR(hr); hr = m_FilterGraph.FindFilterByName("p.wmv", out pFilter); m_es = pFilter as IAMExtendedSeeking; }
private void Configure() { int hr; IBaseFilter pFilter; m_FilterGraph = (IFilterGraph2) new FilterGraph(); hr = m_FilterGraph.RenderFile(@"France-Info.asx", null); DsError.ThrowExceptionForHR(hr); hr = m_FilterGraph.FindFilterByName("XML Playlist", out pFilter); DsError.ThrowExceptionForHR(hr); hr = ((IMediaControl)m_FilterGraph).Run(); DsError.ThrowExceptionForHR(hr); m_imc2 = (IAMMediaContent2)pFilter; }
void TestRenderStream() { int hr; IBaseFilter ifilt; // Try using nulls hr = m_icgb2.RenderStream(null, null, m_Source, null, m_Multiplexer); DsError.ThrowExceptionForHR(hr); hr = m_graphBuilder.FindFilterByName("AVI Splitter", out ifilt); DsError.ThrowExceptionForHR(hr); IPin ipin = DsFindPin.ByConnectionStatus(ifilt, PinConnectedStatus.Unconnected, 0); Guid g = DsUtils.GetPinCategory(ipin); // With this setup, there is no valid value for parm1 hr = m_icgb2.RenderStream(null, MediaType.Audio, m_Source, null, m_Multiplexer); DsError.ThrowExceptionForHR(hr); }