1 /*****************************************************************************
2 * stream_output.c : stream output module
3 *****************************************************************************
4 * Copyright (C) 2002-2007 VLC authors and VideoLAN
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 it
12 * under the terms of the GNU Lesser General Public License as published by
13 * the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this program; if not, write to the Free Software Foundation,
23 * 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>
49 #include <vlc_modules.h>
51 #include "input/input_interface.h"
54 /*****************************************************************************
56 *****************************************************************************/
57 static char *sout_stream_url_to_chain( bool, const char * );
71 /* mrl_Parse: parse psz_mrl and fill p_mrl */
72 static int mrl_Parse( mrl_t
*p_mrl
, const char *psz_mrl
);
73 /* mrl_Clean: clean p_mrl after a call to mrl_Parse */
74 static void mrl_Clean( mrl_t
*p_mrl
);
76 #undef sout_NewInstance
78 /*****************************************************************************
79 * sout_NewInstance: creates a new stream output instance
80 *****************************************************************************/
81 sout_instance_t
*sout_NewInstance( vlc_object_t
*p_parent
, const char *psz_dest
)
83 sout_instance_t
*p_sout
;
86 assert( psz_dest
!= NULL
);
88 if( psz_dest
[0] == '#' )
90 psz_chain
= strdup( &psz_dest
[1] );
94 psz_chain
= sout_stream_url_to_chain(
95 var_InheritBool(p_parent
, "sout-display"), psz_dest
);
100 /* *** Allocate descriptor *** */
101 p_sout
= vlc_custom_create( p_parent
, sizeof( *p_sout
), "stream output" );
108 msg_Dbg( p_sout
, "using sout chain=`%s'", psz_chain
);
110 /* *** init descriptor *** */
111 p_sout
->psz_sout
= strdup( psz_dest
);
112 p_sout
->i_out_pace_nocontrol
= 0;
114 vlc_mutex_init( &p_sout
->lock
);
115 p_sout
->p_stream
= NULL
;
117 var_Create( p_sout
, "sout-mux-caching", VLC_VAR_INTEGER
| VLC_VAR_DOINHERIT
);
119 p_sout
->p_stream
= sout_StreamChainNew( p_sout
, psz_chain
, NULL
, NULL
);
120 if( p_sout
->p_stream
)
126 msg_Err( p_sout
, "stream chain failed for `%s'", psz_chain
);
129 FREENULL( p_sout
->psz_sout
);
131 vlc_mutex_destroy( &p_sout
->lock
);
132 vlc_object_release( p_sout
);
136 /*****************************************************************************
137 * sout_DeleteInstance: delete a previously allocated instance
138 *****************************************************************************/
139 void sout_DeleteInstance( sout_instance_t
* p_sout
)
141 /* remove the stream out chain */
142 sout_StreamChainDelete( p_sout
->p_stream
, NULL
);
144 /* *** free all string *** */
145 FREENULL( p_sout
->psz_sout
);
147 vlc_mutex_destroy( &p_sout
->lock
);
149 /* *** free structure *** */
150 vlc_object_release( p_sout
);
153 /*****************************************************************************
155 *****************************************************************************/
156 sout_packetizer_input_t
*sout_InputNew( sout_instance_t
*p_sout
,
159 sout_packetizer_input_t
*p_input
;
161 /* *** create a packetizer input *** */
162 p_input
= malloc( sizeof( sout_packetizer_input_t
) );
163 if( !p_input
) return NULL
;
164 p_input
->p_sout
= p_sout
;
165 p_input
->p_fmt
= p_fmt
;
167 msg_Dbg( p_sout
, "adding a new sout input (sout_input: %p)",
170 /* *** add it to the stream chain */
171 vlc_mutex_lock( &p_sout
->lock
);
172 p_input
->id
= p_sout
->p_stream
->pf_add( p_sout
->p_stream
, p_fmt
);
173 vlc_mutex_unlock( &p_sout
->lock
);
175 if( p_input
->id
== NULL
)
184 /*****************************************************************************
186 *****************************************************************************/
187 int sout_InputDelete( sout_packetizer_input_t
*p_input
)
189 sout_instance_t
*p_sout
= p_input
->p_sout
;
191 msg_Dbg( p_sout
, "removing a sout input (sout_input: %p)",
196 vlc_mutex_lock( &p_sout
->lock
);
197 p_sout
->p_stream
->pf_del( p_sout
->p_stream
, p_input
->id
);
198 vlc_mutex_unlock( &p_sout
->lock
);
203 return( VLC_SUCCESS
);
206 bool sout_InputIsEmpty( sout_packetizer_input_t
*p_input
)
208 sout_instance_t
*p_sout
= p_input
->p_sout
;
211 vlc_mutex_lock( &p_sout
->lock
);
212 if( sout_StreamControl( p_sout
->p_stream
, SOUT_STREAM_EMPTY
, &b
) != VLC_SUCCESS
)
214 vlc_mutex_unlock( &p_sout
->lock
);
218 void sout_InputFlush( sout_packetizer_input_t
*p_input
)
220 sout_instance_t
*p_sout
= p_input
->p_sout
;
222 vlc_mutex_lock( &p_sout
->lock
);
223 sout_StreamFlush( p_sout
->p_stream
, p_input
->id
);
224 vlc_mutex_unlock( &p_sout
->lock
);
227 /*****************************************************************************
229 *****************************************************************************/
230 int sout_InputSendBuffer( sout_packetizer_input_t
*p_input
,
233 sout_instance_t
*p_sout
= p_input
->p_sout
;
236 if( p_input
->id
== NULL
)
238 block_Release( p_buffer
);
242 vlc_mutex_lock( &p_sout
->lock
);
243 i_ret
= p_sout
->p_stream
->pf_send( p_sout
->p_stream
,
244 p_input
->id
, p_buffer
);
245 vlc_mutex_unlock( &p_sout
->lock
);
250 #undef sout_AccessOutNew
251 /*****************************************************************************
252 * sout_AccessOutNew: allocate a new access out
253 *****************************************************************************/
254 sout_access_out_t
*sout_AccessOutNew( vlc_object_t
*p_sout
,
255 const char *psz_access
, const char *psz_name
)
257 sout_access_out_t
*p_access
;
260 p_access
= vlc_custom_create( p_sout
, sizeof( *p_access
), "access out" );
264 psz_next
= config_ChainCreate( &p_access
->psz_access
, &p_access
->p_cfg
,
267 p_access
->psz_path
= strdup( psz_name
? psz_name
: "" );
268 p_access
->p_sys
= NULL
;
269 p_access
->pf_seek
= NULL
;
270 p_access
->pf_read
= NULL
;
271 p_access
->pf_write
= NULL
;
272 p_access
->pf_control
= NULL
;
273 p_access
->p_module
= NULL
;
276 module_need( p_access
, "sout access", p_access
->psz_access
, true );
278 if( !p_access
->p_module
)
280 free( p_access
->psz_access
);
281 free( p_access
->psz_path
);
282 vlc_object_release( p_access
);
288 /*****************************************************************************
289 * sout_AccessDelete: delete an access out
290 *****************************************************************************/
291 void sout_AccessOutDelete( sout_access_out_t
*p_access
)
293 if( p_access
->p_module
)
295 module_unneed( p_access
, p_access
->p_module
);
297 free( p_access
->psz_access
);
299 config_ChainDestroy( p_access
->p_cfg
);
301 free( p_access
->psz_path
);
303 vlc_object_release( p_access
);
306 /*****************************************************************************
308 *****************************************************************************/
309 int sout_AccessOutSeek( sout_access_out_t
*p_access
, off_t i_pos
)
311 return p_access
->pf_seek( p_access
, i_pos
);
314 /*****************************************************************************
316 *****************************************************************************/
317 ssize_t
sout_AccessOutRead( sout_access_out_t
*p_access
, block_t
*p_buffer
)
319 return( p_access
->pf_read
?
320 p_access
->pf_read( p_access
, p_buffer
) : VLC_EGENERIC
);
323 /*****************************************************************************
325 *****************************************************************************/
326 ssize_t
sout_AccessOutWrite( sout_access_out_t
*p_access
, block_t
*p_buffer
)
328 return p_access
->pf_write( p_access
, p_buffer
);
332 * sout_AccessOutControl
334 int sout_AccessOutControl (sout_access_out_t
*access
, int query
, ...)
339 va_start (ap
, query
);
340 if (access
->pf_control
)
341 ret
= access
->pf_control (access
, query
, ap
);
348 /*****************************************************************************
349 * sout_MuxNew: create a new mux
350 *****************************************************************************/
351 sout_mux_t
* sout_MuxNew( sout_instance_t
*p_sout
, const char *psz_mux
,
352 sout_access_out_t
*p_access
)
357 p_mux
= vlc_custom_create( p_sout
, sizeof( *p_mux
), "mux" );
361 p_mux
->p_sout
= p_sout
;
362 psz_next
= config_ChainCreate( &p_mux
->psz_mux
, &p_mux
->p_cfg
, psz_mux
);
365 p_mux
->p_access
= p_access
;
366 p_mux
->pf_control
= NULL
;
367 p_mux
->pf_addstream
= NULL
;
368 p_mux
->pf_delstream
= NULL
;
369 p_mux
->pf_mux
= NULL
;
370 p_mux
->i_nb_inputs
= 0;
371 p_mux
->pp_inputs
= NULL
;
374 p_mux
->p_module
= NULL
;
376 p_mux
->b_add_stream_any_time
= false;
377 p_mux
->b_waiting_stream
= true;
378 p_mux
->i_add_stream_start
= -1;
381 module_need( p_mux
, "sout mux", p_mux
->psz_mux
, true );
383 if( p_mux
->p_module
== NULL
)
385 FREENULL( p_mux
->psz_mux
);
387 vlc_object_release( p_mux
);
391 /* *** probe mux capacity *** */
392 if( p_mux
->pf_control
)
394 int b_answer
= false;
396 if( sout_MuxControl( p_mux
, MUX_CAN_ADD_STREAM_WHILE_MUXING
,
404 msg_Dbg( p_sout
, "muxer support adding stream at any time" );
405 p_mux
->b_add_stream_any_time
= true;
406 p_mux
->b_waiting_stream
= false;
408 /* If we control the output pace then it's better to wait before
409 * starting muxing (generates better streams/files). */
410 if( !p_sout
->i_out_pace_nocontrol
)
414 else if( sout_MuxControl( p_mux
, MUX_GET_ADD_STREAM_WAIT
,
422 msg_Dbg( p_sout
, "muxer prefers to wait for all ES before "
424 p_mux
->b_waiting_stream
= true;
432 /*****************************************************************************
434 *****************************************************************************/
435 void sout_MuxDelete( sout_mux_t
*p_mux
)
437 if( p_mux
->p_module
)
439 module_unneed( p_mux
, p_mux
->p_module
);
441 free( p_mux
->psz_mux
);
443 config_ChainDestroy( p_mux
->p_cfg
);
445 vlc_object_release( p_mux
);
448 /*****************************************************************************
450 *****************************************************************************/
451 sout_input_t
*sout_MuxAddStream( sout_mux_t
*p_mux
, const es_format_t
*p_fmt
)
453 sout_input_t
*p_input
;
455 if( !p_mux
->b_add_stream_any_time
&& !p_mux
->b_waiting_stream
)
457 msg_Err( p_mux
, "cannot add a new stream (unsupported while muxing "
458 "to this format). You can try increasing sout-mux-caching value" );
462 msg_Dbg( p_mux
, "adding a new input" );
464 /* create a new sout input */
465 p_input
= malloc( sizeof( sout_input_t
) );
469 // FIXME: remove either fmt or p_fmt...
470 es_format_Copy( &p_input
->fmt
, p_fmt
);
471 p_input
->p_fmt
= &p_input
->fmt
;
473 p_input
->p_fifo
= block_FifoNew();
474 p_input
->p_sys
= NULL
;
476 TAB_APPEND( p_mux
->i_nb_inputs
, p_mux
->pp_inputs
, p_input
);
477 if( p_mux
->pf_addstream( p_mux
, p_input
) < 0 )
479 msg_Err( p_mux
, "cannot add this stream" );
480 TAB_REMOVE( p_mux
->i_nb_inputs
, p_mux
->pp_inputs
, p_input
);
481 block_FifoRelease( p_input
->p_fifo
);
482 es_format_Clean( &p_input
->fmt
);
490 /*****************************************************************************
491 * sout_MuxDeleteStream:
492 *****************************************************************************/
493 void sout_MuxDeleteStream( sout_mux_t
*p_mux
, sout_input_t
*p_input
)
497 if( p_mux
->b_waiting_stream
498 && block_FifoCount( p_input
->p_fifo
) > 0 )
500 /* We stop waiting, and call the muxer for taking care of the data
501 * before we remove this es */
502 p_mux
->b_waiting_stream
= false;
503 p_mux
->pf_mux( p_mux
);
506 TAB_FIND( p_mux
->i_nb_inputs
, p_mux
->pp_inputs
, p_input
, i_index
);
509 p_mux
->pf_delstream( p_mux
, p_input
);
511 /* remove the entry */
512 TAB_REMOVE( p_mux
->i_nb_inputs
, p_mux
->pp_inputs
, p_input
);
514 if( p_mux
->i_nb_inputs
== 0 )
516 msg_Warn( p_mux
, "no more input streams for this mux" );
519 block_FifoRelease( p_input
->p_fifo
);
520 es_format_Clean( &p_input
->fmt
);
525 /*****************************************************************************
526 * sout_MuxSendBuffer:
527 *****************************************************************************/
528 int sout_MuxSendBuffer( sout_mux_t
*p_mux
, sout_input_t
*p_input
,
531 mtime_t i_dts
= p_buffer
->i_dts
;
532 block_FifoPut( p_input
->p_fifo
, p_buffer
);
534 if( p_mux
->p_sout
->i_out_pace_nocontrol
)
536 mtime_t current_date
= mdate();
537 if ( current_date
> i_dts
)
538 msg_Warn( p_mux
, "late buffer for mux input (%"PRId64
")",
539 current_date
- i_dts
);
542 if( p_mux
->b_waiting_stream
)
544 const int64_t i_caching
= var_GetInteger( p_mux
->p_sout
, "sout-mux-caching" ) * INT64_C(1000);
546 if( p_mux
->i_add_stream_start
< 0 )
547 p_mux
->i_add_stream_start
= i_dts
;
549 /* Wait until we have enough data before muxing */
550 if( p_mux
->i_add_stream_start
< 0 ||
551 i_dts
< p_mux
->i_add_stream_start
+ i_caching
)
553 p_mux
->b_waiting_stream
= false;
555 return p_mux
->pf_mux( p_mux
);
558 void sout_MuxFlush( sout_mux_t
*p_mux
, sout_input_t
*p_input
)
561 block_FifoEmpty( p_input
->p_fifo
);
564 /*****************************************************************************
565 * sout_MuxGetStream: find stream to be muxed
566 *****************************************************************************/
567 int sout_MuxGetStream( sout_mux_t
*p_mux
, unsigned i_blocks
, mtime_t
*pi_dts
)
572 assert( i_blocks
> 0 );
574 for( int i
= 0; i
< p_mux
->i_nb_inputs
; i
++ )
576 sout_input_t
*p_input
= p_mux
->pp_inputs
[i
];
579 if( block_FifoCount( p_input
->p_fifo
) < i_blocks
)
581 if( (!p_mux
->b_add_stream_any_time
) &&
582 (p_input
->p_fmt
->i_cat
!= SPU_ES
) )
586 /* FIXME: SPU muxing */
590 p_data
= block_FifoShow( p_input
->p_fifo
);
591 if( i_stream
< 0 || p_data
->i_dts
< i_dts
)
594 i_dts
= p_data
->i_dts
;
598 if( pi_dts
) *pi_dts
= i_dts
;
604 /*****************************************************************************
606 *****************************************************************************/
607 static int mrl_Parse( mrl_t
*p_mrl
, const char *psz_mrl
)
609 char * psz_dup
= strdup( psz_mrl
);
610 char * psz_parser
= psz_dup
;
611 const char * psz_access
;
612 const char * psz_way
;
615 /* *** first parse psz_dest */
616 while( *psz_parser
&& *psz_parser
!= ':' )
618 if( *psz_parser
== '{' )
620 while( *psz_parser
&& *psz_parser
!= '}' )
634 #if defined( _WIN32 ) || defined( __OS2__ )
635 if( psz_parser
- psz_dup
== 1 )
637 /* msg_Warn( p_sout, "drive letter %c: found in source string",
645 psz_access
= psz_way
= "";
650 *psz_parser
++ = '\0';
652 /* let's skip '//' */
653 if( psz_parser
[0] == '/' && psz_parser
[1] == '/' )
658 psz_name
= psz_parser
;
660 /* Come back to parse the access and mux plug-ins */
661 psz_parser
= psz_dup
;
668 else if( *psz_parser
== '/' )
676 psz_access
= psz_parser
;
678 while( *psz_parser
&& *psz_parser
!= '/' )
680 if( *psz_parser
== '{' )
682 while( *psz_parser
&& *psz_parser
!= '}' )
697 if( *psz_parser
== '/' )
699 *psz_parser
++ = '\0';
710 psz_way
= psz_parser
;
714 p_mrl
->psz_access
= strdup( psz_access
);
715 p_mrl
->psz_way
= strdup( psz_way
);
716 p_mrl
->psz_name
= strdup( psz_name
);
719 return( VLC_SUCCESS
);
723 /* mrl_Clean: clean p_mrl after a call to mrl_Parse */
724 static void mrl_Clean( mrl_t
*p_mrl
)
726 FREENULL( p_mrl
->psz_access
);
727 FREENULL( p_mrl
->psz_way
);
728 FREENULL( p_mrl
->psz_name
);
732 /****************************************************************************
733 ****************************************************************************
737 ****************************************************************************
738 ****************************************************************************/
740 /* Destroy a "stream_out" module */
741 static void sout_StreamDelete( sout_stream_t
*p_stream
)
743 sout_instance_t
*p_sout
= (sout_instance_t
*)(p_stream
->obj
.parent
);
745 msg_Dbg( p_stream
, "destroying chain... (name=%s)", p_stream
->psz_name
);
747 p_sout
->i_out_pace_nocontrol
-= p_stream
->pace_nocontrol
;
749 if( p_stream
->p_module
!= NULL
)
750 module_unneed( p_stream
, p_stream
->p_module
);
752 FREENULL( p_stream
->psz_name
);
754 config_ChainDestroy( p_stream
->p_cfg
);
756 msg_Dbg( p_stream
, "destroying chain done" );
757 vlc_object_release( p_stream
);
760 /* Destroy a "stream_out" modules chain
762 * p_first is the first module to be destroyed in the chain
763 * p_last is the last module to be destroyed
764 * if NULL, all modules are destroyed
765 * if not NULL, modules following it must be destroyed separately
767 void sout_StreamChainDelete(sout_stream_t
*p_first
, sout_stream_t
*p_last
)
769 while(p_first
!= NULL
)
771 sout_stream_t
*p_next
= p_first
->p_next
;
773 sout_StreamDelete(p_first
);
774 if(p_first
== p_last
)
780 /* Create a "stream_out" module, which may forward its ES to p_next module */
782 * XXX name and p_cfg are used (-> do NOT free them)
784 static sout_stream_t
*sout_StreamNew( sout_instance_t
*p_sout
, char *psz_name
,
785 config_chain_t
*p_cfg
, sout_stream_t
*p_next
)
787 sout_stream_t
*p_stream
;
791 p_stream
= vlc_custom_create( p_sout
, sizeof( *p_stream
), "stream out" );
795 p_stream
->p_sout
= p_sout
;
796 p_stream
->psz_name
= psz_name
;
797 p_stream
->p_cfg
= p_cfg
;
798 p_stream
->p_next
= p_next
;
799 p_stream
->pf_flush
= NULL
;
800 p_stream
->pf_control
= NULL
;
801 p_stream
->pace_nocontrol
= false;
802 p_stream
->p_sys
= NULL
;
804 msg_Dbg( p_sout
, "stream=`%s'", p_stream
->psz_name
);
807 module_need( p_stream
, "sout stream", p_stream
->psz_name
, true );
809 if( !p_stream
->p_module
)
811 /* those must be freed by the caller if creation failed */
812 p_stream
->psz_name
= NULL
;
813 p_stream
->p_cfg
= NULL
;
815 sout_StreamDelete( p_stream
);
819 p_sout
->i_out_pace_nocontrol
+= p_stream
->pace_nocontrol
;
823 /* Creates a complete "stream_out" modules chain
825 * chain format: module1{option=*:option=*}[:module2{option=*:...}]
827 * The modules are created starting from the last one and linked together
828 * A pointer to the last module created is stored if pp_last isn't NULL, to
829 * make sure sout_StreamChainDelete doesn't delete modules created in another
832 * Returns a pointer to the first module.
834 sout_stream_t
*sout_StreamChainNew(sout_instance_t
*p_sout
, const char *psz_chain
,
835 sout_stream_t
*p_next
, sout_stream_t
**pp_last
)
837 if(!psz_chain
|| !*psz_chain
)
839 if(pp_last
) *pp_last
= NULL
;
843 char *psz_parser
= strdup(psz_chain
);
847 vlc_array_t cfg
, name
;
848 vlc_array_init(&cfg
);
849 vlc_array_init(&name
);
854 config_chain_t
*p_cfg
;
856 char *psz_rest_chain
= config_ChainCreate( &psz_name
, &p_cfg
, psz_parser
);
858 psz_parser
= psz_rest_chain
;
860 vlc_array_append(&cfg
, p_cfg
);
861 vlc_array_append(&name
, psz_name
);
864 size_t i
= vlc_array_count(&name
);
866 vlc_array_init(&module
);
869 p_next
= sout_StreamNew( p_sout
, vlc_array_item_at_index(&name
, i
),
870 vlc_array_item_at_index(&cfg
, i
), p_next
);
875 if(i
== vlc_array_count(&name
) - 1 && pp_last
)
876 *pp_last
= p_next
; /* last module created in the chain */
878 vlc_array_append(&module
, p_next
);
881 vlc_array_clear(&name
);
882 vlc_array_clear(&cfg
);
883 vlc_array_clear(&module
);
889 i
++; /* last module couldn't be created */
891 /* destroy all modules created, starting with the last one */
892 int modules
= vlc_array_count(&module
);
894 sout_StreamDelete(vlc_array_item_at_index(&module
, modules
));
895 vlc_array_clear(&module
);
897 /* then destroy all names and config which weren't destroyed by
898 * sout_StreamDelete */
901 free(vlc_array_item_at_index(&name
, i
));
902 config_ChainDestroy(vlc_array_item_at_index(&cfg
, i
));
904 vlc_array_clear(&name
);
905 vlc_array_clear(&cfg
);
910 static char *sout_stream_url_to_chain( bool b_sout_display
,
911 const char *psz_url
)
916 mrl_Parse( &mrl
, psz_url
);
918 /* Check if the URLs goes to #rtp - otherwise we'll use #standard */
919 static const char rtplist
[] = "dccp\0sctp\0tcp\0udplite\0";
920 for (const char *a
= rtplist
; *a
; a
+= strlen (a
) + 1)
921 if (strcmp (a
, mrl
.psz_access
) == 0)
924 if (strcmp (mrl
.psz_access
, "rtp") == 0)
927 /* For historical reasons, rtp:// means RTP over UDP */
928 strcpy (mrl
.psz_access
, "udp");
930 if (mrl
.psz_name
[0] == '[')
932 port
= strstr (mrl
.psz_name
, "]:");
937 port
= strchr (mrl
.psz_name
, ':');
939 *port
++ = '\0'; /* erase ':' */
941 if (asprintf (&psz_chain
,
942 "rtp{mux=\"%s\",proto=\"%s\",dst=\"%s%s%s\"}",
943 mrl
.psz_way
, mrl
.psz_access
, mrl
.psz_name
,
944 port
? "\",port=\"" : "", port
? port
: "") == -1)
949 /* Convert the URL to a basic standard sout chain */
950 if (asprintf (&psz_chain
,
951 "standard{mux=\"%s\",access=\"%s\",dst=\"%s\"}",
952 mrl
.psz_way
, mrl
.psz_access
, mrl
.psz_name
) == -1)
956 /* Duplicate and wrap if sout-display is on */
957 if (psz_chain
&& b_sout_display
)
960 if (asprintf (&tmp
, "duplicate{dst=display,dst=%s}", psz_chain
) == -1)
970 #undef sout_EncoderCreate
971 encoder_t
*sout_EncoderCreate( vlc_object_t
*p_this
)
973 return vlc_custom_create( p_this
, sizeof( encoder_t
), "encoder" );