[FFmpeg-devel] [PATCH 1/2] avutil/frame: add av_frame_side_data_name()

Michael Niedermayer michaelni at gmx.at
Wed Jul 30 02:18:47 CEST 2014


Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavutil/frame.c |   14 ++++++++++++++
 libavutil/frame.h |    5 +++++
 2 files changed, 19 insertions(+)

diff --git a/libavutil/frame.c b/libavutil/frame.c
index fdfbc46..2c62922 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -672,3 +672,17 @@ void av_frame_remove_side_data(AVFrame *frame, enum AVFrameSideDataType type)
         }
     }
 }
+
+const char *av_frame_side_data_name(enum AVFrameSideDataType type)
+{
+    switch(type) {
+    case AV_FRAME_DATA_PANSCAN:         return "AVPanScan";
+    case AV_FRAME_DATA_A53_CC:          return "ATSC A53 Part 4 Closed Captions";
+    case AV_FRAME_DATA_STEREO3D:        return "Stereoscopic 3d metadata";
+    case AV_FRAME_DATA_MATRIXENCODING:  return "AVMatrixEncoding";
+    case AV_FRAME_DATA_DOWNMIX_INFO:    return "Metadata relevant to a downmix procedure";
+    case AV_FRAME_DATA_REPLAYGAIN:      return "AVReplayGain";
+    case AV_FRAME_DATA_DISPLAYMATRIX:   return "3x3 displaymatrix";
+    }
+    return NULL;
+}
diff --git a/libavutil/frame.h b/libavutil/frame.h
index a39c8d0..c57eb55 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -728,6 +728,11 @@ AVFrameSideData *av_frame_get_side_data(const AVFrame *frame,
 void av_frame_remove_side_data(AVFrame *frame, enum AVFrameSideDataType type);
 
 /**
+ * @return a string identifying the side data type
+ */
+const char *av_frame_side_data_name(enum AVFrameSideDataType type);
+
+/**
  * @}
  */
 
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list