[vlc-commits] vout: add flag for copy-needing display plugins
Rémi Denis-Courmont
git at videolan.org
Wed Dec 26 13:31:52 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Dec 26 13:06:29 2018 +0200| [a0a6f6b39ccd67cb8eeaad9053cdb2d4b5e9495d] | committer: Rémi Denis-Courmont
vout: add flag for copy-needing display plugins
In the corner case that the display plugin supports the decoder output
format, but the display pool is too small or too slow, copy is needed.
This adds and uses an explicit flag for that case to help revector the
code. The actual picture copy is not changed.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a0a6f6b39ccd67cb8eeaad9053cdb2d4b5e9495d
---
src/video_output/video_output.c | 4 +---
src/video_output/vout_internal.h | 1 +
src/video_output/vout_wrapper.c | 2 ++
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 06d1b3d06d..0eff39f890 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1123,7 +1123,6 @@ 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 = sys->decoder_pool == sys->display_pool;
picture_t *todisplay = filtered;
picture_t *snap_pic = todisplay;
if (do_early_spu && subpic) {
@@ -1154,8 +1153,7 @@ static int ThreadDisplayRenderPicture(vout_thread_t *vout, bool is_forced)
subpic = NULL;
}
- assert(vout_IsDisplayFiltered(vd) == !sys->display.use_dr);
- if (sys->display.use_dr && !is_direct) {
+ if (sys->display.use_copy) {
picture_t *direct = NULL;
if (likely(sys->display_pool != NULL))
direct = picture_pool_Get(sys->display_pool);
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index 41f3e76484..655475a7ed 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -92,6 +92,7 @@ struct vout_thread_sys_t
struct {
vout_display_t *vd;
bool use_dr;
+ bool use_copy;
} display;
struct {
diff --git a/src/video_output/vout_wrapper.c b/src/video_output/vout_wrapper.c
index 2ee3c9dd1a..46b58f4ea4 100644
--- a/src/video_output/vout_wrapper.c
+++ b/src/video_output/vout_wrapper.c
@@ -93,10 +93,12 @@ int vout_OpenWrapper(vout_thread_t *vout,
if (allow_dr &&
picture_pool_GetSize(display_pool) >= reserved_picture + decoder_picture) {
+ sys->display.use_copy = false;
sys->dpb_size = picture_pool_GetSize(display_pool) - reserved_picture;
sys->decoder_pool = display_pool;
sys->display_pool = display_pool;
} else {
+ sys->display.use_copy = sys->display.use_dr;
sys->decoder_pool =
picture_pool_NewFromFormat(&vd->source,
__MAX(VOUT_MAX_PICTURES,
More information about the vlc-commits
mailing list