[FFmpeg-devel,1/2] lavfi/sidedata: add missed frame side data type

Submitted by Jun Zhao on March 9, 2019, 8:33 a.m.

Details

Message ID 1552120413-10741-1-git-send-email-mypopydev@gmail.com
State New
Headers show

Commit Message

Jun Zhao March 9, 2019, 8:33 a.m.
From: Jun Zhao <barryjzhao@tencent.com>

add missed frame side data type

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
---
 libavfilter/f_sidedata.c |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libavfilter/f_sidedata.c b/libavfilter/f_sidedata.c
index 45d246b..381da5a 100644
--- a/libavfilter/f_sidedata.c
+++ b/libavfilter/f_sidedata.c
@@ -43,6 +43,7 @@  typedef struct SideDataContext {
 } SideDataContext;
 
 #define OFFSET(x) offsetof(SideDataContext, x)
+#if FF_API_FRAME_QP
 #define DEFINE_OPTIONS(filt_name, FLAGS) \
 static const AVOption filt_name##_options[] = { \
     { "mode", "set a mode of operation", OFFSET(mode),   AV_OPT_TYPE_INT,    {.i64 = 0 }, 0, SIDEDATA_NB-1, FLAGS, "mode" }, \
@@ -62,8 +63,45 @@  static const AVOption filt_name##_options[] = { \
     {   "AUDIO_SERVICE_TYPE",         "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_AUDIO_SERVICE_TYPE         }, 0, 0, FLAGS, "type" }, \
     {   "MASTERING_DISPLAY_METADATA", "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_MASTERING_DISPLAY_METADATA }, 0, 0, FLAGS, "type" }, \
     {   "GOP_TIMECODE",               "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_GOP_TIMECODE               }, 0, 0, FLAGS, "type" }, \
+    {   "SPHERICAL",                  "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_SPHERICAL                  }, 0, 0, FLAGS, "type" }, \
+    {   "CONTENT_LIGHT_LEVEL",        "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_CONTENT_LIGHT_LEVEL        }, 0, 0, FLAGS, "type" }, \
+    {   "ICC_PROFILE",                "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_ICC_PROFILE                }, 0, 0, FLAGS, "type" }, \
+    {   "QP_TABLE_PROPERTIES",        "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_QP_TABLE_PROPERTIES        }, 0, 0, FLAGS, "type" }, \
+    {   "QP_TABLE_DATA",              "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_QP_TABLE_DATA              }, 0, 0, FLAGS, "type" }, \
+    {   "S12M_TIMECOD",               "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_S12M_TIMECODE              }, 0, 0, FLAGS, "type" }, \
+    {   "DYNAMIC_HDR_PLUS",           "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_DYNAMIC_HDR_PLUS           }, 0, 0, FLAGS, "type" }, \
+    {   "REGIONS_OF_INTEREST",        "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_REGIONS_OF_INTEREST        }, 0, 0, FLAGS, "type" }, \
     { NULL } \
 }
+#else
+#define DEFINE_OPTIONS(filt_name, FLAGS) \
+static const AVOption filt_name##_options[] = { \
+    { "mode", "set a mode of operation", OFFSET(mode),   AV_OPT_TYPE_INT,    {.i64 = 0 }, 0, SIDEDATA_NB-1, FLAGS, "mode" }, \
+    {   "select", "select frame",        0,              AV_OPT_TYPE_CONST,  {.i64 = SIDEDATA_SELECT }, 0, 0, FLAGS, "mode" }, \
+    {   "delete", "delete side data",    0,              AV_OPT_TYPE_CONST,  {.i64 = SIDEDATA_DELETE }, 0, 0, FLAGS, "mode" }, \
+    { "type",   "set side data type",    OFFSET(type),   AV_OPT_TYPE_INT,    {.i64 = -1 }, -1, INT_MAX, FLAGS, "type" }, \
+    {   "PANSCAN",                    "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_PANSCAN                    }, 0, 0, FLAGS, "type" }, \
+    {   "A53_CC",                     "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_A53_CC                     }, 0, 0, FLAGS, "type" }, \
+    {   "STEREO3D",                   "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_STEREO3D                   }, 0, 0, FLAGS, "type" }, \
+    {   "MATRIXENCODING",             "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_MATRIXENCODING             }, 0, 0, FLAGS, "type" }, \
+    {   "DOWNMIX_INFO",               "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_DOWNMIX_INFO               }, 0, 0, FLAGS, "type" }, \
+    {   "REPLAYGAIN",                 "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_REPLAYGAIN                 }, 0, 0, FLAGS, "type" }, \
+    {   "DISPLAYMATRIX",              "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_DISPLAYMATRIX              }, 0, 0, FLAGS, "type" }, \
+    {   "AFD",                        "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_AFD                        }, 0, 0, FLAGS, "type" }, \
+    {   "MOTION_VECTORS",             "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_MOTION_VECTORS             }, 0, 0, FLAGS, "type" }, \
+    {   "SKIP_SAMPLES",               "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_SKIP_SAMPLES               }, 0, 0, FLAGS, "type" }, \
+    {   "AUDIO_SERVICE_TYPE",         "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_AUDIO_SERVICE_TYPE         }, 0, 0, FLAGS, "type" }, \
+    {   "MASTERING_DISPLAY_METADATA", "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_MASTERING_DISPLAY_METADATA }, 0, 0, FLAGS, "type" }, \
+    {   "GOP_TIMECODE",               "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_GOP_TIMECODE               }, 0, 0, FLAGS, "type" }, \
+    {   "SPHERICAL",                  "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_SPHERICAL                  }, 0, 0, FLAGS, "type" }, \
+    {   "CONTENT_LIGHT_LEVEL",        "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_CONTENT_LIGHT_LEVEL        }, 0, 0, FLAGS, "type" }, \
+    {   "ICC_PROFILE",                "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_ICC_PROFILE                }, 0, 0, FLAGS, "type" }, \
+    {   "S12M_TIMECOD",               "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_S12M_TIMECODE              }, 0, 0, FLAGS, "type" }, \
+    {   "DYNAMIC_HDR_PLUS",           "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_DYNAMIC_HDR_PLUS           }, 0, 0, FLAGS, "type" }, \
+    {   "REGIONS_OF_INTEREST",        "", 0,             AV_OPT_TYPE_CONST,  {.i64 = AV_FRAME_DATA_REGIONS_OF_INTEREST        }, 0, 0, FLAGS, "type" }, \
+    { NULL } \
+}
+#endif
 
 static av_cold int init(AVFilterContext *ctx)
 {