Esempio n. 1
0
        public DVRLeadNetSink(StreamSourceInfo sourceConfig, OpenGraphRequest openGraphRequest) : base(sourceConfig, openGraphRequest)
        {
            AppLogger.Message("In DVRNetSink constructor - CurrentProfile is " + CurrentProfile.Name);

            InitializeNetworkSink();

            _captureFilter = DVRGraphHelper.GetAndConfigureDVRSourceForSink(_graphBuilder, sourceConfig);

            _demux                          = AddFilterByName(FilterCategory.LegacyAmFilterCategory, "LEAD MPEG2 Transport Demultiplexer");
            _demuxControl                   = (ILMMpgDmx)_demux;
            _demuxControl.AutoLive          = true;
            _demuxControl.AutoLiveTolerance = .5;

            ConnectFilters(_captureFilter, "Output", _demux, "Input 01");

            ConnectFilterToNetMux(_demux, "H.264 Video", "Input 01");

            ConnectNetMuxToNetSnk();
        }
Esempio n. 2
0
        public DVRtoDVR(StreamSourceInfo sourceConfig, OpenGraphRequest openGraphRequest) : base(sourceConfig, openGraphRequest)
        {
            AppLogger.Message("In DVRtoDVR - CurrentProfile is " + CurrentProfile.Name);

            InitializeSink();

            _captureFilter = DVRGraphHelper.GetAndConfigureDVRSourceForSink(_graphBuilder, sourceConfig);

            _demux                          = AddFilterByName(FilterCategory.LegacyAmFilterCategory, "LEAD MPEG2 Transport Demultiplexer");
            _demuxControl                   = (ILMMpgDmx)_demux;
            _demuxControl.AutoLive          = true;
            _demuxControl.AutoLiveTolerance = .5;

//            _currentVideoSettings = new VideoSettings();
//            _currentVideoSettings.CodecType = CurrentProfile.Video.CodecType;

            ConnectFilters(_captureFilter, "Output", _demux, "Input 01");

            if (CurrentProfile.Video != null)
            {
                VideoSettings settings = CurrentProfile.Video;
                _videoDecoder = AddFilterByName(FilterCategory.LegacyAmFilterCategory, "LEAD H264 Decoder (3.0)");
                _videoEncoder = AddFilterByName(FilterCategory.LegacyAmFilterCategory, "LEAD H264 Encoder (4.0)");
                ConnectFilters(_demux, "H.264 Video", _videoDecoder, "XForm In");
                ConnectFilters(_videoDecoder, "XForm Out", _videoEncoder, "XForm In");
                LMH264EncoderLib.ILMH264Encoder encoderConfig = (LMH264EncoderLib.ILMH264Encoder)_videoEncoder;
                encoderConfig.EnableRateControl = true;
                encoderConfig.BitRate           = settings.ConstantBitRate * 1024;
                ConnectFilterToMux(_videoEncoder, "XForm Out", "Input 01");
            }
            else
            {
                ConnectFilterToMux(_demux, "H.264 Video", "Input 01");
            }
            ConnectMuxToSink();
        }