[FFmpeg-cvslog] avprobe: Print the display matrix from per-stream sidedata

Martin Storsjö git at videolan.org
Sun May 3 01:17:30 CEST 2015


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Wed Apr 29 16:48:26 2015 +0300| [709e1c91ea7a5bbf2b9a104642572ca7616b224f] | committer: Martin Storsjö

avprobe: Print the display matrix from per-stream sidedata

This is printed in a separate subgroup "displaymatrix" inside a
new group named "sidedata". The subgroup has got two values,
"rotation" (which is the parsed rotation from the matrix) and
"matrix" containing the full actual values.

Signed-off-by: Martin Storsjö <martin at martin.st>

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

 avprobe.c |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/avprobe.c b/avprobe.c
index ebc41df..a83fa68 100644
--- a/avprobe.c
+++ b/avprobe.c
@@ -24,6 +24,7 @@
 #include "libavformat/avformat.h"
 #include "libavcodec/avcodec.h"
 #include "libavutil/avstring.h"
+#include "libavutil/display.h"
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/dict.h"
@@ -700,6 +701,27 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
 
     probe_dict(stream->metadata, "tags");
 
+    if (stream->nb_side_data) {
+        int i, j;
+        probe_object_header("sidedata");
+        for (i = 0; i < stream->nb_side_data; i++) {
+            const AVPacketSideData* sd = &stream->side_data[i];
+            switch (sd->type) {
+            case AV_PKT_DATA_DISPLAYMATRIX:
+                probe_object_header("displaymatrix");
+                probe_array_header("matrix", 1);
+                for (j = 0; j < 9; j++)
+                    probe_int(NULL, ((int32_t *)sd->data)[j]);
+                probe_array_footer("matrix", 1);
+                probe_int("rotation",
+                          av_display_rotation_get((int32_t *)sd->data));
+                probe_object_footer("displaymatrix");
+                break;
+            }
+        }
+        probe_object_footer("sidedata");
+    }
+
     probe_object_footer("stream");
 }
 



More information about the ffmpeg-cvslog mailing list