public void Initialize() { if (this.context != null) { throw new Exception("Already Initialized"); } this.context = new CodecContext(this); }
public void Initialize(MediaStream stream) { if (this.context != null) { throw new Exception("Already Initialized"); } Stream = stream ?? throw new ArgumentNullException(nameof(stream)); this.context = new CodecContext(stream.Pointer->codec); // context.Pointer->codec = this.pointer }
protected Codec(AVCodecContext *context, CodecType type) { Id = (context->codec_id).ToCodecId(); Type = type; this.pointer = context->codec; if (pointer == null) { pointer = Get(Id, Type); } this.context = new CodecContext(context); }