Commit 092c9daa authored by Geoffroy Lacarriere's avatar Geoffroy Lacarriere
Browse files

Implemenation of the setDrawable method of libvlc_mediaplayer in the media class.

parent 429b0d64
......@@ -68,7 +68,7 @@ qint64 MediaPlayer::getLength()
{
qint64 length = libvlc_media_player_get_length( m_internalPtr, m_ex );
m_ex.checkThrow();
// qDebug() << "Media length: " << length;
//qDebug() << "Media length: " << length;
return length;
}
......@@ -91,3 +91,9 @@ bool MediaPlayer::isSeekable()
m_ex.checkThrow();
return (res == 1);
}
void MediaPlayer::setDrawable(int handle)
{
libvlc_drawable_t window = handle;
libvlc_media_player_set_drawable( m_internalPtr, window, m_ex );
}
......@@ -46,6 +46,7 @@ namespace LibVLCpp
void takeSnapshot( char* outputFile, unsigned int width, unsigned int heigth );
bool isPlaying();
bool isSeekable();
void setDrawable(int handle);
private:
Exception m_ex;
......
......@@ -141,10 +141,7 @@ qint64 Media::getLength()
void Media::play()
{
if( m_isMediaInitialized )
{
qDebug() << "play";
playSlot();
}
else
{
msleep(100);
......@@ -154,7 +151,6 @@ void Media::play()
void Media::playSlot()
{
qDebug() << "playSlot";
m_vlcMediaPlayer->play();
}
......@@ -163,3 +159,7 @@ QImage& Media::getImage()
return *m_image;
}
void Media::setDrawable(int handle)
{
m_vlcMediaPlayer->setDrawable(handle);
}
......@@ -50,6 +50,7 @@ public:
qint64 getLength();
QImage& getImage();
void play();
void setDrawable(int handle);
private:
virtual void run();
......
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