Пример #1
0
 ////////////////////////////////////////////////////
 ////////////////////////////////////////////////////
 ////////////////////// VIDEO ///////////////////////
 ////////////////////////////////////////////////////
 ////////////////////////////////////////////////////
 private unsafe void OnVideoPacketAcquired(VideoPacket packet)
 {
     if (_videoPacketDecoderWorker.IsAlive)
     {
         _videoPacketDecoderWorker.EnqueuePacket(packet);
     }
 }
Пример #2
0
        void VideoRecvLoop()
        {
            var stream = videoClient.GetStream();

            while (running)
            {
                try
                {
                    // Read packet size.
                    var szbuf      = ReadBytes(stream, 4);
                    int total_size = BitConverter.ToInt32(szbuf, 0);
                    bytes += total_size;

                    // Read data.
                    var databuf = ReadBytes(stream, total_size);
                    var packet  = ConvertVideoPacket(databuf);

                    videoDecoder.EnqueuePacket(packet);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(ex.Message);
                }
            }
        }
Пример #3
0
 private void OnVideoPacketAqcuired(VideoPacket packet)
 {
     // If the video decoder is alive, enqueue the packet to be decoded.
     if (videoDecoder.IsAlive)
     {
         videoDecoder.EnqueuePacket(packet);
     }
 }
 void _droneClient_VideoPacketAcquired(VideoPacket packet)
 {
     if (_packetRecorderWorker != null && _packetRecorderWorker.IsAlive)
     {
         _packetRecorderWorker.EnqueuePacket(packet);
     }
     if (_videoPacketDecoderWorker.IsAlive)
     {
         _videoPacketDecoderWorker.EnqueuePacket(packet);
     }
 }
Пример #5
0
 private void OnVideoPacketAcquired(VideoPacket packet)
 {
     if (_packetRecorderWorker != null && _packetRecorderWorker.IsAlive)
     {
         _packetRecorderWorker.EnqueuePacket(packet);
     }
     if (_videoPacketDecoderWorker.IsAlive)
     {
         _videoPacketDecoderWorker.EnqueuePacket(packet);
     }
 }
Пример #6
0
 public static void OnVideoPacketAcquired(VideoPacket packet)
 {
     //check if the worker is valid then send the nav packet to the worker.
     if (_packetRecorderWorker != null && _packetRecorderWorker.IsAlive)
     {
         _packetRecorderWorker.EnqueuePacket(packet);
     }
     if (VideoPacketDecoderWorker.IsAlive)
     {
         VideoPacketDecoderWorker.EnqueuePacket(packet);
     }
 }
Пример #7
0
 private void OnVideoPacketAcquired(VideoPacket packet)
 {
     if (_fileWriter != null && _isWriter)
     {
         _fileWriter.EnqueuePacket(packet);
     }
     if (_isWriter)
     {
         _totalWriteStream.WriteLine("%%Vedio%%");
         _totalWriteStream.WriteLine("Vedio:" + packet.Timestamp);
         _totalWriteStream.WriteLine();
         // _totalWriteStream.Flush();
     }
     _videoPacketDecoderWorker.EnqueuePacket(packet);
     Thread.Sleep(20);
 }
Пример #8
0
 private void OnVideoPacketAcquired(VideoPacket packet)
 {
     _videoPacketDecoderWorker.EnqueuePacket(packet);
     Thread.Sleep(20);
 }