private void Library_Click(object sender, RoutedEventArgs e)
        {
            var lMenuItem = sender as MenuItem;

            if (lMenuItem == null || lMenuItem.Tag == null)
            {
                return;
            }

            var ltag = lMenuItem.Tag.ToString();

            int lIndex = 0;

            if (int.TryParse(ltag, out lIndex))
            {
                CaptureManagerVideoRendererMultiSinkFactory.getInstance().LibraryIndex = lIndex;

                mCaptureManagerLib.IsChecked = false;

                mCaptureManagerVideoRendererLib.IsChecked = false;

                lMenuItem.IsChecked = true;

                init();
            }
        }
示例#2
0
        public static CaptureManagerVideoRendererMultiSinkFactory getInstance()
        {
            if (mInstance == null)
            {
                mInstance = new CaptureManagerVideoRendererMultiSinkFactory();
            }

            return(mInstance);
        }
        private void init()
        {
            var lCaptureManagerEVRMultiSinkFactory = CaptureManagerVideoRendererMultiSinkFactory.getInstance().getICaptureManagerEVRMultiSinkFactory();


            uint lMaxVideoRenderStreamCount = lCaptureManagerEVRMultiSinkFactory.getMaxVideoRenderStreamCount();

            if (lMaxVideoRenderStreamCount == 0)
            {
                return;
            }

            List <object> lOutputNodesList = new List <object>();

            lCaptureManagerEVRMultiSinkFactory.createOutputNodes(
                mPlayerControl.Handle,
                null,
                lMaxVideoRenderStreamCount,
                out lOutputNodesList);

            if (lOutputNodesList.Count == 0)
            {
                return;
            }

            List <IMFTopologyNode> lEVRList = new List <IMFTopologyNode>();

            foreach (var item in lOutputNodesList)
            {
                var lRenderTopologyNode = (IMFTopologyNode)item;

                if (lRenderTopologyNode != null)
                {
                    lEVRList.Add(lRenderTopologyNode);
                }
            }

            mPlayerControl.setRenderList(
                lEVRList,
                lCaptureManagerEVRMultiSinkFactory.getIEVRStreamControl(),
                lMaxVideoRenderStreamCount);
        }