Commit 2c5d2a34 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Try to fix Sout Dialog ( Part 2 )

Should fix RTP generation and Icecast generation.
parent d8f50ad6
...@@ -64,6 +64,8 @@ struct sout_gui_descr_t ...@@ -64,6 +64,8 @@ struct sout_gui_descr_t
int32_t i_http; /*< http port number */ int32_t i_http; /*< http port number */
int32_t i_mms; /*< mms port number */ int32_t i_mms; /*< mms port number */
int32_t i_rtp; /*< rtp port number */ int32_t i_rtp; /*< rtp port number */
int32_t i_rtp_audio; /*< rtp port number */
int32_t i_rtp_video; /*< rtp port number */
int32_t i_udp; /*< udp port number */ int32_t i_udp; /*< udp port number */
int32_t i_icecast; /*< icecast port number */ int32_t i_icecast; /*< icecast port number */
...@@ -160,28 +162,31 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, ...@@ -160,28 +162,31 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf,
#define CT( x ) CONNECT( ui.x, textChanged( const QString ), this, updateMRL() ); #define CT( x ) CONNECT( ui.x, textChanged( const QString ), this, updateMRL() );
#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 );
CT( IcecastEdit ); CT( IcecastMountpointEdit ); CT( IcecastNamePassEdit ); CT( IcecastEdit ); CT( IcecastMountpointEdit ); CT( IcecastNamePassEdit );
CS( HTTPPort ); CS( RTPPort ); CS( MMSHPort ); CS( UDPPort ); CS( HTTPPort ); CS( RTPPort ); CS( RTPPort2 ); 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() );
CONNECT( ui.transcodeVideo, toggled( bool ), this, setVTranscodeOptions( bool ) ); CONNECT( ui.transcodeVideo, toggled( bool ),
CONNECT( ui.transcodeAudio, toggled( bool ), this, setATranscodeOptions( bool ) ); this, setVTranscodeOptions( bool ) );
CONNECT( ui.transcodeSubs, toggled( bool ), this, setSTranscodeOptions( bool ) ); CONNECT( ui.transcodeAudio, toggled( bool ),
this, setATranscodeOptions( bool ) );
CONNECT( ui.transcodeSubs, toggled( bool ),
this, setSTranscodeOptions( bool ) );
CONNECT( ui.rawInput, toggled( bool ), this, setRawOptions( bool ) ); CONNECT( ui.rawInput, toggled( bool ), this, setRawOptions( bool ) );
okButton = new QPushButton( qtr( "&Stream" ) ); okButton = new QPushButton( qtr( "&Stream" ) );
...@@ -196,7 +201,9 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, ...@@ -196,7 +201,9 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf,
if( b_transcode_only ) toggleSout(); if( b_transcode_only ) toggleSout();
CONNECT( ui.UDPOutput, toggled( bool ), this, changeUDPandRTPmess( bool ) );} CONNECT( ui.UDPOutput, toggled( bool ), this, changeUDPandRTPmess( bool ) );
CONNECT( ui.RTPOutput, clicked(bool), this, RTPtoggled( bool ) );
}
void SoutDialog::fileBrowse() void SoutDialog::fileBrowse()
{ {
...@@ -303,8 +310,34 @@ void SoutDialog::changeUDPandRTPmess( bool b_udp ) ...@@ -303,8 +310,34 @@ void SoutDialog::changeUDPandRTPmess( bool b_udp )
ui.RTPPortLabel->setVisible( !b_udp ); ui.RTPPortLabel->setVisible( !b_udp );
ui.UDPEdit->setVisible( b_udp ); ui.UDPEdit->setVisible( b_udp );
ui.UDPLabel->setVisible( b_udp ); ui.UDPLabel->setVisible( b_udp );
ui.UDPPortLabel->setText( b_udp ? qtr( "Port:") : qtr( "Video Port:" ) ); ui.UDPPortLabel->setText( b_udp ? qtr( "Port:") : qtr( "Audio Port:" ) );
ui.RTPPortLabel->setText( b_udp ? qtr( "Port:") : qtr( "Audio Port:" ) ); ui.RTPPort2->setVisible( !b_udp );
ui.RTPPortLabel2->setVisible( !b_udp );
}
void SoutDialog::RTPtoggled( bool b_en )
{
if( !b_en )
{
if( ui.RTPPort->value() == ui.UDPPort->value() )
{
ui.UDPPort->setValue( ui.UDPPort->value() + 1 );
}
while( ui.RTPPort2->value() == ui.UDPPort->value() ||
ui.RTPPort2->value() == ui.RTPPort->value() )
{
ui.RTPPort2->setValue( ui.RTPPort2->value() + 1 );
}
}
ui.sap->setEnabled( b_en );
ui.RTPLabel->setEnabled( b_en );
ui.RTPEdit->setEnabled( b_en );
ui.UDPOutput->setEnabled( b_en );
ui.UDPPort->setEnabled( b_en );
ui.UDPPortLabel->setEnabled( b_en );
ui.RTPPort2->setEnabled( b_en );
ui.RTPPortLabel2->setEnabled( b_en );
} }
void SoutDialog::ok() void SoutDialog::ok()
...@@ -349,7 +382,8 @@ void SoutDialog::updateMRL() ...@@ -349,7 +382,8 @@ void SoutDialog::updateMRL()
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_rtp_audio = sout.i_udp = ui.UDPPort->value();
sout.i_rtp_video = ui.RTPPort2->value();
sout.i_icecast = ui.IcecastPort->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();
...@@ -421,12 +455,13 @@ void SoutDialog::updateMRL() ...@@ -421,12 +455,13 @@ void SoutDialog::updateMRL()
mrl.append( "}" ); mrl.append( "}" );
} }
/* Protocol output */
if ( sout.b_local || sout.b_file || sout.b_http || if ( sout.b_local || sout.b_file || sout.b_http ||
sout.b_mms || sout.b_rtp || sout.b_udp ) sout.b_mms || sout.b_rtp || sout.b_udp || sout.b_icecast )
{ {
#define ISMORE() if ( more ) mrl.append( "," ); #define ISMORE() if ( more ) mrl.append( "," )
#define ATLEASTONE() if ( counter ) mrl.append( "dst=" ); #define ATLEASTONE() if ( counter ) mrl.append( "dst=" )
#define CHECKMUX() \ #define CHECKMUX() \
if( sout.psz_mux ) \ if( sout.psz_mux ) \
...@@ -436,23 +471,17 @@ void SoutDialog::updateMRL() ...@@ -436,23 +471,17 @@ void SoutDialog::updateMRL()
} }
if ( trans ) if ( trans )
{
mrl.append( ":" ); mrl.append( ":" );
}
else else
{
mrl = ":sout=#"; mrl = ":sout=#";
}
if ( counter ) if ( counter )
{
mrl.append( "duplicate{" ); mrl.append( "duplicate{" );
}
if ( sout.b_local ) if ( sout.b_local )
{ {
ISMORE(); ISMORE();
ATLEASTONE() ATLEASTONE();
mrl.append( "display" ); mrl.append( "display" );
more = true; more = true;
} }
...@@ -460,7 +489,7 @@ void SoutDialog::updateMRL() ...@@ -460,7 +489,7 @@ void SoutDialog::updateMRL()
if ( sout.b_file ) if ( sout.b_file )
{ {
ISMORE(); ISMORE();
ATLEASTONE() ATLEASTONE();
mrl.append( "std{access=file" ); mrl.append( "std{access=file" );
CHECKMUX(); CHECKMUX();
mrl.append( ",dst=" ); mrl.append( ",dst=" );
...@@ -472,7 +501,7 @@ void SoutDialog::updateMRL() ...@@ -472,7 +501,7 @@ void SoutDialog::updateMRL()
if ( sout.b_http ) if ( sout.b_http )
{ {
ISMORE(); ISMORE();
ATLEASTONE() ATLEASTONE();
mrl.append( "std{access=http" ); mrl.append( "std{access=http" );
CHECKMUX(); CHECKMUX();
mrl.append( ",dst=" ); mrl.append( ",dst=" );
...@@ -486,7 +515,7 @@ void SoutDialog::updateMRL() ...@@ -486,7 +515,7 @@ void SoutDialog::updateMRL()
if ( sout.b_mms ) if ( sout.b_mms )
{ {
ISMORE(); ISMORE();
ATLEASTONE() ATLEASTONE();
mrl.append( "std{access=mmsh" ); mrl.append( "std{access=mmsh" );
CHECKMUX(); CHECKMUX();
mrl.append( ",dst=" ); mrl.append( ",dst=" );
...@@ -500,27 +529,34 @@ void SoutDialog::updateMRL() ...@@ -500,27 +529,34 @@ void SoutDialog::updateMRL()
if ( sout.b_rtp ) if ( sout.b_rtp )
{ {
ISMORE(); ISMORE();
ATLEASTONE() ATLEASTONE();
mrl.append( "rtp{" );
CHECKMUX();
mrl.append( ",dst=" );
mrl.append( sout.psz_rtp );
mrl.append( ":" );
mrl.append( QString::number( sout.i_rtp,10 ) );
mrl.append( "}" );
more = true;
}
if ( sout.b_udp ) if ( sout.b_udp )
{ {
ISMORE();
ATLEASTONE()
mrl.append( "std{access=udp" ); mrl.append( "std{access=udp" );
CHECKMUX(); CHECKMUX();
mrl.append( ",dst=" ); mrl.append( ",dst=" );
mrl.append( sout.psz_udp ); mrl.append( sout.psz_udp );
mrl.append( ":" ); mrl.append( ":" );
mrl.append( QString::number( sout.i_udp,10 ) ); mrl.append( QString::number( sout.i_udp,10 ) );
}
else
{
mrl.append( "rtp{" );
mrl.append( "dst=" );
mrl.append( sout.psz_rtp );
CHECKMUX();
mrl.append( ",port=" );
mrl.append( QString::number( sout.i_rtp,10 ) );
if( !sout.psz_mux || strncmp( sout.psz_mux, "ts", 2 ) )
{
mrl.append( ",port-audio=" );
mrl.append( QString::number( sout.i_rtp_audio, 10 ) );
mrl.append( ",port-video=" );
mrl.append( QString::number( sout.i_rtp_video, 10 ) );
}
}
/* SAP */
if ( sout.b_sap ) if ( sout.b_sap )
{ {
mrl.append( ",sap," ); mrl.append( ",sap," );
...@@ -531,13 +567,26 @@ void SoutDialog::updateMRL() ...@@ -531,13 +567,26 @@ void SoutDialog::updateMRL()
mrl.append( sout.psz_name ); mrl.append( sout.psz_name );
mrl.append( "\"" ); mrl.append( "\"" );
} }
mrl.append( "}" ); mrl.append( "}" );
more = true; more = true;
} }
if( sout.b_icecast ) if( sout.b_icecast )
{ {
// TODO ISMORE();
ATLEASTONE();
mrl.append( "std{access=shout,mux=ogg" );
mrl.append( ",dst=" );
mrl.append( sout.sa_icecast.psz_username );
mrl.append( "@" );
mrl.append( sout.psz_icecast );
mrl.append( ":" );
mrl.append( QString::number( sout.i_icecast, 10 ) );
mrl.append( "/" );
mrl.append( sout.psz_icecast_mountpoint );
mrl.append( "}" );
more = true;
} }
if ( counter ) if ( counter )
......
...@@ -87,6 +87,7 @@ private slots: ...@@ -87,6 +87,7 @@ private slots:
void setSTranscodeOptions( bool ); void setSTranscodeOptions( bool );
void setRawOptions( bool ); void setRawOptions( bool );
void changeUDPandRTPmess( bool ); void changeUDPandRTPmess( bool );
void RTPtoggled( bool );
}; };
#endif #endif
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>726</width> <width>726</width>
<height>782</height> <height>823</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy" > <property name="sizePolicy" >
...@@ -348,14 +348,14 @@ ...@@ -348,14 +348,14 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="0" > <item row="7" column="0" >
<widget class="QCheckBox" name="IcecastOutput" > <widget class="QCheckBox" name="IcecastOutput" >
<property name="text" > <property name="text" >
<string>IceCast</string> <string>IceCast</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="1" > <item row="7" column="1" >
<widget class="QLabel" name="IcecastLabel" > <widget class="QLabel" name="IcecastLabel" >
<property name="enabled" > <property name="enabled" >
<bool>false</bool> <bool>false</bool>
...@@ -365,10 +365,10 @@ ...@@ -365,10 +365,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="2" > <item row="7" column="2" >
<widget class="QLineEdit" name="IcecastEdit" /> <widget class="QLineEdit" name="IcecastEdit" />
</item> </item>
<item row="6" column="3" > <item row="7" column="3" >
<widget class="QLabel" name="IcecastPortLabel" > <widget class="QLabel" name="IcecastPortLabel" >
<property name="enabled" > <property name="enabled" >
<bool>false</bool> <bool>false</bool>
...@@ -381,7 +381,7 @@ ...@@ -381,7 +381,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="4" > <item row="7" column="4" >
<widget class="QSpinBox" name="IcecastPort" > <widget class="QSpinBox" name="IcecastPort" >
<property name="enabled" > <property name="enabled" >
<bool>false</bool> <bool>false</bool>
...@@ -403,7 +403,7 @@ ...@@ -403,7 +403,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="1" > <item row="8" column="1" >
<widget class="QLabel" name="IcecastMountpointLabel" > <widget class="QLabel" name="IcecastMountpointLabel" >
<property name="enabled" > <property name="enabled" >
<bool>false</bool> <bool>false</bool>
...@@ -413,10 +413,10 @@ ...@@ -413,10 +413,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="2" > <item row="8" column="2" >
<widget class="QLineEdit" name="IcecastMountpointEdit" /> <widget class="QLineEdit" name="IcecastMountpointEdit" />
</item> </item>
<item row="7" column="3" > <item row="8" column="3" >
<widget class="QLabel" name="IcecastNameLabel" > <widget class="QLabel" name="IcecastNameLabel" >
<property name="enabled" > <property name="enabled" >
<bool>false</bool> <bool>false</bool>
...@@ -426,13 +426,67 @@ ...@@ -426,13 +426,67 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="7" column="4" > <item row="8" column="4" >
<widget class="QLineEdit" name="IcecastNamePassEdit" > <widget class="QLineEdit" name="IcecastNamePassEdit" >
<property name="enabled" > <property name="enabled" >
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item row="6" column="4" >
<widget class="QSpinBox" name="RTPPort2" >
<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="accelerated" >
<bool>true</bool>
</property>
<property name="maximum" >
<number>65355</number>
</property>
<property name="value" >
<number>1234</number>
</property>
</widget>
</item>
<item row="6" column="3" >
<widget class="QLabel" name="RTPPortLabel2" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" >
<string>_("Video Port")</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="6" column="2" >
<spacer name="verticalSpacer" >
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0" >
<size>
<width>20</width>
<height>29</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
...@@ -458,7 +512,7 @@ ...@@ -458,7 +512,7 @@
<item row="3" column="0" colspan="2" > <item row="3" column="0" colspan="2" >
<widget class="QTabWidget" name="tabWidget" > <widget class="QTabWidget" name="tabWidget" >
<property name="currentIndex" > <property name="currentIndex" >
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="muxer" > <widget class="QWidget" name="muxer" >
<property name="geometry" > <property name="geometry" >
...@@ -466,7 +520,7 @@ ...@@ -466,7 +520,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>704</width> <width>704</width>
<height>148</height> <height>154</height>
</rect> </rect>
</property> </property>
<attribute name="title" > <attribute name="title" >
...@@ -561,7 +615,7 @@ ...@@ -561,7 +615,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>704</width> <width>704</width>
<height>148</height> <height>154</height>
</rect> </rect>
</property> </property>
<attribute name="title" > <attribute name="title" >
...@@ -658,7 +712,7 @@ ...@@ -658,7 +712,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>704</width> <width>704</width>
<height>148</height> <height>154</height>
</rect> </rect>
</property> </property>
<attribute name="title" > <attribute name="title" >
...@@ -758,7 +812,7 @@ ...@@ -758,7 +812,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>704</width> <width>704</width>
<height>148</height> <height>154</height>
</rect> </rect>
</property> </property>
<attribute name="title" > <attribute name="title" >
...@@ -920,54 +974,6 @@ ...@@ -920,54 +974,6 @@
</widget> </widget>
<resources/> <resources/>
<connections> <connections>
<connection>
<sender>RTPOutput</sender>
<signal>clicked(bool)</signal>
<receiver>sap</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>68</x>
<y>175</y>
</hint>
<hint type="destinationlabel" >
<x>80</x>
<y>467</y>
</hint>
</hints>
</connection>
<connection>
<sender>RTPOutput</sender>
<signal>clicked(bool)</signal>
<receiver>RTPLabel</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>58</x>
<y>174</y>
</hint>
<hint type="destinationlabel" >
<x>147</x>
<y>184</y>
</hint>
</hints>
</connection>
<connection>
<sender>RTPOutput</sender>
<signal>clicked(bool)</signal>
<receiver>RTPEdit</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>63</x>
<y>186</y>
</hint>
<hint type="destinationlabel" >
<x>244</x>
<y>186</y>
</hint>
</hints>
</connection>
<connection> <connection>
<sender>MMSHOutput</sender> <sender>MMSHOutput</sender>
<signal>clicked(bool)</signal> <signal>clicked(bool)</signal>
...@@ -1448,5 +1454,37 @@ ...@@ -1448,5 +1454,37 @@
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection>
<sender>RTPOutput</sender>
<signal>clicked(bool)</signal>
<receiver>RTPPort2</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>110</x>
<y>190</y>
</hint>
<hint type="destinationlabel" >
<x>597</x>
<y>260</y>
</hint>
</hints>
</connection>
<connection>
<sender>RTPOutput</sender>
<signal>clicked(bool)</signal>
<receiver>RTPPortLabel2</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>110</x>
<y>190</y>
</hint>
<hint type="destinationlabel" >
<x>497</x>
<y>260</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