Esempio n. 1
0
 protected override MessageBase CopyImpl(MessageBase clone)
 {
     // Instantiate the clone, if a derived type hasn't already.
     if (clone == null)
     {
         clone = new ResetMessage();
     }
     return(base.CopyImpl(clone));
 }
Esempio n. 2
0
        /// <summary>
        /// Send reset message
        /// </summary>
        private void SendReset()
        {
            if (_isPullMode)
            {
                Ping ping1 = new Ping();
                ping1.PingType = (short)Ping.RecordedStream;
                ping1.Value2 = this.StreamId;

                RtmpMessage ping1Msg = new RtmpMessage();
                ping1Msg.body = ping1;
                DoPushMessage(ping1Msg);
            }

            Ping ping2 = new Ping();
            ping2.PingType = (short)Ping.StreamBegin;
            ping2.Value2 = this.StreamId;

            RtmpMessage ping2Msg = new RtmpMessage();
            ping2Msg.body = ping2;
            DoPushMessage(ping2Msg);

            ResetMessage reset = new ResetMessage();
            DoPushMessage(reset);
        }
Esempio n. 3
0
 protected override MessageBase CopyImpl(MessageBase clone)
 {
     // Instantiate the clone, if a derived type hasn't already.
     if (clone == null) clone = new ResetMessage();
     return base.CopyImpl(clone);
 }
Esempio n. 4
0
        /// <summary>
        /// Send VOD seek control message
        /// </summary>
        /// <param name="msgIn">Message input</param>
        /// <param name="position">New timestamp to play from</param>
        private void SendVODSeekCM(IMessageInput msgIn, int position)
        {
            OOBControlMessage oobCtrlMsg = new OOBControlMessage();
            oobCtrlMsg.Target = typeof(ISeekableProvider).Name;
            oobCtrlMsg.ServiceName = "seek";
            oobCtrlMsg.ServiceParameterMap.Add("position", position);
            msgIn.SendOOBControlMessage(this, oobCtrlMsg);

            lock (this.SyncRoot)
            {
                // Reset properties
                _vodStartTS = 0;
                _serverStartTS = System.Environment.TickCount;
                if (_nextRTMPMessage != null)
                {
                    try
                    {
                        PushMessage(_nextRTMPMessage);
                    }
                    catch (IOException ex)
                    {
                        log.Error("Error while sending message.", ex);
                    }
                    _nextRTMPMessage = null;
                }
                ResetMessage reset = new ResetMessage();
                try
                {
                    PushMessage(reset);
                }
                catch (IOException ex)
                {
                    log.Error("Error while sending message.", ex);
                }
                ScheduleNextMessage();
            }
        }