[vlc-commits] vout: pass the first draft of vlc_video_context

Thomas Guillem git at videolan.org
Sun Feb 24 15:21:40 CET 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Sun Feb 24 15:14:10 2019 +0100| [71e562bd5f67fc442aa4eee30ce332898c1658dc] | committer: Thomas Guillem

vout: pass the first draft of vlc_video_context

May be NULL, contains only a reference to a vlc_decoder_device.

This is a temporary commit since vlc_video_context must come from the decoder
module.

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

 src/video_output/display.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/video_output/display.c b/src/video_output/display.c
index c93ca4dae6..429d7285eb 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -36,6 +36,7 @@
 #include <vlc_modules.h>
 #include <vlc_filter.h>
 #include <vlc_picture_pool.h>
+#include <vlc_codec.h>
 
 #include <libvlc.h>
 
@@ -294,6 +295,9 @@ typedef struct {
     atomic_bool reset_pictures;
 #endif
     picture_pool_t *pool;
+
+    /* temporary: must come from decoder module */
+    vlc_video_context video_context;
 } vout_display_priv_t;
 
 static const struct filter_video_callbacks vout_display_filter_cbs = {
@@ -765,10 +769,14 @@ vout_display_t *vout_display_New(vlc_object_t *parent,
     vd->sys = NULL;
     vd->owner = *owner;
 
+    osys->video_context.device = vlc_decoder_device_Create(vd->cfg->window);
+    vlc_video_context *video_context = osys->video_context.device ?
+        &osys->video_context : NULL;
+
     vd->module = vlc_module_load(vd, "vout display", module,
                                  module && *module != '\0',
                                  vout_display_start, vd, &osys->cfg,
-                                 &vd->fmt, (vlc_video_context *)NULL);
+                                 &vd->fmt, video_context);
     if (vd->module == NULL)
         goto error;
 
@@ -794,6 +802,8 @@ vout_display_t *vout_display_New(vlc_object_t *parent,
     return vd;
 error:
     video_format_Clean(&vd->source);
+    if (osys->video_context.device)
+        vlc_decoder_device_Release(osys->video_context.device);
     vlc_object_release(vd);
     return NULL;
 }
@@ -811,6 +821,9 @@ void vout_display_Delete(vout_display_t *vd)
     if (vd->module != NULL)
         vlc_module_unload(vd, vd->module, vout_display_stop, vd);
 
+    if (osys->video_context.device)
+        vlc_decoder_device_Release(osys->video_context.device);
+
     video_format_Clean(&vd->source);
     video_format_Clean(&vd->fmt);
     vlc_object_release(vd);



More information about the vlc-commits mailing list