[vlc-devel] commit: Added a input_ressource_HasVout. (Laurent Aimar )
git version control
git at videolan.org
Sat Jan 24 11:30:33 CET 2009
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Jan 24 11:13:24 2009 +0100| [f379cff8749e9b445ca97ecfe2ed0330add951c2] | committer: Laurent Aimar
Added a input_ressource_HasVout.
It can only be used on detached ressource to ensure the value validity.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f379cff8749e9b445ca97ecfe2ed0330add951c2
---
src/input/input_interface.h | 10 ++++++----
src/input/ressource.c | 10 ++++++++++
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/src/input/input_interface.h b/src/input/input_interface.h
index 7b2490c..ae963b5 100644
--- a/src/input/input_interface.h
+++ b/src/input/input_interface.h
@@ -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)
diff --git a/src/input/ressource.c b/src/input/ressource.c
index 852843b..8320e90 100644
--- a/src/input/ressource.c
+++ b/src/input/ressource.c
@@ -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 )
More information about the vlc-devel
mailing list