Commit 6d1917fd authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Updating libvlcpp according to latest changes in libvlc

Removed useless and old methods.
parent de6cd2e1
...@@ -27,11 +27,10 @@ ...@@ -27,11 +27,10 @@
using namespace LibVLCpp; using namespace LibVLCpp;
Media::Media( const QString& filename ) Media::Media( const QString& filename ) :
: m_pixelBuffer( NULL ), m_fileName( filename ) m_fileName( filename )
{ {
m_internalPtr = libvlc_media_new( *(LibVLCpp::Instance::getInstance()), filename.toLocal8Bit(), m_ex ); m_internalPtr = libvlc_media_new( *(LibVLCpp::Instance::getInstance()), filename.toLocal8Bit() );
CheckVlcppException(m_ex);
} }
Media::~Media() Media::~Media()
...@@ -42,7 +41,6 @@ Media::~Media() ...@@ -42,7 +41,6 @@ Media::~Media()
void Media::addOption( const char* opt ) void Media::addOption( const char* opt )
{ {
libvlc_media_add_option_flag( m_internalPtr, opt, libvlc_media_option_trusted ); libvlc_media_add_option_flag( m_internalPtr, opt, libvlc_media_option_trusted );
CheckVlcppException(m_ex);
} }
void Media::setVideoLockCallback( void* callback ) void Media::setVideoLockCallback( void* callback )
...@@ -89,26 +87,6 @@ void Media::setAudioDataCtx( void* dataCtx ) ...@@ -89,26 +87,6 @@ void Media::setAudioDataCtx( void* dataCtx )
addOption( param ); addOption( param );
} }
void Media::outputInVmem()
{
addOption( ":vout=vmem" );
}
void Media::outputInWindow()
{
// this->addOption();
}
void Media::setPixelBuffer( uchar* buffer )
{
m_pixelBuffer = buffer;
}
uchar* Media::getPixelBuffer()
{
return m_pixelBuffer;
}
const QString& Media::getFileName() const const QString& Media::getFileName() const
{ {
return m_fileName; return m_fileName;
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include <QMutex> #include <QMutex>
#include "VLCpp.hpp" #include "VLCpp.hpp"
#include "VLCException.h"
namespace LibVLCpp namespace LibVLCpp
{ {
...@@ -46,18 +45,9 @@ namespace LibVLCpp ...@@ -46,18 +45,9 @@ namespace LibVLCpp
void setAudioUnlockCallback( void* ); void setAudioUnlockCallback( void* );
void setVideoDataCtx( void* dataCtx ); void setVideoDataCtx( void* dataCtx );
void setAudioDataCtx( void* dataCtx ); void setAudioDataCtx( void* dataCtx );
void outputInVmem();
void outputInWindow();
void setPixelBuffer( uchar* buffer );
uchar* getPixelBuffer();
const QString& getFileName() const; const QString& getFileName() const;
private: private:
private:
Exception m_ex;
uchar* m_pixelBuffer;
QString m_fileName; QString m_fileName;
}; };
} }
......
...@@ -186,8 +186,7 @@ qint64 MediaPlayer::getLength() ...@@ -186,8 +186,7 @@ qint64 MediaPlayer::getLength()
void MediaPlayer::takeSnapshot( const char* outputFile, unsigned int width, unsigned int heigth ) void MediaPlayer::takeSnapshot( const char* outputFile, unsigned int width, unsigned int heigth )
{ {
libvlc_video_take_snapshot( *this, outputFile, width, heigth, m_ex ); libvlc_video_take_snapshot( *this, 0, outputFile, width, heigth );
CheckVlcppException( m_ex );
} }
bool MediaPlayer::isPlaying() bool MediaPlayer::isPlaying()
...@@ -217,18 +216,10 @@ void MediaPlayer::setMedia( Media* media ) ...@@ -217,18 +216,10 @@ void MediaPlayer::setMedia( Media* media )
libvlc_media_player_set_media( m_internalPtr, media->getInternalPtr() ); libvlc_media_player_set_media( m_internalPtr, media->getInternalPtr() );
} }
int MediaPlayer::getWidth() void
{ MediaPlayer::getSize( quint32 *outWidth, quint32 *outHeight )
int width = libvlc_video_get_width( m_internalPtr, m_ex );
CheckVlcppException( m_ex );
return width;
}
int MediaPlayer::getHeight()
{ {
int height = libvlc_video_get_height( m_internalPtr, m_ex ); libvlc_video_get_size( m_internalPtr, 0, outWidth, outHeight );
CheckVlcppException( m_ex );
return height;
} }
float MediaPlayer::getFps() float MediaPlayer::getFps()
......
...@@ -57,8 +57,7 @@ namespace LibVLCpp ...@@ -57,8 +57,7 @@ namespace LibVLCpp
void setDrawable( void* hwnd ); void setDrawable( void* hwnd );
void setDrawable( quint32 drawable ); void setDrawable( quint32 drawable );
void setMedia(Media* media); void setMedia(Media* media);
int getWidth(); void getSize( quint32 *outWidth, quint32 *outHeight);
int getHeight();
float getFps(); float getFps();
void nextFrame(); void nextFrame();
bool hasVout(); bool hasVout();
......
...@@ -117,8 +117,10 @@ MetaDataWorker::metaDataAvailable() ...@@ -117,8 +117,10 @@ MetaDataWorker::metaDataAvailable()
} }
LibVLCpp::Exception::setErrorCallback( NULL ); LibVLCpp::Exception::setErrorCallback( NULL );
m_media->setWidth( m_mediaPlayer->getWidth() ); quint32 width, height;
m_media->setHeight( m_mediaPlayer->getHeight() ); m_mediaPlayer->getSize( &width, &height );
m_media->setWidth( width );
m_media->setHeight( height );
m_media->setFps( m_mediaPlayer->getFps() ); m_media->setFps( m_mediaPlayer->getFps() );
if ( m_media->getFps() == .0f ) if ( m_media->getFps() == .0f )
{ {
......
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