Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AVCodec"/> class.
        /// </summary>
        /// <param name="client">
        /// An implementation of the <see cref="FFmpegClient"/> which provides access to the native FFmpeg functions.
        /// </param>
        /// <param name="stream">
        /// The identifier of the requested codec.
        /// </param>
        public AVCodec(FFmpegClient client, AVStream stream)
        {
            this.context = stream.CodecContext;
            this.native  = (NativeAVCodec *)client.FindDecoder(context->codec_id);

            this.client = client;

            if ((this.Capabilities & AVCodecCapabilities.Truncated) == AVCodecCapabilities.Truncated)
            {
                context->flags |= (int)AVCodecCapabilities.Truncated;
            }

            this.Open(this.context);
        }