[vlc-commits] visualization: split RequestVout in GetVout and PutVout
Rémi Denis-Courmont
git at videolan.org
Fri Jan 18 22:12:46 CET 2019
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Jan 18 20:53:21 2019 +0200| [16fb2fea1623e6b00244737b0d209446ebf3165b] | committer: Rémi Denis-Courmont
visualization: split RequestVout in GetVout and PutVout
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=16fb2fea1623e6b00244737b0d209446ebf3165b
---
include/vlc_aout.h | 3 ++-
modules/visualization/goom.c | 9 ++++-----
modules/visualization/visual/visual.c | 8 ++++----
src/audio_output/filters.c | 12 +++++++++---
src/input/decoder.c | 2 ++
src/libvlccore.sym | 3 ++-
6 files changed, 23 insertions(+), 14 deletions(-)
diff --git a/include/vlc_aout.h b/include/vlc_aout.h
index aa49884001..056d3b9b3e 100644
--- a/include/vlc_aout.h
+++ b/include/vlc_aout.h
@@ -509,7 +509,8 @@ VLC_API block_t *aout_FiltersDrain(aout_filters_t *);
VLC_API void aout_FiltersFlush(aout_filters_t *);
VLC_API void aout_FiltersChangeViewpoint(aout_filters_t *, const vlc_viewpoint_t *vp);
-VLC_API vout_thread_t * aout_filter_RequestVout( filter_t *, vout_thread_t *p_vout, const video_format_t *p_fmt );
+VLC_API vout_thread_t *aout_filter_GetVout(filter_t *, const video_format_t *);
+VLC_API void aout_filter_PutVout(filter_t *, vout_thread_t *p_vout);
/** @} */
diff --git a/modules/visualization/goom.c b/modules/visualization/goom.c
index c1ee4c1899..2bb042633b 100644
--- a/modules/visualization/goom.c
+++ b/modules/visualization/goom.c
@@ -32,7 +32,7 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_aout.h> /* aout_FormatNbChannels, AOUT_FMTS_SIMILAR */
-#include <vlc_vout.h> /* vout_*Picture, aout_filter_RequestVout */
+#include <vlc_vout.h> /* vout_*Picture, aout_filter_..tVout */
#include <vlc_filter.h>
#include <goom/goom.h>
@@ -122,8 +122,7 @@ static int Open( vlc_object_t *p_this )
p_thread->fmt.i_chroma = VLC_CODEC_RGB32;
p_thread->fmt.i_sar_num = p_thread->fmt.i_sar_den = 1;
- p_thread->p_vout = aout_filter_RequestVout( p_filter, NULL,
- &p_thread->fmt );
+ p_thread->p_vout = aout_filter_GetVout( p_filter, &p_thread->fmt );
if( p_thread->p_vout == NULL )
{
msg_Err( p_filter, "no suitable vout module" );
@@ -149,7 +148,7 @@ static int Open( vlc_object_t *p_this )
msg_Err( p_filter, "cannot launch goom thread" );
vlc_mutex_destroy( &p_thread->lock );
vlc_cond_destroy( &p_thread->wait );
- aout_filter_RequestVout( p_filter, p_thread->p_vout, NULL );
+ aout_filter_PutVout( p_filter, p_thread->p_vout );
free( p_thread );
return VLC_EGENERIC;
}
@@ -345,7 +344,7 @@ static void Close( vlc_object_t *p_this )
vlc_join( p_thread->thread, NULL );
/* Free data */
- aout_filter_RequestVout( p_filter, p_thread->p_vout, NULL );
+ aout_filter_PutVout( p_filter, p_thread->p_vout );
vlc_mutex_destroy( &p_thread->lock );
vlc_cond_destroy( &p_thread->wait );
diff --git a/modules/visualization/visual/visual.c b/modules/visualization/visual/visual.c
index 9c9da45e7a..9458da3be4 100644
--- a/modules/visualization/visual/visual.c
+++ b/modules/visualization/visual/visual.c
@@ -301,7 +301,7 @@ static int Open( vlc_object_t *p_this )
.primaries = COLOR_PRIMARIES_SRGB,
.space = COLOR_SPACE_SRGB,
};
- p_sys->p_vout = aout_filter_RequestVout( p_filter, NULL, &fmt );
+ p_sys->p_vout = aout_filter_GetVout( p_filter, &fmt );
if( p_sys->p_vout == NULL )
{
msg_Err( p_filter, "no suitable vout module" );
@@ -311,7 +311,7 @@ static int Open( vlc_object_t *p_this )
p_sys->fifo = block_FifoNew();
if( unlikely( p_sys->fifo == NULL ) )
{
- aout_filter_RequestVout( p_filter, p_sys->p_vout, NULL );
+ aout_filter_PutVout( p_filter, p_sys->p_vout );
goto error;
}
@@ -319,7 +319,7 @@ static int Open( vlc_object_t *p_this )
VLC_THREAD_PRIORITY_VIDEO ) )
{
block_FifoRelease( p_sys->fifo );
- aout_filter_RequestVout( p_filter, p_sys->p_vout, NULL );
+ aout_filter_PutVout( p_filter, p_sys->p_vout );
goto error;
}
@@ -407,7 +407,7 @@ static void Close( vlc_object_t *p_this )
vlc_cancel( p_sys->thread );
vlc_join( p_sys->thread, NULL );
block_FifoRelease( p_sys->fifo );
- aout_filter_RequestVout( p_filter, p_sys->p_vout, NULL );
+ aout_filter_PutVout( p_filter, p_sys->p_vout );
/* Free the list */
for( int i = 0; i < p_sys->i_effect; i++ )
diff --git a/src/audio_output/filters.c b/src/audio_output/filters.c
index 463c6fccf7..1b8f82bc72 100644
--- a/src/audio_output/filters.c
+++ b/src/audio_output/filters.c
@@ -382,8 +382,7 @@ static int VisualizationCallback (vlc_object_t *obj, const char *var,
return VLC_SUCCESS;
}
-vout_thread_t *aout_filter_RequestVout (filter_t *filter, vout_thread_t *vout,
- const video_format_t *fmt)
+vout_thread_t *aout_filter_GetVout(filter_t *filter, const video_format_t *fmt)
{
/* NOTE: This only works from aout_filters_t.
* If you want to use visualization filters from another place, you will
@@ -391,7 +390,14 @@ vout_thread_t *aout_filter_RequestVout (filter_t *filter, vout_thread_t *vout,
* to aout_request_vout_t inside filter_t (i.e. a level of indirection). */
const aout_request_vout_t *req = filter->owner.sys;
- return req->pf_request_vout(req->p_private, vout, fmt);
+ return req->pf_request_vout(req->p_private, NULL, fmt);
+}
+
+void aout_filter_PutVout(filter_t *filter, vout_thread_t *vout)
+{
+ const aout_request_vout_t *req = filter->owner.sys;
+
+ req->pf_request_vout(req->p_private, vout, NULL);
}
static int AppendFilter(vlc_object_t *obj, const char *type, const char *name,
diff --git a/src/input/decoder.c b/src/input/decoder.c
index d4a6ce2ad5..5923c42421 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -309,6 +309,8 @@ static vout_thread_t *aout_request_vout( void *p_private,
struct decoder_owner *p_owner = dec_get_owner( p_dec );
video_format_t fmt;
+ assert((p_fmt == NULL) != (p_vout == NULL));
+
if (p_fmt != NULL)
{
fmt = *p_fmt;
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index fe69d7b5eb..9a38d310fc 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -9,7 +9,8 @@ aout_CheckChannelReorder
aout_EnableFilter
aout_Interleave
aout_Deinterleave
-aout_filter_RequestVout
+aout_filter_GetVout
+aout_filter_PutVout
aout_FormatPrepare
aout_FormatPrint
aout_FormatPrintChannels
More information about the vlc-commits
mailing list