[vlc-commits] decoder: use an object to create the decoder device

Steve Lhomme git at videolan.org
Mon Dec 9 11:51:02 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Oct 25 15:13:10 2019 +0200| [476b5a02c26cce959926ccd20ae571eda31b1465] | committer: Steve Lhomme

decoder: use an object to create the decoder device

Allowing the window to be NULL, which is OK for D3D11/D3D9/NVDEC.

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

 include/vlc_codec.h             | 4 ++--
 src/input/decoder_helpers.c     | 6 +++---
 src/video_output/video_output.c | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/vlc_codec.h b/include/vlc_codec.h
index 6649ef94cc..3613e1a14c 100644
--- a/include/vlc_codec.h
+++ b/include/vlc_codec.h
@@ -604,8 +604,8 @@ typedef int (*vlc_decoder_device_Open)(vlc_decoder_device *device,
  * This function will be hidden in the future. It is now used by opengl vout
  * module as a transition.
  */
-VLC_USED vlc_decoder_device *
-vlc_decoder_device_Create(vout_window_t *window);
+vlc_decoder_device *
+vlc_decoder_device_Create(vlc_object_t *, vout_window_t *window) VLC_USED;
 
 /**
  * Hold a decoder device
diff --git a/src/input/decoder_helpers.c b/src/input/decoder_helpers.c
index da64af09db..3f03394ead 100644
--- a/src/input/decoder_helpers.c
+++ b/src/input/decoder_helpers.c
@@ -182,13 +182,13 @@ static int decoder_device_Open(void *func, bool forced, va_list ap)
 }
 
 vlc_decoder_device *
-vlc_decoder_device_Create(vout_window_t *window)
+vlc_decoder_device_Create(vlc_object_t *o, vout_window_t *window)
 {
     struct vlc_decoder_device_priv *priv =
-            vlc_object_create(window, sizeof (*priv));
+            vlc_object_create(o, sizeof (*priv));
     if (!priv)
         return NULL;
-    char *name = var_InheritString(window, "dec-dev");
+    char *name = var_InheritString(o, "dec-dev");
     module_t *module = vlc_module_load(&priv->device, "decoder device", name,
                                     true, decoder_device_Open, &priv->device,
                                     window);
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index b6d4b8c458..659ede546b 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -2033,7 +2033,7 @@ static int vout_EnableWindow(vout_thread_t *vout, const video_format_t *original
     if (pp_dec_device)
     {
         if (sys->dec_device == NULL)
-            sys->dec_device = vlc_decoder_device_Create(sys->display_cfg.window);
+            sys->dec_device = vlc_decoder_device_Create(&vout->obj, sys->display_cfg.window);
         *pp_dec_device = sys->dec_device ? vlc_decoder_device_Hold( sys->dec_device ) : NULL;
     }
     vlc_mutex_unlock(&sys->window_lock);



More information about the vlc-commits mailing list