aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/v4l2_m2m_dec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-03-16 21:09:54 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-03-21 01:33:09 +0100
commit20f972701806be20a77f808db332d9489343bb78 (patch)
tree8d8b588c0ca06fa652518a5685db8280b0bf532d /libavcodec/v4l2_m2m_dec.c
parenta688f3c13ce55c2ba51dbbb344564649f1bb52fe (diff)
downloadffmpeg-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_dec.c')
-rw-r--r--libavcodec/v4l2_m2m_dec.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c
index 2c5a22a976..4c521eba34 100644
--- a/libavcodec/v4l2_m2m_dec.c
+++ b/libavcodec/v4l2_m2m_dec.c
@@ -240,20 +240,20 @@ static const AVOption options[] = {
#define M2MDEC(NAME, LONGNAME, CODEC, bsf_name) \
M2MDEC_CLASS(NAME) \
- const AVCodec ff_ ## NAME ## _v4l2m2m_decoder = { \
- .name = #NAME "_v4l2m2m" , \
- .long_name = NULL_IF_CONFIG_SMALL("V4L2 mem2mem " LONGNAME " decoder wrapper"), \
- .type = AVMEDIA_TYPE_VIDEO, \
- .id = CODEC , \
+ const FFCodec ff_ ## NAME ## _v4l2m2m_decoder = { \
+ .p.name = #NAME "_v4l2m2m" , \
+ .p.long_name = NULL_IF_CONFIG_SMALL("V4L2 mem2mem " LONGNAME " decoder wrapper"), \
+ .p.type = AVMEDIA_TYPE_VIDEO, \
+ .p.id = CODEC , \
.priv_data_size = sizeof(V4L2m2mPriv), \
- .priv_class = &v4l2_m2m_ ## NAME ## _dec_class, \
+ .p.priv_class = &v4l2_m2m_ ## NAME ## _dec_class, \
.init = v4l2_decode_init, \
.receive_frame = v4l2_receive_frame, \
.close = v4l2_decode_close, \
.bsfs = bsf_name, \
- .capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING, \
+ .p.capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING, \
.caps_internal = FF_CODEC_CAP_SETS_PKT_DTS | FF_CODEC_CAP_INIT_CLEANUP, \
- .wrapper_name = "v4l2m2m", \
+ .p.wrapper_name = "v4l2m2m", \
}
M2MDEC(h264, "H.264", AV_CODEC_ID_H264, "h264_mp4toannexb");