[vlc-devel] [PATCH 2/6] vout: Allow vout modules to request extra filter pictures

Julian Scheel julian at jusst.de
Thu Jun 19 11:22:17 CEST 2014


Some video filters, especially hardware implementations with questionable
APIs, might require more than 3 pictures to send to the filter. As those
filters are most likely tight to a specific vout anyway allow the vout to
pre-request additional buffers for the filters, so that direct rendering can
still be used.

Signed-off-by: Julian Scheel <julian at jusst.de>
---
 include/vlc_vout_display.h      | 1 +
 src/video_output/vout_wrapper.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index f5f6817..591adc0 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -126,6 +126,7 @@ typedef struct {
     bool has_pictures_invalid;              /* Will VOUT_DISPLAY_EVENT_PICTURES_INVALID be used */
     bool has_event_thread;                  /* Will events (key at least) be emitted using an independent thread */
     const vlc_fourcc_t *subpicture_chromas; /* List of supported chromas for subpicture rendering. */
+    int extra_video_filter_pictures;        /* Allocate additional pictures in the private_pool for video filters */
 } vout_display_info_t;
 
 /**
diff --git a/src/video_output/vout_wrapper.c b/src/video_output/vout_wrapper.c
index 2e24d63..54f66d0 100644
--- a/src/video_output/vout_wrapper.c
+++ b/src/video_output/vout_wrapper.c
@@ -124,7 +124,7 @@ int vout_InitWrapper(vout_thread_t *vout)
 
     sys->display.use_dr = !vout_IsDisplayFiltered(vd);
     const bool allow_dr = !vd->info.has_pictures_invalid && !vd->info.is_slow && sys->display.use_dr;
-    const unsigned private_picture  = 4; /* XXX 3 for filter, 1 for SPU */
+    const unsigned private_picture  = 4 + vd->info.extra_video_filter_pictures; /* XXX 3 for filter, 1 for SPU */
     const unsigned decoder_picture  = 1 + sys->dpb_size;
     const unsigned kept_picture     = 1; /* last displayed picture */
     const unsigned reserved_picture = DISPLAY_PICTURE_COUNT +
-- 
2.0.0




More information about the vlc-devel mailing list