Commit f379cff8 authored by Laurent Aimar's avatar Laurent Aimar

Added a input_ressource_HasVout.

It can only be used on detached ressource to ensure the value validity.
parent 062c8ac4
......@@ -54,18 +54,20 @@ void input_ressource_Delete( input_ressource_t * );
/**
* This function deletes the current sout in the ressources.
*
* It can only be called on detached ressources.
*/
void input_ressource_TerminateSout( input_ressource_t *p_ressource );
/**
* This function deletes the current vout in the ressources.
*
* It can only be called on detached ressources.
*/
void input_ressource_TerminateVout( input_ressource_t *p_ressource );
/**
* This function return true if there is at least one vout in the ressources.
*
* It can only be called on detached ressources.
*/
bool input_ressource_HasVout( input_ressource_t *p_ressource );
/* input.c */
#define input_CreateThreadExtended(a,b,c,d) __input_CreateThreadExtended(VLC_OBJECT(a),b,c,d)
......
......@@ -339,6 +339,7 @@ static aout_instance_t *HoldAout( input_ressource_t *p_ressource )
return p_aout;
}
/* */
input_ressource_t *input_ressource_New( void )
{
......@@ -406,6 +407,15 @@ void input_ressource_TerminateVout( input_ressource_t *p_ressource )
{
input_ressource_RequestVout( p_ressource, NULL, NULL );
}
bool input_ressource_HasVout( input_ressource_t *p_ressource )
{
vlc_mutex_lock( &p_ressource->lock );
assert( !p_ressource->p_input );
const bool b_vout = p_ressource->p_vout_free != NULL;
vlc_mutex_unlock( &p_ressource->lock );
return b_vout;
}
/* */
aout_instance_t *input_ressource_RequestAout( input_ressource_t *p_ressource, aout_instance_t *p_aout )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment