[vlc-commits] input: pass vlc_es_id_t to decoder
Thomas Guillem
git at videolan.org
Mon Jun 3 16:16:11 CEST 2019
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed May 29 14:55:05 2019 +0200| [b5260c2d7836390c622925eb79b142a190e1558b] | committer: Thomas Guillem
input: pass vlc_es_id_t to decoder
This will just be used as an identifier for input events. In order to link an
output to an ES track (from the player).
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b5260c2d7836390c622925eb79b142a190e1558b
---
src/input/decoder.c | 20 +++++++++++---------
src/input/decoder.h | 4 ++--
src/input/es_out.c | 8 +++++---
3 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/src/input/decoder.c b/src/input/decoder.c
index b7589a7d3c..f074c40fdb 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -66,6 +66,7 @@ struct decoder_owner
{
decoder_t dec;
input_thread_t *p_input;
+ vlc_es_id_t *id;
input_resource_t*p_resource;
vlc_clock_t *p_clock;
@@ -1760,7 +1761,7 @@ static const struct decoder_owner_callbacks dec_spu_cbs =
* \return the decoder object
*/
static decoder_t * CreateDecoder( vlc_object_t *p_parent,
- input_thread_t *p_input,
+ input_thread_t *p_input, vlc_es_id_t *id,
const es_format_t *fmt, vlc_clock_t *p_clock,
input_resource_t *p_resource,
sout_instance_t *p_sout )
@@ -1773,6 +1774,7 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
return NULL;
p_dec = &p_owner->dec;
+ p_owner->id = id;
p_owner->p_clock = p_clock;
p_owner->i_preroll_end = (vlc_tick_t)INT64_MIN;
p_owner->p_input = p_input;
@@ -2015,8 +2017,8 @@ static void DecoderUnsupportedCodec( decoder_t *p_dec, const es_format_t *fmt, b
/* TODO: pass p_sout through p_resource? -- Courmisch */
static decoder_t *decoder_New( vlc_object_t *p_parent, input_thread_t *p_input,
- const es_format_t *fmt, vlc_clock_t *p_clock,
- input_resource_t *p_resource,
+ vlc_es_id_t *id, const es_format_t *fmt,
+ vlc_clock_t *p_clock, input_resource_t *p_resource,
sout_instance_t *p_sout )
{
decoder_t *p_dec = NULL;
@@ -2024,7 +2026,7 @@ static decoder_t *decoder_New( vlc_object_t *p_parent, input_thread_t *p_input,
int i_priority;
/* Create the decoder configuration structure */
- p_dec = CreateDecoder( p_parent, p_input, fmt, p_clock, p_resource, p_sout );
+ p_dec = CreateDecoder( p_parent, p_input, id, fmt, p_clock, p_resource, p_sout );
if( p_dec == NULL )
{
msg_Err( p_parent, "could not create %s", psz_type );
@@ -2083,12 +2085,12 @@ static decoder_t *decoder_New( vlc_object_t *p_parent, input_thread_t *p_input,
* \param p_es the es descriptor
* \return the spawned decoder object
*/
-decoder_t *input_DecoderNew( input_thread_t *p_input,
+decoder_t *input_DecoderNew( input_thread_t *p_input, vlc_es_id_t *id,
es_format_t *fmt, vlc_clock_t *p_clock,
sout_instance_t *p_sout )
{
- assert(p_input);
- return decoder_New( VLC_OBJECT(p_input), p_input, fmt, p_clock,
+ assert(p_input && id);
+ return decoder_New( VLC_OBJECT(p_input), p_input, id, fmt, p_clock,
input_priv(p_input)->p_resource, p_sout );
}
@@ -2098,7 +2100,7 @@ decoder_t *input_DecoderNew( input_thread_t *p_input,
decoder_t *input_DecoderCreate( vlc_object_t *p_parent, const es_format_t *fmt,
input_resource_t *p_resource )
{
- return decoder_New( p_parent, NULL, fmt, NULL, p_resource, NULL );
+ return decoder_New( p_parent, NULL, NULL, fmt, NULL, p_resource, NULL );
}
@@ -2318,7 +2320,7 @@ int input_DecoderSetCcState( decoder_t *p_dec, vlc_fourcc_t codec,
es_format_Init( &fmt, SPU_ES, codec );
fmt.subs.cc.i_channel = i_channel;
fmt.subs.cc.i_reorder_depth = p_owner->cc.desc.i_reorder_depth;
- p_cc = input_DecoderNew( p_owner->p_input, &fmt,
+ p_cc = input_DecoderNew( p_owner->p_input, p_owner->id, &fmt,
p_owner->p_clock, p_owner->p_sout );
if( !p_cc )
{
diff --git a/src/input/decoder.h b/src/input/decoder.h
index f9928edb45..0ac021e9b2 100644
--- a/src/input/decoder.h
+++ b/src/input/decoder.h
@@ -28,8 +28,8 @@
#include <vlc_codec.h>
#include <vlc_mouse.h>
-decoder_t *input_DecoderNew( input_thread_t *, es_format_t *, vlc_clock_t *,
- sout_instance_t * ) VLC_USED;
+decoder_t *input_DecoderNew( input_thread_t *, vlc_es_id_t *, es_format_t *,
+ vlc_clock_t *, sout_instance_t * ) VLC_USED;
/**
* This function changes the pause state.
diff --git a/src/input/es_out.c b/src/input/es_out.c
index 289117f22d..3c22fdbbe9 100644
--- a/src/input/es_out.c
+++ b/src/input/es_out.c
@@ -633,7 +633,8 @@ static int EsOutSetRecord( es_out_t *out, bool b_record )
if( !p_es->p_dec )
continue;
- p_es->p_dec_record = input_DecoderNew( p_input, &p_es->fmt, NULL, p_sys->p_sout_record );
+ p_es->p_dec_record = input_DecoderNew( p_input, &p_es->id, &p_es->fmt,
+ NULL, p_sys->p_sout_record );
if( p_es->p_dec_record && p_sys->b_buffering )
input_DecoderStartWait( p_es->p_dec_record );
}
@@ -1828,7 +1829,7 @@ static void EsOutCreateDecoder( es_out_t *out, es_out_id_t *p_es )
if( !p_es->p_clock )
return;
- dec = input_DecoderNew( p_input, &p_es->fmt, p_es->p_clock,
+ dec = input_DecoderNew( p_input, &p_es->id, &p_es->fmt, p_es->p_clock,
input_priv(p_input)->p_sout );
if( dec != NULL )
{
@@ -1839,7 +1840,8 @@ static void EsOutCreateDecoder( es_out_t *out, es_out_id_t *p_es )
if( !p_es->p_master && p_sys->p_sout_record )
{
- p_es->p_dec_record = input_DecoderNew( p_input, &p_es->fmt, NULL, p_sys->p_sout_record );
+ p_es->p_dec_record = input_DecoderNew( p_input, &p_es->id, &p_es->fmt,
+ NULL, p_sys->p_sout_record );
if( p_es->p_dec_record && p_sys->b_buffering )
input_DecoderStartWait( p_es->p_dec_record );
}
More information about the vlc-commits
mailing list