Ejemplo n.º 1
0
        public void startDecoder(iMediaFile media, Audio.iDecoderQueues audioQueues)
        {
            iVideoTrackReader reader = encoded.enqueueInitial(media.videoTrack);
            var audioReader          = media.audioTrack.createReader();

            // Launch the thread
            m_thread = new DecoderThread(device, reader, encoded, decoded, shutdownHandle, this,
                                         audioReader, audioQueues);
        }
Ejemplo n.º 2
0
        public DecoderThread(VideoDevice device, iVideoTrackReader reader, EncodedQueue encoded, DecodedQueue decoded, int shutdownEvent, iDecoderEvents eventsSink,
                             iAudioTrackReader audioReader, Audio.iDecoderQueues audioQueue)
        {
            this.device        = device;
            this.reader        = reader;
            this.encoded       = encoded;
            this.decoded       = decoded;
            this.shutdownEvent = shutdownEvent;
            this.audioReader   = audioReader;
            this.audioQueue    = audioQueue;

            // Enqueue decoded buffers
            decoded.enqueueAll();

            this.eventsSink = eventsSink;
            seekEventHandle = EventHandle.create();

            // Remaining work is done in the thread
            thread = new Thread(threadMain);
            thread.IsBackground = true;
            thread.Name         = "Media player thread";
            Logger.logInfo("Launching the video decoding thread");
            thread.Start();
        }