[vlmc-devel] Media: Remove InputType. We don't support this and it clutters the code.

Hugo Beauzée-Luyssen git at videolan.org
Mon Feb 24 14:46:42 CET 2014


vlmc | branch: ibackend | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Feb 24 14:51:12 2014 +0200| [8ecfa9bec7ed4492430db0282dd5c7253a5a0974] | committer: Hugo Beauzée-Luyssen

Media: Remove InputType. We don't support this and it clutters the code.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=8ecfa9bec7ed4492430db0282dd5c7253a5a0974
---

 src/Gui/import/ImportController.cpp |    4 ++--
 src/Media/Clip.cpp                  |   18 +++++-------------
 src/Media/Media.cpp                 |    7 -------
 src/Media/Media.h                   |    8 --------
 4 files changed, 7 insertions(+), 30 deletions(-)

diff --git a/src/Gui/import/ImportController.cpp b/src/Gui/import/ImportController.cpp
index 1a8c18f..f825305 100644
--- a/src/Gui/import/ImportController.cpp
+++ b/src/Gui/import/ImportController.cpp
@@ -238,7 +238,7 @@ ImportController::accept()
     collapseAllButCurrentPath();
     foreach ( Clip* clip, m_temporaryMedias->clips().values() )
     {
-        if ( clip->getMedia()->source()->length() == 0 && clip->getMedia()->inputType() == Media::File )
+        if ( clip->getMedia()->source()->length() == 0 )
             invalidMedias = true;
         Library::getInstance()->addClip( clip );
     }
@@ -260,7 +260,7 @@ ImportController::handleInvalidMedias()
     {
         foreach ( Clip* clip, m_temporaryMedias->clips().values() )
         {
-            if ( clip->getMedia()->source()->length() == 0 && clip->getMedia()->inputType() == Media::File )
+            if ( clip->getMedia()->source()->length() == 0 )
             {
                 Transcoder  *transcoder = new Transcoder( clip->getMedia() );
                 connect( transcoder, SIGNAL( done() ), transcoder, SLOT( deleteLater() ) );
diff --git a/src/Media/Clip.cpp b/src/Media/Clip.cpp
index 7e53499..8fd229c 100644
--- a/src/Media/Clip.cpp
+++ b/src/Media/Clip.cpp
@@ -106,19 +106,11 @@ Clip::lengthSecond() const
 void
 Clip::computeLength()
 {
-    if ( m_media->inputType() == Media::File )
-    {
-        float   fps = m_media->source()->fps();
-        if ( fps < 0.1f )
-            fps = Clip::DefaultFPS;
-        m_length = m_end - m_begin;
-        m_lengthSeconds = qRound64( (float)m_length / fps );
-    }
-    else
-    {
-        m_length = 0;
-        m_lengthSeconds = 0;
-    }
+    float   fps = m_media->source()->fps();
+    if ( fps < 0.1f )
+        fps = Clip::DefaultFPS;
+    m_length = m_end - m_begin;
+    m_lengthSeconds = qRound64( (float)m_length / fps );
 }
 
 const QStringList&
diff --git a/src/Media/Media.cpp b/src/Media/Media.cpp
index a79fdca..6e44caf 100644
--- a/src/Media/Media.cpp
+++ b/src/Media/Media.cpp
@@ -106,12 +106,6 @@ void Media::setFileType(Media::FileType type)
     m_fileType = type;
 }
 
-Media::InputType
-Media::inputType() const
-{
-    return m_inputType;
-}
-
 void
 Media::setNbFrames( qint64 nbFrames )
 {
@@ -187,7 +181,6 @@ Media::onMetaDataComputed()
 void
 Media::setFilePath( const QString &filePath )
 {
-    m_inputType = Media::File;
     if ( m_fileInfo )
         delete m_fileInfo;
     m_fileInfo = new QFileInfo( filePath );
diff --git a/src/Media/Media.h b/src/Media/Media.h
index 251be0c..ea0821f 100644
--- a/src/Media/Media.h
+++ b/src/Media/Media.h
@@ -66,11 +66,6 @@ public:
         Video,
         Image
     };
-    enum    InputType
-    {
-        File,
-        Stream
-    };
     static const QString        VideoExtensions;
     static const QString        AudioExtensions;
     static const QString        ImageExtensions;
@@ -98,8 +93,6 @@ public:
     FileType                    fileType() const;
     void                        setFileType( FileType type );
 
-    InputType                   inputType() const;
-
     Clip*                       baseClip() { return m_baseClip; }
     const Clip*                 baseClip() const { return m_baseClip; }
     void                        setBaseClip( Clip* clip );
@@ -122,7 +115,6 @@ protected:
     QFileInfo*                  m_fileInfo;
     qint64                      m_nbFrames;
     FileType                    m_fileType;
-    InputType                   m_inputType;
     QString                     m_fileName;
     Clip*                       m_baseClip;
     bool                        m_inWorkspace;



More information about the Vlmc-devel mailing list