private async void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            MainWindow.mISourceItems.Add(this);

            mEncoderControl = await MainWindow.mCaptureManager.createEncoderControlAsync();

            if (mEncoderControl == null)
            {
                return;
            }

            mSourceControl = await MainWindow.mCaptureManager.createSourceControlAsync();

            if (mSourceControl == null)
            {
                return;
            }



            mStreamControl = await MainWindow.mCaptureManager.createStreamControlAsync();

            if (mStreamControl == null)
            {
                return;
            }

            mSpreaderNodeFactory = await mStreamControl.createSpreaderNodeFactoryAsync();

            if (mSpreaderNodeFactory == null)
            {
                return;
            }



            mSinkControl = await MainWindow.mCaptureManager.createSinkControlAsync();

            if (mSinkControl == null)
            {
                return;
            }

            mEVRMultiSinkFactory = await mSinkControl.createEVRMultiSinkFactoryAsync(Guid.Empty);

            if (mEVRMultiSinkFactory == null)
            {
                return;
            }
        }
示例#2
0
        private async Task initInterface()
        {
            mSinkControl = await MainWindow.mCaptureManager.createSinkControlAsync();

            if (mSinkControl == null)
            {
                return;
            }

            string lxmldoc = await MainWindow.mCaptureManager.getCollectionOfSinksAsync();

            XmlDocument doc = new XmlDocument();

            doc = new XmlDocument();

            doc.LoadXml(lxmldoc);

            var lSinkNode = doc.SelectSingleNode("SinkFactories/SinkFactory[@GUID='{759D24FF-C5D6-4B65-8DDF-8A2B2BECDE39}']");

            if (lSinkNode == null)
            {
                return;
            }

            var lContainerNode = lSinkNode.SelectSingleNode("Value.ValueParts/ValuePart[3]");

            if (lContainerNode == null)
            {
                return;
            }

            setContainerFormat(lContainerNode);

            mSampleGrabberSinkFactory = await mSinkControl.createSampleGrabberCallSinkFactoryAsync(
                mReadMode);
        }
