コード例 #1
0
        public override void Start()
        {
            lock (this.SyncRoot)
            {
                IConsumerService consumerManager = this.Scope.GetService(typeof(IConsumerService)) as IConsumerService;
                try
                {
                    //_videoCodecFactory = new VideoCodecFactory();
                    _videoCodecFactory = this.Scope.GetService(typeof(VideoCodecFactory)) as VideoCodecFactory;
                    _checkVideoCodec   = true;
                }
                catch (Exception ex)
                {
                    log.Warn("No video codec factory available.", ex);
                }
                _firstPacketTime = _audioTime = _videoTime = _dataTime = -1;
                _connMsgOut      = consumerManager.GetConsumerOutput(this);
                _connMsgOut.Subscribe(this, null);
                _recordPipe = new InMemoryPushPushPipe();
#if !(NET_1_1)
                Dictionary <string, object> recordParameterMap = new Dictionary <string, object>();
#else
                Hashtable recordParameterMap = new Hashtable();
#endif
                // Clear record flag
                recordParameterMap.Add("record", null);
                _recordPipe.Subscribe(this as IProvider, recordParameterMap);
                _recording         = false;
                _recordingFilename = null;
                this.CodecInfo     = new StreamCodecInfo();
                _closed            = false;
                _bytesReceived     = 0;
                _creationTime      = System.Environment.TickCount;
            }
        }
コード例 #2
0
 public override void Start()
 {
     lock (base.SyncRoot)
     {
         IConsumerService service = base.Scope.GetService(typeof(IConsumerService)) as IConsumerService;
         try
         {
             this._videoCodecFactory = new VideoCodecFactory();
             this._checkVideoCodec   = true;
         }
         catch (Exception exception)
         {
             log.Warn("No video codec factory available.", exception);
         }
         this._firstPacketTime = this._audioTime = this._videoTime = this._dataTime = -1;
         this._connMsgOut      = service.GetConsumerOutput(this);
         this._connMsgOut.Subscribe(this, null);
         this._recordPipe = new InMemoryPushPushPipe();
         Dictionary <string, object> parameterMap = new Dictionary <string, object>();
         parameterMap.Add("record", null);
         this._recordPipe.Subscribe(this, parameterMap);
         this._recording         = false;
         this._recordingFilename = null;
         base.CodecInfo          = new StreamCodecInfo();
         this._closed            = false;
         this._bytesReceived     = 0L;
         this._creationTime      = Environment.TickCount;
     }
 }
コード例 #3
0
ファイル: Manager.cs プロジェクト: lypvc/WindowsRibbon
        public Manager(IMessageOutput output, string ribbonXmlFilename, string ribbonXmlContent)
        {
            _output = output;

            _ribbonXmlFilename = ribbonXmlFilename;
            _ribbonXmlContent  = ribbonXmlContent;

            Initialize();
        }
コード例 #4
0
ファイル: Manager.cs プロジェクト: ldh9451/XLE
        public Manager(IMessageOutput output, string ribbonXmlFilename, string ribbonXmlContent)
        {
            _output = output;

            _ribbonXmlFilename = ribbonXmlFilename;
            _ribbonXmlContent = ribbonXmlContent;

            Initialize();
        }
コード例 #5
0
 /// <summary>
 /// Pipe connection event handler. There are two types of pipe connection events so far,
 /// provider push connection event and provider disconnection event.
 /// </summary>
 /// <param name="evt"></param>
 public void OnPipeConnectionEvent(PipeConnectionEvent evt)
 {
     switch (evt.Type)
     {
         case PipeConnectionEvent.PROVIDER_CONNECT_PUSH:
             if (evt.Provider == this && (evt.ParameterMap == null || !evt.ParameterMap.ContainsKey("record")))
             {
                 _msgOut = (IMessageOutput)evt.Source;
             }
             break;
         case PipeConnectionEvent.PROVIDER_DISCONNECT:
             if (_msgOut == evt.Source)
                 _msgOut = null;
             break;
         default:
             break;
     }
 }
コード例 #6
0
        public override void Start()
        {
            lock (this.SyncRoot)
            {
                IConsumerService consumerManager = this.Scope.GetService(typeof(IConsumerService)) as IConsumerService;
                try
                {
                    //_videoCodecFactory = new VideoCodecFactory();
                    _videoCodecFactory = this.Scope.GetService(typeof(VideoCodecFactory)) as VideoCodecFactory;
                    _checkVideoCodec = true;
                }
                catch (Exception ex)
                {
                    log.Warn("No video codec factory available.", ex);
                }
                _firstPacketTime = _audioTime = _videoTime = _dataTime = -1;
                _connMsgOut = consumerManager.GetConsumerOutput(this);
                _connMsgOut.Subscribe(this, null);
                _recordPipe = new InMemoryPushPushPipe();
#if !(NET_1_1)
                Dictionary<string, object> recordParameterMap = new Dictionary<string, object>();
#else
                Hashtable recordParameterMap = new Hashtable();
#endif
                // Clear record flag
                recordParameterMap.Add("record", null);
                _recordPipe.Subscribe(this as IProvider, recordParameterMap);
                _recording = false;
                _recordingFilename = null;
                this.CodecInfo = new StreamCodecInfo();
                _closed = false;
                _bytesReceived = 0;
                _creationTime = System.Environment.TickCount;
            }
        }
コード例 #7
0
ファイル: PlayEngine.cs プロジェクト: ByteSempai/Ubiquitous
 /// <summary>
 /// Start stream.
 /// </summary>
 public void Start()
 {
     lock (this.SyncRoot)
     {
         if (_playlistSubscriberStream.State != State.UNINIT)
             throw new IllegalStateException();
         _playlistSubscriberStream.State = State.STOPPED;
         if (_msgOut == null)
         {
             _msgOut = _consumerService.GetConsumerOutput(_playlistSubscriberStream);
             _msgOut.Subscribe(this, null);
         }
         _audioBucket = _bwController.GetAudioBucket(_bwContext);
         _videoBucket = _bwController.GetVideoBucket(_bwContext);
     }
 }
コード例 #8
0
 /// <summary>
 /// Pipe connection event handler. There are two types of pipe connection events so far,
 /// provider push connection event and provider disconnection event.
 /// </summary>
 /// <param name="evt"></param>
 public void OnPipeConnectionEvent(PipeConnectionEvent evt)
 {
     switch (evt.Type)
     {
         case PipeConnectionEvent.PROVIDER_CONNECT_PUSH:
             if (evt.Provider == this && (evt.ParameterMap == null || !evt.ParameterMap.ContainsKey("record")))
             {
                 _msgOut = (IMessageOutput)evt.Source;
             }
             break;
         case PipeConnectionEvent.PROVIDER_DISCONNECT:
             if (_msgOut == evt.Source)
                 _msgOut = null;
             break;
         default:
             break;
     }
 }