[vlc-devel] [PATCH 09/31] vout: add a getter for the decoder device of the vout
Steve Lhomme
robux4 at ycbcr.xyz
Fri Jul 5 16:19:48 CEST 2019
To create a video context outside of the vout we need to get it.
Increments the decoder device refcount
---
src/video_output/video_output.c | 10 ++++++++++
src/video_output/vout_internal.h | 2 ++
2 files changed, 12 insertions(+)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 687fb2b932..c5b2d032a0 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1954,3 +1954,13 @@ error:
vout_IntfReinit(vout);
return 0;
}
+
+vlc_decoder_device *vout_GetDecoderDevice(vout_thread_t *vout)
+{
+ vout_thread_sys_t *sys = vout->p;
+ vlc_mutex_lock(&sys->window_lock);
+ vlc_decoder_device * res = sys->dec_device ?
+ vlc_decoder_device_Hold( sys->dec_device ) : NULL;
+ vlc_mutex_unlock(&sys->window_lock);
+ return res;
+}
diff --git a/src/video_output/vout_internal.h b/src/video_output/vout_internal.h
index 5a60a2926c..f328fa1973 100644
--- a/src/video_output/vout_internal.h
+++ b/src/video_output/vout_internal.h
@@ -265,6 +265,8 @@ vout_display_t *vout_OpenWrapper(vout_thread_t *, const char *,
void vout_CloseWrapper(vout_thread_t *, vout_display_t *vd);
/* */
+vlc_decoder_device *vout_GetDecoderDevice( vout_thread_t * );
+
ssize_t vout_RegisterSubpictureChannelInternal( vout_thread_t *,
vlc_clock_t *clock,
enum vlc_vout_order *out_order );
--
2.17.1
More information about the vlc-devel
mailing list