vlc_stream: Allow fetching the underlying item type

This commit is contained in:
Hugo Beauzée-Luyssen 2020-09-10 15:11:21 +02:00
parent f38584ff33
commit 9f2933fcd0
3 changed files with 15 additions and 0 deletions

View File

@ -119,6 +119,12 @@ enum demux_query_e
* arg1=double *quality, arg2=double *strength */
DEMUX_GET_SIGNAL = 0x107,
/** Retrieves the demuxed content type
* Can fail if the control is not implemented
*
* arg1= int* */
DEMUX_GET_TYPE = 0x109,
/** Sets the paused or playing/resumed state.
*
* Streams are initially in playing state. The control always specifies a

View File

@ -168,6 +168,7 @@ enum stream_query_e
STREAM_GET_CONTENT_TYPE, /**< arg1= char ** res=can fail */
STREAM_GET_SIGNAL, /**< arg1=double *pf_quality, arg2=double *pf_strength res=can fail */
STREAM_GET_TAGS, /**< arg1=const block_t ** res=can fail */
STREAM_GET_TYPE, /**< arg1=int* res=can fail */
STREAM_SET_PAUSE_STATE = 0x200, /**< arg1= bool res=can fail */
STREAM_SET_TITLE, /**< arg1= int res=can fail */

View File

@ -2791,6 +2791,14 @@ static int InputSourceInit( input_source_t *in, input_thread_t *p_input,
if( demux_Control( in->p_demux, DEMUX_GET_FPS, &in->f_fps ) )
in->f_fps = 0.f;
int input_type;
if( !demux_Control( in->p_demux, DEMUX_GET_TYPE, &input_type ) )
{
vlc_mutex_lock( &input_priv(p_input)->p_item->lock );
input_priv(p_input)->p_item->i_type = input_type;
vlc_mutex_unlock( &input_priv(p_input)->p_item->lock );
}
if( var_GetInteger( p_input, "clock-synchro" ) != -1 )
in->b_can_pace_control = !var_GetInteger( p_input, "clock-synchro" );