[vlc-devel] commit: Qt4: rework HTTP sout box ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Dec 29 22:30:21 CET 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Dec 29 23:28:00 2009 +0200| [abe147c03c7586d4a0f3ccc5ca455cc80b06de5f] | committer: Rémi Denis-Courmont 

Qt4: rework HTTP sout box

The address field is removed, as it is quite useless. The default
unspecified value works just fine. In fact, it works better than
0.0.0.0 as it allows both IPv6 and IPv4 automatically.

A new path field is added for the local path, defaults to '/'
consistent with HTTP URI semantics ("http://www.example.com" really
means "http://www.example.com/").

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

 modules/gui/qt4/components/sout/sout_widgets.cpp |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/modules/gui/qt4/components/sout/sout_widgets.cpp b/modules/gui/qt4/components/sout/sout_widgets.cpp
index 98154fd..7cfd911 100644
--- a/modules/gui/qt4/components/sout/sout_widgets.cpp
+++ b/modules/gui/qt4/components/sout/sout_widgets.cpp
@@ -138,13 +138,13 @@ HTTPDestBox::HTTPDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
         this );
     layout->addWidget(httpOutput, 0, 0, 1, -1);
 
-    QLabel *HTTPLabel = new QLabel( qtr("Address"), this );
+    QLabel *HTTPLabel = new QLabel( qtr("Path"), this );
     QLabel *HTTPPortLabel = new QLabel( qtr("Port"), this );
-    layout->addWidget(HTTPLabel, 1, 0, 1, 1);
-    layout->addWidget(HTTPPortLabel, 2, 0, 1, 1);
+    layout->addWidget(HTTPLabel, 2, 0, 1, 1);
+    layout->addWidget(HTTPPortLabel, 1, 0, 1, 1);
 
     HTTPEdit = new QLineEdit(this);
-    HTTPEdit->setText( "0.0.0.0" );
+    HTTPEdit->setText( "/" );
 
     HTTPPort = new QSpinBox(this);
     HTTPPort->setMaximumSize(QSize(90, 16777215));
@@ -153,8 +153,8 @@ HTTPDestBox::HTTPDestBox( QWidget *_parent ) : VirtualDestBox( _parent )
     HTTPPort->setMaximum(65535);
     HTTPPort->setValue(8080);
 
-    layout->addWidget(HTTPEdit, 1, 1, 1, 1);
-    layout->addWidget(HTTPPort, 2, 1, 1, 1);
+    layout->addWidget(HTTPEdit, 2, 1, 1, 1);
+    layout->addWidget(HTTPPort, 1, 1, 1, 1);
     CS( HTTPPort );
     CT( HTTPEdit );
 }
@@ -163,12 +163,19 @@ QString HTTPDestBox::getMRL( const QString& mux )
 {
     if( HTTPEdit->text().isEmpty() ) return "";
 
+    QString path = HTTPEdit->text();
+    if( path[0] != '/' )
+        path.prepend( qfu("/") );
+    QString port;
+    port.setNum( HTTPPort->value() );
+    QString dst = ":" + port + path;
+
     SoutMrl m;
     m.begin( "std" );
     m.option(  "access", "http" );
     if( !mux.isEmpty() )
         m.option( "mux", mux );
-    m.option( "dst", HTTPEdit->text(), HTTPPort->value() );
+    m.option( "dst", dst );
     m.end();
 
     return m.getMrl();




More information about the vlc-devel mailing list