[vlc-commits] decoder: request decoder device when getting the vout
Steve Lhomme
git at videolan.org
Wed Oct 9 10:15:59 CEST 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Mon Sep 23 14:42:58 2019 +0200| [a85ba37c8a29822dfe92275b74623c34be633d47] | committer: Steve Lhomme
decoder: request decoder device when getting the vout
The decoder device is kept in the decoder for now (in further patches it will
come with the video context).
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a85ba37c8a29822dfe92275b74623c34be633d47
---
src/input/decoder.c | 12 ++++++++++--
src/input/resource.c | 5 +++--
src/input/resource.h | 5 +++--
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/input/decoder.c b/src/input/decoder.c
index d28b5d14b6..d3fa78ea1a 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -122,6 +122,7 @@ struct decoder_owner
audio_output_t *p_aout;
vout_thread_t *p_vout;
+ vlc_decoder_device *p_dec_dev; // TEMPORARY
/* -- Theses variables need locking on read *and* write -- */
/* Preroll */
@@ -549,13 +550,17 @@ static int CreateVoutIfNeeded(struct decoder_owner *p_owner)
.dpb_size = dpb_size + p_dec->i_extra_picture_buffers + 1,
.mouse_event = MouseEvent, .mouse_opaque = p_dec
};
- p_vout = input_resource_GetVout( p_owner->p_resource,
- &cfg, &order );
+ vlc_decoder_device *dec_dev = NULL;
+ p_vout = input_resource_GetVoutDecoderDevice( p_owner->p_resource,
+ &cfg, &order, &dec_dev );
if (p_vout)
decoder_Notify(p_owner, on_vout_added, p_vout, order);
vlc_mutex_lock( &p_owner->lock );
p_owner->p_vout = p_vout;
+ if ( p_owner->p_dec_dev != NULL )
+ vlc_decoder_device_Release( p_owner->p_dec_dev );
+ p_owner->p_dec_dev = dec_dev;
DecoderUpdateFormatLocked( p_owner );
p_owner->fmt.video.i_chroma = p_dec->fmt_out.i_codec;
@@ -1919,6 +1924,9 @@ static void DeleteDecoder( decoder_t * p_dec )
const enum es_format_category_e i_cat =p_dec->fmt_in.i_cat;
decoder_Clean( p_dec );
+ if ( p_owner->p_dec_dev )
+ vlc_decoder_device_Release( p_owner->p_dec_dev );
+
/* Free all packets still in the decoder fifo. */
block_FifoRelease( p_owner->p_fifo );
diff --git a/src/input/resource.c b/src/input/resource.c
index 0c9693fb9e..984d68e3ff 100644
--- a/src/input/resource.c
+++ b/src/input/resource.c
@@ -368,9 +368,10 @@ void input_resource_PutVout(input_resource_t *p_resource,
vlc_mutex_unlock( &p_resource->lock );
}
-vout_thread_t *input_resource_GetVout(input_resource_t *p_resource,
+vout_thread_t *input_resource_GetVoutDecoderDevice(input_resource_t *p_resource,
const vout_configuration_t *cfg,
- enum vlc_vout_order *order)
+ enum vlc_vout_order *order,
+ vlc_decoder_device **pp_dec_dev)
{
vout_configuration_t cfg_buf;
vout_thread_t *vout;
diff --git a/src/input/resource.h b/src/input/resource.h
index a13ca0dc85..537033c9d7 100644
--- a/src/input/resource.h
+++ b/src/input/resource.h
@@ -37,9 +37,10 @@ void input_resource_SetInput( input_resource_t *, input_thread_t * );
*/
sout_instance_t *input_resource_RequestSout( input_resource_t *, sout_instance_t *, const char *psz_sout );
-vout_thread_t *input_resource_GetVout(input_resource_t *,
+vout_thread_t *input_resource_GetVoutDecoderDevice(input_resource_t *,
const vout_configuration_t *,
- enum vlc_vout_order *order);
+ enum vlc_vout_order *order,
+ vlc_decoder_device **);
void input_resource_PutVout(input_resource_t *, vout_thread_t *);
/**
More information about the vlc-commits
mailing list