From 9a3f2b576274f5139d863a6c15c29c8eef746181 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Fri, 26 Aug 2016 21:07:06 -0700 Subject: [PATCH] mkvparser_sample: Add support for Projection element. Part of the Spherical Video V2 draft specification: https://github.com/google/spatial-media/blob/master/docs/spherical-video-v2-rfc.md Change-Id: I06d8e55d197fcf106b91d8d795ef85163ef5c2d5 --- mkvparser_sample.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mkvparser_sample.cc b/mkvparser_sample.cc index 3af1721..77aa47b 100644 --- a/mkvparser_sample.cc +++ b/mkvparser_sample.cc @@ -298,6 +298,25 @@ int main(int argc, char* argv[]) { } } } + + const mkvparser::Projection* const projection = + pVideoTrack->GetProjection(); + if (projection) { + printf("\t\tVideo Projection:\n"); + if (projection->type != mkvparser::Projection::kTypeNotPresent) + printf("\t\t\tProjectionType: %d\n", + static_cast(projection->type)); + if (projection->private_data) { + printf("\t\t\tProjectionPrivate: %u bytes\n", + static_cast(projection->private_data_length)); + } + if (projection->pose_yaw != mkvparser::Projection::kValueNotPresent) + printf("\t\t\tProjectionPoseYaw: %f\n", projection->pose_yaw); + if (projection->pose_pitch != mkvparser::Projection::kValueNotPresent) + printf("\t\t\tProjectionPosePitch: %f\n", projection->pose_pitch); + if (projection->pose_roll != mkvparser::Projection::kValueNotPresent) + printf("\t\t\tProjectionPosePitch: %f\n", projection->pose_roll); + } } if (trackType == mkvparser::Track::kAudio) {