[vlc-commits] commit: qt4: sout-widget changes to check mux (Ilkka Ollakka )

git at videolan.org git at videolan.org
Sat Jun 5 16:58:18 CEST 2010


vlc/vlc-1.1 | branch: master | Ilkka Ollakka <ileoo at videolan.org> | Sun May 16 14:16:04 2010 +0300| [b01ae8b41e6884db32b85a963cb38fd2c79fd302] | committer: Ilkka Ollakka 

qt4: sout-widget changes to check mux

Doesn't allow mp4-muxer on other than file-output (doesn't check rtp atm).
Also tries to be littlebit clever and cleanup sout-mrl.
(cherry picked from commit b46a8cb9e596cc5d0b69480cb374d382cdc46b90)

Signed-off-by: Ilkka Ollakka <ileoo at videolan.org>

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

 modules/gui/qt4/components/sout/sout_widgets.cpp |   34 +++++++++++++++------
 1 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/modules/gui/qt4/components/sout/sout_widgets.cpp b/modules/gui/qt4/components/sout/sout_widgets.cpp
index 3be195c..02ad3be 100644
--- a/modules/gui/qt4/components/sout/sout_widgets.cpp
+++ b/modules/gui/qt4/components/sout/sout_widgets.cpp
@@ -113,11 +113,21 @@ QString FileDestBox::getMRL( const QString& mux )
     if( fileEdit->text().isEmpty() ) return "";
 
     SoutMrl m;
-    m.begin( "std" );
-    m.option( "access", "file" );
+    m.begin( "file" );
+    QString outputfile = fileEdit->text();
     if( !mux.isEmpty() )
-        m.option( "mux", mux ); //FIXME: alert if ext doesn't match
-    m.option( "dst", fileEdit->text() );
+    {
+        if( outputfile.contains( QRegExp("\\..{2,3}$")) &&
+            !outputfile.endsWith(mux) )
+        {
+           /* Replace the extension according to muxer */
+           outputfile.replace(QRegExp("\\..{2,3}$"),"."+mux);
+        } else if (!outputfile.endsWith( mux ) )
+        {
+           m.option( "mux", mux );
+        }
+    }
+    m.option( "dst", outputfile );
     m.end();
 
     return m.getMrl();
@@ -175,10 +185,13 @@ QString HTTPDestBox::getMRL( const QString& mux )
     QString dst = ":" + port + path;
 
     SoutMrl m;
-    m.begin( "std" );
-    m.option(  "access", "http" );
-    if( !mux.isEmpty() )
+    m.begin( "http" );
+    /* http-output can't do mp4-mux, so don't accept it,
+       if we don't get usable mux, fallback to flv */
+    if( !mux.isEmpty() && mux.compare("mp4") )
         m.option( "mux", mux );
+    else if ( !path.contains(QRegExp("\\..{2,3}$") ) )
+        m.option( "mux", "ffmpeg{mux=flv}" );
     m.option( "dst", dst );
     m.end();
 
@@ -314,9 +327,9 @@ QString UDPDestBox::getMRL( const QString& mux )
     if( UDPEdit->text().isEmpty() ) return "";
 
     SoutMrl m;
-    m.begin( "std" );
-    m.option(  "access", "udp" );
-    if( !mux.isEmpty() )
+    m.begin( "udp" );
+    /* udp output, ts-mux is really only reasonable one to use*/
+    if( !mux.isEmpty() && !mux.compare("ts" ) )
         m.option( "mux", mux );
     m.option( "dst", UDPEdit->text(), UDPPort->value() );
     m.end();
@@ -365,6 +378,7 @@ QString RTPDestBox::getMRL( const QString& )
     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 ) );
     m.end();



More information about the vlc-commits mailing list