Commit 829df829 authored by Rémi Duraffort's avatar Rémi Duraffort

libvlcpp: fix compilation.

parent c1626d91
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
*****************************************************************************/ *****************************************************************************/
#include "media_player.hpp" #include "media_player.hpp"
#include "exception.hpp"
using namespace libvlc; using namespace libvlc;
...@@ -222,24 +221,20 @@ void MediaPlayer::nextFrame() ...@@ -222,24 +221,20 @@ void MediaPlayer::nextFrame()
void MediaPlayer::toggleFullscreen() void MediaPlayer::toggleFullscreen()
{ {
Exception ex; libvlc_toggle_fullscreen( m_player );
libvlc_toggle_fullscreen( m_player, &ex.ex );
} }
void MediaPlayer::enableFullscreen() void MediaPlayer::enableFullscreen()
{ {
Exception ex; libvlc_set_fullscreen( m_player, 1 );
libvlc_set_fullscreen( m_player, 1, &ex.ex );
} }
void MediaPlayer::disableFullscreen() void MediaPlayer::disableFullscreen()
{ {
Exception ex; libvlc_set_fullscreen( m_player, 0 );
libvlc_set_fullscreen( m_player, 0, &ex.ex );
} }
int MediaPlayer::fullscreen() int MediaPlayer::fullscreen()
{ {
Exception ex; return libvlc_get_fullscreen( m_player );
return libvlc_get_fullscreen( m_player, &ex.ex );
} }
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/ *****************************************************************************/
#include <cstdlib>
#include "video.hpp" #include "video.hpp"
#include "exception.hpp" #include "exception.hpp"
...@@ -40,38 +41,32 @@ Video::~Video() ...@@ -40,38 +41,32 @@ Video::~Video()
float Video::scale() float Video::scale()
{ {
Exception ex; return libvlc_video_get_scale( m_player );
return libvlc_video_get_scale( m_player, &ex.ex );
} }
char *Video::aspectRatio() char *Video::aspectRatio()
{ {
Exception ex; return libvlc_video_get_aspect_ratio( m_player );
return libvlc_video_get_aspect_ratio( m_player, &ex.ex );
} }
void Video::setAspectRatio( const char *aspect_ratio ) void Video::setAspectRatio( const char *aspect_ratio )
{ {
Exception ex; libvlc_video_set_aspect_ratio( m_player, aspect_ratio );
libvlc_video_set_aspect_ratio( m_player, aspect_ratio, &ex.ex );
} }
int Video::spu() int Video::spu()
{ {
Exception ex; return libvlc_video_get_spu( m_player );
return libvlc_video_get_spu( m_player, &ex.ex );
} }
int Video::spuCount() int Video::spuCount()
{ {
Exception ex; return libvlc_video_get_spu_count( m_player );
return libvlc_video_get_spu_count( m_player, &ex.ex );
} }
void Video::setSpu( int spu ) void Video::setSpu( int spu )
{ {
Exception ex; libvlc_video_set_spu( m_player, spu );
libvlc_video_set_spu( m_player, spu, &ex.ex );
} }
void Video::setSubtitleFile( const char *subtitle_file ) void Video::setSubtitleFile( const char *subtitle_file )
...@@ -81,20 +76,17 @@ void Video::setSubtitleFile( const char *subtitle_file ) ...@@ -81,20 +76,17 @@ void Video::setSubtitleFile( const char *subtitle_file )
char *Video::cropGeometry() char *Video::cropGeometry()
{ {
Exception ex; return libvlc_video_get_crop_geometry( m_player );
return libvlc_video_get_crop_geometry( m_player, &ex.ex );
} }
void Video::setCropGeometry( const char *geometry ) void Video::setCropGeometry( const char *geometry )
{ {
Exception ex; libvlc_video_set_crop_geometry( m_player, geometry );
libvlc_video_set_crop_geometry( m_player, geometry, &ex.ex );
} }
int Video::track() int Video::track()
{ {
Exception ex; return libvlc_video_get_track( m_player );
return libvlc_video_get_track( m_player, &ex.ex );
} }
int Video::trackCount() int Video::trackCount()
...@@ -104,18 +96,18 @@ int Video::trackCount() ...@@ -104,18 +96,18 @@ int Video::trackCount()
void Video::setTrack( int track ) void Video::setTrack( int track )
{ {
Exception ex; libvlc_video_set_track( m_player, track );
libvlc_video_set_track( m_player, track, &ex.ex );
} }
void Video::snapshot( const char *filepath, int with, int height ) int Video::snapshot( int num, const char *filepath, int with, int height )
{ {
Exception ex; return libvlc_video_take_snapshot( m_player, num, filepath, with, height );
libvlc_video_take_snapshot( m_player, filepath, with, height, &ex.ex );
} }
void Video::deinterlace( int enable, const char *mode ) void Video::deinterlace( int enable, const char *mode )
{ {
Exception ex; if( enable )
libvlc_video_set_deinterlace( m_player, enable, mode, &ex.ex ); libvlc_video_set_deinterlace( m_player, mode );
else
libvlc_video_set_deinterlace( m_player, NULL );
} }
...@@ -145,11 +145,13 @@ public: ...@@ -145,11 +145,13 @@ public:
/** /**
* Take a snapshot and save it to a file * Take a snapshot and save it to a file
* @param num: the video output id (0 for the first/only one)
* @param filepath: path where to save the file * @param filepath: path where to save the file
* @param widht: widht of the snapshot * @param widht: widht of the snapshot
* @param height: height of the snapshot * @param height: height of the snapshot
* @return 0 on success, -1 if the video output was not found
*/ */
void snapshot( const char *filepath, int widht, int height ); int snapshot( int num, const char *filepath, int widht, int height );
/** /**
* Enable or disable deinterlace filter and select the deinterlace filter to use * Enable or disable deinterlace filter and select the deinterlace filter to use
......
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