Infognition forum
May 18, 2012, 10:34:46 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Last GraphEditPlus version: 1.4.0   Last Video Enhancer version: 1.9.7
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Switching Graph  (Read 495 times)
floydus
Newbie
*

Karma: +0/-0
Posts: 19


View Profile
« on: February 06, 2012, 06:17:50 PM »

I have created to different graphs, one with Closed Caption, and the other without...
The way I do things for switching is that I rebuilt the graph everytime and in between I release the IMediaControl...
It takes around 8 seconds to switch graph.
I found this behavior ancestral and not reallly user friendly. Also after switching  many times, sometimes 30, sometimes 20, the image is lost...
Maybe is because the object doesn't get released completely or whatever.

But here it is, I'm pretty sure I don't have to reconstruct the graph everytime, since only one or two filters are allowed.
What is THE WAY to create two different graph and being able to switch them without breaking everything, being robust and not having delays because the graph is rebuilding ?

thanks. !
Logged
Dee Mon
Administrator
Hero Member
*****

Karma: +8/-0
Posts: 530



View Profile WWW
« Reply #1 on: February 06, 2012, 08:05:56 PM »

Are you sure you need to build them every time?
You could have both graphs in one application and just hide one window and show another at a time (pausing the unshown graph, of course).
Logged
floydus
Newbie
*

Karma: +0/-0
Posts: 19


View Profile
« Reply #2 on: February 06, 2012, 08:32:27 PM »

I tried it, but I get a weard result... When called separately, they display all good, but when initializing both graph, only one shows correctly.
It might be some logical mistake but I just cannot see it.
I have two different MediaControl, two different panels, they do both show, but for example the one that has closedcaption, only displays the CC text, the image is on pause (I got sound)...
It would be nice if I could see an example of two very very similar graph running in the same program.
Merci
Logged
floydus
Newbie
*

Karma: +0/-0
Posts: 19


View Profile
« Reply #3 on: February 07, 2012, 07:55:11 PM »

