diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-03-16 21:09:54 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-03-21 01:33:09 +0100 |
commit | 20f972701806be20a77f808db332d9489343bb78 (patch) | |
tree | 8d8b588c0ca06fa652518a5685db8280b0bf532d /libavcodec/v4l2_m2m_enc.c | |
parent | a688f3c13ce55c2ba51dbbb344564649f1bb52fe (diff) | |
download | ffmpeg-20f972701806be20a77f808db332d9489343bb78.tar.gz |
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/v4l2_m2m_enc.c')
-rw-r--r-- | libavcodec/v4l2_m2m_enc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c index feccfe4911..ff5c79c91c 100644 --- a/libavcodec/v4l2_m2m_enc.c +++ b/libavcodec/v4l2_m2m_enc.c @@ -421,20 +421,20 @@ static const AVCodecDefault v4l2_m2m_defaults[] = { #define M2MENC(NAME, LONGNAME, OPTIONS_NAME, CODEC) \ M2MENC_CLASS(NAME, OPTIONS_NAME) \ - const AVCodec ff_ ## NAME ## _v4l2m2m_encoder = { \ - .name = #NAME "_v4l2m2m" , \ - .long_name = NULL_IF_CONFIG_SMALL("V4L2 mem2mem " LONGNAME " encoder wrapper"), \ - .type = AVMEDIA_TYPE_VIDEO, \ - .id = CODEC , \ + const FFCodec ff_ ## NAME ## _v4l2m2m_encoder = { \ + .p.name = #NAME "_v4l2m2m" , \ + .p.long_name = NULL_IF_CONFIG_SMALL("V4L2 mem2mem " LONGNAME " encoder wrapper"), \ + .p.type = AVMEDIA_TYPE_VIDEO, \ + .p.id = CODEC , \ .priv_data_size = sizeof(V4L2m2mPriv), \ - .priv_class = &v4l2_m2m_ ## NAME ##_enc_class, \ + .p.priv_class = &v4l2_m2m_ ## NAME ##_enc_class, \ .init = v4l2_encode_init, \ .receive_packet = v4l2_receive_packet, \ .close = v4l2_encode_close, \ .defaults = v4l2_m2m_defaults, \ - .capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY, \ + .p.capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY, \ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, \ - .wrapper_name = "v4l2m2m", \ + .p.wrapper_name = "v4l2m2m", \ } M2MENC(mpeg4,"MPEG4", mpeg4_options, AV_CODEC_ID_MPEG4); |