[FFmpeg-cvslog] avcodec/v4l2_m2m_enc: fix indentation and add M2MENC_CLASS macro

Aman Gupta git at videolan.org
Wed Sep 11 05:16:50 EEST 2019


ffmpeg | branch: master | Aman Gupta <aman at tmm1.net> | Tue Aug 27 11:59:50 2019 -0700| [84540b2b847cd0bd3335845b398c583939b0b9c5] | committer: Aman Gupta

avcodec/v4l2_m2m_enc: fix indentation and add M2MENC_CLASS macro

Signed-off-by: Aman Gupta <aman at tmm1.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=84540b2b847cd0bd3335845b398c583939b0b9c5
---

 libavcodec/v4l2_m2m_enc.c | 44 +++++++++++++++++++++++---------------------
 1 file changed, 23 insertions(+), 21 deletions(-)

diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c
index 8014e442a8..4849bc26c5 100644
--- a/libavcodec/v4l2_m2m_enc.c
+++ b/libavcodec/v4l2_m2m_enc.c
@@ -332,28 +332,30 @@ static const AVOption options[] = {
     { NULL },
 };
 
+#define M2MENC_CLASS(NAME) \
+    static const AVClass v4l2_m2m_ ## NAME ## _enc_class = { \
+        .class_name = #NAME "_v4l2m2m_encoder", \
+        .item_name  = av_default_item_name, \
+        .option     = options, \
+        .version    = LIBAVUTIL_VERSION_INT, \
+    };
+
 #define M2MENC(NAME, LONGNAME, CODEC) \
-static const AVClass v4l2_m2m_ ## NAME ## _enc_class = {\
-    .class_name = #NAME "_v4l2_m2m_encoder",\
-    .item_name  = av_default_item_name,\
-    .option     = options,\
-    .version    = LIBAVUTIL_VERSION_INT,\
-};\
-\
-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 ,\
-    .priv_data_size = sizeof(V4L2m2mPriv),\
-    .priv_class     = &v4l2_m2m_ ## NAME ##_enc_class,\
-    .init           = v4l2_encode_init,\
-    .send_frame     = v4l2_send_frame,\
-    .receive_packet = v4l2_receive_packet,\
-    .close          = v4l2_encode_close,\
-    .capabilities   = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY, \
-    .wrapper_name   = "v4l2m2m", \
-};
+    M2MENC_CLASS(NAME) \
+    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 , \
+        .priv_data_size = sizeof(V4L2m2mPriv), \
+        .priv_class     = &v4l2_m2m_ ## NAME ##_enc_class, \
+        .init           = v4l2_encode_init, \
+        .send_frame     = v4l2_send_frame, \
+        .receive_packet = v4l2_receive_packet, \
+        .close          = v4l2_encode_close, \
+        .capabilities   = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY, \
+        .wrapper_name   = "v4l2m2m", \
+    };
 
 M2MENC(mpeg4,"MPEG4", AV_CODEC_ID_MPEG4);
 M2MENC(h263, "H.263", AV_CODEC_ID_H263);



More information about the ffmpeg-cvslog mailing list