예제 #1
0
 public void AppendPacket(Packet packet)
 {
     try
     {
         packetStorage.AddPacket(packet);
     }
     catch (Exception e)
         when(e is ObjectDisposedException || e is InvalidOperationException)
         {
             logger.Warn($"{packet.StreamType}: Packet storage stopped/disposed {packet.Dts}");
             packet.Dispose();
         }
     catch (Exception e)
     {
         logger.Error($"{packet.StreamType}: {e}");
         throw;
     }
 }
예제 #2
0
        /// <summary>
        /// Sets Stream configuration
        /// Non configured stream - stream config will be pushed directly to ES Player.
        /// Configured stream - stream config will be enqueue in packet storage
        /// and processed once retrieved.
        /// </summary>
        /// <param name="bufferConfig">BufferConfigurationPacket</param>
        /// <returns>SetStreamConfigResult</returns>
        public SetStreamConfigResult SetStreamConfig(BufferConfigurationPacket bufferConfig)
        {
            // Depending on current configuration state, packets are either pushed
            // directly to player or queued in packet queue.
            // To make sure current state is known, sync this operation.
            //
            logger.Info($"{streamType}: Already Configured: {IsConfigured}");

            if (IsConfigured)
            {
                packetStorage.AddPacket(bufferConfig);
                logger.Info($"{streamType}: New configuration queued");
                return(SetStreamConfigResult.ConfigQueued);
            }

            CurrentConfig = bufferConfig;
            PushStreamConfig(CurrentConfig.Config);
            return(SetStreamConfigResult.ConfigPushed);
        }
예제 #3
0
 public void AppendPacket(Packet packet)
 {
     packetStorage.AddPacket(packet);
 }
예제 #4
0
 public void AppendPacket(Packet packet)
 {
     streamControl.DataIn(packet);
     packetStorage.AddPacket(packet);
 }