private bool FindXOverlay()
        {
            Element video_sink = null;
            Element xoverlay_element;
            bool    found_xoverlay;

            video_sink = playbin.VideoSink;

            Monitor.Enter(video_mutex);

            if (video_sink == null)
            {
                xoverlay = null;
                Monitor.Exit(video_mutex);
                return(false);
            }

            xoverlay_element = video_sink is Bin
                ? ((Bin)video_sink).GetByInterface(typeof(XOverlay))
                : video_sink;

            xoverlay = xoverlay_element as XOverlay;

            if (!PlatformDetection.IsWindows)
            {
                // We can't rely on aspect ratio from dshowvideosink
                if (xoverlay != null && xoverlay_element.HasProperty("force-aspect-ratio"))
                {
                    xoverlay_element ["force-aspect-ratio"] = true;
                }
            }

            if (xoverlay != null && xoverlay_element.HasProperty("handle-events"))
            {
                xoverlay_element ["handle-events"] = false;
            }

            found_xoverlay = (xoverlay != null) ? true : false;

            Monitor.Exit(video_mutex);
            return(found_xoverlay);
        }
Example #2
0
        private bool FindXOverlay ()
        {
            Element video_sink = null;
            Element xoverlay_element;
            bool    found_xoverlay;

            video_sink = playbin.VideoSink;

            Monitor.Enter (video_mutex);

            if (video_sink == null) {
                xoverlay = null;
                Monitor.Exit (video_mutex);
                return false;
            }
           
            xoverlay_element = video_sink is Bin
                ? ((Bin)video_sink).GetByInterface (typeof(XOverlay))
                : video_sink;
            
            xoverlay = xoverlay_element as XOverlay;

            if (!PlatformDetection.IsWindows) {
                // We can't rely on aspect ratio from dshowvideosink
                if (xoverlay != null && xoverlay_element.HasProperty ("force-aspect-ratio")) {
                    xoverlay_element ["force-aspect-ratio"] = true;
                }
            }

            if (xoverlay != null && xoverlay_element.HasProperty ("handle-events")) {
                xoverlay_element ["handle-events"] = false;
            }

            found_xoverlay = (xoverlay != null) ? true : false;

            Monitor.Exit (video_mutex);
            return found_xoverlay;
        }