示例#3
0
        protected override async void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            try
            {
                mCaptureManager = new CaptureManager("CaptureManager.dll");
            }
            catch (System.Exception)
            {
                try
                {
                    mCaptureManager = new CaptureManager();
                }
                catch (System.Exception)
                {
                }
            }

            if (mCaptureManager == null)
            {
                return;
            }


            mSourceControl = await mCaptureManager.createSourceControlAsync();

            mISessionControl = await mCaptureManager.createSessionControlAsync();

            mSinkControl = await mCaptureManager.createSinkControlAsync();

            mEncoderControl = await mCaptureManager.createEncoderControlAsync();

            System.Xml.XmlDocument doc = new System.Xml.XmlDocument();

            string lxmldoc = await mCaptureManager.getCollectionOfSourcesAsync();

            if (string.IsNullOrEmpty(lxmldoc))
            {
                return;
            }

            doc.LoadXml(lxmldoc);

            var lSourceNodes = doc.DocumentElement.ChildNodes;// .SelectNodes("//*[Source.Attributes/Attribute[@Name='MF_DEVSOURCE_ATTRIBUTE_MEDIA_TYPE']/Value.ValueParts/ValuePart[@Value='MFMediaType_Video']]");

            if (lSourceNodes != null)
            {
                foreach (var item in lSourceNodes)
                {
                    var lNode = (XmlNode)item;

                    if (lNode != null)
                    {
                        var lvalueNode = lNode.SelectSingleNode("Source.Attributes/Attribute[@Name='MF_DEVSOURCE_ATTRIBUTE_FRIENDLY_NAME']/SingleValue/@Value");

                        ContainerItem lSourceItem = new ContainerItem()
                        {
                            mFriendlyName = lvalueNode.Value,
                            mXmlNode      = lNode
                        };

                        sourceComboBox.Items.Add(lSourceItem);
                    }
                }
            }
        }
        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                mCaptureManager = new CaptureManager("CaptureManager.dll");
            }
            catch (System.Exception)
            {
                try
                {
                    mCaptureManager = new CaptureManager();
                }
                catch (System.Exception)
                {
                }
            }

            LogManager.getInstance().WriteDelegateEvent += MainWindow_WriteDelegateEvent;

            mSourceControl = await mCaptureManager.createSourceControlAsync();

            mEncoderControl = await mCaptureManager.createEncoderControlAsync();

            mSinkControl = await mCaptureManager.createSinkControlAsync();

            mStreamControl = await mCaptureManager.createStreamControlAsync();

            mISessionControl = await mCaptureManager.createSessionControlAsync();


            mSpreaderNodeFactory = await mStreamControl.createSpreaderNodeFactoryAsync();

            if (mSpreaderNodeFactory == null)
            {
                return;
            }

            XmlDataProvider lXmlDataProvider = (XmlDataProvider)this.Resources["XmlSources"];

            if (lXmlDataProvider == null)
            {
                return;
            }

            XmlDocument doc = new XmlDocument();

            string lxmldoc = await mCaptureManager.getCollectionOfSourcesAsync();

            doc.LoadXml(lxmldoc);

            lXmlDataProvider.Document = doc;



            XmlDataProvider lXmlContainerTypeProvider = (XmlDataProvider)this.Resources["XmlContainerTypeProvider"];

            if (lXmlDataProvider == null)
            {
                return;
            }

            doc = new XmlDocument();

            lxmldoc = await mCaptureManager.getCollectionOfSinksAsync();

            doc.LoadXml(lxmldoc);

            lXmlContainerTypeProvider.Document = doc;
        }
        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                mCaptureManager = new CaptureManager("CaptureManager.dll");
            }
            catch (System.Exception)
            {
                try
                {
                    mCaptureManager = new CaptureManager();
                }
                catch (System.Exception)
                {
                }
            }

            LogManager.getInstance().WriteDelegateEvent += MainWindow_WriteDelegateEvent;

            if (mCaptureManager == null)
            {
                return;
            }

            mSourceControl = await mCaptureManager.createSourceControlAsync();

            if (mSourceControl == null)
            {
                return;
            }

            mEncoderControl = await mCaptureManager.createEncoderControlAsync();

            if (mEncoderControl == null)
            {
                return;
            }

            mSinkControl = await mCaptureManager.createSinkControlAsync();

            if (mSinkControl == null)
            {
                return;
            }

            mISessionControl = await mCaptureManager.createSessionControlAsync();

            if (mISessionControl == null)
            {
                return;
            }

            mStreamControl = await mCaptureManager.createStreamControlAsync();

            if (mStreamControl == null)
            {
                return;
            }

            mSpreaderNodeFactory = await mStreamControl.createSpreaderNodeFactoryAsync();

            if (mSpreaderNodeFactory == null)
            {
                return;
            }

            mEVRMultiSinkFactory = await mSinkControl.createEVRSinkFactoryAsync(Guid.Empty);

            if (mEVRMultiSinkFactory == null)
            {
                return;
            }


            XmlDataProvider lXmlDataProvider = (XmlDataProvider)this.Resources["XmlSources"];

            if (lXmlDataProvider == null)
            {
                return;
            }

            XmlDocument doc = new XmlDocument();

            string lxmldoc = await mCaptureManager.getCollectionOfSourcesAsync();

            doc.LoadXml(lxmldoc);

            lXmlDataProvider.Document = doc;

            lXmlDataProvider = (XmlDataProvider)this.Resources["XmlEncoders"];

            if (lXmlDataProvider == null)
            {
                return;
            }

            doc = new XmlDocument();

            lxmldoc = await mCaptureManager.getCollectionOfEncodersAsync();

            doc.LoadXml(lxmldoc);

            lXmlDataProvider.Document = doc;



            lxmldoc = await mCaptureManager.getCollectionOfSinksAsync();


            lXmlDataProvider = (XmlDataProvider)this.Resources["XmlContainerTypeProvider"];

            if (lXmlDataProvider == null)
            {
                return;
            }

            doc = new XmlDocument();

            doc.LoadXml(lxmldoc);

            lXmlDataProvider.Document = doc;


            ProcessPriorityClass lpriority = Process.GetCurrentProcess().PriorityClass;

            Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.RealTime;
        }
