示例#1
0
        private void TestCalibrate()
        {
            //No hardware
            IMediaEventSink mes;
            IFilterGraph2   FilterGraph;
            int             hr;

            FilterGraph = (IFilterGraph2) new FilterGraph();

            hr = FilterGraph.RenderFile("foo.avi", null);
            DsError.ThrowExceptionForHR(hr);

            mes = (IMediaEventSink)FilterGraph;
            IMediaEvent pEvent = (IMediaEvent)FilterGraph;


            int ret = 0;

            IntPtr eventHandle = IntPtr.Zero;

            hr = pEvent.GetEventHandle(out eventHandle);
            DsError.ThrowExceptionForHR(hr);

            hr = _extDevice.Calibrate(eventHandle, ExtTransportEdit.Active, out ret);
            //DsError.ThrowExceptionForHR(hr); //E_NOTIMPL , but atleast it's called.

            hr = _extDevice.Calibrate(eventHandle, 0, out ret);
            //DsError.ThrowExceptionForHR(hr); //E_NOTIMPL , but atleast it's called.
        }
示例#2
0
        void BuildGraph()
        {
            int           hr;
            IGraphBuilder graphBuilder = new FilterGraph() as IGraphBuilder;

            m_ROT = new DsROTEntry(graphBuilder);
            IFilterGraph2 ifg2 = graphBuilder as IFilterGraph2;

            hr = graphBuilder.RenderFile("foo.avi", null);
            DsError.ThrowExceptionForHR(hr);

            // Get a ICaptureGraphBuilder2
            ICaptureGraphBuilder2 icgb = (ICaptureGraphBuilder2) new CaptureGraphBuilder2();

            hr = icgb.SetFiltergraph((IGraphBuilder)graphBuilder);
            DsError.ThrowExceptionForHR(hr);

            m_mediaEventEx = graphBuilder as IMediaEventEx;
            hr             = m_mediaEventEx.SetNotifyWindow(this.Handle, WM_GRAPHNOTIFY, IntPtr.Zero);
            DsError.ThrowExceptionForHR(hr);

            Thread.Sleep(500);

            m_imc = graphBuilder as IMediaControl;
            hr    = m_imc.Run();
            DsError.ThrowExceptionForHR(hr);
        }
示例#3
0
文件: Program.cs 项目: WladimirW/alax
        static void Main(string[] args)
        {
            IFilterGraph2 graph = new FilterGraph() as IFilterGraph2;

            graph.RenderFile(@"E:\Media\GoPro 2010 Highlights - You in HD - 1920x1080.mp4", "");
            FilterGraphHelper helper = new FilterGraphHelper();

            helper.FilterGraph = graph;
            Console.WriteLine(helper.Text);
        }
示例#4
0
        void BuildGraph()
        {
            int           hr;
            IGraphBuilder graphBuilder = new FilterGraph() as IGraphBuilder;

            m_ROT = new DsROTEntry(graphBuilder);
            IFilterGraph2 ifg2 = graphBuilder as IFilterGraph2;

            hr = graphBuilder.RenderFile("foo.avi", null);
            DsError.ThrowExceptionForHR(hr);

            // Get a ICaptureGraphBuilder2
            ICaptureGraphBuilder2 icgb = (ICaptureGraphBuilder2) new CaptureGraphBuilder2();

            hr = icgb.SetFiltergraph((IGraphBuilder)graphBuilder);
            DsError.ThrowExceptionForHR(hr);

            m_imc = graphBuilder as IMediaControl;
            hr    = m_imc.Run();
            DsError.ThrowExceptionForHR(hr);

            m_mediaEvent = graphBuilder as IMediaEvent;
        }