Code:
private void BuildGraphCaption()
        {
            // Version 10.1.1.37
            int hr = 0;
            graphBuilderCaption = (IGraphBuilder)new FilterGraph();
            //graph builder
            ICaptureGraphBuilder2 pBuilderCaption = (ICaptureGraphBuilder2)new CaptureGraphBuilder2();
            hr = pBuilderCaption.SetFiltergraph(graphBuilderCaption);

            //Create the media control for controlling the graph
            mediaControlCaption = (IMediaControl)graphBuilderCaption;

            checkHR(hr, "Can't SetFiltergraph");

            Guid CLSID_VBICodec = new Guid("{370A1D5D-DDEB-418C-81CD-189E0D4FA443}"); //VBICodec.ax
            Guid CLSID_ffdshowVideoDecoder = new Guid("{04FE9017-F873-410E-871E-AB91661A4EF7}"); //ffdshow.ax

            //add AVerMedia 7231 Analog TV Tuner
            IBaseFilter pAVerMedia7231AnalogTVTuner = CreateFilter(@"@device:pnp:\\?\pci#ven_1131&dev_7231&subsys_06071461&rev_aa#4&25ba7335&0&00e1#{a799a800-a46d-11d0-a18c-00a02401dcd4}\{62b08a3e-335e-4b30-90f9-2ba400000000}");
            System.Threading.Thread.Sleep(200);

            hr = graphBuilderCaption.AddFilter(pAVerMedia7231AnalogTVTuner, "AVerMedia 7231 Analog TV Tuner");
            checkHR(hr, "Can't add AVerMedia 7231 Analog TV Tuner to graph");

            //add AVerMedia 7231 Analog TV Audio
            IBaseFilter pAVerMedia7231AnalogTVAudio = CreateFilter(@"@device:pnp:\\?\pci#ven_1131&dev_7231&subsys_06071461&rev_aa#4&25ba7335&0&00e1#{a799a802-a46d-11d0-a18c-00a02401dcd4}\{defe4e8d-584b-446c-89cc-fd1f00000000}");
            System.Threading.Thread.Sleep(250);
            hr = graphBuilderCaption.AddFilter(pAVerMedia7231AnalogTVAudio, "AVerMedia 7231 Analog TV Audio");
            checkHR(hr, "Can't add AVerMedia 7231 Analog TV Audio to graph");

            //connect AVerMedia 7231 Analog TV Tuner and AVerMedia 7231 Analog TV Audio
            hr = graphBuilderCaption.ConnectDirect(GetPin(pAVerMedia7231AnalogTVTuner, "Analog Audio"), GetPin(pAVerMedia7231AnalogTVAudio, "TVAudio In"), null);
            checkHR(hr, "Can't connect AVerMedia 7231 Analog TV Tuner and AVerMedia 7231 Analog TV Audio");

            //add AVerMedia 7231 Analog Xbar
            IBaseFilter pAVerMedia7231AnalogXbar = CreateFilter(@"@device:pnp:\\?\pci#ven_1131&dev_7231&subsys_06071461&rev_aa#4&25ba7335&0&00e1#{a799a801-a46d-11d0-a18c-00a02401dcd4}\{ed97d48c-e41e-11d5-9964-00e000000000}");
            System.Threading.Thread.Sleep(250);
            hr = graphBuilderCaption.AddFilter(pAVerMedia7231AnalogXbar, "AVerMedia 7231 Analog Xbar");
            checkHR(hr, "Can't add AVerMedia 7231 Analog Xbar to graph");

            //connect AVerMedia 7231 Analog TV Tuner and AVerMedia 7231 Analog Xbar
            hr = graphBuilderCaption.ConnectDirect(GetPin(pAVerMedia7231AnalogTVTuner, "Analog Video"), GetPin(pAVerMedia7231AnalogXbar, "0: Video Tuner In"), null);
            checkHR(hr, "Can't connect AVerMedia 7231 Analog TV Tuner and AVerMedia 7231 Analog Xbar");

            //connect AVerMedia 7231 Analog TV Audio and AVerMedia 7231 Analog Xbar
            hr = graphBuilderCaption.ConnectDirect(GetPin(pAVerMedia7231AnalogTVAudio, "TVAudio Out"), GetPin(pAVerMedia7231AnalogXbar, "1: Audio Tuner In"), null);
            checkHR(hr, "Can't connect AVerMedia 7231 Analog TV Audio and AVerMedia 7231 Analog Xbar");

            //add AVerMedia 7231 Analog Capture
            pAVerMedia7231AnalogCaptureCaption = CreateFilter(@"@device:pnp:\\?\pci#ven_1131&dev_7231&subsys_06071461&rev_aa#4&25ba7335&0&00e1#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{bbefb6c7-2fc4-4139-bb8b-a58b00000000}");
            hr = graphBuilderCaption.AddFilter(pAVerMedia7231AnalogCaptureCaption, "AVerMedia 7231 Analog Capture");
            checkHR(hr, "Can't add AVerMedia 7231 Analog Capture to graph");
            System.Threading.Thread.Sleep(250);

            //connect AVerMedia 7231 Analog Xbar and AVerMedia 7231 Analog Capture
            hr = graphBuilderCaption.ConnectDirect(GetPin(pAVerMedia7231AnalogXbar, "0: Video Decoder Out"), GetPin(pAVerMedia7231AnalogCaptureCaption, "Analog Video In"), null);
            checkHR(hr, "Can't connect AVerMedia 7231 Analog Xbar and AVerMedia 7231 Analog Capture");

            //connect AVerMedia 7231 Analog Xbar and AVerMedia 7231 Analog Capture
            hr = graphBuilderCaption.ConnectDirect(GetPin(pAVerMedia7231AnalogXbar, "1: Audio Decoder Out"), GetPin(pAVerMedia7231AnalogCaptureCaption, "Analog Audio Input"), null);
            checkHR(hr, "Can't connect AVerMedia 7231 Analog Xbar and AVerMedia 7231 Analog Capture");

            //add Default DirectSound Device
            IBaseFilter pDefaultDirectSoundDevice = (IBaseFilter)new DSoundRender();
            hr = graphBuilderCaption.AddFilter(pDefaultDirectSoundDevice, "Default DirectSound Device");
            checkHR(hr, "Can't add Default DirectSound Device to graph");

            IBaseFilter pVBICodec = null;
            //  VBI CODEC CLOSED CAPTION RELATED
            //add VBI Codec
            pVBICodec = (IBaseFilter)Activator.CreateInstance(Type.GetTypeFromCLSID(CLSID_VBICodec));
            hr = graphBuilderCaption.AddFilter(pVBICodec, "VBI Codec");
            checkHR(hr, "Can't add VBI Codec to graph");
           
            //add Smart Tee
            IBaseFilter pSmartTee = (IBaseFilter)new SmartTee();
            hr = graphBuilderCaption.AddFilter(pSmartTee, "Smart Tee");
            checkHR(hr, "Can't add Smart Tee to graph");

            SetConfigParms(pBuilderCaption, pAVerMedia7231AnalogCaptureCaption, 0, 720, 480);

            //connect AVerMedia 7231 Analog Capture and Smart Tee
            hr = graphBuilderCaption.ConnectDirect(GetPin(pAVerMedia7231AnalogCaptureCaption, "Capture"), GetPin(pSmartTee, "Input"), null);
            checkHR(hr, "Can't connect AVerMedia 7231 Analog Capture and Smart Tee");
            // VBI CODEC CLOSED CAPTION
            //connect AVerMedia 7231 Analog Capture and VBI Codec
            hr = graphBuilderCaption.ConnectDirect(GetPin(pAVerMedia7231AnalogCaptureCaption, "VBI"), GetPin(pVBICodec, "Input"), null);
            checkHR(hr, "Can't connect AVerMedia 7231 Analog Capture and VBI Codec");

            //connect AVerMedia 7231 Analog Capture and Default DirectSound Device
            hr = graphBuilderCaption.ConnectDirect(GetPin(pAVerMedia7231AnalogCaptureCaption, "Audio"), GetPin(pDefaultDirectSoundDevice, "Audio Input pin (rendered)"), null);
            checkHR(hr, "Can't connect AVerMedia 7231 Analog Capture and Default DirectSound Device");

            //add ffdshow Video Decoder
            IBaseFilter pffdshowVideoDecoder = (IBaseFilter)Activator.CreateInstance(Type.GetTypeFromCLSID(CLSID_ffdshowVideoDecoder));
            hr = graphBuilderCaption.AddFilter(pffdshowVideoDecoder, "ffdshow Video Decoder");
            checkHR(hr, "Can't add ffdshow Video Decoder to graph");

            IBaseFilter pLine21Decoder = null;
            //add Line 21 Decoder
            pLine21Decoder = (IBaseFilter)new Line21Decoder();
            hr = graphBuilderCaption.AddFilter(pLine21Decoder, "Line 21 Decoder");
            checkHR(hr, "Can't add Line 21 Decoder to graph");

            //connect Smart Tee and ffdshow Video Decoder
            hr = graphBuilderCaption.ConnectDirect(GetPin(pSmartTee, "Capture"), GetPin(pffdshowVideoDecoder, "In"), null);
            checkHR(hr, "Can't connect Smart Tee and ffdshow Video Decoder");                                                                                                           // Closed CAPT
            //connect VBI Codec and Line 21 Decoder
            hr = graphBuilderCaption.ConnectDirect(GetPin(pVBICodec, "CC"), GetPin(pLine21Decoder, "XForm In"), null);
            checkHR(hr, "Can't connect VBI Codec and Line 21 Decoder");
                                                                                                                             // CLOSED CAPTION 
            //add Overlay Mixer
            IBaseFilter pOverlayMixer = (IBaseFilter)new OverlayMixer();
            hr = graphBuilderCaption.AddFilter(pOverlayMixer, "Overlay Mixer");
            checkHR(hr, "Can't add Overlay Mixer to graph");

            //connect ffdshow Video Decoder and Overlay Mixer
            hr = graphBuilderCaption.ConnectDirect(GetPin(pffdshowVideoDecoder, "Out"), GetPin(pOverlayMixer, "Input0"), null);
            checkHR(hr, "Can't connect ffdshow Video Decoder and Overlay Mixer");
            //connect Line 21 Decoder and Overlay Mixer
            hr = graphBuilderCaption.ConnectDirect(GetPin(pLine21Decoder, "XForm Out"), GetPin(pOverlayMixer, "Input2"), null);
            checkHR(hr, "Can't connect Line 21 Decoder and Overlay Mixer");
                                                                                                                             //CLOSED CAPT                                                                                                                                                                                   
            //add Video Renderer
            IBaseFilter pVideoRenderer = (IBaseFilter)new VideoRenderer();
            hr = graphBuilderCaption.AddFilter(pVideoRenderer, "Video Renderer");
            checkHR(hr, "Can't add Video Renderer to graph");

            //connect Overlay Mixer and Video Renderer

            hr = graphBuilderCaption.ConnectDirect(GetPin(pOverlayMixer, "Output"), GetPin(pVideoRenderer, "Input"), null);
            checkHR(hr, "Can't connect Overlay Mixer and Video Renderer");

            IReferenceClock returnedClockReference = IsImplementingIReferenceClock(pBuilderCaption, pAVerMedia7231AnalogCaptureCaption);
            pVideoRenderer.SetSyncSource(returnedClockReference);
            pDefaultDirectSoundDevice.SetSyncSource(returnedClockReference);
#if DEBUG
            m_rot = new DsROTEntry(graphBuilderCaption);
#endif

            //get the video window from the graph
            IVideoWindow videoWindowCaption = null;
            videoWindowCaption = (IVideoWindow)graphBuilderCaption;

            //Set the owener of the videoWindow to an IntPtr of some sort (the Handle of any control - could be a form / button etc.)
            hr = videoWindowCaption.put_Owner(panel2.Handle);
            DsError.ThrowExceptionForHR(hr);

            //Set the style of the video window
            hr = videoWindowCaption.put_WindowStyle(WindowStyle.Child | WindowStyle.ClipChildren);
            DsError.ThrowExceptionForHR(hr);


            // Position video window in client rect of main application window
            hr = videoWindowCaption.SetWindowPosition(0, 0, panel2.Width, panel2.Height);
            DsError.ThrowExceptionForHR(hr);

            hr = videoWindowCaption.put_Visible(OABool.True);
            DsError.ThrowExceptionForHR(hr);

            Marshal.FinalReleaseComObject(pBuilderCaption);
            pBuilderCaption = null;
            for (int i = 0; i < 1000; i++)
            {
                Application.DoEvents();
            }
            GC.Collect();
           // Reset(timerReSyncVocals);
            //MessageBox.Show("OK In BuildGraph");

        }
