Commit 860fdb79 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Sout: icecast patch mostly rewritten...

parent 068b5be2
...@@ -2,11 +2,15 @@ ...@@ -2,11 +2,15 @@
* sout.cpp : Stream output dialog ( old-style ) * sout.cpp : Stream output dialog ( old-style )
**************************************************************************** ****************************************************************************
* Copyright ( C ) 2006 the VideoLAN team * Copyright ( C ) 2006 the VideoLAN team
* Copyright (C) 2007 Société des arts technologiques
* Copyright (C) 2007 Savoir-faire Linux
*
* $Id$ * $Id$
* *
* Authors: Clément Stenac <zorglub@videolan.org> * Authors: Clément Stenac <zorglub@videolan.org>
* Jean-Baptiste Kempf <jb@videolan.org> * Jean-Baptiste Kempf <jb@videolan.org>
* Jean-François Massol <jf.massol -at- gmail.com> * Jean-François Massol <jf.massol -at- gmail.com>
* Pierre-Luc Beaudoin <pierre-luc.beaudoin@savoirfairelinux.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -95,20 +99,21 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, ...@@ -95,20 +99,21 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf,
#define CS( x ) CONNECT( ui.x, valueChanged( int ), this, updateMRL() ); #define CS( x ) CONNECT( ui.x, valueChanged( int ), this, updateMRL() );
#define CC( x ) CONNECT( ui.x, currentIndexChanged( int ), this, updateMRL() ); #define CC( x ) CONNECT( ui.x, currentIndexChanged( int ), this, updateMRL() );
// /* Output */ // /* Output */
CB( fileOutput ); CB( HTTPOutput ); CB( localOutput ); CB( fileOutput ); CB( HTTPOutput ); CB( localOutput );
CB( RTPOutput ); CB( MMSHOutput ); CB( rawInput ); CB( UDPOutput ); CB( RTPOutput ); CB( MMSHOutput ); CB( rawInput ); CB( UDPOutput );
CT( fileEdit ); CT( HTTPEdit ); CT( RTPEdit ); CT( MMSHEdit ); CT( UDPEdit ); CT( fileEdit ); CT( HTTPEdit ); CT( RTPEdit ); CT( MMSHEdit ); CT( UDPEdit );
CS( HTTPPort ); CS( RTPPort ); CS( MMSHPort ); CS( UDPPort ); CT( IcecastEdit ); CT( IcecastMountpointEdit ); CT( IcecastNamePassEdit );
CS( HTTPPort ); CS( RTPPort ); CS( MMSHPort ); CS( UDPPort );
// /* Transcode */ // /* Transcode */
CC( vCodecBox ); CC( subsCodecBox ); CC( aCodecBox ) ; CC( vCodecBox ); CC( subsCodecBox ); CC( aCodecBox ) ;
CB( transcodeVideo ); CB( transcodeAudio ); CB( transcodeSubs ); CB( transcodeVideo ); CB( transcodeAudio ); CB( transcodeSubs );
// CB( sOverlay ); // CB( sOverlay );
CS( vBitrateSpin ); CS( aBitrateSpin ); CS( aChannelsSpin ); CC( vScaleBox ); CS( vBitrateSpin ); CS( aBitrateSpin ); CS( aChannelsSpin ); CC( vScaleBox );
// /* Mux */ // /* Mux */
CB( PSMux ); CB( TSMux ); CB( MPEG1Mux ); CB( OggMux ); CB( ASFMux ); CB( PSMux ); CB( TSMux ); CB( MPEG1Mux ); CB( OggMux ); CB( ASFMux );
CB( MP4Mux ); CB( MOVMux ); CB( WAVMux ); CB( RAWMux ); CB( FLVMux ); CB( MP4Mux ); CB( MOVMux ); CB( WAVMux ); CB( RAWMux ); CB( FLVMux );
// /* Misc */ // /* Misc */
CB( soutAll ); CS( ttl ); CT( sapName ); CT( sapGroup ); CB( soutAll ); CS( ttl ); CT( sapName ); CT( sapGroup );
// //
CONNECT( ui.profileBox, activated( const QString & ), this, setOptions() ); CONNECT( ui.profileBox, activated( const QString & ), this, setOptions() );
CONNECT( ui.fileSelectButton, clicked() , this, fileBrowse() ); CONNECT( ui.fileSelectButton, clicked() , this, fileBrowse() );
...@@ -259,6 +264,7 @@ void SoutDialog::updateMRL() ...@@ -259,6 +264,7 @@ void SoutDialog::updateMRL()
sout.b_file = ui.fileOutput->isChecked(); sout.b_file = ui.fileOutput->isChecked();
sout.b_http = ui.HTTPOutput->isChecked(); sout.b_http = ui.HTTPOutput->isChecked();
sout.b_mms = ui.MMSHOutput->isChecked(); sout.b_mms = ui.MMSHOutput->isChecked();
sout.b_icecast = ui.IcecastOutput->isChecked();
sout.b_rtp = ui.RTPOutput->isChecked(); sout.b_rtp = ui.RTPOutput->isChecked();
sout.b_udp = ui.UDPOutput->isChecked(); sout.b_udp = ui.UDPOutput->isChecked();
sout.b_sap = ui.sap->isChecked(); sout.b_sap = ui.sap->isChecked();
...@@ -271,10 +277,15 @@ void SoutDialog::updateMRL() ...@@ -271,10 +277,15 @@ void SoutDialog::updateMRL()
sout.psz_mms = strdup( qtu( ui.MMSHEdit->text() ) ); sout.psz_mms = strdup( qtu( ui.MMSHEdit->text() ) );
sout.psz_rtp = strdup( qtu( ui.RTPEdit->text() ) ); sout.psz_rtp = strdup( qtu( ui.RTPEdit->text() ) );
sout.psz_udp = strdup( qtu( ui.UDPEdit->text() ) ); sout.psz_udp = strdup( qtu( ui.UDPEdit->text() ) );
sout.psz_icecast = strdup( qtu( ui.IcecastEdit->text() ) );
sout.sa_icecast.psz_username = strdup( qtu( ui.IcecastNamePassEdit->text() ) );
sout.sa_icecast.psz_password = strdup( qtu( ui.IcecastNamePassEdit->text() ) );
sout.psz_icecast_mountpoint = strdup( qtu( ui.IcecastMountpointEdit->text() ) );
sout.i_http = ui.HTTPPort->value(); sout.i_http = ui.HTTPPort->value();
sout.i_mms = ui.MMSHPort->value(); sout.i_mms = ui.MMSHPort->value();
sout.i_rtp = ui.RTPPort->value(); sout.i_rtp = ui.RTPPort->value();
sout.i_udp = ui.UDPPort->value(); sout.i_udp = ui.UDPPort->value();
sout.i_icecast = ui.IcecastPort->value();
sout.i_ab = ui.aBitrateSpin->value(); sout.i_ab = ui.aBitrateSpin->value();
sout.i_vb = ui.vBitrateSpin->value(); sout.i_vb = ui.vBitrateSpin->value();
sout.i_channels = ui.aChannelsSpin->value(); sout.i_channels = ui.aChannelsSpin->value();
...@@ -282,23 +293,13 @@ void SoutDialog::updateMRL() ...@@ -282,23 +293,13 @@ void SoutDialog::updateMRL()
sout.psz_group = strdup( qtu( ui.sapGroup->text() ) ); sout.psz_group = strdup( qtu( ui.sapGroup->text() ) );
sout.psz_name = strdup( qtu( ui.sapName->text() ) ); sout.psz_name = strdup( qtu( ui.sapName->text() ) );
#define COUNT() \ if ( sout.b_local ) counter++ ;
{ \ if ( sout.b_file ) counter++ ;
if ( sout.b_local ) \ if ( sout.b_http ) counter++ ;
counter += 1; \ if ( sout.b_mms ) counter++ ;
if ( sout.b_file ) \ if ( sout.b_rtp ) counter++ ;
counter += 1; \ if ( sout.b_udp ) counter ++;
if ( sout.b_http ) \ if ( sout.b_icecast ) counter ++;
counter += 1; \
if ( sout.b_mms ) \
counter += 1; \
if ( sout.b_rtp ) \
counter += 1; \
if ( sout.b_udp ) \
counter += 1; \
}
COUNT()
#define SMUX( x, txt ) if( ui.x->isChecked() ) sout.psz_mux = strdup( txt ); #define SMUX( x, txt ) if( ui.x->isChecked() ) sout.psz_mux = strdup( txt );
SMUX( PSMux, "ps" ); SMUX( PSMux, "ps" );
...@@ -489,4 +490,6 @@ COUNT() ...@@ -489,4 +490,6 @@ COUNT()
free( sout.psz_file );free( sout.psz_http ); free( sout.psz_mms ); free( sout.psz_file );free( sout.psz_http ); free( sout.psz_mms );
free( sout.psz_rtp ); free( sout.psz_udp ); free( sout.psz_mux ); free( sout.psz_rtp ); free( sout.psz_udp ); free( sout.psz_mux );
free( sout.psz_name ); free( sout.psz_group ); free( sout.psz_name ); free( sout.psz_group );
free( sout.psz_icecast ); free( sout.psz_icecast_mountpoint );
free( sout.sa_icecast.psz_password ); free( sout.sa_icecast.psz_username );
} }
...@@ -277,7 +277,7 @@ ...@@ -277,7 +277,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0" > <item row="7" column="0" >
<widget class="QCheckBox" name="UDPOutput" > <widget class="QCheckBox" name="UDPOutput" >
<property name="toolTip" > <property name="toolTip" >
<string>_("Using this option is not recommended in most of the cases.")</string> <string>_("Using this option is not recommended in most of the cases.")</string>
...@@ -287,17 +287,17 @@ ...@@ -287,17 +287,17 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="1" > <item row="7" column="1" >
<widget class="QLabel" name="UDPLabel" > <widget class="QLabel" name="UDPLabel" >
<property name="text" > <property name="text" >
<string>_("Address")</string> <string>_("Address")</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="2" > <item row="7" column="2" >
<widget class="QLineEdit" name="UDPEdit" /> <widget class="QLineEdit" name="UDPEdit" />
</item> </item>
<item row="5" column="3" > <item row="7" column="3" >
<widget class="QLabel" name="UDPPortLabel" > <widget class="QLabel" name="UDPPortLabel" >
<property name="text" > <property name="text" >
<string>_("Port")</string> <string>_("Port")</string>
...@@ -307,7 +307,7 @@ ...@@ -307,7 +307,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="4" > <item row="7" column="4" >
<widget class="QSpinBox" name="UDPPort" > <widget class="QSpinBox" name="UDPPort" >
<property name="maximumSize" > <property name="maximumSize" >
<size> <size>
...@@ -332,6 +332,91 @@ ...@@ -332,6 +332,91 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="5" column="0" >
<widget class="QCheckBox" name="IcecastOutput" >
<property name="text" >
<string>IceCast</string>
</property>
</widget>
</item>
<item row="5" column="1" >
<widget class="QLabel" name="IcecastLabel" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>_("Address")</string>
</property>
</widget>
</item>
<item row="5" column="2" >
<widget class="QLineEdit" name="IcecastEdit" />
</item>
<item row="5" column="3" >
<widget class="QLabel" name="IcecastPortLabel" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>_("Port:")</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="5" column="4" >
<widget class="QSpinBox" name="IcecastPort" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="maximumSize" >
<size>
<width>90</width>
<height>16777215</height>
</size>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="maximum" >
<number>65535</number>
</property>
<property name="value" >
<number>1024</number>
</property>
</widget>
</item>
<item row="6" column="1" >
<widget class="QLabel" name="IcecastMountpointLabel" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>_("Mount Point")</string>
</property>
</widget>
</item>
<item row="6" column="2" >
<widget class="QLineEdit" name="IcecastMountpointEdit" />
</item>
<item row="6" column="3" >
<widget class="QLabel" name="IcecastNameLabel" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>_("Login:pass:")</string>
</property>
</widget>
</item>
<item row="6" column="4" >
<widget class="QLineEdit" name="IcecastNamePassEdit" >
<property name="enabled" >
<bool>false</bool>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
...@@ -1225,5 +1310,133 @@ ...@@ -1225,5 +1310,133 @@
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection>
<sender>IcecastOutput</sender>
<signal>clicked(bool)</signal>
<receiver>IcecastEdit</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>96</x>
<y>171</y>
</hint>
<hint type="destinationlabel" >
<x>296</x>
<y>171</y>
</hint>
</hints>
</connection>
<connection>
<sender>IcecastOutput</sender>
<signal>clicked(bool)</signal>
<receiver>IcecastLabel</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>96</x>
<y>171</y>
</hint>
<hint type="destinationlabel" >
<x>227</x>
<y>171</y>
</hint>
</hints>
</connection>
<connection>
<sender>IcecastOutput</sender>
<signal>clicked(bool)</signal>
<receiver>IcecastPortLabel</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>96</x>
<y>171</y>
</hint>
<hint type="destinationlabel" >
<x>377</x>
<y>171</y>
</hint>
</hints>
</connection>
<connection>
<sender>IcecastOutput</sender>
<signal>clicked(bool)</signal>
<receiver>IcecastPort</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>96</x>
<y>171</y>
</hint>
<hint type="destinationlabel" >
<x>488</x>
<y>171</y>
</hint>
</hints>
</connection>
<connection>
<sender>IcecastOutput</sender>
<signal>clicked(bool)</signal>
<receiver>IcecastMountpointEdit</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>91</x>
<y>154</y>
</hint>
<hint type="destinationlabel" >
<x>306</x>
<y>175</y>
</hint>
</hints>
</connection>
<connection>
<sender>IcecastOutput</sender>
<signal>clicked(bool)</signal>
<receiver>IcecastMountpointLabel</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>91</x>
<y>154</y>
</hint>
<hint type="destinationlabel" >
<x>226</x>
<y>175</y>
</hint>
</hints>
</connection>
<connection>
<sender>IcecastOutput</sender>
<signal>clicked(bool)</signal>
<receiver>IcecastNameLabel</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>91</x>
<y>154</y>
</hint>
<hint type="destinationlabel" >
<x>388</x>
<y>175</y>
</hint>
</hints>
</connection>
<connection>
<sender>IcecastOutput</sender>
<signal>clicked(bool)</signal>
<receiver>IcecastNamePassEdit</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>91</x>
<y>154</y>
</hint>
<hint type="destinationlabel" >
<x>526</x>
<y>175</y>
</hint>
</hints>
</connection>
</connections> </connections>
</ui> </ui>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment