示例#1
0
        public EsStream(Common.StreamType type, EsPlayerPacketStorage storage)
        {
            streamType    = type;
            packetStorage = storage;

            switch (streamType)
            {
            case StreamType.Audio:
                PushStreamConfig = PushAudioConfig;
                break;

            case StreamType.Video:
                PushStreamConfig = PushVideoConfig;
                break;

            default:
                throw new ArgumentException($"Stream Type {streamType} is unsupported");
            }

            wakeup = new ManualResetEventSlim(false);
        }
示例#2
0
        public EsStream(StreamType type, EsPlayerPacketStorage storage, Synchronizer synchronizer, PlayerClockProvider playerClock)
        {
            streamType        = type;
            packetStorage     = storage;
            _dataSynchronizer = synchronizer;
            _dataSynchronizer.Initialize(streamType);
            _playerClock = playerClock;

            switch (streamType)
            {
            case StreamType.Audio:
                PushStreamConfig = PushAudioConfig;
                break;

            case StreamType.Video:
                PushStreamConfig = PushVideoConfig;
                break;

            default:
                throw new ArgumentException($"Stream Type {streamType} is unsupported");
            }
        }
示例#3
0
        public EsStream(Common.StreamType type, EsPlayerPacketStorage storage, StreamBufferController bufferController)
        {
            streamType             = type;
            packetStorage          = storage;
            streamBufferController = bufferController;

            switch (streamType)
            {
            case StreamType.Audio:
                PushStreamConfig = PushAudioConfig;
                break;

            case StreamType.Video:
                PushStreamConfig = PushVideoConfig;
                break;

            default:
                throw new ArgumentException($"Stream Type {streamType} is unsupported");
            }

            wakeup  = new ManualResetEventSlim(false);
            barrier = new PacketBarrier(TransferChunk);
        }
示例#4
0
        public EsStream(StreamType type, EsPlayerPacketStorage storage, Synchronizer synchronizer, SuspendResumeLogic suspendRedumeLogic)
        {
            streamType        = type;
            packetStorage     = storage;
            _dataSynchronizer = synchronizer;
            _dataSynchronizer.Initialize(streamType);
            _suspendResumeLogic = suspendRedumeLogic;

            switch (streamType)
            {
            case StreamType.Audio:
                PushStreamConfig = PushAudioConfig;
                break;

            case StreamType.Video:
                PushStreamConfig = PushVideoConfig;
                break;

            default:
                throw new ArgumentException($"Stream Type {streamType} is unsupported");
            }

            _firstDataPacketTcs = new TaskCompletionSource <object>();
        }