From cc4a55dede1d59fd5801b0dfff8398ba55be74d2 Mon Sep 17 00:00:00 2001 From: Gildas Bazin <gbazin@videolan.org> Date: Wed, 18 Dec 2002 17:52:23 +0000 Subject: [PATCH] * src/libvlc.h, src/input/input_dec.c: added an "sout-video" and "sout-audio" config option that allows to selectively enable audio or video stream output. This is very useful if you want to play video on one computer and audio on another one ;) --- src/input/input_dec.c | 20 ++++++++++++++++++-- src/libvlc.h | 25 +++++++++++++++++++++---- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/src/input/input_dec.c b/src/input/input_dec.c index 89965c1fe7..f69950075c 100644 --- a/src/input/input_dec.c +++ b/src/input/input_dec.c @@ -2,7 +2,7 @@ * input_dec.c: Functions for the management of decoders ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: input_dec.c,v 1.53 2002/12/14 21:32:42 fenrir Exp $ + * $Id: input_dec.c,v 1.54 2002/12/18 17:52:23 gbazin Exp $ * * Authors: Christophe Massiot <massiot@via.ecp.fr> * @@ -63,8 +63,24 @@ decoder_fifo_t * input_RunDecoder( input_thread_t * p_input, psz_sout = config_GetPsz( p_input, "sout" ); if( psz_sout != NULL && *psz_sout != 0 ) { - p_fifo->p_module = module_Need( p_fifo, "packetizer", "$packetizer" ); + vlc_bool_t b_sout = VLC_TRUE; + + if( p_es->i_cat == AUDIO_ES ) + { + b_sout = config_GetInt( p_input, "sout-audio" ); + } + else if( p_es->i_cat == VIDEO_ES ) + { + b_sout = config_GetInt( p_input, "sout-video" ); + } + + if( b_sout ) + { + p_fifo->p_module = + module_Need( p_fifo, "packetizer", "$packetizer" ); + } } + /* default Get a suitable decoder module */ if( p_fifo->p_module == NULL ) { diff --git a/src/libvlc.h b/src/libvlc.h index 1699fea679..f7c5e4c38c 100644 --- a/src/libvlc.h +++ b/src/libvlc.h @@ -2,7 +2,7 @@ * libvlc.h: main libvlc header ***************************************************************************** * Copyright (C) 1998-2002 VideoLAN - * $Id: libvlc.h,v 1.30 2002/12/14 22:33:21 fenrir Exp $ + * $Id: libvlc.h,v 1.31 2002/12/18 17:52:23 gbazin Exp $ * * Authors: Vincent Seguin <seguin@via.ecp.fr> * Samuel Hocevar <sam@zoy.org> @@ -283,13 +283,26 @@ #define SOUT_TEXT N_("choose a stream output") #define SOUT_LONGTEXT N_( \ "Empty if no stream output.") + +#define SOUT_VIDEO_TEXT N_("enable video stream output") +#define SOUT_VIDEO_LONGTEXT N_( \ + "This allows you to choose if the video stream should be redirected to " \ + "the stream output facility when this last one is enabled.") + +#define SOUT_AUDIO_TEXT N_("enable audio stream output") +#define SOUT_AUDIO_LONGTEXT N_( \ + "This allows you to choose if the video stream should be redirected to " \ + "the stream output facility when this last one is enabled.") + #define PACKETIZER_TEXT N_("choose prefered packetizer list") #define PACKETIZER_LONGTEXT N_( \ "This allows you to select the order in which vlc will choose its " \ "packetizers." ) + #define MUX_TEXT N_("mux module") #define MUX_LONGTEXT N_( \ "This is a legacy entry to let you configure mux modules") + #define ACCESS_OUTPUT_TEXT N_("access output module") #define ACCESS_OUTPUT_LONGTEXT N_( \ "This is a legacy entry to let you configure access output modules") @@ -486,12 +499,16 @@ vlc_module_begin(); add_category_hint( N_("Decoders"), NULL ); add_module( "codec", "decoder", NULL, NULL, CODEC_TEXT, CODEC_LONGTEXT ); - /* Stream output */ + /* Stream output options */ add_category_hint( N_("Stream output"), NULL ); - add_module( "packetizer", "packetizer", NULL, NULL, PACKETIZER_TEXT, PACKETIZER_LONGTEXT ); + add_module( "packetizer", "packetizer", NULL, NULL, + PACKETIZER_TEXT, PACKETIZER_LONGTEXT ); add_module( "mux", "sout mux", NULL, NULL, MUX_TEXT, MUX_LONGTEXT ); - add_module( "access_output", "sout access", NULL, NULL, ACCESS_OUTPUT_TEXT, ACCESS_OUTPUT_LONGTEXT ); + add_module( "access_output", "sout access", NULL, NULL, + ACCESS_OUTPUT_TEXT, ACCESS_OUTPUT_LONGTEXT ); add_string( "sout", NULL, NULL, SOUT_TEXT, SOUT_LONGTEXT ); + add_bool( "sout-video", 1, NULL, SOUT_VIDEO_TEXT, SOUT_VIDEO_LONGTEXT ); + add_bool( "sout-audio", 1, NULL, SOUT_AUDIO_TEXT, SOUT_AUDIO_LONGTEXT ); /* CPU options */ add_category_hint( N_("CPU"), NULL ); -- 2.25.4