[vlc-commits] es_format: display orientation with video format

Alexandre Janniaux git at videolan.org
Thu Jan 28 11:10:26 UTC 2021


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Mon Jan 25 11:00:26 2021 +0100| [93ae689589d11261a4847d389c0266b1ece11209] | committer: Alexandre Janniaux

es_format: display orientation with video format

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=93ae689589d11261a4847d389c0266b1ece11209
---

 src/misc/es_format.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/src/misc/es_format.c b/src/misc/es_format.c
index 77c512a90a..fb61f7df2c 100644
--- a/src/misc/es_format.c
+++ b/src/misc/es_format.c
@@ -374,16 +374,35 @@ bool video_format_IsSimilar( const video_format_t *f1,
     }
     return true;
 }
+
+static const char *orient_to_string[] =
+{
+    [ORIENT_NORMAL]             = "normal",
+    [ORIENT_TRANSPOSED]         = "transposed",
+    [ORIENT_ANTI_TRANSPOSED]    = "antitransposed",
+    [ORIENT_HFLIPPED]           = "hflip",
+    [ORIENT_VFLIPPED]           = "vflip",
+    [ORIENT_ROTATED_180]        = "80",
+    [ORIENT_ROTATED_270]        = "270",
+    [ORIENT_ROTATED_90]         = "90",
+};
+
 void video_format_Print( vlc_object_t *p_this,
                          const char *psz_text, const video_format_t *fmt )
 {
+    const char *orient;
+    if ( fmt->orientation >= 0 && fmt->orientation < ARRAY_SIZE(orient_to_string) )
+        orient = orient_to_string[fmt->orientation];
+    else orient = "error";
+
     msg_Dbg( p_this,
-             "%s sz %ux%u, of (%u,%u), vsz %ux%u, 4cc %4.4s, sar %u:%u, msk r0x%" PRIx32 " g0x%" PRIx32 " b0x%" PRIx32,
+             "%s sz %ux%u, of (%u,%u), vsz %ux%u, 4cc %4.4s, sar %u:%u, orient: %s, msk r0x%" PRIx32 " g0x%" PRIx32 " b0x%" PRIx32,
              psz_text,
              fmt->i_width, fmt->i_height, fmt->i_x_offset, fmt->i_y_offset,
              fmt->i_visible_width, fmt->i_visible_height,
              (char*)&fmt->i_chroma,
              fmt->i_sar_num, fmt->i_sar_den,
+             orient,
              fmt->i_rmask, fmt->i_gmask, fmt->i_bmask );
 }
 



More information about the vlc-commits mailing list