summaryrefslogtreecommitdiff
path: root/libavcodec/v4l2_m2m_dec.c
diff options
context:
space:
mode:
authorLukas Rusak <lorusak@gmail.com>2018-04-24 22:48:23 -0700
committerAman Gupta <aman@tmm1.net>2019-09-10 19:05:18 -0700
commitf9b0f88aa471c30b72e288d906caa098761776f7 (patch)
tree00d524da4980f3f680c7115ea6386cfa7e33337a /libavcodec/v4l2_m2m_dec.c
parentc0c7946196710d0579a9c85bf65289d5a123ab89 (diff)
downloadffmpeg-f9b0f88aa471c30b72e288d906caa098761776f7.tar.gz
avcodec/v4l2_m2m_dec: fix indentation and add M2MDEC_CLASS macro
This just makes the M2MDEC_CLASS similar to how it is done in rkmpp. It looks clean and has proper indentation Signed-off-by: Aman Gupta <aman@tmm1.net>
Diffstat (limited to 'libavcodec/v4l2_m2m_dec.c')
-rw-r--r--libavcodec/v4l2_m2m_dec.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/libavcodec/v4l2_m2m_dec.c b/libavcodec/v4l2_m2m_dec.c
index 596e435463..fb2bfde714 100644
--- a/libavcodec/v4l2_m2m_dec.c
+++ b/libavcodec/v4l2_m2m_dec.c
@@ -220,29 +220,30 @@ static const AVOption options[] = {
{ NULL},
};
+#define M2MDEC_CLASS(NAME) \
+ static const AVClass v4l2_m2m_ ## NAME ## _dec_class = { \
+ .class_name = #NAME "_v4l2m2m_decoder", \
+ .item_name = av_default_item_name, \
+ .option = options, \
+ .version = LIBAVUTIL_VERSION_INT, \
+ };
+
#define M2MDEC(NAME, LONGNAME, CODEC, bsf_name) \
-static const AVClass v4l2_m2m_ ## NAME ## _dec_class = {\
- .class_name = #NAME "_v4l2_m2m_decoder",\
- .item_name = av_default_item_name,\
- .option = options,\
- .version = LIBAVUTIL_VERSION_INT,\
-};\
-\
-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 ,\
- .priv_data_size = sizeof(V4L2m2mPriv),\
- .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, \
- .wrapper_name = "v4l2m2m", \
-};
+ M2MDEC_CLASS(NAME) \
+ 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 , \
+ .priv_data_size = sizeof(V4L2m2mPriv), \
+ .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, \
+ .wrapper_name = "v4l2m2m", \
+ };
M2MDEC(h264, "H.264", AV_CODEC_ID_H264, "h264_mp4toannexb");
M2MDEC(hevc, "HEVC", AV_CODEC_ID_HEVC, "hevc_mp4toannexb");