]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/dump.c
dashenc: copy language and role metadata from streams assigned to sets
[ffmpeg] / libavformat / dump.c
index bef0e76b80fc1ab955adecd149b60be79cfce64a..660df0a533f440b717ecd477f4759bb342767641 100644 (file)
@@ -27,6 +27,7 @@
 #include "libavutil/log.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/replaygain.h"
+#include "libavutil/spherical.h"
 #include "libavutil/stereo3d.h"
 
 #include "avformat.h"
@@ -233,7 +234,6 @@ static void dump_replaygain(void *ctx, AVPacketSideData *sd)
 static void dump_stereo3d(void *ctx, AVPacketSideData *sd)
 {
     AVStereo3D *stereo;
-    const char *name;
 
     if (sd->size < sizeof(*stereo)) {
         av_log(ctx, AV_LOG_INFO, "invalid data");
@@ -307,6 +307,31 @@ static void dump_cpb(void *ctx, AVPacketSideData *sd)
            cpb->vbv_delay);
 }
 
+static void dump_spherical(void *ctx, AVPacketSideData *sd)
+{
+    AVSphericalMapping *spherical = (AVSphericalMapping *)sd->data;
+    double yaw, pitch, roll;
+
+    if (sd->size < sizeof(*spherical)) {
+        av_log(ctx, AV_LOG_INFO, "invalid data");
+        return;
+    }
+
+    if (spherical->projection == AV_SPHERICAL_EQUIRECTANGULAR)
+        av_log(ctx, AV_LOG_INFO, "equirectangular ");
+    else if (spherical->projection == AV_SPHERICAL_CUBEMAP)
+        av_log(ctx, AV_LOG_INFO, "cubemap ");
+    else {
+        av_log(ctx, AV_LOG_WARNING, "unknown");
+        return;
+    }
+
+    yaw = ((double)spherical->yaw) / (1 << 16);
+    pitch = ((double)spherical->pitch) / (1 << 16);
+    roll = ((double)spherical->roll) / (1 << 16);
+    av_log(ctx, AV_LOG_INFO, "(%f/%f/%f) ", yaw, pitch, roll);
+}
+
 static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
 {
     int i;
@@ -355,6 +380,10 @@ static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
             av_log(ctx, AV_LOG_INFO, "cpb: ");
             dump_cpb(ctx, &sd);
             break;
+        case AV_PKT_DATA_SPHERICAL:
+            av_log(ctx, AV_LOG_INFO, "spherical: ");
+            dump_spherical(ctx, &sd);
+            break;
         default:
             av_log(ctx, AV_LOG_WARNING,
                    "unknown side data type %d (%d bytes)", sd.type, sd.size);