1 /*****************************************************************************
2 * stream_output.c : stream output module
3 *****************************************************************************
4 * Copyright (C) 2002-2007 the VideoLAN team
7 * Authors: Christophe Massiot <massiot@via.ecp.fr>
8 * Laurent Aimar <fenrir@via.ecp.fr>
9 * Eric Petit <titer@videolan.org>
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24 *****************************************************************************/
26 /*****************************************************************************
28 *****************************************************************************/
36 #include <vlc_common.h>
38 #include <stdlib.h> /* free() */
39 #include <stdio.h> /* sprintf() */
44 #include "stream_output.h"
47 #include <vlc_block.h>
48 #include <vlc_codec.h>
50 #include "input/input_interface.h"
52 #define VLC_CODEC_NULL VLC_FOURCC( 'n', 'u', 'l', 'l' )
55 /*****************************************************************************
57 *****************************************************************************/
58 static char *sout_stream_url_to_chain( bool, const char * );
72 /* mrl_Parse: parse psz_mrl and fill p_mrl */
73 static int mrl_Parse( mrl_t *p_mrl, const char *psz_mrl );
74 /* mrl_Clean: clean p_mrl after a call to mrl_Parse */
75 static void mrl_Clean( mrl_t *p_mrl );
77 /*****************************************************************************
78 * sout_NewInstance: creates a new stream output instance
79 *****************************************************************************/
80 sout_instance_t *__sout_NewInstance( vlc_object_t *p_parent, const char *psz_dest )
82 static const char typename[] = "stream output";
83 sout_instance_t *p_sout;
86 if( psz_dest && psz_dest[0] == '#' )
88 psz_chain = strdup( &psz_dest[1] );
92 psz_chain = sout_stream_url_to_chain(
93 config_GetInt(p_parent, "sout-display") > 0, psz_dest );
98 /* *** Allocate descriptor *** */
99 p_sout = vlc_custom_create( p_parent, sizeof( *p_sout ),
100 VLC_OBJECT_GENERIC, typename );
104 msg_Dbg( p_sout, "using sout chain=`%s'", psz_chain );
106 /* *** init descriptor *** */
107 p_sout->psz_sout = strdup( psz_dest );
108 p_sout->p_meta = NULL;
109 p_sout->i_out_pace_nocontrol = 0;
110 p_sout->p_sys = NULL;
112 vlc_mutex_init( &p_sout->lock );
113 p_sout->p_stream = NULL;
115 /* attach it for inherit */
116 vlc_object_attach( p_sout, p_parent );
118 var_Create( p_sout, "sout-mux-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
120 p_sout->p_stream = sout_StreamChainNew( p_sout, psz_chain, NULL, NULL );
121 if( p_sout->p_stream )
127 msg_Err( p_sout, "stream chain failed for `%s'", psz_chain );
130 FREENULL( p_sout->psz_sout );
132 vlc_object_detach( p_sout );
133 vlc_object_release( p_sout );
137 /*****************************************************************************
138 * sout_DeleteInstance: delete a previously allocated instance
139 *****************************************************************************/
140 void sout_DeleteInstance( sout_instance_t * p_sout )
142 /* remove the stream out chain */
143 sout_StreamChainDelete( p_sout->p_stream, NULL );
145 /* *** free all string *** */
146 FREENULL( p_sout->psz_sout );
151 vlc_meta_Delete( p_sout->p_meta );
154 vlc_mutex_destroy( &p_sout->lock );
156 /* *** free structure *** */
157 vlc_object_release( p_sout );
160 /*****************************************************************************
162 *****************************************************************************/
163 void sout_UpdateStatistic( sout_instance_t *p_sout, sout_statistic_t i_type, int i_delta )
165 if( !libvlc_stats( p_sout ) )
169 input_thread_t *p_input = vlc_object_find( p_sout, VLC_OBJECT_INPUT, FIND_PARENT );
176 case SOUT_STATISTIC_DECODED_VIDEO:
177 i_input_type = SOUT_STATISTIC_DECODED_VIDEO;
179 case SOUT_STATISTIC_DECODED_AUDIO:
180 i_input_type = SOUT_STATISTIC_DECODED_AUDIO;
182 case SOUT_STATISTIC_DECODED_SUBTITLE:
183 i_input_type = SOUT_STATISTIC_DECODED_SUBTITLE;
186 case SOUT_STATISTIC_SENT_PACKET:
187 i_input_type = SOUT_STATISTIC_SENT_PACKET;
190 case SOUT_STATISTIC_SENT_BYTE:
191 i_input_type = SOUT_STATISTIC_SENT_BYTE;
195 msg_Err( p_sout, "Not yet supported statistic type %d", i_type );
196 vlc_object_release( p_input );
200 input_UpdateStatistic( p_input, i_input_type, i_delta );
202 vlc_object_release( p_input );
204 /*****************************************************************************
206 *****************************************************************************/
207 sout_packetizer_input_t *sout_InputNew( sout_instance_t *p_sout,
210 sout_packetizer_input_t *p_input;
212 /* *** create a packetizer input *** */
213 p_input = malloc( sizeof( sout_packetizer_input_t ) );
214 if( !p_input ) return NULL;
215 p_input->p_sout = p_sout;
216 p_input->p_fmt = p_fmt;
218 msg_Dbg( p_sout, "adding a new sout input (sout_input:%p)", p_input );
220 if( p_fmt->i_codec == VLC_CODEC_NULL )
222 vlc_object_release( p_sout );
226 /* *** add it to the stream chain */
227 vlc_mutex_lock( &p_sout->lock );
228 p_input->id = p_sout->p_stream->pf_add( p_sout->p_stream, p_fmt );
229 vlc_mutex_unlock( &p_sout->lock );
231 if( p_input->id == NULL )
240 /*****************************************************************************
242 *****************************************************************************/
243 int sout_InputDelete( sout_packetizer_input_t *p_input )
245 sout_instance_t *p_sout = p_input->p_sout;
247 msg_Dbg( p_sout, "removing a sout input (sout_input:%p)", p_input );
249 if( p_input->p_fmt->i_codec != VLC_CODEC_NULL )
251 vlc_mutex_lock( &p_sout->lock );
252 p_sout->p_stream->pf_del( p_sout->p_stream, p_input->id );
253 vlc_mutex_unlock( &p_sout->lock );
258 return( VLC_SUCCESS);
261 /*****************************************************************************
263 *****************************************************************************/
264 int sout_InputSendBuffer( sout_packetizer_input_t *p_input,
267 sout_instance_t *p_sout = p_input->p_sout;
270 if( p_input->p_fmt->i_codec == VLC_CODEC_NULL )
272 block_Release( p_buffer );
276 if( p_buffer->i_dts <= VLC_TS_INVALID )
278 msg_Warn( p_sout, "trying to send non-dated packet to stream output!");
279 block_Release( p_buffer );
283 vlc_mutex_lock( &p_sout->lock );
284 i_ret = p_sout->p_stream->pf_send( p_sout->p_stream,
285 p_input->id, p_buffer );
286 vlc_mutex_unlock( &p_sout->lock );
291 #undef sout_AccessOutNew
292 /*****************************************************************************
293 * sout_AccessOutNew: allocate a new access out
294 *****************************************************************************/
295 sout_access_out_t *sout_AccessOutNew( vlc_object_t *p_sout,
296 const char *psz_access, const char *psz_name )
298 static const char typename[] = "access out";
299 sout_access_out_t *p_access;
302 p_access = vlc_custom_create( p_sout, sizeof( *p_access ),
303 VLC_OBJECT_GENERIC, typename );
307 psz_next = config_ChainCreate( &p_access->psz_access, &p_access->p_cfg,
310 p_access->psz_path = strdup( psz_name ? psz_name : "" );
311 p_access->p_sys = NULL;
312 p_access->pf_seek = NULL;
313 p_access->pf_read = NULL;
314 p_access->pf_write = NULL;
315 p_access->pf_control = NULL;
316 p_access->p_module = NULL;
318 p_access->i_writes = 0;
319 p_access->i_sent_bytes = 0;
321 vlc_object_attach( p_access, p_sout );
324 module_need( p_access, "sout access", p_access->psz_access, true );
326 if( !p_access->p_module )
328 free( p_access->psz_access );
329 free( p_access->psz_path );
330 vlc_object_detach( p_access );
331 vlc_object_release( p_access );
337 /*****************************************************************************
338 * sout_AccessDelete: delete an access out
339 *****************************************************************************/
340 void sout_AccessOutDelete( sout_access_out_t *p_access )
342 vlc_object_detach( p_access );
343 if( p_access->p_module )
345 module_unneed( p_access, p_access->p_module );
347 free( p_access->psz_access );
349 config_ChainDestroy( p_access->p_cfg );
351 free( p_access->psz_path );
353 vlc_object_release( p_access );
356 /*****************************************************************************
358 *****************************************************************************/
359 int sout_AccessOutSeek( sout_access_out_t *p_access, off_t i_pos )
361 return p_access->pf_seek( p_access, i_pos );
364 /*****************************************************************************
366 *****************************************************************************/
367 ssize_t sout_AccessOutRead( sout_access_out_t *p_access, block_t *p_buffer )
369 return( p_access->pf_read ?
370 p_access->pf_read( p_access, p_buffer ) : VLC_EGENERIC );
373 /*****************************************************************************
375 *****************************************************************************/
376 ssize_t sout_AccessOutWrite( sout_access_out_t *p_access, block_t *p_buffer )
379 const unsigned i_packets_gather = 30;
380 p_access->i_writes++;
381 p_access->i_sent_bytes += p_buffer->i_buffer;
382 if( (p_access->i_writes % i_packets_gather) == 0 )
384 sout_UpdateStatistic( p_access->p_sout, SOUT_STATISTIC_SENT_PACKET, i_packets_gather );
385 sout_UpdateStatistic( p_access->p_sout, SOUT_STATISTIC_SENT_BYTE, p_access->i_sent_bytes );
386 p_access->i_sent_bytes = 0;
389 return p_access->pf_write( p_access, p_buffer );
393 * sout_AccessOutControl
395 int sout_AccessOutControl (sout_access_out_t *access, int query, ...)
400 va_start (ap, query);
401 if (access->pf_control)
402 ret = access->pf_control (access, query, ap);
409 /*****************************************************************************
410 * sout_MuxNew: create a new mux
411 *****************************************************************************/
412 sout_mux_t * sout_MuxNew( sout_instance_t *p_sout, const char *psz_mux,
413 sout_access_out_t *p_access )
415 static const char typename[] = "mux";
419 p_mux = vlc_custom_create( p_sout, sizeof( *p_mux ), VLC_OBJECT_GENERIC,
424 p_mux->p_sout = p_sout;
425 psz_next = config_ChainCreate( &p_mux->psz_mux, &p_mux->p_cfg, psz_mux );
428 p_mux->p_access = p_access;
429 p_mux->pf_control = NULL;
430 p_mux->pf_addstream = NULL;
431 p_mux->pf_delstream = NULL;
432 p_mux->pf_mux = NULL;
433 p_mux->i_nb_inputs = 0;
434 p_mux->pp_inputs = NULL;
437 p_mux->p_module = NULL;
439 p_mux->b_add_stream_any_time = false;
440 p_mux->b_waiting_stream = true;
441 p_mux->i_add_stream_start = -1;
443 vlc_object_attach( p_mux, p_sout );
446 module_need( p_mux, "sout mux", p_mux->psz_mux, true );
448 if( p_mux->p_module == NULL )
450 FREENULL( p_mux->psz_mux );
452 vlc_object_detach( p_mux );
453 vlc_object_release( p_mux );
457 /* *** probe mux capacity *** */
458 if( p_mux->pf_control )
460 int b_answer = false;
462 if( sout_MuxControl( p_mux, MUX_CAN_ADD_STREAM_WHILE_MUXING,
470 msg_Dbg( p_sout, "muxer support adding stream at any time" );
471 p_mux->b_add_stream_any_time = true;
472 p_mux->b_waiting_stream = false;
474 /* If we control the output pace then it's better to wait before
475 * starting muxing (generates better streams/files). */
476 if( !p_sout->i_out_pace_nocontrol )
480 else if( sout_MuxControl( p_mux, MUX_GET_ADD_STREAM_WAIT,
488 msg_Dbg( p_sout, "muxer prefers to wait for all ES before "
490 p_mux->b_waiting_stream = true;
498 /*****************************************************************************
500 *****************************************************************************/
501 void sout_MuxDelete( sout_mux_t *p_mux )
503 vlc_object_detach( p_mux );
504 if( p_mux->p_module )
506 module_unneed( p_mux, p_mux->p_module );
508 free( p_mux->psz_mux );
510 config_ChainDestroy( p_mux->p_cfg );
512 vlc_object_release( p_mux );
515 /*****************************************************************************
517 *****************************************************************************/
518 sout_input_t *sout_MuxAddStream( sout_mux_t *p_mux, es_format_t *p_fmt )
520 sout_input_t *p_input;
522 if( !p_mux->b_add_stream_any_time && !p_mux->b_waiting_stream )
524 msg_Err( p_mux, "cannot add a new stream (unsupported while muxing "
525 "to this format). You can try increasing sout-mux-caching value" );
529 msg_Dbg( p_mux, "adding a new input" );
531 /* create a new sout input */
532 p_input = malloc( sizeof( sout_input_t ) );
535 p_input->p_sout = p_mux->p_sout;
536 p_input->p_fmt = p_fmt;
537 p_input->p_fifo = block_FifoNew();
538 p_input->p_sys = NULL;
540 TAB_APPEND( p_mux->i_nb_inputs, p_mux->pp_inputs, p_input );
541 if( p_mux->pf_addstream( p_mux, p_input ) < 0 )
543 msg_Err( p_mux, "cannot add this stream" );
544 TAB_REMOVE( p_mux->i_nb_inputs, p_mux->pp_inputs, p_input );
545 block_FifoRelease( p_input->p_fifo );
553 /*****************************************************************************
554 * sout_MuxDeleteStream:
555 *****************************************************************************/
556 void sout_MuxDeleteStream( sout_mux_t *p_mux, sout_input_t *p_input )
560 if( p_mux->b_waiting_stream
561 && block_FifoCount( p_input->p_fifo ) > 0 )
563 /* We stop waiting, and call the muxer for taking care of the data
564 * before we remove this es */
565 p_mux->b_waiting_stream = false;
566 p_mux->pf_mux( p_mux );
569 TAB_FIND( p_mux->i_nb_inputs, p_mux->pp_inputs, p_input, i_index );
572 if( p_mux->pf_delstream( p_mux, p_input ) < 0 )
574 msg_Err( p_mux, "cannot delete this stream from mux" );
577 /* remove the entry */
578 TAB_REMOVE( p_mux->i_nb_inputs, p_mux->pp_inputs, p_input );
580 if( p_mux->i_nb_inputs == 0 )
582 msg_Warn( p_mux, "no more input streams for this mux" );
585 block_FifoRelease( p_input->p_fifo );
590 /*****************************************************************************
591 * sout_MuxSendBuffer:
592 *****************************************************************************/
593 void sout_MuxSendBuffer( sout_mux_t *p_mux, sout_input_t *p_input,
596 block_FifoPut( p_input->p_fifo, p_buffer );
598 if( p_mux->p_sout->i_out_pace_nocontrol )
600 mtime_t current_date = mdate();
601 if ( current_date > p_buffer->i_dts )
602 msg_Warn( p_mux, "late buffer for mux input (%"PRId64")",
603 current_date - p_buffer->i_dts );
606 if( p_mux->b_waiting_stream )
608 const int64_t i_caching = var_GetInteger( p_mux->p_sout, "sout-mux-caching" ) * INT64_C(1000);
610 if( p_mux->i_add_stream_start < 0 )
611 p_mux->i_add_stream_start = p_buffer->i_dts;
613 /* Wait until we have enought data before muxing */
614 if( p_mux->i_add_stream_start < 0 ||
615 p_buffer->i_dts < p_mux->i_add_stream_start + i_caching )
617 p_mux->b_waiting_stream = false;
619 p_mux->pf_mux( p_mux );
623 /*****************************************************************************
624 * sout_MuxGetStream: find stream to be muxed
625 *****************************************************************************/
626 int sout_MuxGetStream( sout_mux_t *p_mux, int i_blocks, mtime_t *pi_dts )
631 for( int i = 0; i < p_mux->i_nb_inputs; i++ )
633 sout_input_t *p_input = p_mux->pp_inputs[i];
636 if( block_FifoCount( p_input->p_fifo ) < i_blocks )
638 if( p_input->p_fmt->i_cat != SPU_ES )
642 /* FIXME: SPU muxing */
646 p_data = block_FifoShow( p_input->p_fifo );
647 if( i_stream < 0 || p_data->i_dts < i_dts )
650 i_dts = p_data->i_dts;
654 if( pi_dts ) *pi_dts = i_dts;
660 /*****************************************************************************
662 *****************************************************************************/
663 static int mrl_Parse( mrl_t *p_mrl, const char *psz_mrl )
665 char * psz_dup = strdup( psz_mrl );
666 char * psz_parser = psz_dup;
667 const char * psz_access;
668 const char * psz_way;
671 /* *** first parse psz_dest */
672 while( *psz_parser && *psz_parser != ':' )
674 if( *psz_parser == '{' )
676 while( *psz_parser && *psz_parser != '}' )
690 #if defined( WIN32 ) || defined( UNDER_CE )
691 if( psz_parser - psz_dup == 1 )
693 /* msg_Warn( p_sout, "drive letter %c: found in source string",
701 psz_access = psz_way = "";
706 *psz_parser++ = '\0';
708 /* let's skip '//' */
709 if( psz_parser[0] == '/' && psz_parser[1] == '/' )
714 psz_name = psz_parser ;
716 /* Come back to parse the access and mux plug-ins */
717 psz_parser = psz_dup;
724 else if( *psz_parser == '/' )
732 psz_access = psz_parser;
734 while( *psz_parser && *psz_parser != '/' )
736 if( *psz_parser == '{' )
738 while( *psz_parser && *psz_parser != '}' )
753 if( *psz_parser == '/' )
755 *psz_parser++ = '\0';
766 psz_way = psz_parser;
770 p_mrl->psz_access = strdup( psz_access );
771 p_mrl->psz_way = strdup( psz_way );
772 p_mrl->psz_name = strdup( psz_name );
775 return( VLC_SUCCESS );
779 /* mrl_Clean: clean p_mrl after a call to mrl_Parse */
780 static void mrl_Clean( mrl_t *p_mrl )
782 FREENULL( p_mrl->psz_access );
783 FREENULL( p_mrl->psz_way );
784 FREENULL( p_mrl->psz_name );
788 /****************************************************************************
789 ****************************************************************************
793 ****************************************************************************
794 ****************************************************************************/
796 /* Destroy a "stream_out" module */
797 static void sout_StreamDelete( sout_stream_t *p_stream )
799 msg_Dbg( p_stream, "destroying chain... (name=%s)", p_stream->psz_name );
801 vlc_object_detach( p_stream );
802 if( p_stream->p_module ) module_unneed( p_stream, p_stream->p_module );
804 FREENULL( p_stream->psz_name );
806 config_ChainDestroy( p_stream->p_cfg );
808 msg_Dbg( p_stream, "destroying chain done" );
809 vlc_object_release( p_stream );
812 /* Destroy a "stream_out" modules chain
814 * p_first is the first module to be destroyed in the chain
815 * p_last is the last module to be destroyed
816 * if NULL, all modules are destroyed
817 * if not NULL, modules following it must be destroyed separately
819 void sout_StreamChainDelete(sout_stream_t *p_first, sout_stream_t *p_last)
824 if(p_first != p_last)
825 sout_StreamChainDelete(p_first->p_next, p_last);
827 sout_StreamDelete(p_first);
830 /* Create a "stream_out" module, which may forward its ES to p_next module */
832 * XXX name and p_cfg are used (-> do NOT free them)
834 static sout_stream_t *sout_StreamNew( sout_instance_t *p_sout, char *psz_name,
835 config_chain_t *p_cfg, sout_stream_t *p_next)
837 static const char typename[] = "stream out";
838 sout_stream_t *p_stream;
842 p_stream = vlc_custom_create( p_sout, sizeof( *p_stream ),
843 VLC_OBJECT_GENERIC, typename );
847 p_stream->p_sout = p_sout;
848 p_stream->p_sys = NULL;
849 p_stream->psz_name = psz_name;
850 p_stream->p_cfg = p_cfg;
851 p_stream->p_next = p_next;
853 msg_Dbg( p_sout, "stream=`%s'", p_stream->psz_name );
855 vlc_object_attach( p_stream, p_sout );
858 module_need( p_stream, "sout stream", p_stream->psz_name, true );
860 if( !p_stream->p_module )
862 /* those must be freed by the caller if creation failed */
863 p_stream->psz_name = NULL;
864 p_stream->p_cfg = NULL;
866 sout_StreamDelete( p_stream );
873 /* Creates a complete "stream_out" modules chain
875 * chain format: module1{option=*:option=*}[:module2{option=*:...}]
877 * The modules are created starting from the last one and linked together
878 * A pointer to the last module created is stored if pp_last isn't NULL, to
879 * make sure sout_StreamChainDelete doesn't delete modules created in another
882 * Returns a pointer to the first module.
884 sout_stream_t *sout_StreamChainNew(sout_instance_t *p_sout, char *psz_chain,
885 sout_stream_t *p_next, sout_stream_t **pp_last)
887 if(!psz_chain || !*psz_chain)
889 if(pp_last) *pp_last = NULL;
893 char *psz_parser = strdup(psz_chain);
897 vlc_array_t cfg, name;
898 vlc_array_init(&cfg);
899 vlc_array_init(&name);
904 config_chain_t *p_cfg;
906 psz_chain = config_ChainCreate( &psz_name, &p_cfg, psz_parser );
908 psz_parser = psz_chain;
910 vlc_array_append(&cfg, p_cfg);
911 vlc_array_append(&name, psz_name);
914 int i = vlc_array_count(&name);
916 vlc_array_init(&module);
919 p_next = sout_StreamNew( p_sout, vlc_array_item_at_index(&name, i),
920 vlc_array_item_at_index(&cfg, i), p_next);
925 if(i == vlc_array_count(&name) - 1 && pp_last)
926 *pp_last = p_next; /* last module created in the chain */
928 vlc_array_append(&module, p_next);
931 vlc_array_clear(&name);
932 vlc_array_clear(&cfg);
933 vlc_array_clear(&module);
939 i++; /* last module couldn't be created */
941 /* destroy all modules created, starting with the last one */
942 int modules = vlc_array_count(&module);
944 sout_StreamDelete(vlc_array_item_at_index(&module, modules));
945 vlc_array_clear(&module);
947 /* then destroy all names and config which weren't destroyed by
948 * sout_StreamDelete */
951 free(vlc_array_item_at_index(&name, i));
952 config_ChainDestroy(vlc_array_item_at_index(&cfg, i));
954 vlc_array_clear(&name);
955 vlc_array_clear(&cfg);
960 static char *sout_stream_url_to_chain( bool b_sout_display,
961 const char *psz_url )
966 mrl_Parse( &mrl, psz_url );
968 /* Check if the URLs goes to #rtp - otherwise we'll use #standard */
969 static const char rtplist[] = "dccp\0sctp\0tcp\0udplite\0";
970 for (const char *a = rtplist; *a; a += strlen (a) + 1)
971 if (strcmp (a, mrl.psz_access) == 0)
974 if (strcmp (mrl.psz_access, "rtp") == 0)
977 /* For historical reasons, rtp:// means RTP over UDP */
978 strcpy (mrl.psz_access, "udp");
980 if (mrl.psz_name[0] == '[')
982 port = strstr (mrl.psz_name, "]:");
987 port = strchr (mrl.psz_name, ':');
989 *port++ = '\0'; /* erase ':' */
991 if (asprintf (&psz_chain,
992 "rtp{mux=\"%s\",proto=\"%s\",dst=\"%s%s%s\"}",
993 mrl.psz_way, mrl.psz_access, mrl.psz_name,
994 port ? "\",port=\"" : "", port ? port : "") == -1)
999 /* Convert the URL to a basic standard sout chain */
1000 if (asprintf (&psz_chain,
1001 "standard{mux=\"%s\",access=\"%s\",dst=\"%s\"}",
1002 mrl.psz_way, mrl.psz_access, mrl.psz_name) == -1)
1006 /* Duplicate and wrap if sout-display is on */
1007 if (psz_chain && b_sout_display)
1010 if (asprintf (&tmp, "duplicate{dst=display,dst=%s}", tmp) == -1)
1020 #undef sout_EncoderCreate
1021 encoder_t *sout_EncoderCreate( vlc_object_t *p_this )
1023 static const char type[] = "encoder";
1024 return vlc_custom_create( p_this, sizeof( encoder_t ), VLC_OBJECT_GENERIC,