diff options
author | Minh Ngo <nlminhtl@gmail.com> | 2013-06-21 09:19:51 +0300 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-07-26 10:50:18 +0100 |
commit | a1c329f6b5a482d8339db6213c8d40f73e176883 (patch) | |
tree | 6c3caeb79cb88ff707de2a72d268193ddb5963f9 /avmedia | |
parent | 16ae4845685653c0fe67b8658c34e24c40fb297f (diff) |
Media player/VLC instance initializing.
+ implementing some methods in vlcplayer
Change-Id: I9b9ca9ecd56f85b73fb7e79fcab5fc2968bd20fb
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/vlc/vlcplayer.cxx | 20 | ||||
-rw-r--r-- | avmedia/source/vlc/vlcplayer.hxx | 10 |
2 files changed, 25 insertions, 5 deletions
diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx index e977de41d98f..c48b1f3d3c44 100644 --- a/avmedia/source/vlc/vlcplayer.cxx +++ b/avmedia/source/vlc/vlcplayer.cxx @@ -5,17 +5,33 @@ using namespace ::com::sun::star; namespace avmedia { namespace vlc { +const char * const VLC_ARGS[] = { + "-I", + "dummy", + "--ignore-config", + "--verbose=-1", + "--quiet" +}; + +VLCPlayer::VLCPlayer() + : mInstance( libvlc_new( sizeof( VLC_ARGS ) / sizeof( VLC_ARGS[0] ), VLC_ARGS ), libvlc_release ) + , mPlayer( libvlc_media_player_new(mInstance.get()), libvlc_media_player_release ) +{ +} + void SAL_CALL VLCPlayer::start() { + libvlc_media_player_play( mPlayer.get() ); } void SAL_CALL VLCPlayer::stop() { + libvlc_media_player_stop( mPlayer.get() ); } ::sal_Bool SAL_CALL VLCPlayer::isPlaying() { - return false; + return (libvlc_media_player_is_playing( mPlayer.get() ) == 1); } double SAL_CALL VLCPlayer::getDuration() @@ -34,7 +50,7 @@ double SAL_CALL VLCPlayer::getMediaTime() double SAL_CALL VLCPlayer::getRate() { - return 0.f; + return libvlc_media_player_get_rate( mPlayer.get() ); } void SAL_CALL VLCPlayer::setPlaybackLoop( ::sal_Bool bSet ) diff --git a/avmedia/source/vlc/vlcplayer.hxx b/avmedia/source/vlc/vlcplayer.hxx index f82bd597fc01..ee1ebbab1316 100644 --- a/avmedia/source/vlc/vlcplayer.hxx +++ b/avmedia/source/vlc/vlcplayer.hxx @@ -20,10 +20,10 @@ #ifndef _VLCPLAYER_HXX #define _VLCPLAYER_HXX -#include "vlccommon.hxx" - -#include "com/sun/star/media/XPlayer.hpp" +#include <vlc/vlc.h> +#include <com/sun/star/media/XPlayer.hpp> #include <cppuhelper/basemutex.hxx> +#include "vlccommon.hxx" namespace avmedia { namespace vlc { @@ -34,7 +34,11 @@ typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::media::XPlayer, class VLCPlayer : public ::cppu::BaseMutex, public VLC_Base { + boost::shared_ptr<libvlc_instance_t> mInstance; + boost::shared_ptr<libvlc_media_player_t> mPlayer; public: + VLCPlayer(); + void SAL_CALL start(); void SAL_CALL stop(); ::sal_Bool SAL_CALL isPlaying(); |