[vlmc-devel] ISource: Expose length (in milliseconds)
Hugo Beauzée-Luyssen
git at videolan.org
Mon Feb 24 20:09:38 CET 2014
vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Feb 24 00:29:17 2014 +0200| [135c35ac2807ed68d7cba9b37efad298c14cbd06] | committer: Hugo Beauzée-Luyssen
ISource: Expose length (in milliseconds)
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=135c35ac2807ed68d7cba9b37efad298c14cbd06
---
src/Backend/ISource.h | 15 +++++++++------
src/Backend/VLC/VLCSource.cpp | 6 ++++++
src/Backend/VLC/VLCSource.h | 3 ++-
3 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/src/Backend/ISource.h b/src/Backend/ISource.h
index 1416150..744cc0a 100644
--- a/src/Backend/ISource.h
+++ b/src/Backend/ISource.h
@@ -23,6 +23,8 @@
#ifndef ISOURCE_HPP
#define ISOURCE_HPP
+#include <stdint.h>
+
namespace Backend
{
class ISourceRendererEventCb;
@@ -38,12 +40,13 @@ namespace Backend
* This method will block until computing is finished.
* @return
*/
- virtual bool preparse() = 0;
- virtual unsigned int width() const = 0;
- virtual unsigned int height() const = 0;
- virtual float fps() const = 0;
- virtual bool hasVideo() const = 0;
- virtual bool hasAudio() const = 0;
+ virtual bool preparse() = 0;
+ virtual unsigned int width() const = 0;
+ virtual unsigned int height() const = 0;
+ virtual int64_t length() const = 0;
+ virtual float fps() const = 0;
+ virtual bool hasVideo() const = 0;
+ virtual bool hasAudio() const = 0;
};
class IMemorySource
diff --git a/src/Backend/VLC/VLCSource.cpp b/src/Backend/VLC/VLCSource.cpp
index 3b0c1c2..a72bca7 100644
--- a/src/Backend/VLC/VLCSource.cpp
+++ b/src/Backend/VLC/VLCSource.cpp
@@ -124,6 +124,12 @@ VLCSource::height() const
return m_height;
}
+int64_t
+VLCSource::length() const
+{
+ return m_length;
+}
+
float
VLCSource::fps() const
{
diff --git a/src/Backend/VLC/VLCSource.h b/src/Backend/VLC/VLCSource.h
index fbda626..c27fb6c 100644
--- a/src/Backend/VLC/VLCSource.h
+++ b/src/Backend/VLC/VLCSource.h
@@ -45,6 +45,7 @@ public:
virtual bool preparse();
virtual quint32 width() const;
virtual quint32 height() const;
+ virtual int64_t length() const;
virtual float fps() const;
virtual bool hasVideo() const;
virtual bool hasAudio() const;
@@ -63,7 +64,7 @@ private:
float m_fps;
unsigned int m_nbVideoTracks;
unsigned int m_nbAudioTracks;
- qint64 m_length; //in milliseconds.
+ int64_t m_length; //in milliseconds.
QImage* m_snapshot;
};
More information about the Vlmc-devel
mailing list