私はデコーダーコードを持っています。に統合しようとしていffmpeg framework
ます。
ここにある HOW TO を参照しています: http://wiki.multimedia.cx/index.php?title=FFmpeg_codec_howto
その記事によると、decoder_name.c
ファイルに構造を定義する必要があります。
構造の例を以下に示します。
AVCodec sample_decoder =
{
.name = "sample",
.type = AVCODEC_TYPE_VIDEO,
.id = AVCODEC_ID_SAMPLE,
// .priv_data_size = sizeof(COOKContext),
.init = sample_decode_init,
.close = sample_decode_close,
.decode = sample_decode_frame,
};
どこ、
.name -> specifies the short name of my decoder.
.type -> is used to specify that it is a video decoder.
.id -> is an unique id that i'm assigning to my video decoder.
.init -> is a function pointer to the function in my decoder code that performs decoder related initializations
.decode -> is a function pointer to the function in my decoder code that decodes a single frame, given the input data (elementary stream).
.close -> is a function pointer to the function in my decoder that frees all allocated memory i.e. the memory allocated in init.
ただし、上記の記事によると、私の疑問は.priv_data_size
、何らかのコンテキストのサイズを保持するという別のフィールドがあるということです。
.priv_data_size
上記の記事によると、構造体のすべてのパラメーターを定義する必要はないため、このフィールドを持つことは必須ですかAVCodec
。さらに、デコーダーにそのようなコンテキストはありません。
libavcodec
ただし、 ffmpegの他の利用可能なデコーダーのコードを調べると、すべてのデコーダーがこれを定義していることがわかります。これを指定しない場合、デコーダは機能しますか? このため、先に進むことができません。同じことを評価するガイダンスを提供してください。
- 前もって感謝します。