Commit 61930d9a authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Try to fix Sout Dialog ( Part 1 )

This should fix part of the behaviour for RTP/UDP and the video/audio port.
MRL is not correct since I don't exactly  how it should look like for rtp with two ports.
parent 33e8266d
/***************************************************************************** /*****************************************************************************
* sout.cpp : Stream output dialog ( old-style ) * sout.cpp : Stream output dialog ( old-style )
**************************************************************************** ****************************************************************************
* Copyright (C) 2006 the VideoLAN team * Copyright (C) 2007-2008 the VideoLAN team
* Copyright (C) 2007 Société des arts technologiques * Copyright (C) 2007 Société des arts technologiques
* Copyright (C) 2007 Savoir-faire Linux * Copyright (C) 2007 Savoir-faire Linux
* *
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
# include "config.h" # include "config.h"
#endif #endif
...@@ -103,8 +104,8 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, ...@@ -103,8 +104,8 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf,
/* UI stuff */ /* UI stuff */
ui.setupUi( this ); ui.setupUi( this );
ui.UDPEdit->hide(); ui.UDPLabel->hide(); changeUDPandRTPmess( false );
ui.UDPPort->hide(); ui.UDPPortLabel->hide();
/* ADD HERE for new profiles */ /* ADD HERE for new profiles */
#define ADD_PROFILE( name, shortname ) ui.profileBox->addItem( qtr( name ), QVariant( QString( shortname ) ) ); #define ADD_PROFILE( name, shortname ) ui.profileBox->addItem( qtr( name ), QVariant( QString( shortname ) ) );
ADD_PROFILE( "Custom" , "Custom" ) ADD_PROFILE( "Custom" , "Custom" )
...@@ -149,8 +150,10 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, ...@@ -149,8 +150,10 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf,
ADD_SCALING( "1.75" ) ADD_SCALING( "1.75" )
ADD_SCALING( "2" ) ADD_SCALING( "2" )
ui.mrlEdit->setToolTip ( qtr( "Stream output string.\n This is automatically generated " ui.mrlEdit->setToolTip ( qtr( "Stream output string.\n"
"when you change the above settings,\n but you can update it manually." ) ) ; "This is automatically generated "
"when you change the above settings,\n"
"but you can update it manually." ) ) ;
// /* Connect everything to the updateMRL function */ // /* Connect everything to the updateMRL function */
#define CB( x ) CONNECT( ui.x, toggled( bool ), this, updateMRL() ); #define CB( x ) CONNECT( ui.x, toggled( bool ), this, updateMRL() );
...@@ -192,11 +195,11 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, ...@@ -192,11 +195,11 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf,
BUTTONACT( cancelButton, cancel() ); BUTTONACT( cancelButton, cancel() );
if( b_transcode_only ) toggleSout(); if( b_transcode_only ) toggleSout();
}
CONNECT( ui.UDPOutput, toggled( bool ), this, changeUDPandRTPmess( bool ) );}
void SoutDialog::fileBrowse() void SoutDialog::fileBrowse()
{ {
ui.tabWidget->setTabEnabled( 0,false );
QString fileName = QFileDialog::getSaveFileName( this, qtr( "Save file" ), "", QString fileName = QFileDialog::getSaveFileName( this, qtr( "Save file" ), "",
qtr( "Containers (*.ps *.ts *.mpg *.ogg *.asf *.mp4 *.mov *.wav *.raw *.flv)" ) ); qtr( "Containers (*.ps *.ts *.mpg *.ogg *.asf *.mp4 *.mov *.wav *.raw *.flv)" ) );
ui.fileEdit->setText( fileName ); ui.fileEdit->setText( fileName );
...@@ -232,18 +235,15 @@ void SoutDialog::setSTranscodeOptions( bool b_trans ) ...@@ -232,18 +235,15 @@ void SoutDialog::setSTranscodeOptions( bool b_trans )
void SoutDialog::setRawOptions( bool b_raw ) void SoutDialog::setRawOptions( bool b_raw )
{ {
if( b_raw ) if( b_raw )
{
ui.tabWidget->setDisabled( true ); ui.tabWidget->setDisabled( true );
}
else else
{
SoutDialog::setOptions(); SoutDialog::setOptions();
}
} }
void SoutDialog::setOptions() void SoutDialog::setOptions()
{ {
QString profileString = ui.profileBox->itemData( ui.profileBox->currentIndex() ).toString(); QString profileString =
ui.profileBox->itemData( ui.profileBox->currentIndex() ).toString();
msg_Dbg( p_intf, "Profile Used: %s", qta( profileString )); msg_Dbg( p_intf, "Profile Used: %s", qta( profileString ));
int index; int index;
...@@ -267,18 +267,15 @@ void SoutDialog::setOptions() ...@@ -267,18 +267,15 @@ void SoutDialog::setOptions()
/* If the profile is not a custom one, then disable the tabWidget */ /* If the profile is not a custom one, then disable the tabWidget */
if ( profileString == "Custom" ) if ( profileString == "Custom" )
{
ui.tabWidget->setEnabled( true ); ui.tabWidget->setEnabled( true );
}
else else
{
ui.tabWidget->setDisabled( true ); ui.tabWidget->setDisabled( true );
}
/* Update the MRL !! */ /* Update the MRL !! */
updateMRL(); updateMRL();
} }
//FIXME
void SoutDialog::toggleSout() void SoutDialog::toggleSout()
{ {
//Toggle all the streaming options. //Toggle all the streaming options.
...@@ -298,14 +295,27 @@ void SoutDialog::toggleSout() ...@@ -298,14 +295,27 @@ void SoutDialog::toggleSout()
updateGeometry(); updateGeometry();
} }
void SoutDialog::changeUDPandRTPmess( bool b_udp )
{
ui.RTPEdit->setVisible( !b_udp );
ui.RTPLabel->setVisible( !b_udp );
ui.RTPPort->setVisible( !b_udp );
ui.RTPPortLabel->setVisible( !b_udp );
ui.UDPEdit->setVisible( b_udp );
ui.UDPLabel->setVisible( b_udp );
ui.UDPPortLabel->setText( b_udp ? qtr( "Port:") : qtr( "Video Port:" ) );
ui.RTPPortLabel->setText( b_udp ? qtr( "Port:") : qtr( "Audio Port:" ) );
}
void SoutDialog::ok() void SoutDialog::ok()
{ {
mrl = ui.mrlEdit->text(); mrl = ui.mrlEdit->text();
accept(); accept();
} }
void SoutDialog::cancel() void SoutDialog::cancel()
{ {
mrl = ui.mrlEdit->text(); mrl.clear();
reject(); reject();
} }
...@@ -411,7 +421,8 @@ void SoutDialog::updateMRL() ...@@ -411,7 +421,8 @@ void SoutDialog::updateMRL()
mrl.append( "}" ); mrl.append( "}" );
} }
if ( sout.b_local || sout.b_file || sout.b_http || sout.b_mms || sout.b_rtp || sout.b_udp ) if ( sout.b_local || sout.b_file || sout.b_http ||
sout.b_mms || sout.b_rtp || sout.b_udp )
{ {
#define ISMORE() if ( more ) mrl.append( "," ); #define ISMORE() if ( more ) mrl.append( "," );
......
...@@ -86,6 +86,7 @@ private slots: ...@@ -86,6 +86,7 @@ private slots:
void setATranscodeOptions( bool ); void setATranscodeOptions( bool );
void setSTranscodeOptions( bool ); void setSTranscodeOptions( bool );
void setRawOptions( bool ); void setRawOptions( bool );
void changeUDPandRTPmess( bool );
}; };
#endif #endif
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>617</width> <width>726</width>
<height>678</height> <height>782</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy" > <property name="sizePolicy" >
...@@ -279,6 +279,9 @@ ...@@ -279,6 +279,9 @@
</item> </item>
<item row="5" column="0" > <item row="5" column="0" >
<widget class="QCheckBox" name="UDPOutput" > <widget class="QCheckBox" name="UDPOutput" >
<property name="enabled" >
<bool>false</bool>
</property>
<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>
</property> </property>
...@@ -289,16 +292,26 @@ ...@@ -289,16 +292,26 @@
</item> </item>
<item row="5" column="1" > <item row="5" column="1" >
<widget class="QLabel" name="UDPLabel" > <widget class="QLabel" name="UDPLabel" >
<property name="enabled" >
<bool>true</bool>
</property>
<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="5" column="2" >
<widget class="QLineEdit" name="UDPEdit" /> <widget class="QLineEdit" name="UDPEdit" >
<property name="enabled" >
<bool>true</bool>
</property>
</widget>
</item> </item>
<item row="5" column="3" > <item row="5" column="3" >
<widget class="QLabel" name="UDPPortLabel" > <widget class="QLabel" name="UDPPortLabel" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="text" > <property name="text" >
<string>_("Port")</string> <string>_("Port")</string>
</property> </property>
...@@ -309,6 +322,9 @@ ...@@ -309,6 +322,9 @@
</item> </item>
<item row="5" column="4" > <item row="5" column="4" >
<widget class="QSpinBox" name="UDPPort" > <widget class="QSpinBox" name="UDPPort" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="maximumSize" > <property name="maximumSize" >
<size> <size>
<width>90</width> <width>90</width>
...@@ -445,6 +461,14 @@ ...@@ -445,6 +461,14 @@
<number>1</number> <number>1</number>
</property> </property>
<widget class="QWidget" name="muxer" > <widget class="QWidget" name="muxer" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>704</width>
<height>148</height>
</rect>
</property>
<attribute name="title" > <attribute name="title" >
<string>_("Encapsulation")</string> <string>_("Encapsulation")</string>
</attribute> </attribute>
...@@ -532,6 +556,14 @@ ...@@ -532,6 +556,14 @@
<property name="enabled" > <property name="enabled" >
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>704</width>
<height>148</height>
</rect>
</property>
<attribute name="title" > <attribute name="title" >
<string>_("Video codec")</string> <string>_("Video codec")</string>
</attribute> </attribute>
...@@ -621,6 +653,14 @@ ...@@ -621,6 +653,14 @@
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="audioCodec" > <widget class="QWidget" name="audioCodec" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>704</width>
<height>148</height>
</rect>
</property>
<attribute name="title" > <attribute name="title" >
<string>_("Audio codec")</string> <string>_("Audio codec")</string>
</attribute> </attribute>
...@@ -713,6 +753,14 @@ ...@@ -713,6 +753,14 @@
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="subtitles" > <widget class="QWidget" name="subtitles" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>704</width>
<height>148</height>
</rect>
</property>
<attribute name="title" > <attribute name="title" >
<string>_("Subtitles")</string> <string>_("Subtitles")</string>
</attribute> </attribute>
...@@ -851,7 +899,7 @@ ...@@ -851,7 +899,7 @@
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0" >
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
...@@ -1224,102 +1272,6 @@ ...@@ -1224,102 +1272,6 @@
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection>
<sender>rawInput</sender>
<signal>clicked(bool)</signal>
<receiver>RTPOutput</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>595</x>
<y>75</y>
</hint>
<hint type="destinationlabel" >
<x>66</x>
<y>172</y>
</hint>
</hints>
</connection>
<connection>
<sender>rawInput</sender>
<signal>clicked(bool)</signal>
<receiver>MMSHOutput</receiver>
<slot>setDisabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>485</x>
<y>92</y>
</hint>
<hint type="destinationlabel" >
<x>46</x>
<y>141</y>
</hint>
</hints>
</connection>
<connection>
<sender>UDPOutput</sender>
<signal>toggled(bool)</signal>
<receiver>UDPPort</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>98</x>
<y>212</y>
</hint>
<hint type="destinationlabel" >
<x>493</x>
<y>212</y>
</hint>
</hints>
</connection>
<connection>
<sender>UDPOutput</sender>
<signal>toggled(bool)</signal>
<receiver>UDPPortLabel</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>107</x>
<y>212</y>
</hint>
<hint type="destinationlabel" >
<x>396</x>
<y>212</y>
</hint>
</hints>
</connection>
<connection>
<sender>UDPOutput</sender>
<signal>toggled(bool)</signal>
<receiver>UDPLabel</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>107</x>
<y>212</y>
</hint>
<hint type="destinationlabel" >
<x>241</x>
<y>212</y>
</hint>
</hints>
</connection>
<connection>
<sender>UDPOutput</sender>
<signal>toggled(bool)</signal>
<receiver>UDPEdit</receiver>
<slot>setVisible(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>107</x>
<y>212</y>
</hint>
<hint type="destinationlabel" >
<x>315</x>
<y>212</y>
</hint>
</hints>
</connection>
<connection> <connection>
<sender>IcecastOutput</sender> <sender>IcecastOutput</sender>
<signal>clicked(bool)</signal> <signal>clicked(bool)</signal>
...@@ -1448,5 +1400,53 @@ ...@@ -1448,5 +1400,53 @@
</hint> </hint>
</hints> </hints>
</connection> </connection>
<connection>
<sender>RTPOutput</sender>
<signal>clicked(bool)</signal>
<receiver>UDPOutput</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>110</x>
<y>190</y>
</hint>
<hint type="destinationlabel" >
<x>110</x>
<y>225</y>
</hint>
</hints>
</connection>
<connection>
<sender>RTPOutput</sender>
<signal>clicked(bool)</signal>
<receiver>UDPPort</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>110</x>
<y>190</y>
</hint>
<hint type="destinationlabel" >
<x>597</x>
<y>225</y>
</hint>
</hints>
</connection>
<connection>
<sender>RTPOutput</sender>
<signal>clicked(bool)</signal>
<receiver>UDPPortLabel</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>110</x>
<y>190</y>
</hint>
<hint type="destinationlabel" >
<x>497</x>
<y>225</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