[vlc-commits] mosaic_bridge: implement the hold_device for filters
Steve Lhomme
git at videolan.org
Mon Dec 9 11:51:12 CET 2019
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Nov 12 08:47:52 2019 +0100| [1d17597b377b519ec7fe43ad42ac736bbe6d37c8] | committer: Steve Lhomme
mosaic_bridge: implement the hold_device for filters
Factorize the code with the get_device for the decoder.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1d17597b377b519ec7fe43ad42ac736bbe6d37c8
---
modules/stream_out/mosaic_bridge.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/modules/stream_out/mosaic_bridge.c b/modules/stream_out/mosaic_bridge.c
index b1b386f757..63846634e3 100644
--- a/modules/stream_out/mosaic_bridge.c
+++ b/modules/stream_out/mosaic_bridge.c
@@ -252,16 +252,21 @@ static int Open( vlc_object_t *p_this )
return VLC_SUCCESS;
}
-static vlc_decoder_device * video_get_decoder_device( decoder_t *p_dec )
+static vlc_decoder_device * MosaicHoldDecoderDevice( struct decoder_owner *p_owner )
{
- struct decoder_owner *p_owner = dec_get_owner( p_dec );
if ( p_owner->dec_dev == NULL )
{
- p_owner->dec_dev = vlc_decoder_device_Create(&p_dec->obj, NULL);
+ p_owner->dec_dev = vlc_decoder_device_Create(&p_owner->dec.obj, NULL);
}
return p_owner->dec_dev ? vlc_decoder_device_Hold(p_owner->dec_dev) : NULL;
}
+static vlc_decoder_device * video_get_decoder_device( decoder_t *p_dec )
+{
+ struct decoder_owner *p_owner = dec_get_owner( p_dec );
+ return MosaicHoldDecoderDevice(p_owner);
+}
+
/*****************************************************************************
* Close
*****************************************************************************/
@@ -293,6 +298,13 @@ static void ReleaseDecoder( decoder_t *p_dec )
decoder_Destroy( p_dec );
}
+static vlc_decoder_device * video_filter_hold_device(vlc_object_t *o, void *sys)
+{
+ VLC_UNUSED(o);
+ struct decoder_owner *p_owner = sys;
+ return MosaicHoldDecoderDevice(p_owner);
+}
+
static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
{
sout_stream_sys_t *p_sys = p_stream->p_sys;
@@ -320,7 +332,7 @@ static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
/* Create user specified video filters */
static const struct filter_video_callbacks cbs =
{
- video_new_buffer_filter, NULL/*TODO*/,
+ video_new_buffer_filter, video_filter_hold_device,
};
psz_chain = var_GetNonEmptyString( p_stream, CFG_PREFIX "vfilter" );
More information about the vlc-commits
mailing list