[vlc-devel] [PATCH 2/5] [RFC] core: add a way for the vout to tell if it can display decoder pictures

Steve Lhomme robux4 at videolabs.io
Tue Mar 28 16:23:57 CEST 2017


By default the display is supposed to be able to display pictures from the
display pool. But in some cases it may be able to display pictures from the
decoder.

This is true in direct rendering when both pools are the same. But it can also
be true in other cases.
---
 include/vlc_vout_display.h      | 1 +
 src/video_output/display.c      | 1 +
 src/video_output/video_output.c | 3 ++-
 src/video_output/vout_wrapper.c | 1 +
 4 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index 674fa546dc..219d9526f9 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -133,6 +133,7 @@ typedef struct {
     bool needs_event_thread VLC_DEPRECATED; /* Will events (key at least) be emitted using an independent thread */
     const vlc_fourcc_t *subpicture_chromas; /* List of supported chromas for subpicture rendering. */
     bool typed_pools;                       /* will produce different pools for each vout_display_pool_t */
+    bool can_display_decoder;               /* true if pictures from the decoder pool can be displayed directly */
 } vout_display_info_t;
 
 /**
diff --git a/src/video_output/display.c b/src/video_output/display.c
index 8d086561aa..d4219b98a7 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -97,6 +97,7 @@ static vout_display_t *vout_display_New(vlc_object_t *obj,
     vd->info.needs_event_thread = false;
     vd->info.subpicture_chromas = NULL;
     vd->info.typed_pools = false;
+    vd->info.can_display_decoder = false;
 
     vd->cfg = cfg;
     vd->pool = NULL;
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 050a2a2bfa..2c3d742ca5 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -955,7 +955,8 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced)
      * - be sure to end up with a direct buffer.
      * - blend subtitles, and in a fast access buffer
      */
-    bool is_direct = vout->p->decoder_pool == vout->p->display_pool;
+    bool is_direct = vout->p->decoder_pool == vout->p->display_pool ||
+            (vd->info.typed_pools && vd->info.can_display_decoder);
     picture_t *todisplay = filtered;
     if (do_early_spu && subpic) {
         if (vout->p->spu_blend) {
diff --git a/src/video_output/vout_wrapper.c b/src/video_output/vout_wrapper.c
index 0c6a869faa..bb5b489422 100644
--- a/src/video_output/vout_wrapper.c
+++ b/src/video_output/vout_wrapper.c
@@ -202,6 +202,7 @@ int vout_InitWrapper(vout_thread_t *vout)
             sys->display_pool = sys->decoder_pool = NULL;
             return VLC_EGENERIC;
         }
+        vd->info.can_display_decoder = false;
     }
 
     return VLC_SUCCESS;
-- 
2.11.1



More information about the vlc-devel mailing list