Commit b6eb37cc authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

ISource: expose the parsed state

parent edf05f45
......@@ -41,6 +41,7 @@ namespace Backend
* @return
*/
virtual bool preparse() = 0;
virtual bool isParsed() const = 0;
virtual unsigned int width() const = 0;
virtual unsigned int height() const = 0;
virtual int64_t length() const = 0;
......
......@@ -31,6 +31,7 @@ using namespace Backend::VLC;
VLCSource::VLCSource( VLCBackend* backend, const QString& path )
: m_backend( backend )
, m_isParsed( false )
{
m_media = new LibVLCpp::Media( backend->vlcInstance(), path );
}
......@@ -55,6 +56,9 @@ VLCSource::createRenderer( ISourceRendererEventCb *callback )
bool
VLCSource::preparse()
{
// This assume we won't try to parse the same media twice ast the same time
m_isParsed = true;
VmemRenderer* renderer = new VmemRenderer( m_backend, this, NULL );
LibVLCpp::MediaPlayer* mediaPlayer = renderer->mediaPlayer();
{
......@@ -84,6 +88,12 @@ VLCSource::preparse()
return true;
}
bool
VLCSource::isParsed() const
{
return m_isParsed;
}
static bool
checkTimeChanged( const libvlc_event_t* event )
{
......
......@@ -43,6 +43,7 @@ public:
virtual ~VLCSource();
virtual ISourceRenderer* createRenderer( ISourceRendererEventCb* callback );
virtual bool preparse();
virtual bool isParsed() const;
virtual quint32 width() const;
virtual quint32 height() const;
virtual int64_t length() const;
......@@ -68,6 +69,7 @@ private:
unsigned int m_nbAudioTracks;
int64_t m_length; //in milliseconds.
QImage* m_snapshot;
bool m_isParsed;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment