[vlc-devel] [PATCH 3.0.x 4/4] Qt: sout: Add rist output option

Thomas Guillem thomas at gllm.fr
Mon Nov 2 14:03:39 CET 2020


From: Sergio Ammirata <sergio at ammirata.net>

(cherry picked from commit d87f13521cba7f2072ca03c0451c7afd47274fa9)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
---
 .../gui/qt/components/sout/sout_widgets.cpp   | 52 +++++++++++++++++++
 .../gui/qt/components/sout/sout_widgets.hpp   | 13 +++++
 modules/gui/qt/dialogs/sout.cpp               | 17 +++---
 3 files changed, 76 insertions(+), 6 deletions(-)

diff --git a/modules/gui/qt/components/sout/sout_widgets.cpp b/modules/gui/qt/components/sout/sout_widgets.cpp
index 8fb1b993dd..d5288ff2ee 100644
--- a/modules/gui/qt/components/sout/sout_widgets.cpp
+++ b/modules/gui/qt/components/sout/sout_widgets.cpp
@@ -177,7 +177,59 @@ void FileDestBox::fileBrowse()
     emit mrlUpdated();
 }
 
+RISTDestBox::RISTDestBox( QWidget *_parent, const char *_mux )
+    : VirtualDestBox( _parent ), mux( qfu(_mux) )
+{
+    label->setText( qtr( "This module outputs the stream using the RIST protocol (TR06).") );
+
+    QLabel *RISTAddressLabel = new QLabel( qtr("Destination Address"), this );
+    RISTAddress = new QLineEdit(this);
+    layout->addWidget(RISTAddressLabel, 1, 0, 1, 1);
+    layout->addWidget(RISTAddress, 1, 1, 1, 1);
+
+    QLabel *RISTPortLabel = new QLabel( qtr("Destination Port"), this );
+    RISTPort = new QSpinBox(this);
+    RISTPort->setMaximumSize(QSize(90, 16777215));
+    RISTPort->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
+    RISTPort->setMinimum(1);
+    RISTPort->setMaximum(65535);
+    RISTPort->setValue(1968);
+    layout->addWidget(RISTPortLabel, 2, 0, 1, 1);
+    layout->addWidget(RISTPort, 2, 1, 1, 1);
+
+    QLabel *RISTNameLabel = new QLabel( qtr("Stream Name"), this );
+    RISTName = new QLineEdit(this);
+    layout->addWidget(RISTNameLabel, 3, 0, 1, 1);
+    layout->addWidget(RISTName, 3, 1, 1, 1);
+
+    CT( RISTAddress );
+    CS( RISTPort );
+    CT( RISTName );
+}
+
+QString RISTDestBox::getMRL( const QString& )
+{
+    QString addr = RISTAddress->text();
+    QString name = RISTName->text();
+
+    if( addr.isEmpty() ) return qfu("");
+    QString destination = addr + ":" + QString::number(RISTPort->value());
+    SoutMrl m;
+    m.begin( "std" );
+    if( !name.isEmpty() )
+    {
+        m.option( "access", "rist{stream-name=" + name + "}" );
+    }
+    else
+    {
+        m.option( "access", "rist" );
+    }
+    m.option( "mux", "ts" );
+    m.option( "dst", destination );
+    m.end();
 
+    return m.getMrl();
+}
 
 HTTPDestBox::HTTPDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
 {
diff --git a/modules/gui/qt/components/sout/sout_widgets.hpp b/modules/gui/qt/components/sout/sout_widgets.hpp
index 9143cdba64..e548796f72 100644
--- a/modules/gui/qt/components/sout/sout_widgets.hpp
+++ b/modules/gui/qt/components/sout/sout_widgets.hpp
@@ -74,6 +74,19 @@ class FileDestBox: public VirtualDestBox
         void fileBrowse();
 };
 
+class RISTDestBox: public VirtualDestBox
+{
+    Q_OBJECT
+    public:
+        RISTDestBox( QWidget *_parent = NULL, const char *mux = NULL );
+        QString getMRL( const QString& ) Q_DECL_OVERRIDE;
+    private:
+        QLineEdit *RISTAddress;
+        QSpinBox *RISTPort;
+        QLineEdit *RISTName;
+        QString mux;
+};
+
 class HTTPDestBox: public VirtualDestBox
 {
     Q_OBJECT
diff --git a/modules/gui/qt/dialogs/sout.cpp b/modules/gui/qt/dialogs/sout.cpp
index 1a6213bf35..3d9de8f9c9 100644
--- a/modules/gui/qt/dialogs/sout.cpp
+++ b/modules/gui/qt/dialogs/sout.cpp
@@ -67,6 +67,7 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf, const QString&
     ui.destTab->setTabIcon( 0, QIcon( ":/buttons/playlist/playlist_add.svg" ) );
 
     ui.destBox->addItem( qtr( "File" ) );
+    ui.destBox->addItem( "RIST / MPEG Transport Stream" );
     ui.destBox->addItem( "HTTP" );
     ui.destBox->addItem( "MS-WMSP (MMSH)" );
     ui.destBox->addItem( "RTSP" );
@@ -121,30 +122,34 @@ void SoutDialog::addDest( )
             caption = qtr( "File" );
             break;
         case 1:
+            db = new RISTDestBox( this );
+            caption = qfu( "RIST" );
+            break;
+        case 2:
             db = new HTTPDestBox( this );
             caption = qfu( "HTTP" );
             break;
-        case 2:
+        case 3:
             db = new MMSHDestBox( this );
             caption = qfu( "WMSP" );
             break;
-        case 3:
+        case 4:
             db = new RTSPDestBox( this );
             caption = qfu( "RTSP" );
             break;
-        case 4:
+        case 5:
             db = new RTPDestBox( this, "ts" );
             caption = "RTP/TS";
             break;
-        case 5:
+        case 6:
             db = new RTPDestBox( this );
             caption = "RTP/AVP";
             break;
-        case 6:
+        case 7:
             db = new UDPDestBox( this );
             caption = "UDP";
             break;
-        case 7:
+        case 8:
             db = new ICEDestBox( this );
             caption = "Icecast";
             break;
-- 
2.28.0



More information about the vlc-devel mailing list