diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-03-16 23:09:54 +0300 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-03-21 03:33:09 +0300 |
commit | 20f972701806be20a77f808db332d9489343bb78 (patch) | |
tree | 8d8b588c0ca06fa652518a5685db8280b0bf532d /libavcodec/mpeg4videodec.c | |
parent | a688f3c13ce55c2ba51dbbb344564649f1bb52fe (diff) |
avcodec/codec_internal: Add FFCodec, hide internal part of AVCodec
Up until now, codec.h contains both public and private parts
of AVCodec. This exposes the internals of AVCodec to users
and leads them into the temptation of actually using them
and forces us to forward-declare structures and types that
users can't use at all.
This commit changes this by adding a new structure FFCodec to
codec_internal.h that extends AVCodec, i.e. contains the public
AVCodec as first member; the private fields of AVCodec are moved
to this structure, leaving codec.h clean.
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/mpeg4videodec.c')
-rw-r--r-- | libavcodec/mpeg4videodec.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index cefec7ab3e..5c55de3eb8 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -3662,16 +3662,16 @@ static const AVClass mpeg4_class = { .version = LIBAVUTIL_VERSION_INT, }; -const AVCodec ff_mpeg4_decoder = { - .name = "mpeg4", - .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"), - .type = AVMEDIA_TYPE_VIDEO, - .id = AV_CODEC_ID_MPEG4, +const FFCodec ff_mpeg4_decoder = { + .p.name = "mpeg4", + .p.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"), + .p.type = AVMEDIA_TYPE_VIDEO, + .p.id = AV_CODEC_ID_MPEG4, .priv_data_size = sizeof(Mpeg4DecContext), .init = decode_init, .close = ff_h263_decode_end, .decode = ff_h263_decode_frame, - .capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | + .p.capabilities = AV_CODEC_CAP_DRAW_HORIZ_BAND | AV_CODEC_CAP_DR1 | #if FF_API_FLAG_TRUNCATED AV_CODEC_CAP_TRUNCATED | #endif @@ -3680,12 +3680,12 @@ const AVCodec ff_mpeg4_decoder = { FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM | FF_CODEC_CAP_ALLOCATE_PROGRESS, .flush = ff_mpeg_flush, - .max_lowres = 3, - .pix_fmts = ff_h263_hwaccel_pixfmt_list_420, - .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg4_video_profiles), + .p.max_lowres = 3, + .p.pix_fmts = ff_h263_hwaccel_pixfmt_list_420, + .p.profiles = NULL_IF_CONFIG_SMALL(ff_mpeg4_video_profiles), .update_thread_context = ONLY_IF_THREADS_ENABLED(mpeg4_update_thread_context), .update_thread_context_for_user = ONLY_IF_THREADS_ENABLED(mpeg4_update_thread_context_for_user), - .priv_class = &mpeg4_class, + .p.priv_class = &mpeg4_class, .hw_configs = (const AVCodecHWConfigInternal *const []) { #if CONFIG_MPEG4_NVDEC_HWACCEL HWACCEL_NVDEC(mpeg4), |