summaryrefslogtreecommitdiff
path: root/avmedia/source
diff options
context:
space:
mode:
Diffstat (limited to 'avmedia/source')
-rw-r--r--avmedia/source/vlc/vlcplayer.cxx20
-rw-r--r--avmedia/source/vlc/vlcplayer.hxx10
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();