示例#6
0
        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                mCaptureManager = new CaptureManager("CaptureManager.dll");
            }
            catch (Exception)
            {
                mCaptureManager = new CaptureManager();
            }

            LogManager.getInstance().WriteDelegateEvent += MainWindow_WriteDelegateEvent;

            if (mCaptureManager == null)
            {
                return;
            }

            mSourceControl = await mCaptureManager.createSourceControlAsync();

            if (mSourceControl == null)
            {
                return;
            }

            mSinkControl = await mCaptureManager.createSinkControlAsync();

            if (mSinkControl == null)
            {
                return;
            }

            mISessionControl = await mCaptureManager.createSessionControlAsync();

            if (mISessionControl == null)
            {
                return;
            }

            mISARVolumeControl = await mCaptureManager.createSARVolumeControlAsync();

            if (mISARVolumeControl == null)
            {
                return;
            }



            XmlDataProvider lXmlDataProvider = (XmlDataProvider)this.Resources["XmlSources"];

            if (lXmlDataProvider == null)
            {
                return;
            }

            XmlDocument doc = new XmlDocument();

            string lxmldoc = await mCaptureManager.getCollectionOfSourcesAsync();

            doc.LoadXml(lxmldoc);

            lXmlDataProvider.Document = doc;



            mSARSinkFactory = await mSinkControl.createSARSinkFactoryAsync(Guid.Empty);
        }
        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                mCaptureManager = new CaptureManager("CaptureManager.dll");
            }
            catch (System.Exception)
            {
                try
                {
                    mCaptureManager = new CaptureManager();
                }
                catch (System.Exception)
                {
                }
            }

            m_Thumbnail.mChangeState += m_Thumbnail_mChangeState;

            LogManager.getInstance().WriteDelegateEvent += MainWindow_WriteDelegateEvent;

            if (mCaptureManager == null)
            {
                return;
            }

            mSourceControl = await mCaptureManager.createSourceControlAsync();

            if (mSourceControl == null)
            {
                return;
            }

            mSinkControl = await mCaptureManager.createSinkControlAsync();

            if (mSinkControl == null)
            {
                return;
            }

            mISessionControl = await mCaptureManager.createSessionControlAsync();

            if (mISessionControl == null)
            {
                return;
            }

            mStreamControl = await mCaptureManager.createStreamControlAsync();

            if (mStreamControl == null)
            {
                return;
            }

            mSpreaderNodeFactory = await mStreamControl.createSpreaderNodeFactoryAsync();

            if (mSpreaderNodeFactory == null)
            {
                return;
            }

            mEVRMultiSinkFactory = await mSinkControl.createEVRMultiSinkFactoryAsync(Guid.Empty);

            if (mEVRMultiSinkFactory == null)
            {
                return;
            }

            mSwitcherControl = await mCaptureManager.createSwitcherControlAsync();

            if (mSwitcherControl == null)
            {
                return;
            }



            XmlDataProvider lXmlDataProvider = (XmlDataProvider)this.Resources["XmlSources"];

            if (lXmlDataProvider == null)
            {
                return;
            }

            XmlDocument doc = new XmlDocument();

            string lxmldoc = await mCaptureManager.getCollectionOfSourcesAsync();

            doc.LoadXml(lxmldoc);

            lXmlDataProvider.Document = doc;

            lXmlDataProvider = (XmlDataProvider)this.Resources["XmlEncoders"];

            if (lXmlDataProvider == null)
            {
                return;
            }

            doc = new XmlDocument();

            lxmldoc = await mCaptureManager.getCollectionOfEncodersAsync();

            doc.LoadXml(lxmldoc);

            lXmlDataProvider.Document = doc;
        }
        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                mCaptureManager = new CaptureManager("CaptureManager.dll");
            }
            catch (System.Exception)
            {
                try
                {
                    mCaptureManager = new CaptureManager();
                }
                catch (System.Exception)
                {
                }
            }

            if (mCaptureManager == null)
            {
                return;
            }

            XmlDataProvider lXmlDataProvider = (XmlDataProvider)this.Resources["XmlLogProvider"];

            if (lXmlDataProvider == null)
            {
                return;
            }

            System.Xml.XmlDocument doc = new System.Xml.XmlDocument();

            string lxmldoc = await mCaptureManager.getCollectionOfSourcesAsync();

            doc.LoadXml(lxmldoc);

            lXmlDataProvider.Document = doc;

            mSourceControl = await mCaptureManager.createSourceControlAsync();



            lxmldoc = await mCaptureManager.getCollectionOfSinksAsync();


            lXmlDataProvider = (XmlDataProvider)this.Resources["XmlSinkFactoryCollectionProvider"];

            if (lXmlDataProvider == null)
            {
                return;
            }

            doc = new System.Xml.XmlDocument();

            doc.LoadXml(lxmldoc);

            lXmlDataProvider.Document = doc;


            mISessionControl = await mCaptureManager.createSessionControlAsync();

            mSinkControl = await mCaptureManager.createSinkControlAsync();

            mEncoderControl = await mCaptureManager.createEncoderControlAsync();
        }