From 2fb6acd9c28907e4f8c0510099a4603ea6caf861 Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Wed, 2 Nov 2016 11:28:54 -0400 Subject: lavc: Add spherical packet side data API Signed-off-by: Vittorio Giovara --- avprobe.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'avprobe.c') diff --git a/avprobe.c b/avprobe.c index ff28a0b343..8142ce2966 100644 --- a/avprobe.c +++ b/avprobe.c @@ -27,6 +27,7 @@ #include "libavutil/display.h" #include "libavutil/opt.h" #include "libavutil/pixdesc.h" +#include "libavutil/spherical.h" #include "libavutil/stereo3d.h" #include "libavutil/dict.h" #include "libavutil/libm.h" @@ -766,6 +767,7 @@ static void show_stream(InputFile *ifile, InputStream *ist) for (i = 0; i < stream->nb_side_data; i++) { const AVPacketSideData* sd = &stream->side_data[i]; AVStereo3D *stereo; + AVSphericalMapping *spherical; switch (sd->type) { case AV_PKT_DATA_DISPLAYMATRIX: @@ -786,6 +788,25 @@ static void show_stream(InputFile *ifile, InputStream *ist) !!(stereo->flags & AV_STEREO3D_FLAG_INVERT)); probe_object_footer("stereo3d"); break; + case AV_PKT_DATA_SPHERICAL: + spherical = (AVSphericalMapping *)sd->data; + probe_object_header("spherical"); + + if (spherical->projection == AV_SPHERICAL_EQUIRECTANGULAR) + probe_str("projection", "equirectangular"); + else if (spherical->projection == AV_SPHERICAL_CUBEMAP) + probe_str("projection", "cubemap"); + else + probe_str("projection", "unknown"); + + probe_object_header("orientation"); + probe_int("yaw", (double) spherical->yaw / (1 << 16)); + probe_int("pitch", (double) spherical->pitch / (1 << 16)); + probe_int("roll", (double) spherical->roll / (1 << 16)); + probe_object_footer("orientation"); + + probe_object_footer("spherical"); + break; } } probe_object_footer("sidedata"); -- cgit v1.2.3