[vlc-commits] Qt4: add SAP session name to RTP/AVP and RTP/TS destinations

Rémi Denis-Courmont git at videolan.org
Thu Aug 23 16:40:04 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Aug 23 17:37:43 2012 +0300| [11104bf4206a1e16bbdd70faaa5190e0e0a34d78] | committer: Rémi Denis-Courmont

Qt4: add SAP session name to RTP/AVP and RTP/TS destinations

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=11104bf4206a1e16bbdd70faaa5190e0e0a34d78
---

 modules/gui/qt4/components/sout/sout_widgets.cpp |   34 +++++++++++++++-------
 modules/gui/qt4/components/sout/sout_widgets.hpp |    3 +-
 2 files changed, 25 insertions(+), 12 deletions(-)

diff --git a/modules/gui/qt4/components/sout/sout_widgets.cpp b/modules/gui/qt4/components/sout/sout_widgets.cpp
index ebf952a..94a0c4a 100644
--- a/modules/gui/qt4/components/sout/sout_widgets.cpp
+++ b/modules/gui/qt4/components/sout/sout_widgets.cpp
@@ -344,7 +344,7 @@ QString UDPDestBox::getMRL( const QString& mux )
 
 
 RTPDestBox::RTPDestBox( QWidget *_parent, const char *_mux )
-    : VirtualDestBox( _parent ), mux( _mux )
+    : VirtualDestBox( _parent ), mux( qfu(_mux) )
 {
     QGridLayout *layout = new QGridLayout( this );
 
@@ -354,37 +354,49 @@ RTPDestBox::RTPDestBox( QWidget *_parent, const char *_mux )
     layout->addWidget(rtpOutput, 0, 0, 1, -1);
 
     QLabel *RTPLabel = new QLabel( qtr("Address"), this );
-    QLabel *RTPPortLabel = new QLabel( qtr("Base port"), this );
-    layout->addWidget(RTPLabel, 1, 0, 1, 1);
-    layout->addWidget(RTPPortLabel, 2, 0, 1, 1);
-
     RTPEdit = new QLineEdit(this);
+    layout->addWidget(RTPLabel, 1, 0, 1, 1);
+    layout->addWidget(RTPEdit, 1, 1, 1, 1);
 
+    QLabel *RTPPortLabel = new QLabel( qtr("Base port"), this );
     RTPPort = new QSpinBox(this);
     RTPPort->setMaximumSize(QSize(90, 16777215));
     RTPPort->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
     RTPPort->setMinimum(1);
     RTPPort->setMaximum(65535);
     RTPPort->setValue(5004);
-
-    layout->addWidget(RTPEdit, 1, 1, 1, 1);
+    layout->addWidget(RTPPortLabel, 2, 0, 1, 1);
     layout->addWidget(RTPPort, 2, 1, 1, 1);
 
-    CS( RTPPort );
+    QLabel *SAPNameLabel = new QLabel( qtr("Stream name"), this );
+    SAPName = new QLineEdit(this);
+    layout->addWidget(SAPNameLabel, 3, 0, 1, 1);
+    layout->addWidget(SAPName, 3, 1, 1, 1);
+
     CT( RTPEdit );
+    CS( RTPPort );
+    CT( SAPName );
 }
 
 QString RTPDestBox::getMRL( const QString& )
 {
-    if( RTPEdit->text().isEmpty() ) return "";
+    QString addr = RTPEdit->text();
+    QString name = SAPName->text();
+
+    if( addr.isEmpty() ) return qfu("");
 
     SoutMrl m;
     m.begin( "rtp" );
     m.option( "dst", RTPEdit->text() );
     m.option( "port", RTPPort->value() );
     /* mp4-mux ain't usable in rtp-output either */
-    if( mux != NULL )
-        m.option( "mux", qfu( mux ) );
+    if( !mux.isEmpty() )
+        m.option( "mux", mux );
+    if( !name.isEmpty() )
+    {
+        m.option( "sap" );
+        m.option( "name", name );
+    }
     m.end();
 
     return m.getMrl();
diff --git a/modules/gui/qt4/components/sout/sout_widgets.hpp b/modules/gui/qt4/components/sout/sout_widgets.hpp
index c7572e2..983170e 100644
--- a/modules/gui/qt4/components/sout/sout_widgets.hpp
+++ b/modules/gui/qt4/components/sout/sout_widgets.hpp
@@ -121,7 +121,8 @@ class RTPDestBox: public VirtualDestBox
     private:
         QLineEdit *RTPEdit;
         QSpinBox *RTPPort;
-        const char *mux;
+        QLineEdit *SAPName;
+        QString mux;
 };
 
 class ICEDestBox: public VirtualDestBox



More information about the vlc-commits mailing list