[vlc-commits] display: rotate the source format rather than temporary output format

Steve Lhomme git at videolan.org
Fri Sep 11 13:35:22 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed Sep  2 09:43:30 2020 +0200| [9e369fcb741f459e5288770837d839a89d7485fe] | committer: Steve Lhomme

display: rotate the source format rather than temporary output format

The temporary and output format are the same at this stage.

It also shows potential that might need some attention when vd->source changes in push.

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

 modules/video_output/fb.c      | 2 +-
 modules/video_output/kms.c     | 2 +-
 modules/video_output/kva.c     | 2 +-
 modules/video_output/vmem.c    | 2 +-
 modules/video_output/xcb/x11.c | 5 +++--
 modules/video_output/yuv.c     | 2 +-
 6 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/modules/video_output/fb.c b/modules/video_output/fb.c
index c06700377f..26cbbec773 100644
--- a/modules/video_output/fb.c
+++ b/modules/video_output/fb.c
@@ -248,7 +248,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
 
     /* */
     video_format_t fmt;
-    video_format_ApplyRotation(&fmt, fmtp);
+    video_format_ApplyRotation(&fmt, vd->source);
 
     if (sys->chroma) {
         fmt.i_chroma = sys->chroma;
diff --git a/modules/video_output/kms.c b/modules/video_output/kms.c
index e74ff5a3da..afe91126be 100644
--- a/modules/video_output/kms.c
+++ b/modules/video_output/kms.c
@@ -725,7 +725,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
         return VLC_EGENERIC;
     }
 
-    video_format_ApplyRotation(&fmt, fmtp);
+    video_format_ApplyRotation(&fmt, vd->source);
 
     fmt.i_width = fmt.i_visible_width  = sys->width;
     fmt.i_height = fmt.i_visible_height = sys->height;
diff --git a/modules/video_output/kva.c b/modules/video_output/kva.c
index 8a07fa65c1..18fcb61098 100644
--- a/modules/video_output/kva.c
+++ b/modules/video_output/kva.c
@@ -169,7 +169,7 @@ static void PMThread( void *arg )
 
     /* */
     video_format_t fmt;
-    video_format_ApplyRotation(&fmt, fmtp);
+    video_format_ApplyRotation(&fmt, vd->source);
 
     /* */
     MorphToPM();
diff --git a/modules/video_output/vmem.c b/modules/video_output/vmem.c
index 2de886284e..5f7e920f75 100644
--- a/modules/video_output/vmem.c
+++ b/modules/video_output/vmem.c
@@ -133,7 +133,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
 
     /* Define the video format */
     video_format_t fmt;
-    video_format_ApplyRotation(&fmt, fmtp);
+    video_format_ApplyRotation(&fmt, vd->source);
 
     if (setup != NULL) {
         char chroma[5];
diff --git a/modules/video_output/xcb/x11.c b/modules/video_output/xcb/x11.c
index eee5c66651..8dc37cc744 100644
--- a/modules/video_output/xcb/x11.c
+++ b/modules/video_output/xcb/x11.c
@@ -219,6 +219,7 @@ static xcb_visualid_t DepthToFormat(const xcb_setup_t *setup,
 static xcb_visualid_t ScreenToFormat(const xcb_setup_t *setup,
                                      const xcb_screen_t *screen,
                                      uint8_t *restrict bits,
+                                     const video_format_t *source,
                                      video_format_t *restrict fmtp)
 {
     xcb_visualid_t visual = 0;
@@ -236,7 +237,7 @@ static xcb_visualid_t ScreenToFormat(const xcb_setup_t *setup,
         if (depth->depth <= *bits)
             continue; /* no better than earlier depth */
 
-        video_format_ApplyRotation(&fmt, fmtp);
+        video_format_ApplyRotation(&fmt, source);
         vid = DepthToFormat(setup, depth, &fmt);
         if (vid != 0)
         {
@@ -273,7 +274,7 @@ static int Open (vout_display_t *vd, const vout_display_cfg_t *cfg,
     const xcb_setup_t *setup = xcb_get_setup (conn);
 
     /* Determine our pixel format */
-    xcb_visualid_t vid = ScreenToFormat(setup, scr, &sys->depth, fmtp);
+    xcb_visualid_t vid = ScreenToFormat(setup, scr, &sys->depth, vd->source, fmtp);
     if (vid == 0) {
         msg_Err(vd, "no supported visual & pixel format");
         goto error;
diff --git a/modules/video_output/yuv.c b/modules/video_output/yuv.c
index f5789cce28..62df5406f3 100644
--- a/modules/video_output/yuv.c
+++ b/modules/video_output/yuv.c
@@ -143,7 +143,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
 
     /* */
     video_format_t fmt;
-    video_format_ApplyRotation(&fmt, fmtp);
+    video_format_ApplyRotation(&fmt, vd->source);
     fmt.i_chroma = chroma;
     video_format_FixRgb(&fmt);
 



More information about the vlc-commits mailing list