Commit 193c90fa authored by Pierre Ynard's avatar Pierre Ynard

qt4: fix TTL and SAP in sout wizard

This is ugly but fixes it for 2.0
parent bc3d16ae
...@@ -108,7 +108,8 @@ FileDestBox::FileDestBox( QWidget *_parent ) : VirtualDestBox( _parent ) ...@@ -108,7 +108,8 @@ FileDestBox::FileDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
BUTTONACT( fileSelectButton, fileBrowse() ); BUTTONACT( fileSelectButton, fileBrowse() );
} }
QString FileDestBox::getMRL( const QString& mux ) QString FileDestBox::getMRL( const QString& mux, const int, const bool,
const QString&, const QString& )
{ {
if( fileEdit->text().isEmpty() ) return ""; if( fileEdit->text().isEmpty() ) return "";
...@@ -173,7 +174,8 @@ HTTPDestBox::HTTPDestBox( QWidget *_parent ) : VirtualDestBox( _parent ) ...@@ -173,7 +174,8 @@ HTTPDestBox::HTTPDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
CT( HTTPEdit ); CT( HTTPEdit );
} }
QString HTTPDestBox::getMRL( const QString& mux ) QString HTTPDestBox::getMRL( const QString& mux, const int, const bool,
const QString&, const QString& )
{ {
if( HTTPEdit->text().isEmpty() ) return ""; if( HTTPEdit->text().isEmpty() ) return "";
...@@ -232,7 +234,8 @@ MMSHDestBox::MMSHDestBox( QWidget *_parent ) : VirtualDestBox( _parent ) ...@@ -232,7 +234,8 @@ MMSHDestBox::MMSHDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
CT( MMSHEdit ); CT( MMSHEdit );
} }
QString MMSHDestBox::getMRL( const QString& ) QString MMSHDestBox::getMRL( const QString&, const int, const bool,
const QString&, const QString& )
{ {
if( MMSHEdit->text().isEmpty() ) return ""; if( MMSHEdit->text().isEmpty() ) return "";
...@@ -277,7 +280,8 @@ RTSPDestBox::RTSPDestBox( QWidget *_parent ) : VirtualDestBox( _parent ) ...@@ -277,7 +280,8 @@ RTSPDestBox::RTSPDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
CT( RTSPEdit ); CT( RTSPEdit );
} }
QString RTSPDestBox::getMRL( const QString& ) QString RTSPDestBox::getMRL( const QString&, const int, const bool,
const QString&, const QString& )
{ {
if( RTSPEdit->text().isEmpty() ) return ""; if( RTSPEdit->text().isEmpty() ) return "";
...@@ -326,16 +330,34 @@ UDPDestBox::UDPDestBox( QWidget *_parent ) : VirtualDestBox( _parent ) ...@@ -326,16 +330,34 @@ UDPDestBox::UDPDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
CT( UDPEdit ); CT( UDPEdit );
} }
QString UDPDestBox::getMRL( const QString& mux ) QString UDPDestBox::getMRL( const QString& mux, const int ttl, const bool sap,
const QString& sapName, const QString& sapGroup )
{ {
if( UDPEdit->text().isEmpty() ) return ""; if( UDPEdit->text().isEmpty() ) return "";
SoutMrl m; SoutMrl m;
m.begin( "udp" ); m.begin( "std" );
SoutMrl access;
access.begin( "udp" );
access.option( "ttl", ttl );
access.end();
m.option( "access", access.getMrl() );
/* udp output, ts-mux is really only reasonable one to use*/ /* udp output, ts-mux is really only reasonable one to use*/
if( !mux.isEmpty() && !mux.compare("ts" ) ) if( !mux.isEmpty() && !mux.compare("ts" ) )
m.option( "mux", mux ); m.option( "mux", mux );
m.option( "dst", UDPEdit->text(), UDPPort->value() ); m.option( "dst", UDPEdit->text(), UDPPort->value() );
if( sap )
{
m.option( "sap" );
if( !sapName.isEmpty() )
m.option( "name", sapName );
if( !sapGroup.isEmpty() )
m.option( "group", sapGroup );
}
m.end(); m.end();
return m.getMrl(); return m.getMrl();
...@@ -374,7 +396,8 @@ RTPDestBox::RTPDestBox( QWidget *_parent, const char *_mux ) ...@@ -374,7 +396,8 @@ RTPDestBox::RTPDestBox( QWidget *_parent, const char *_mux )
CT( RTPEdit ); CT( RTPEdit );
} }
QString RTPDestBox::getMRL( const QString& ) QString RTPDestBox::getMRL( const QString&, const int ttl, const bool sap,
const QString& sapName, const QString& )
{ {
if( RTPEdit->text().isEmpty() ) return ""; if( RTPEdit->text().isEmpty() ) return "";
...@@ -385,6 +408,13 @@ QString RTPDestBox::getMRL( const QString& ) ...@@ -385,6 +408,13 @@ QString RTPDestBox::getMRL( const QString& )
/* mp4-mux ain't usable in rtp-output either */ /* mp4-mux ain't usable in rtp-output either */
if( mux != NULL ) if( mux != NULL )
m.option( "mux", qfu( mux ) ); m.option( "mux", qfu( mux ) );
if( sap )
{
m.option( "sap" );
if( !sapName.isEmpty() )
m.option( "name", sapName );
}
m.option( "ttl", ttl );
m.end(); m.end();
return m.getMrl(); return m.getMrl();
...@@ -435,7 +465,8 @@ ICEDestBox::ICEDestBox( QWidget *_parent ) : VirtualDestBox( _parent ) ...@@ -435,7 +465,8 @@ ICEDestBox::ICEDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
#undef CS #undef CS
#undef CT #undef CT
QString ICEDestBox::getMRL( const QString& ) QString ICEDestBox::getMRL( const QString&, const int, const bool,
const QString&, const QString& )
{ {
if( ICEEdit->text().isEmpty() ) return ""; if( ICEEdit->text().isEmpty() ) return "";
......
...@@ -49,7 +49,8 @@ class VirtualDestBox : public QWidget ...@@ -49,7 +49,8 @@ class VirtualDestBox : public QWidget
Q_OBJECT Q_OBJECT
public: public:
VirtualDestBox( QWidget *_parent = NULL ) : QWidget( _parent ){} VirtualDestBox( QWidget *_parent = NULL ) : QWidget( _parent ){}
virtual QString getMRL( const QString& ) = 0; virtual QString getMRL( const QString&, const int, const bool,
const QString&, const QString& ) = 0;
protected: protected:
QString mrl; QString mrl;
signals: signals:
...@@ -61,7 +62,8 @@ class FileDestBox: public VirtualDestBox ...@@ -61,7 +62,8 @@ class FileDestBox: public VirtualDestBox
Q_OBJECT Q_OBJECT
public: public:
FileDestBox( QWidget *_parent = NULL ); FileDestBox( QWidget *_parent = NULL );
virtual QString getMRL( const QString& ); virtual QString getMRL( const QString&, const int, const bool,
const QString&, const QString& );
private: private:
QLineEdit *fileEdit; QLineEdit *fileEdit;
private slots: private slots:
...@@ -73,7 +75,8 @@ class HTTPDestBox: public VirtualDestBox ...@@ -73,7 +75,8 @@ class HTTPDestBox: public VirtualDestBox
Q_OBJECT Q_OBJECT
public: public:
HTTPDestBox( QWidget *_parent = NULL ); HTTPDestBox( QWidget *_parent = NULL );
virtual QString getMRL( const QString& ); virtual QString getMRL( const QString&, const int, const bool,
const QString&, const QString& );
private: private:
QLineEdit *HTTPEdit; QLineEdit *HTTPEdit;
QSpinBox *HTTPPort; QSpinBox *HTTPPort;
...@@ -84,7 +87,8 @@ class MMSHDestBox: public VirtualDestBox ...@@ -84,7 +87,8 @@ class MMSHDestBox: public VirtualDestBox
Q_OBJECT Q_OBJECT
public: public:
MMSHDestBox( QWidget *_parent = NULL ); MMSHDestBox( QWidget *_parent = NULL );
virtual QString getMRL( const QString& ); virtual QString getMRL( const QString&, const int, const bool,
const QString&, const QString& );
private: private:
QLineEdit *MMSHEdit; QLineEdit *MMSHEdit;
QSpinBox *MMSHPort; QSpinBox *MMSHPort;
...@@ -95,7 +99,8 @@ class RTSPDestBox: public VirtualDestBox ...@@ -95,7 +99,8 @@ class RTSPDestBox: public VirtualDestBox
Q_OBJECT Q_OBJECT
public: public:
RTSPDestBox( QWidget *_parent = NULL ); RTSPDestBox( QWidget *_parent = NULL );
virtual QString getMRL( const QString& ); virtual QString getMRL( const QString&, const int, const bool,
const QString&, const QString& );
private: private:
QLineEdit *RTSPEdit; QLineEdit *RTSPEdit;
QSpinBox *RTSPPort; QSpinBox *RTSPPort;
...@@ -106,7 +111,8 @@ class UDPDestBox: public VirtualDestBox ...@@ -106,7 +111,8 @@ class UDPDestBox: public VirtualDestBox
Q_OBJECT Q_OBJECT
public: public:
UDPDestBox( QWidget *_parent = NULL ); UDPDestBox( QWidget *_parent = NULL );
virtual QString getMRL( const QString& ); virtual QString getMRL( const QString&, const int, const bool,
const QString&, const QString& );
private: private:
QLineEdit *UDPEdit; QLineEdit *UDPEdit;
QSpinBox *UDPPort; QSpinBox *UDPPort;
...@@ -117,7 +123,8 @@ class RTPDestBox: public VirtualDestBox ...@@ -117,7 +123,8 @@ class RTPDestBox: public VirtualDestBox
Q_OBJECT Q_OBJECT
public: public:
RTPDestBox( QWidget *_parent = NULL, const char *mux = NULL ); RTPDestBox( QWidget *_parent = NULL, const char *mux = NULL );
virtual QString getMRL( const QString& ); virtual QString getMRL( const QString&, const int, const bool,
const QString&, const QString& );
private: private:
QLineEdit *RTPEdit; QLineEdit *RTPEdit;
QSpinBox *RTPPort; QSpinBox *RTPPort;
...@@ -129,7 +136,8 @@ class ICEDestBox: public VirtualDestBox ...@@ -129,7 +136,8 @@ class ICEDestBox: public VirtualDestBox
Q_OBJECT Q_OBJECT
public: public:
ICEDestBox( QWidget *_parent = NULL ); ICEDestBox( QWidget *_parent = NULL );
virtual QString getMRL( const QString& ); virtual QString getMRL( const QString&, const int, const bool,
const QString&, const QString& );
private: private:
QLineEdit *ICEEdit; QLineEdit *ICEEdit;
QLineEdit *ICEMountEdit; QLineEdit *ICEMountEdit;
......
...@@ -229,7 +229,10 @@ void SoutDialog::updateMRL() ...@@ -229,7 +229,10 @@ void SoutDialog::updateMRL()
if( !vdb ) if( !vdb )
continue; continue;
QString tempMRL = vdb->getMRL( qs_mux ); QString tempMRL = vdb->getMRL( qs_mux, ui.ttl->value(),
ui.sap->isChecked(),
ui.sapName->text(),
ui.sapGroup->text() );
if( tempMRL.isEmpty() ) continue; if( tempMRL.isEmpty() ) continue;
if( multi ) if( multi )
...@@ -255,33 +258,7 @@ void SoutDialog::updateMRL() ...@@ -255,33 +258,7 @@ void SoutDialog::updateMRL()
mrl = smrl.getMrl(); mrl = smrl.getMrl();
if( ui.sap->isChecked() )
{
QString group = ui.sapGroup->text();
QString name = ui.sapName->text();
/* FIXME: This sucks. We should really return a QStringList instead of
* (mis)quoting, concatainating and split input item paramters. */
name = name.replace( " ", " " );
group = group.replace( " ", " " );
/* We need to add options for both standard and rtp targets */
/* This is inelegant but simple and functional */
mrl.append( qfu( " :sout-rtp-sap" ) );
mrl.append( qfu( " :sout-rtp-name=" ) + name );
mrl.append( qfu( " :sout-standard-sap" ) );
mrl.append( qfu( " :sout-standard-name=" ) + name );
mrl.append( qfu( " :sout-standard-group=" ) + group );
}
else
{
mrl.append( qfu( " :no-sout-rtp-sap" ) );
mrl.append( qfu( " :no-sout-standard-sap" ) );
}
if( ui.soutAll->isChecked() ) mrl.append( " :sout-all" ); if( ui.soutAll->isChecked() ) mrl.append( " :sout-all" );
mrl.append( qfu( " :ttl=" ) + QString::number( ui.ttl->value() ) );
mrl.append( " :sout-keep" ); mrl.append( " :sout-keep" );
ui.mrlEdit->setPlainText( mrl ); ui.mrlEdit->setPlainText( mrl );
......
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