Logged
floydus
Newbie
*

Karma: +0/-0
Posts: 19


View Profile
« Reply #4 on: February 07, 2012, 07:55:49 PM »

Code:
private void BuildGraph(bool boolClosedCaption)
        {
            // Version 10.1.1.37
            int hr = 0;
            graphBuilder = (IGraphBuilder)new FilterGraph();
            //graph builder
            ICaptureGraphBuilder2 pBuilder = (ICaptureGraphBuilder2)new CaptureGraphBuilder2();
            hr = pBuilder.SetFiltergraph(graphBuilder);
           
            //Create the media control for controlling the graph
            mediaControl = (IMediaControl)graphBuilder;
           
            checkHR(hr, "Can't SetFiltergraph");

            Guid CLSID_VBICodec = new Guid("{370A1D5D-DDEB-418C-81CD-189E0D4FA443}"); //VBICodec.ax
            Guid CLSID_ffdshowVideoDecoder = new Guid("{04FE9017-F873-410E-871E-AB91661A4EF7}"); //ffdshow.ax

            //add AVerMedia 7231 Analog TV Tuner
            IBaseFilter pAVerMedia7231AnalogTVTuner = CreateFilter(@"@device:pnp:\\?\pci#ven_1131&dev_7231&subsys_06071461&rev_aa#4&25ba7335&0&00e1#{a799a800-a46d-11d0-a18c-00a02401dcd4}\{62b08a3e-335e-4b30-90f9-2ba400000000}");
            System.Threading.Thread.Sleep(200);
           
            hr = graphBuilder.AddFilter(pAVerMedia7231AnalogTVTuner, "AVerMedia 7231 Analog TV Tuner");
            checkHR(hr, "Can't add AVerMedia 7231 Analog TV Tuner to graph");

            //add AVerMedia 7231 Analog TV Audio
            IBaseFilter pAVerMedia7231AnalogTVAudio = CreateFilter(@"@device:pnp:\\?\pci#ven_1131&dev_7231&subsys_06071461&rev_aa#4&25ba7335&0&00e1#{a799a802-a46d-11d0-a18c-00a02401dcd4}\{defe4e8d-584b-446c-89cc-fd1f00000000}");
            System.Threading.Thread.Sleep(250);
            hr = graphBuilder.AddFilter(pAVerMedia7231AnalogTVAudio, "AVerMedia 7231 Analog TV Audio");
            checkHR(hr, "Can't add AVerMedia 7231 Analog TV Audio to graph");

            //connect AVerMedia 7231 Analog TV Tuner and AVerMedia 7231 Analog TV Audio
            hr = graphBuilder.ConnectDirect(GetPin(pAVerMedia7231AnalogTVTuner, "Analog Audio"), GetPin(pAVerMedia7231AnalogTVAudio, "TVAudio In"), null);
            checkHR(hr, "Can't connect AVerMedia 7231 Analog TV Tuner and AVerMedia 7231 Analog TV Audio");

            //add AVerMedia 7231 Analog Xbar
            IBaseFilter pAVerMedia7231AnalogXbar = CreateFilter(@"@device:pnp:\\?\pci#ven_1131&dev_7231&subsys_06071461&rev_aa#4&25ba7335&0&00e1#{a799a801-a46d-11d0-a18c-00a02401dcd4}\{ed97d48c-e41e-11d5-9964-00e000000000}");
            System.Threading.Thread.Sleep(250);
            hr = graphBuilder.AddFilter(pAVerMedia7231AnalogXbar, "AVerMedia 7231 Analog Xbar");
            checkHR(hr, "Can't add AVerMedia 7231 Analog Xbar to graph");

            //connect AVerMedia 7231 Analog TV Tuner and AVerMedia 7231 Analog Xbar
            hr = graphBuilder.ConnectDirect(GetPin(pAVerMedia7231AnalogTVTuner, "Analog Video"), GetPin(pAVerMedia7231AnalogXbar, "0: Video Tuner In"), null);
            checkHR(hr, "Can't connect AVerMedia 7231 Analog TV Tuner and AVerMedia 7231 Analog Xbar");

            //connect AVerMedia 7231 Analog TV Audio and AVerMedia 7231 Analog Xbar
            hr = graphBuilder.ConnectDirect(GetPin(pAVerMedia7231AnalogTVAudio, "TVAudio Out"), GetPin(pAVerMedia7231AnalogXbar, "1: Audio Tuner In"), null);
            checkHR(hr, "Can't connect AVerMedia 7231 Analog TV Audio and AVerMedia 7231 Analog Xbar");

            //add AVerMedia 7231 Analog Capture
            pAVerMedia7231AnalogCapture = CreateFilter(@"@device:pnp:\\?\pci#ven_1131&dev_7231&subsys_06071461&rev_aa#4&25ba7335&0&00e1#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\{bbefb6c7-2fc4-4139-bb8b-a58b00000000}");
            hr = graphBuilder.AddFilter(pAVerMedia7231AnalogCapture, "AVerMedia 7231 Analog Capture");
            checkHR(hr, "Can't add AVerMedia 7231 Analog Capture to graph");
            System.Threading.Thread.Sleep(250);

            //connect AVerMedia 7231 Analog Xbar and AVerMedia 7231 Analog Capture
            hr = graphBuilder.ConnectDirect(GetPin(pAVerMedia7231AnalogXbar, "0: Video Decoder Out"), GetPin(pAVerMedia7231AnalogCapture, "Analog Video In"), null);
            checkHR(hr, "Can't connect AVerMedia 7231 Analog Xbar and AVerMedia 7231 Analog Capture");
           
            //connect AVerMedia 7231 Analog Xbar and AVerMedia 7231 Analog Capture
            hr = graphBuilder.ConnectDirect(GetPin(pAVerMedia7231AnalogXbar, "1: Audio Decoder Out"), GetPin(pAVerMedia7231AnalogCapture, "Analog Audio Input"), null);
            checkHR(hr, "Can't connect AVerMedia 7231 Analog Xbar and AVerMedia 7231 Analog Capture");

            //add Default DirectSound Device
            IBaseFilter pDefaultDirectSoundDevice = (IBaseFilter) new DSoundRender();
            hr = graphBuilder.AddFilter(pDefaultDirectSoundDevice, "Default DirectSound Device");
            checkHR(hr, "Can't add Default DirectSound Device to graph");

            //add Smart Tee
            IBaseFilter pSmartTee = (IBaseFilter) new SmartTee();
            hr = graphBuilder.AddFilter(pSmartTee, "Smart Tee");
            checkHR(hr, "Can't add Smart Tee to graph");

            SetConfigParms(pBuilder, pAVerMedia7231AnalogCapture, 0, 720, 480);

            //connect AVerMedia 7231 Analog Capture and Smart Tee
            hr = graphBuilder.ConnectDirect(GetPin(pAVerMedia7231AnalogCapture, "Capture"), GetPin(pSmartTee, "Input"), null);
            checkHR(hr, "Can't connect AVerMedia 7231 Analog Capture and Smart Tee");

            //connect AVerMedia 7231 Analog Capture and Default DirectSound Device
            hr = graphBuilder.ConnectDirect(GetPin(pAVerMedia7231AnalogCapture, "Audio"), GetPin(pDefaultDirectSoundDevice, "Audio Input pin (rendered)"), null);
            checkHR(hr, "Can't connect AVerMedia 7231 Analog Capture and Default DirectSound Device");

            //add ffdshow Video Decoder
            IBaseFilter pffdshowVideoDecoder = (IBaseFilter)Activator.CreateInstance(Type.GetTypeFromCLSID(CLSID_ffdshowVideoDecoder));
            hr = graphBuilder.AddFilter(pffdshowVideoDecoder, "ffdshow Video Decoder");
            checkHR(hr, "Can't add ffdshow Video Decoder to graph");

            //connect Smart Tee and ffdshow Video Decoder
            hr = graphBuilder.ConnectDirect(GetPin(pSmartTee, "Capture"), GetPin(pffdshowVideoDecoder, "In"), null);
            checkHR(hr, "Can't connect Smart Tee and ffdshow Video Decoder");
                                                                                                                        // CLOSED CAPTION 
            //add Overlay Mixer
            IBaseFilter pOverlayMixer = (IBaseFilter) new OverlayMixer();
            hr = graphBuilder.AddFilter(pOverlayMixer, "Overlay Mixer");
            checkHR(hr, "Can't add Overlay Mixer to graph");

            //connect ffdshow Video Decoder and Overlay Mixer
            hr = graphBuilder.ConnectDirect(GetPin(pffdshowVideoDecoder, "Out"), GetPin(pOverlayMixer, "Input0"), null);
            checkHR(hr, "Can't connect ffdshow Video Decoder and Overlay Mixer");

            //add Video Renderer
            IBaseFilter pVideoRenderer = (IBaseFilter) new VideoRenderer();
            hr = graphBuilder.AddFilter(pVideoRenderer, "Video Renderer");
            checkHR(hr, "Can't add Video Renderer to graph");

            //connect Overlay Mixer and Video Renderer
           
            hr = graphBuilder.ConnectDirect(GetPin(pOverlayMixer, "Output"), GetPin(pVideoRenderer, "Input"), null);
            checkHR(hr, "Can't connect Overlay Mixer and Video Renderer");
           
            IReferenceClock returnedClockReference = IsImplementingIReferenceClock(pBuilder, pAVerMedia7231AnalogCapture);
            pVideoRenderer.SetSyncSource(returnedClockReference);
            pDefaultDirectSoundDevice.SetSyncSource(returnedClockReference);
#if DEBUG
            m_rot = new DsROTEntry(graphBuilder);
#endif

            //get the video window from the graph
            IVideoWindow videoWindow = null;
            videoWindow = (IVideoWindow)graphBuilder;

            //Set the owener of the videoWindow to an IntPtr of some sort (the Handle of any control - could be a form / button etc.)
            hr = videoWindow.put_Owner(panel1.Handle);
            DsError.ThrowExceptionForHR(hr);

            //Set the style of the video window
            hr = videoWindow.put_WindowStyle(WindowStyle.Child | WindowStyle.ClipChildren);
            DsError.ThrowExceptionForHR(hr);


            // Position video window in client rect of main application window
            hr = videoWindow.SetWindowPosition(0, 25, panel1.Width, panel1.Height-25);
            DsError.ThrowExceptionForHR(hr);

            hr = videoWindow.put_Visible(OABool.True);
            DsError.ThrowExceptionForHR(hr);

            Marshal.FinalReleaseComObject(pBuilder);
            pBuilder = null;
            for (int i = 0; i < 1000; i++)
            {
                Application.DoEvents();
            }
            GC.Collect();
           // Reset(timerReSyncVocals);
            //MessageBox.Show("OK In BuildGraph");

        }
