Ejemplo n.º 1
0
        /// <summary>
        /// Initialisiert die Filterstruktur.
        /// </summary>
        public void CreateGraph()
        {
            // Cleanup
            DestroyGraph();

            // Check log
            var logFile = BDASettings.BDALogPath;

            if (logFile != null)
            {
                m_LogFile = new FileStream(logFile.FullName, FileMode.Create, FileAccess.Write, FileShare.Read);
            }

            // Create new graph builder
            m_Graph = (IGraphBuilder)Activator.CreateInstance(Type.GetTypeFromCLSID(BDAEnvironment.GraphBuilderClassIdentifier));

            // Enable logging
            if (m_LogFile != null)
            {
                m_Graph.SetLogFile(m_LogFile.SafeFileHandle);
            }

            // See if we should register the graph
            m_Register = BDASettings.RegisterBDAGRaph(DirectShowObject, false);

            // Create filter
            InjectorFilter = new TSFilter(this);
            try
            {
                // Check for statistics
                InjectorFilter.EnableStatistics = BDASettings.GenerateTSStatistics;

                // Register in graph
                AddFilter(Filter_Injector, InjectorFilter);
            }
            catch
            {
                // Cleanup
                InjectorFilter.Dispose();

                // Forward
                throw;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initialisiert die Filterstruktur.
        /// </summary>
        public void CreateGraph()
        {
            // Cleanup
            DestroyGraph();

            // Check log 
            var logFile = BDASettings.BDALogPath;
            if (logFile != null)
                m_LogFile = new FileStream( logFile.FullName, FileMode.Create, FileAccess.Write, FileShare.Read );

            // Create new graph builder
            m_Graph = (IGraphBuilder) Activator.CreateInstance( Type.GetTypeFromCLSID( BDAEnvironment.GraphBuilderClassIdentifier ) );

            // Enable logging
            if (m_LogFile != null)
                m_Graph.SetLogFile( m_LogFile.SafeFileHandle );

            // See if we should register the graph
            m_Register = BDASettings.RegisterBDAGRaph( DirectShowObject, false );

            // Create filter
            InjectorFilter = new TSFilter( this );
            try
            {
                // Check for statistics
                InjectorFilter.EnableStatistics = BDASettings.GenerateTSStatistics;

                // Register in graph
                AddFilter( Filter_Injector, InjectorFilter );
            }
            catch
            {
                // Cleanup
                InjectorFilter.Dispose();

                // Forward
                throw;
            }
        }