Ejemplo n.º 1
0
        protected CaptureGraph(FilterInfo fiSource)
        {
            try
            {
                // Fgm initialization
                fgm   = new FilgraphManagerClass();
                iFG   = (IFilterGraph)fgm;
                iGB   = (IGraphBuilder)fgm;
                rotID = FilterGraph.AddToRot(iGB);

                // Create source filter and initialize it
                source = (SourceFilter)Filter.CreateFilter(fiSource);
                iGB.AddFilter(source.BaseFilter, source.FriendlyName);
                source.AddedToGraph(fgm);

                // Pass flags to the RtpRenderer filter from the config file.
                this.rtpRendererFlags = 0;
                string setting = ConfigurationManager.AppSettings[AppConfig.MDS_RtpRendererFlags];
                if (!String.IsNullOrEmpty(setting))
                {
                    if (!byte.TryParse(setting, out rtpRendererFlags))
                    {
                        rtpRendererFlags = 0;
                    }
                }
            }
            catch (Exception)
            {
                Cleanup();
                throw;
            }
        }
Ejemplo n.º 2
0
        protected CaptureGraph(FilterInfo fiSource)
        {
            try
            {
                // Fgm initialization
                fgm   = new FilgraphManagerClass();
                iFG   = (IFilterGraph)fgm;
                iGB   = (IGraphBuilder)fgm;
                rotID = FilterGraph.AddToRot(iGB);

                // Create source filter and initialize it
                source = (SourceFilter)Filter.CreateFilter(fiSource);
                iGB.AddFilter(source.BaseFilter, source.FriendlyName);
                source.AddedToGraph(fgm);
            }
            catch (Exception)
            {
                Cleanup();
                throw;
            }
        }