コード例 #1
0
        private void DecodePacket()
        {
            if (!reuseLastPacket)
            {
                if (IsBufferEmpty)
                {
                    OwnerFile.GetPacketFromStream(Info.Index);
                }
                packet      = BufferedPackets.Dequeue();
                bufferSize -= packet.Pointer->size;
            }

            // Sends the packet to the decoder.
            var result = ffmpeg.avcodec_send_packet(Pointer, packet);

            if (result == ffmpeg.AVERROR(ffmpeg.EAGAIN))
            {
                reuseLastPacket = true;
            }
            else
            {
                reuseLastPacket = false;
                result.ThrowIfError("Cannot send a packet to the decoder.");
                packet.Wipe();
            }
        }
コード例 #2
0
        private void DecodePacket()
        {
            var pkt = OwnerFile.ReadNextPacket(Info.Index);

            // Sends the packet to the decoder.
            var result = ffmpeg.avcodec_send_packet(Pointer, pkt);

            if (result == ffmpeg.AVERROR(ffmpeg.EAGAIN))
            {
                OwnerFile.ReuseLastPacket();
            }
            else
            {
                result.ThrowIfError("Cannot send a packet to the decoder.");
            }
        }
コード例 #3
0
 public override int GetHashCode() => OwnerFile.GetHashCode() ^ Platform.GetHashCode();