]> git.sesse.net Git - vlc/blob - modules/gui/qt4/dialogs/sout.cpp
Try to fix Sout Dialog ( Part 1 )
[vlc] / modules / gui / qt4 / dialogs / sout.cpp
1 /*****************************************************************************
2  * sout.cpp : Stream output dialog ( old-style )
3  ****************************************************************************
4  * Copyright (C) 2007-2008 the VideoLAN team
5  * Copyright (C) 2007 Société des arts technologiques
6  * Copyright (C) 2007 Savoir-faire Linux
7  *
8  * $Id$
9  *
10  * Authors: Clément Stenac <zorglub@videolan.org>
11  *          Jean-Baptiste Kempf <jb@videolan.org>
12  *          Jean-François Massol <jf.massol -at- gmail.com>
13  *          Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
14  *
15  * This program is free software; you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License as published by
17  * the Free Software Foundation; either version 2 of the License, or
18  * ( at your option ) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, write to the Free Software
27  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
28  *****************************************************************************/
29
30 #ifdef HAVE_CONFIG_H
31 # include "config.h"
32 #endif
33
34 #include "dialogs/sout.hpp"
35
36 #include <QString>
37 #include <QFileDialog>
38
39 struct streaming_account_t
40 {
41     char *psz_username; /*< username of account */
42     char *psz_password; /*< password of account */
43 };
44
45 struct sout_gui_descr_t
46 {
47     /* Access types */
48     bool b_local;   /*< local access module */
49     bool b_file;    /*< file access module */
50     bool b_http;    /*< http access module */
51     bool b_mms;     /*< mms access module */
52     bool b_rtp;     /*< rtp access module */
53     bool b_udp;     /*< udp access module */
54     bool b_dump;    /*< dump access module */
55     bool b_icecast; /*< icecast access module */
56
57     char *psz_file;     /*< filename */
58     char *psz_http;     /*< HTTP servername or ipaddress */
59     char *psz_mms;      /*< MMS servername or ipaddress */
60     char *psz_rtp;      /*< RTP servername or ipaddress */
61     char *psz_udp;      /*< UDP servername or ipaddress */
62     char *psz_icecast;  /*< Icecast servername or ipaddress*/
63
64     int32_t i_http;     /*< http port number */
65     int32_t i_mms;      /*< mms port number */
66     int32_t i_rtp;      /*< rtp port number */
67     int32_t i_udp;      /*< udp port number */
68     int32_t i_icecast;  /*< icecast port number */
69
70     /* Mux */
71     char *psz_mux;      /*< name of muxer to use in streaming */
72
73     /* Transcode */
74     bool b_soverlay; /*< enable burning overlay in the video */
75     char *psz_vcodec;   /*< video codec to use in transcoding */
76     char *psz_acodec;   /*< audio codec to use in transcoding */
77     char *psz_scodec;   /*< subtitle codec to use in transcoding */
78     int32_t i_vb;       /*< video bitrate to use in transcoding */
79     int32_t i_ab;       /*< audio bitrate to use in transcoding */
80     int32_t i_channels; /*< number of audio channels to use in transcoding */
81     float f_scale;      /*< scaling factor to use in transcoding */
82
83     /* Misc */
84     bool b_sap;   /*< send SAP announcement */
85     bool b_all_es;/*< send all elementary streams from source stream */
86     char *psz_group;    /*< SAP Group name */
87     char *psz_name;     /*< SAP name */
88     int32_t i_ttl;      /*< Time To Live (TTL) for network traversal */
89
90     /* Icecast */
91     char *psz_icecast_mountpoint;/*< path to Icecast mountpoint */
92     struct streaming_account_t sa_icecast;  /*< Icecast account information */
93 };
94
95 SoutDialog* SoutDialog::instance = NULL;
96
97 SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf,
98                      bool _transcode_only ) : QVLCDialog( parent,  _p_intf )
99 {
100     setWindowTitle( qtr( "Stream Output" ) );
101
102     b_transcode_only = _transcode_only;
103
104     /* UI stuff */
105     ui.setupUi( this );
106
107     changeUDPandRTPmess( false );
108
109 /* ADD HERE for new profiles */
110 #define ADD_PROFILE( name, shortname ) ui.profileBox->addItem( qtr( name ), QVariant( QString( shortname ) ) );
111     ADD_PROFILE( "Custom" , "Custom" )
112     ADD_PROFILE( "IPod (mp4/aac)", "IPod" )
113     ADD_PROFILE( "XBox", "XBox" )
114     ADD_PROFILE( "Windows (wmv/asf)", "Windows" )
115     ADD_PROFILE( "PSP", "PSP")
116     ADD_PROFILE( "GSM", "GSM" )
117
118 #define ADD_VCODEC( name, fourcc ) ui.vCodecBox->addItem( name, QVariant( fourcc ) );
119     ADD_VCODEC( "MPEG-1", "mp1v" )
120     ADD_VCODEC( "MPEG-2", "mp2v" )
121     ADD_VCODEC( "MPEG-4", "mp4v" )
122     ADD_VCODEC( "DIVX 1" , "DIV1" )
123     ADD_VCODEC( "DIVX 2" , "DIV2" )
124     ADD_VCODEC( "DIVX 3" , "DIV3" )
125     ADD_VCODEC( "H-263", "H263" )
126     ADD_VCODEC( "H-264", "h264" )
127     ADD_VCODEC( "WMV1", "WMV1" )
128     ADD_VCODEC( "WMV2" , "WMV2" )
129     ADD_VCODEC( "M-JPEG", "MJPG" )
130     ADD_VCODEC( "Theora", "theo" )
131
132 #define ADD_ACODEC( name, fourcc ) ui.aCodecBox->addItem( name, QVariant( fourcc ) );
133     ADD_ACODEC( "MPEG Audio", "mpga" )
134     ADD_ACODEC( "MP3", "mp3" )
135     ADD_ACODEC( "MPEG 4 Audio ( AAC )", "mp4a" )
136     ADD_ACODEC( "A52/AC-3", "a52" )
137     ADD_ACODEC( "Vorbis", "vorb" )
138     ADD_ACODEC( "Flac", "flac" )
139     ADD_ACODEC( "Speex", "spx" )
140     ADD_ACODEC( "WAV", "s16l" )
141     ADD_ACODEC( "WMA", "wma" )
142
143 #define ADD_SCALING( factor ) ui.vScaleBox->addItem( factor );
144     ADD_SCALING( "0.25" )
145     ADD_SCALING( "0.5" )
146     ADD_SCALING( "0.75" )
147     ADD_SCALING( "1" )
148     ADD_SCALING( "1.25" )
149     ADD_SCALING( "1.5" )
150     ADD_SCALING( "1.75" )
151     ADD_SCALING( "2" )
152
153     ui.mrlEdit->setToolTip ( qtr( "Stream output string.\n"
154                 "This is automatically generated "
155                  "when you change the above settings,\n"
156                  "but you can update it manually." ) ) ;
157
158 //     /* Connect everything to the updateMRL function */
159  #define CB( x ) CONNECT( ui.x, toggled( bool ), this, updateMRL() );
160  #define CT( x ) CONNECT( ui.x, textChanged( const QString ), this, updateMRL() );
161  #define CS( x ) CONNECT( ui.x, valueChanged( int ), this, updateMRL() );
162  #define CC( x ) CONNECT( ui.x, currentIndexChanged( int ), this, updateMRL() );
163 //     /* Output */
164     CB( fileOutput ); CB( HTTPOutput ); CB( localOutput );
165     CB( RTPOutput ); CB( MMSHOutput ); CB( rawInput ); CB( UDPOutput );
166     CT( fileEdit ); CT( HTTPEdit ); CT( RTPEdit ); CT( MMSHEdit ); CT( UDPEdit );
167     CT( IcecastEdit ); CT( IcecastMountpointEdit ); CT( IcecastNamePassEdit );
168     CS( HTTPPort ); CS( RTPPort ); CS( MMSHPort ); CS( UDPPort );
169 //     /* Transcode */
170     CC( vCodecBox ); CC( subsCodecBox ); CC( aCodecBox ) ;
171     CB( transcodeVideo ); CB( transcodeAudio ); CB( transcodeSubs );
172 //     CB( sOverlay );
173     CS( vBitrateSpin ); CS( aBitrateSpin ); CS( aChannelsSpin ); CC( vScaleBox );
174 //     /* Mux */
175     CB( PSMux ); CB( TSMux ); CB( MPEG1Mux ); CB( OggMux ); CB( ASFMux );
176     CB( MP4Mux ); CB( MOVMux ); CB( WAVMux ); CB( RAWMux ); CB( FLVMux );
177 //     /* Misc */
178     CB( soutAll ); CS( ttl ); CT( sapName ); CT( sapGroup );
179 //
180     CONNECT( ui.profileBox, activated( const QString & ), this, setOptions() );
181     CONNECT( ui.fileSelectButton, clicked() , this, fileBrowse()  );
182     CONNECT( ui.transcodeVideo, toggled( bool ), this, setVTranscodeOptions( bool ) );
183     CONNECT( ui.transcodeAudio, toggled( bool ), this, setATranscodeOptions( bool ) );
184     CONNECT( ui.transcodeSubs, toggled( bool ), this, setSTranscodeOptions( bool ) );
185     CONNECT( ui.rawInput, toggled( bool ), this, setRawOptions( bool ) );
186
187     okButton = new QPushButton( qtr( "&Stream" ) );
188     QPushButton *cancelButton = new QPushButton( qtr( "&Cancel" ) );
189
190     okButton->setDefault( true );
191     ui.acceptButtonBox->addButton( okButton, QDialogButtonBox::AcceptRole );
192     ui.acceptButtonBox->addButton( cancelButton, QDialogButtonBox::RejectRole );
193
194     BUTTONACT( okButton, ok() );
195     BUTTONACT( cancelButton, cancel() );
196
197     if( b_transcode_only ) toggleSout();
198
199     CONNECT( ui.UDPOutput, toggled( bool ), this, changeUDPandRTPmess( bool ) );}
200
201 void SoutDialog::fileBrowse()
202 {
203     QString fileName = QFileDialog::getSaveFileName( this, qtr( "Save file" ), "",
204         qtr( "Containers (*.ps *.ts *.mpg *.ogg *.asf *.mp4 *.mov *.wav *.raw *.flv)" ) );
205     ui.fileEdit->setText( fileName );
206     updateMRL();
207 }
208
209 void SoutDialog::setVTranscodeOptions( bool b_trans )
210 {
211     ui.vCodecLabel->setEnabled( b_trans );
212     ui.vCodecBox->setEnabled( b_trans );
213     ui.vBitrateLabel->setEnabled( b_trans );
214     ui.vBitrateSpin->setEnabled( b_trans );
215     ui.vScaleLabel->setEnabled( b_trans );
216     ui.vScaleBox->setEnabled( b_trans );
217 }
218
219 void SoutDialog::setATranscodeOptions( bool b_trans )
220 {
221     ui.aCodecLabel->setEnabled( b_trans );
222     ui.aCodecBox->setEnabled( b_trans );
223     ui.aBitrateLabel->setEnabled( b_trans );
224     ui.aBitrateSpin->setEnabled( b_trans );
225     ui.aChannelsLabel->setEnabled( b_trans );
226     ui.aChannelsSpin->setEnabled( b_trans );
227 }
228
229 void SoutDialog::setSTranscodeOptions( bool b_trans )
230 {
231     ui.subsCodecBox->setEnabled( b_trans );
232     ui.subsOverlay->setEnabled( b_trans );
233 }
234
235 void SoutDialog::setRawOptions( bool b_raw )
236 {
237     if( b_raw )
238         ui.tabWidget->setDisabled( true );
239     else
240         SoutDialog::setOptions();
241 }
242
243 void SoutDialog::setOptions()
244 {
245     QString profileString =
246         ui.profileBox->itemData( ui.profileBox->currentIndex() ).toString();
247     msg_Dbg( p_intf, "Profile Used: %s",  qta( profileString ));
248     int index;
249
250 #define setProfile( muxName, hasVideo, vCodecName, hasAudio, aCodecName ) \
251     { \
252         ui.muxName ##Mux->setChecked( true ); \
253         \
254         ui.transcodeAudio->setChecked( hasAudio ); \
255         index = ui.aCodecBox->findText( vCodecName );  \
256         if( index >= 0 ) ui.aCodecBox->setCurrentIndex( index ); \
257         \
258         ui.transcodeVideo->setChecked( hasVideo ); \
259         index = ui.aCodecBox->findText( vCodecName );  \
260         if( index >=0 ) ui.vCodecBox->setCurrentIndex( index ); \
261     }
262
263     /* ADD HERE the profiles you want and need */
264     /* FIXME */
265     if( profileString == "IPod" ) setProfile( MP4, true, "mp4a", true, "mp4v" )
266     else if( profileString == "XBox" ) setProfile( ASF, true, "wma", true, "WMV2" )
267
268         /* If the profile is not a custom one, then disable the tabWidget */
269         if ( profileString == "Custom" )
270             ui.tabWidget->setEnabled( true );
271         else
272             ui.tabWidget->setDisabled( true );
273
274     /* Update the MRL !! */
275     updateMRL();
276 }
277
278 //FIXME
279 void SoutDialog::toggleSout()
280 {
281     //Toggle all the streaming options.
282     TOGGLEV( ui.HTTPOutput ) ; TOGGLEV( ui.RTPOutput ) ; TOGGLEV( ui.MMSHOutput ) ; TOGGLEV( ui.UDPOutput ) ;
283     TOGGLEV( ui.HTTPEdit ) ; TOGGLEV( ui.RTPEdit ) ; TOGGLEV( ui.MMSHEdit ) ; TOGGLEV( ui.UDPEdit ) ;
284     TOGGLEV( ui.HTTPLabel ) ; TOGGLEV( ui.RTPLabel ) ; TOGGLEV( ui.MMSHLabel ) ; TOGGLEV( ui.UDPLabel ) ;
285     TOGGLEV( ui.HTTPPortLabel ) ; TOGGLEV( ui.RTPPortLabel ) ; TOGGLEV( ui.MMSHPortLabel ) ; TOGGLEV( ui.UDPPortLabel )
286     TOGGLEV( ui.HTTPPort ) ; TOGGLEV( ui.RTPPort ) ; TOGGLEV( ui.MMSHPort ) ; TOGGLEV( ui.UDPPort ) ;
287
288     TOGGLEV( ui.sap ); TOGGLEV( ui.sapName );
289     TOGGLEV( ui.sapGroup ); TOGGLEV( ui.sapGroupLabel );
290     TOGGLEV( ui.ttlLabel ); TOGGLEV( ui.ttl );
291
292     if( b_transcode_only ) okButton->setText( "&Save" );
293     else okButton->setText( "&Stream" );
294
295     updateGeometry();
296 }
297
298 void SoutDialog::changeUDPandRTPmess( bool b_udp )
299 {
300     ui.RTPEdit->setVisible( !b_udp );
301     ui.RTPLabel->setVisible( !b_udp );
302     ui.RTPPort->setVisible( !b_udp );
303     ui.RTPPortLabel->setVisible( !b_udp );
304     ui.UDPEdit->setVisible( b_udp );
305     ui.UDPLabel->setVisible( b_udp );
306     ui.UDPPortLabel->setText( b_udp ? qtr( "Port:") : qtr( "Video Port:" ) );
307     ui.RTPPortLabel->setText( b_udp ? qtr( "Port:") : qtr( "Audio Port:" ) );
308 }
309
310 void SoutDialog::ok()
311 {
312     mrl = ui.mrlEdit->text();
313     accept();
314 }
315
316 void SoutDialog::cancel()
317 {
318     mrl.clear();
319     reject();
320 }
321
322 void SoutDialog::updateMRL()
323 {
324     sout_gui_descr_t sout;
325     memset( &sout, 0, sizeof( sout_gui_descr_t ) );
326     unsigned int counter = 0;
327
328     sout.b_local = ui.localOutput->isChecked();
329     sout.b_file = ui.fileOutput->isChecked();
330     sout.b_http = ui.HTTPOutput->isChecked();
331     sout.b_mms = ui.MMSHOutput->isChecked();
332     sout.b_icecast = ui.IcecastOutput->isChecked();
333     sout.b_rtp = ui.RTPOutput->isChecked();
334     sout.b_udp = ui.UDPOutput->isChecked();
335     sout.b_sap = ui.sap->isChecked();
336     sout.b_all_es = ui.soutAll->isChecked();
337     sout.psz_vcodec = strdup( qtu( ui.vCodecBox->itemData( ui.vCodecBox->currentIndex() ).toString() ) );
338     sout.psz_acodec = strdup( qtu( ui.aCodecBox->itemData( ui.aCodecBox->currentIndex() ).toString() ) );
339     sout.psz_scodec = strdup( qtu( ui.subsCodecBox->itemData( ui.subsCodecBox->currentIndex() ).toString() ) );
340     sout.psz_file = strdup( qtu( ui.fileEdit->text() ) );
341     sout.psz_http = strdup( qtu( ui.HTTPEdit->text() ) );
342     sout.psz_mms = strdup( qtu( ui.MMSHEdit->text() ) );
343     sout.psz_rtp = strdup( qtu( ui.RTPEdit->text() ) );
344     sout.psz_udp = strdup( qtu( ui.UDPEdit->text() ) );
345     sout.psz_icecast = strdup( qtu( ui.IcecastEdit->text() ) );
346     sout.sa_icecast.psz_username = strdup( qtu( ui.IcecastNamePassEdit->text() ) );
347     sout.sa_icecast.psz_password = strdup( qtu( ui.IcecastNamePassEdit->text() ) );
348     sout.psz_icecast_mountpoint = strdup( qtu( ui.IcecastMountpointEdit->text() ) );
349     sout.i_http = ui.HTTPPort->value();
350     sout.i_mms = ui.MMSHPort->value();
351     sout.i_rtp = ui.RTPPort->value();
352     sout.i_udp = ui.UDPPort->value();
353     sout.i_icecast = ui.IcecastPort->value();
354     sout.i_ab = ui.aBitrateSpin->value();
355     sout.i_vb = ui.vBitrateSpin->value();
356     sout.i_channels = ui.aChannelsSpin->value();
357     sout.f_scale = atof( qta( ui.vScaleBox->currentText() ) );
358     sout.psz_group = strdup( qtu( ui.sapGroup->text() ) );
359     sout.psz_name = strdup( qtu( ui.sapName->text() ) );
360
361     if ( sout.b_local ) counter++ ;
362     if ( sout.b_file ) counter++ ;
363     if ( sout.b_http ) counter++ ;
364     if ( sout.b_mms ) counter++ ;
365     if ( sout.b_rtp ) counter++ ;
366     if ( sout.b_udp ) counter ++;
367     if ( sout.b_icecast ) counter ++;
368
369 #define SMUX( x, txt ) if( ui.x->isChecked() ) sout.psz_mux = strdup( txt );
370     SMUX( PSMux, "ps" );
371     SMUX( TSMux, "ts" );
372     SMUX( MPEG1Mux, "mpeg" );
373     SMUX( OggMux, "ogg" );
374     SMUX( ASFMux, "asf" );
375     SMUX( MP4Mux, "mp4" );
376     SMUX( MOVMux, "mov" );
377     SMUX( WAVMux, "wav" );
378     SMUX( RAWMux, "raw" );
379     SMUX( FLVMux, "flv" );
380     SMUX( MKVMux, "mkv" );
381
382     bool trans = false;
383     bool more = false;
384
385     if ( ui.transcodeVideo->isChecked() || ui.transcodeAudio->isChecked() )
386     {
387         if ( ui.transcodeVideo->isChecked() )
388         {
389             mrl = ":sout=#transcode{";
390             mrl.append( "vcodec=" );
391             mrl.append( sout.psz_vcodec );
392             mrl.append( "," );
393             mrl.append( "vb=" );
394             mrl.append( QString::number( sout.i_vb,10 ) );
395             mrl.append( "," );
396             mrl.append( "scale=" );
397             mrl.append( QString::number( sout.f_scale ) );
398             trans = true;
399         }
400
401         if ( ui.transcodeAudio->isChecked() )
402         {
403             if ( trans )
404             {
405                 mrl.append( "," );
406             }
407             else
408             {
409                 mrl = ":sout=#transcode{";
410             }
411             mrl.append( "acodec=" );
412             mrl.append( sout.psz_acodec );
413             mrl.append( "," );
414             mrl.append( "ab=" );
415             mrl.append( QString::number( sout.i_ab,10 ) );
416             mrl.append( "," );
417             mrl.append( "channels=" );
418             mrl.append( QString::number( sout.i_channels,10 ) );
419             trans = true;
420         }
421         mrl.append( "}" );
422     }
423
424     if ( sout.b_local || sout.b_file || sout.b_http ||
425          sout.b_mms || sout.b_rtp || sout.b_udp )
426     {
427
428 #define ISMORE() if ( more ) mrl.append( "," );
429 #define ATLEASTONE() if ( counter ) mrl.append( "dst=" );
430
431 #define CHECKMUX() \
432        if( sout.psz_mux ) \
433        {                  \
434          mrl.append( ",mux=");\
435          mrl.append( sout.psz_mux ); \
436        }
437
438         if ( trans )
439         {
440             mrl.append( ":" );
441         }
442         else
443         {
444             mrl = ":sout=#";
445         }
446
447         if ( counter )
448         {
449             mrl.append( "duplicate{" );
450         }
451
452         if ( sout.b_local )
453         {
454             ISMORE();
455             ATLEASTONE()
456                 mrl.append( "display" );
457             more = true;
458         }
459
460         if ( sout.b_file )
461         {
462             ISMORE();
463             ATLEASTONE()
464                 mrl.append( "std{access=file" );
465             CHECKMUX();
466             mrl.append( ",dst=" );
467             mrl.append( sout.psz_file );
468             mrl.append( "}" );
469             more = true;
470         }
471
472         if ( sout.b_http )
473         {
474             ISMORE();
475             ATLEASTONE()
476                 mrl.append( "std{access=http" );
477             CHECKMUX();
478             mrl.append( ",dst=" );
479             mrl.append( sout.psz_http );
480             mrl.append( ":" );
481             mrl.append( QString::number( sout.i_http,10 ) );
482             mrl.append( "}" );
483             more = true;
484         }
485
486         if ( sout.b_mms )
487         {
488             ISMORE();
489             ATLEASTONE()
490                 mrl.append( "std{access=mmsh" );
491             CHECKMUX();
492             mrl.append( ",dst=" );
493             mrl.append( sout.psz_mms );
494             mrl.append( ":" );
495             mrl.append( QString::number( sout.i_mms,10 ) );
496             mrl.append( "}" );
497             more = true;
498         }
499
500         if ( sout.b_rtp )
501         {
502             ISMORE();
503             ATLEASTONE()
504                 mrl.append( "rtp{" );
505             CHECKMUX();
506             mrl.append( ",dst=" );
507             mrl.append( sout.psz_rtp );
508             mrl.append( ":" );
509             mrl.append( QString::number( sout.i_rtp,10 ) );
510             mrl.append( "}" );
511             more = true;
512         }
513
514         if ( sout.b_udp )
515         {
516             ISMORE();
517             ATLEASTONE()
518             mrl.append( "std{access=udp" );
519             CHECKMUX();
520             mrl.append( ",dst=" );
521             mrl.append( sout.psz_udp );
522             mrl.append( ":" );
523             mrl.append( QString::number( sout.i_udp,10 ) );
524             if ( sout.b_sap )
525             {
526                 mrl.append( ",sap," );
527                 mrl.append( "group=\"" );
528                 mrl.append( sout.psz_group );
529                 mrl.append( "\"," );
530                 mrl.append( "name=\"" );
531                 mrl.append( sout.psz_name );
532                 mrl.append( "\"" );
533             }
534             mrl.append( "}" );
535             more = true;
536         }
537
538         if( sout.b_icecast )
539         {
540             // TODO
541         }
542
543         if ( counter )
544         {
545             mrl.append( "}" );
546         }
547     }
548
549 #undef CHECKMUX
550
551     if ( sout.b_all_es )
552         mrl.append( ":sout-all" );
553
554     ui.mrlEdit->setText( mrl );
555     free( sout.psz_acodec ); free( sout.psz_vcodec ); free( sout.psz_scodec );
556     free( sout.psz_file );free( sout.psz_http ); free( sout.psz_mms );
557     free( sout.psz_rtp ); free( sout.psz_udp ); free( sout.psz_mux );
558     free( sout.psz_name ); free( sout.psz_group );
559     free( sout.psz_icecast ); free( sout.psz_icecast_mountpoint );
560     free( sout.sa_icecast.psz_password ); free( sout.sa_icecast.psz_username );
561 }