디코더 코드가 있습니다. 나는 그것을 ffmpeg framework
에 통합하려고합니다.FFMPEG : 코덱의 컨텍스트를 강제적으로 정의하고 있습니까?
여기 부여 할 수있는 방법을 말하는 겁니다 : http://wiki.multimedia.cx/index.php?title=FFmpeg_codec_howto
난 내 decoder_name.c
파일의 구조를 정의 할 필요가 그 기사에 따르면.
예 구조는 다음과 같다 : 제 역시 위에서 언급 한 문서에 따른된다 그러나
.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.
는 다른 필드가,
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,
};
는의 크기를 유지 .priv_data_size
라고 어떤 상황.
위의 기사에 따르면이 필드는 반드시 .priv_data_size
이어야합니다. 구조의 모든 매개 변수를 정의하지 않아도됩니다. AVCodec
. 게다가 나는 내 디코더에 대한 그런 맥락을 가지고 있지 않다.
그러나 ffmpeg의 libavcodec
에있는 다른 사용 가능한 디코더 코드를 살펴보면 모든 디코더가이를 정의했다는 것을 알았습니다. 이걸 지정하지 않으면 내 디코더가 작동합니까? 이 때문에 진행할 수 없습니다. 같은 지침을 폐지하는 지침을 제공하십시오.
- 미리 감사드립니다.
해당 게시물을 유지하고 있음을 알려주세요. 정말 저와 같은 사람들이 코덱 통합을 시작하는 데 도움이됩니다. 먼저 게시물과 답변에 감사드립니다. 둘째, 관련 게시물이있는 경우이 섹션에서 귀중한 게시물 링크를 제공하십시오. 모든 사람에게 도움이 될 것입니다. 감사합니다 :) – sam
여기 관심있는 멀티미디어 관련 질문에 대한 답변으로 작성한 또 다른 게시물이 있습니다. http://stackoverflow.com/a/9958424/475067 –