Logged
floydus
Newbie
*

Karma: +0/-0
Posts: 19


View Profile
« Reply #5 on: February 07, 2012, 07:58:57 PM »

Only one show at the time, is it because both graphs uses the same device ?
Like I said as a test I've put two panels on a form and calling them separately works, but not together.
Logged
Dee Mon
Administrator
Hero Member
*****

Karma: +8/-0
Posts: 530



View Profile WWW
« Reply #6 on: February 09, 2012, 02:58:55 PM »

Sorry for the delays, I'll try to build and post an example.

Using one capture device in two graphs at the same time may not work. In this case I would make one graph with two paths from one device (using a tee filter) and two renderers, one path with CC, one without. Then hide one renderer and show another, then switch them when needed.
Logged
floydus
Newbie
*

Karma: +0/-0
Posts: 19


View Profile
« Reply #7 on: February 09, 2012, 09:11:25 PM »

Well I fixed the issue by just using disconnect and connect on the Pins.
My graph was basically exactly the same except the Line21 filter...

It works really well now, except that under CC mode, image is lagging.
I guess I'm going to create a new Post for that lagging issue.
Please confirm with me I should create a new Post for that..
Thanks again.

Dave
Logged
Dee Mon
Administrator
Hero Member
*****

Karma: +8/-0
Posts: 530



View Profile WWW
« Reply #8 on: February 10, 2012, 09:27:51 AM »

Whatever suits you best - start a new topic or continue here.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!