How to detect if another application already capture video (VideoCaptureElement)

Mar 25, 2010 at 10:15 AM

 

I have application that capture video from video card(same as from webcam) and I can display video in many instance in this application with VisualBrush and it works fine.
The problem is when I run another instance of my application or e.g. pinnacle studio always comes up blank. I know this is a problem to have two instance of DsDevice so I use VisualBrush but how can I check if any another application already capture video because I don't get any error only blank screen?

I have application that capture video from video card(same as from webcam) and I can display video in many instance in this application with VisualBrush and it works fine.

The problem is when I run another instance of my application or e.g. pinnacle studio always comes up blank. I know this is a problem to have two instance of DsDevice so I use VisualBrush but how can I check if any another application already capture video because I don't get any error only blank screen?

_Lukas_

 

Mar 25, 2010 at 10:18 AM
Have you tried hooking into the "MediaFailed" event?
Mar 25, 2010 at 11:29 AM

Yes but it doesn't rise. Second graph is crated without any exeption. It goes to InvokeMediaOpened();

 

/// <summary>
        /// Configures the DirectShow graph to play the selected video capture
        /// device with the selected parameters
        /// </summary>
        private void SetupGraph()
        {
            /* Clean up any messes left behind */
            FreeResources();
            try
            {
                /* Create a new graph */
                m_graph = (IGraphBuilder)new FilterGraphNoThread();

 

        /// <summary>
        /// Configures the DirectShow graph to play the selected video capture
        /// device with the selected parameters
        /// </summary>
        private void SetupGraph()
        {
            /* Clean up any messes left behind */
            FreeResources();

            try
            {
                /* Create a new graph */
                m_graph = (IGraphBuilder)new FilterGraphNoThread();

               //futher method code
            }
            catch (Exception ex)
            {
                /* Something got fuct up */
                FreeResources();
                InvokeMediaFailed(new MediaFailedEventArgs(ex.Message, ex));
            }

            /* Success */
            InvokeMediaOpened();
        }