[vlc-devel] [PATCH] gui: add SRT stream wizard

Aaron Boxer boxerab at gmail.com
Tue Feb 26 19:09:42 CET 2019


Thanks, Remi.

I changed to match the other URLs in the list


diff --git a/modules/gui/qt/components/sout/sout_widgets.cpp
b/modules/gui/qt/components/sout/sout_widgets.cpp
index a6793e9243..1f47fba0eb 100644
--- a/modules/gui/qt/components/sout/sout_widgets.cpp
+++ b/modules/gui/qt/components/sout/sout_widgets.cpp
@@ -359,6 +359,58 @@ QString UDPDestBox::getMRL( const QString& mux )
     return m.getMrl();
 }

+SRTDestBox::SRTDestBox( QWidget *_parent, const char *_mux )
+    : VirtualDestBox( _parent ), mux( qfu(_mux) )
+{
+    label->setText( qtr( "This module outputs the transcoded stream to a
network via SRT.") );
+
+    QLabel *SRTLabel = new QLabel( qtr("Address"), this );
+    SRTEdit = new QLineEdit(this);
+    layout->addWidget(SRTLabel, 1, 0, 1, 1);
+    layout->addWidget(SRTEdit, 1, 1, 1, 1);
+
+    QLabel *SRTPortLabel = new QLabel( qtr("Base port"), this );
+    SRTPort = new QSpinBox(this);
+    SRTPort->setMaximumSize(QSize(90, 16777215));
+
SRTPort->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
+    SRTPort->setMinimum(1);
+    SRTPort->setMaximum(65535);
+    SRTPort->setValue(7001);
+    layout->addWidget(SRTPortLabel, 2, 0, 1, 1);
+    layout->addWidget(SRTPort, 2, 1, 1, 1);
+
+    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( SRTEdit );
+    CS( SRTPort );
+    CT( SAPName );
+}
+
+QString SRTDestBox::getMRL( const QString& )
+{
+    QString addr = SRTEdit->text();
+    QString name = SAPName->text();
+
+    if( addr.isEmpty() ) return qfu("");
+    QString destination = addr + ":" + QString::number(SRTPort->value());
+    SoutMrl m;
+    m.begin( "srt" );
+    m.option( "dst", destination );
+    /* mp4-mux ain't usable in rtp-output either */
+    if( !mux.isEmpty() )
+        m.option( "mux", mux );
+    if( !name.isEmpty() )
+    {
+        m.option( "sap" );
+        m.option( "name", name );
+    }
+    m.end();
+
+    return m.getMrl();
+}


 RTPDestBox::RTPDestBox( QWidget *_parent, const char *_mux )
diff --git a/modules/gui/qt/components/sout/sout_widgets.hpp
b/modules/gui/qt/components/sout/sout_widgets.hpp
index 5b9496c83a..3413c8d239 100644
--- a/modules/gui/qt/components/sout/sout_widgets.hpp
+++ b/modules/gui/qt/components/sout/sout_widgets.hpp
@@ -117,6 +117,19 @@ class UDPDestBox: public VirtualDestBox
         QSpinBox *UDPPort;
 };

+class SRTDestBox: public VirtualDestBox
+{
+    Q_OBJECT
+    public:
+        SRTDestBox( QWidget *_parent = NULL, const char *mux = NULL );
+        QString getMRL( const QString& ) Q_DECL_OVERRIDE;
+    private:
+        QLineEdit *SRTEdit;
+        QSpinBox *SRTPort;
+        QLineEdit *SAPName;
+        QString mux;
+};
+
 class RTPDestBox: public VirtualDestBox
 {
     Q_OBJECT
diff --git a/modules/gui/qt/dialogs/sout.cpp
b/modules/gui/qt/dialogs/sout.cpp
index 8c2be69e23..003427acae 100644
--- a/modules/gui/qt/dialogs/sout.cpp
+++ b/modules/gui/qt/dialogs/sout.cpp
@@ -69,6 +69,7 @@ SoutDialog::SoutDialog( QWidget *parent, intf_thread_t
*_p_intf, const QString&
     ui.destBox->addItem( "HTTP" );
     ui.destBox->addItem( "MS-WMSP (MMSH)" );
     ui.destBox->addItem( "RTSP" );
+    ui.destBox->addItem( "SRT / MPEG Transport Stream" );
     ui.destBox->addItem( "RTP / MPEG Transport Stream" );
     ui.destBox->addItem( "RTP Audio/Video Profile" );
     ui.destBox->addItem( "UDP (legacy)" );
@@ -132,18 +133,22 @@ void SoutDialog::addDest( )
             caption = qfu( "RTSP" );
             break;
         case 4:
+            db = new SRTDestBox( this, "ts" );
+            caption = "SRT/TS";
+            break;
+        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;
diff --git a/modules/gui/qt/ui/open_net.ui b/modules/gui/qt/ui/open_net.ui
index e565ff3fd9..82c5347476 100644
--- a/modules/gui/qt/ui/open_net.ui
+++ b/modules/gui/qt/ui/open_net.ui
@@ -41,6 +41,7 @@
         </property>
         <property name="text">
          <string notr="true">http://www.example.com/stream.avi
+srt://server.example.org:7001
 rtp://@:1234
 mms://mms.examples.com/stream.asx
 rtsp://server.example.org:8080/test.sdp




On Tue, Feb 26, 2019 at 12:58 PM Rémi Denis-Courmont <remi at remlab.net>
wrote:

> Le tiistaina 26. helmikuuta 2019, 19.50.06 EET Aaron Boxer a écrit :
> > diff --git a/modules/gui/qt/ui/open_net.ui
> b/modules/gui/qt/ui/open_net.ui
> > index e565ff3fd9..26f522e4ce 100644
> > --- a/modules/gui/qt/ui/open_net.ui
> > +++ b/modules/gui/qt/ui/open_net.ui
> > @@ -41,6 +41,7 @@
> >          </property>
> >          <property name="text">
> >           <string notr="true">http://www.example.com/stream.avi
> > +srt://192.168.0.1:7001
>
> RFC1918 space is not "example" space. We have RFC2606 and RFC5737.
>
> >  rtp://@:1234
> >  mms://mms.examples.com/stream.asx
> >  rtsp://server.example.org:8080/test.sdp
>
>
> --
> 雷米‧德尼-库尔蒙
> http://www.remlab.net/
>
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190226/b6be7fb7/attachment.html>


More information about the vlc-devel mailing list