[Libreoffice-commits] core.git: 27 commits - avmedia/Library_avmediavlc.mk avmedia/Module_avmedia.mk avmedia/source config_host.mk.in configure.ac postprocess/Rdb_services.mk Repository.mk

Minh Ngo nlminhtl at gmail.com
Fri Jul 26 02:51:58 PDT 2013


 Repository.mk                                  |    1 
 avmedia/Library_avmediavlc.mk                  |   49 +++++
 avmedia/Module_avmedia.mk                      |    6 
 avmedia/source/inc/mediamisc.hxx               |    9 -
 avmedia/source/viewer/mediawindowbase_impl.cxx |    1 
 avmedia/source/vlc/avmediavlc.component        |   14 +
 avmedia/source/vlc/vlccommon.hxx               |   48 +++++
 avmedia/source/vlc/vlcframegrabber.cxx         |  139 ++++++++++++++++
 avmedia/source/vlc/vlcframegrabber.hxx         |   53 ++++++
 avmedia/source/vlc/vlcmanager.cxx              |   53 ++++++
 avmedia/source/vlc/vlcmanager.hxx              |   53 ++++++
 avmedia/source/vlc/vlcplayer.cxx               |  208 +++++++++++++++++++++++++
 avmedia/source/vlc/vlcplayer.hxx               |   73 ++++++++
 avmedia/source/vlc/vlcuno.cxx                  |   58 ++++++
 avmedia/source/vlc/vlcwindow.cxx               |  153 ++++++++++++++++++
 avmedia/source/vlc/vlcwindow.hxx               |   70 ++++++++
 config_host.mk.in                              |    3 
 configure.ac                                   |   26 +++
 postprocess/Rdb_services.mk                    |    3 
 19 files changed, 1016 insertions(+), 4 deletions(-)

New commits:
commit 4d2998378e4d40f30ee1c9a243608c913350ce93
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Thu Jul 18 23:01:15 2013 +0300

    Fixing windows ID setting
    
    Change-Id: I6ef8b1765afd55da79e4aa3ca89892b920897d34

diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index e65f135..92e0614 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -168,9 +168,9 @@ uno::Reference< css::media::XPlayerWindow > SAL_CALL VLCPlayer::createPlayerWind
     if (winID != -1)
     {
 #if defined(WIN32) && !defined(UNIX)
-        libvlc_media_player_set_hwnd( mPlayer.get(), winID );
-#else
         //TODO: Not works, will be crashed
+#else
+        libvlc_media_player_set_xwindow( mPlayer.get(), winID );
 #endif
     }
 
commit 1b29758910de5e0e9f68c8dad176e9521774020e
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Thu Jul 18 22:59:30 2013 +0300

    Fixing a manager class
    
    Change-Id: Icaaa3e33ebb0e2ca650a279a8b094fbddbff2a4d

diff --git a/avmedia/source/vlc/vlcmanager.cxx b/avmedia/source/vlc/vlcmanager.cxx
index 1ded627..0b2ad6a 100644
--- a/avmedia/source/vlc/vlcmanager.cxx
+++ b/avmedia/source/vlc/vlcmanager.cxx
@@ -7,6 +7,7 @@ namespace avmedia {
 namespace vlc {
 
 const rtl::OUString VLC_IMPLEMENTATION_NAME = "com.sun.star.comp.avmedia.Manager_VLC";
+const ::rtl::OUString VLC_SERVICENAME = "com.sun.star.media.Manager_VLC";
 
 Manager::Manager( const uno::Reference< lang::XMultiServiceFactory >& rxMgr )
     : mxMgr( rxMgr )
@@ -32,16 +33,18 @@ rtl::OUString SAL_CALL Manager::getImplementationName()
     return VLC_IMPLEMENTATION_NAME;
 }
 
-sal_Bool SAL_CALL Manager::supportsService( const rtl::OUString& ServiceName )
+sal_Bool SAL_CALL Manager::supportsService( const rtl::OUString& serviceName )
     throw (uno::RuntimeException)
 {
-    return false;
+    return serviceName == VLC_SERVICENAME;
 }
 
 uno::Sequence< rtl::OUString > SAL_CALL Manager::getSupportedServiceNames()
     throw (uno::RuntimeException)
 {
-    return uno::Sequence< rtl::OUString >();
+    ::uno::Sequence< OUString > aRet(1);
+    aRet[0] = VLC_SERVICENAME;
+    return aRet;
 }
 
 } // end namespace vlc
diff --git a/avmedia/source/vlc/vlcmanager.hxx b/avmedia/source/vlc/vlcmanager.hxx
index 2632161..2e81a35 100644
--- a/avmedia/source/vlc/vlcmanager.hxx
+++ b/avmedia/source/vlc/vlcmanager.hxx
@@ -37,7 +37,7 @@ public:
     ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > SAL_CALL createPlayer( const rtl::OUString& aURL ) throw (::com::sun::star::uno::RuntimeException);
 
     rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException);
-    sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+    sal_Bool SAL_CALL supportsService( const rtl::OUString& serviceName ) throw (::com::sun::star::uno::RuntimeException);
     ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
 
 private:
diff --git a/avmedia/source/vlc/vlcwindow.cxx b/avmedia/source/vlc/vlcwindow.cxx
index 72f0572..39cb26b 100644
--- a/avmedia/source/vlc/vlcwindow.cxx
+++ b/avmedia/source/vlc/vlcwindow.cxx
@@ -82,7 +82,6 @@ void SAL_CALL VLCWindow::setVisible( sal_Bool Visible )
 void SAL_CALL VLCWindow::setEnable( sal_Bool Enable )
     throw (uno::RuntimeException)
 {
-    std::cout << __PRETTY_FUNCTION__ << " " << Enable << std::endl;
 }
 
 void SAL_CALL VLCWindow::setFocus()
commit 2bff2270e10bea702aaef6414f9ea5c8eab9860a
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Thu Jul 18 22:43:01 2013 +0300

    Removing a code for WIN32 that doesn't work
    
    Change-Id: I0ef71e696774648d5155dfc2f35e77bce3f91227

diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index 3c74bb3..e65f135 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -170,7 +170,7 @@ uno::Reference< css::media::XPlayerWindow > SAL_CALL VLCPlayer::createPlayerWind
 #if defined(WIN32) && !defined(UNIX)
         libvlc_media_player_set_hwnd( mPlayer.get(), winID );
 #else
-        libvlc_media_player_set_xwindow( mPlayer.get(), winID );
+        //TODO: Not works, will be crashed
 #endif
     }
 
commit f0833d965d20594c0f2d74ffca95589a572e012c
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Thu Jul 18 22:31:15 2013 +0300

    Minor fixes
    
    Change-Id: Icb76c549d8129d5ab89bf649b1efded32dce059f

diff --git a/avmedia/source/vlc/vlcframegrabber.cxx b/avmedia/source/vlc/vlcframegrabber.cxx
index 165abc2..ec5b959 100644
--- a/avmedia/source/vlc/vlcframegrabber.cxx
+++ b/avmedia/source/vlc/vlcframegrabber.cxx
@@ -96,7 +96,7 @@ namespace
         return ::uno::Reference< css::graphic::XGraphic >();
 
     Bitmap aBmp( Size( w, h ), 24 );
-    std::cout << 1 << std::endl;
+
     sal_uInt8 *pData = frameData.buffer.data();
     BitmapWriteAccess *pWrite = aBmp.AcquireWriteAccess();
     if ( pWrite )
diff --git a/avmedia/source/vlc/vlcframegrabber.hxx b/avmedia/source/vlc/vlcframegrabber.hxx
index 222e15d..7b83a1c 100644
--- a/avmedia/source/vlc/vlcframegrabber.hxx
+++ b/avmedia/source/vlc/vlcframegrabber.hxx
@@ -39,7 +39,6 @@ class VLCFrameGrabber : public FrameGrabber_BASE
     const rtl::OUString& mUrl;
 public:
     SAL_CALL VLCFrameGrabber( boost::shared_ptr<libvlc_media_player_t>& player, const rtl::OUString& url );
-    void setPlayer( );
 
     ::com::sun::star::uno::Reference< css::graphic::XGraphic > SAL_CALL grabFrame( double fMediaTime );
 
commit 71b2e88ff292f8b622b3e1026de164df9433f1b7
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Thu Jul 18 18:23:32 2013 +0300

    Frame grabber implementation.
    
    Change-Id: I50e6c2681f515aa3f52e7d730cd8bc3001c2d3d4

diff --git a/avmedia/source/vlc/vlcframegrabber.cxx b/avmedia/source/vlc/vlcframegrabber.cxx
index b8abf30..165abc2 100644
--- a/avmedia/source/vlc/vlcframegrabber.cxx
+++ b/avmedia/source/vlc/vlcframegrabber.cxx
@@ -1,5 +1,10 @@
+#include <osl/conditn.hxx>
+#include <vcl/bmpacc.hxx>
 #include <vcl/graph.hxx>
+#include <avmedia/mediawindow.hxx>
 #include "vlcframegrabber.hxx"
+#include "vlcplayer.hxx"
+#include <vlc/libvlc_media_player.h>
 
 using namespace ::com::sun::star;
 
@@ -8,16 +13,109 @@ namespace vlc {
 
 const ::rtl::OUString AVMEDIA_VLC_GRABBER_IMPLEMENTATIONNAME = "com.sun.star.comp.avmedia.VLCFrameGrabber_VLC";
 const ::rtl::OUString AVMEDIA_VLC_GRABBER_SERVICENAME = "com.sun.star.media.VLCFrameGrabber_VLC";
+const int MSEC_IN_SEC = 1000;
 
-SAL_CALL VLCFrameGrabber::VLCFrameGrabber()
+SAL_CALL VLCFrameGrabber::VLCFrameGrabber( boost::shared_ptr<libvlc_media_player_t>& player, const rtl::OUString& url )
     : FrameGrabber_BASE()
+    , mPlayer( player )
+    , mUrl( url )
 {
 }
 
+namespace
+{
+    struct FrameData
+    {
+        ::osl::Condition mCondition;
+
+        std::vector<sal_uInt8> buffer;
+
+        libvlc_media_player_t *mpPlayer;
+
+        FrameData( libvlc_media_player_t *pPlayer )
+            : mpPlayer( pPlayer )
+        {
+        }
+
+        void updateSize()
+        {
+            unsigned int w, h;
+            libvlc_video_get_size( mpPlayer, 0, &w, &h );
+
+            buffer.resize(w * h * 3);
+        }
+
+        ~FrameData()
+        {
+        }
+    };
+
+    void *FrameLock( void *data, void **pPixels )
+    {
+        FrameData *frameData = static_cast<FrameData*>( data );
+
+        frameData->updateSize();
+
+        *pPixels = frameData->buffer.data();
+
+        return *pPixels;
+    }
+
+    void FrameUnlock( void *data, void */* id */, void *const * /* pPixels */ )
+    {
+        FrameData *frameData = static_cast<FrameData*>( data );
+
+        frameData->mCondition.set();
+    }
+
+    void FrameDisplay( void */* data */, void */* id */ )
+    {
+    }
+}
+
 ::uno::Reference< css::graphic::XGraphic > SAL_CALL VLCFrameGrabber::grabFrame( double fMediaTime )
 {
-    std::cout << __PRETTY_FUNCTION__ << std::endl;
-    return ::uno::Reference< css::graphic::XGraphic >();
+    if ( mUrl.isEmpty() )
+        return ::uno::Reference< css::graphic::XGraphic >();
+
+    libvlc_media_player_t *pPlayer = mPlayer.get();
+    FrameData frameData( pPlayer );
+    libvlc_video_set_callbacks( pPlayer, FrameLock, FrameUnlock, FrameDisplay, &frameData );
+
+    const unsigned int w = 480, h = 360;
+
+    libvlc_video_set_format( pPlayer, "RV24", w, h, w * 3 );
+
+    libvlc_media_player_set_time( pPlayer, fMediaTime * MSEC_IN_SEC );
+    libvlc_media_player_play( pPlayer );
+
+    const TimeValue t = {2, 0};
+    frameData.mCondition.wait( &t );
+
+    if ( !frameData.mCondition.check() )
+        return ::uno::Reference< css::graphic::XGraphic >();
+
+    Bitmap aBmp( Size( w, h ), 24 );
+    std::cout << 1 << std::endl;
+    sal_uInt8 *pData = frameData.buffer.data();
+    BitmapWriteAccess *pWrite = aBmp.AcquireWriteAccess();
+    if ( pWrite )
+    {
+        for ( std::size_t y = 0; y < h; ++y )
+        {
+            for ( std::size_t x = 0; x < w; ++x )
+            {
+                sal_uInt8 *p = pData + ( y * w + x ) * 3;
+                BitmapColor col( p[0], p[1], p[2] );
+                pWrite->SetPixel( y, x, col );
+            }
+        }
+    }
+    aBmp.ReleaseAccess( pWrite );
+
+    libvlc_media_player_stop( pPlayer );
+
+    return Graphic( aBmp ).GetXGraphic();
 }
 
 ::rtl::OUString SAL_CALL VLCFrameGrabber::getImplementationName()
diff --git a/avmedia/source/vlc/vlcframegrabber.hxx b/avmedia/source/vlc/vlcframegrabber.hxx
index 7d4d664..222e15d 100644
--- a/avmedia/source/vlc/vlcframegrabber.hxx
+++ b/avmedia/source/vlc/vlcframegrabber.hxx
@@ -20,21 +20,26 @@
 #ifndef _VLCFRAMEGRABBER_HXX
 #define _VLCFRAMEGRABBER_HXX
 
-#include <boost/noncopyable.hpp>
+#include <boost/shared_ptr.hpp>
 #include <com/sun/star/media/XFrameGrabber.hpp>
 #include <cppuhelper/implbase2.hxx>
 #include "vlccommon.hxx"
 
+struct libvlc_media_player_t;
+
 namespace avmedia {
 namespace vlc {
 
 typedef ::cppu::WeakImplHelper2< ::com::sun::star::media::XFrameGrabber,
                                  ::com::sun::star::lang::XServiceInfo > FrameGrabber_BASE;
 
-class VLCFrameGrabber : public FrameGrabber_BASE, boost::noncopyable
+class VLCFrameGrabber : public FrameGrabber_BASE
 {
+    boost::shared_ptr<libvlc_media_player_t> mPlayer;
+    const rtl::OUString& mUrl;
 public:
-    SAL_CALL VLCFrameGrabber();
+    SAL_CALL VLCFrameGrabber( boost::shared_ptr<libvlc_media_player_t>& player, const rtl::OUString& url );
+    void setPlayer( );
 
     ::com::sun::star::uno::Reference< css::graphic::XGraphic > SAL_CALL grabFrame( double fMediaTime );
 
diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index 376604d..3c74bb3 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -29,6 +29,7 @@ namespace
     {
         rtl::OString dest;
         url.convertToString(&dest, RTL_TEXTENCODING_UTF8, 0);
+
         return libvlc_media_new_path(instance.get(), dest.getStr());
     }
 }
@@ -37,9 +38,10 @@ VLCPlayer::VLCPlayer( const rtl::OUString& url )
     : VLC_Base(m_aMutex)
     , 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 )
-    , mMedia( InitMedia( url, mInstance ), libvlc_media_release )
+    , mUrl( url )
 {
-    libvlc_media_player_set_media( mPlayer.get(), mMedia.get() );
+    boost::shared_ptr<libvlc_media_t> media( InitMedia( url, mInstance ), libvlc_media_release );
+    mPlayer.reset( libvlc_media_player_new_from_media( media.get() ), libvlc_media_player_release );
 }
 
 void SAL_CALL VLCPlayer::start()
@@ -63,7 +65,7 @@ void SAL_CALL VLCPlayer::stop()
 double SAL_CALL VLCPlayer::getDuration()
 {
     ::osl::MutexGuard aGuard(m_aMutex);
-    return static_cast<double>( libvlc_media_get_duration( mMedia.get() ) ) / MS_IN_SEC;
+    return static_cast<double>( libvlc_media_player_get_length( mPlayer.get() ) ) / MS_IN_SEC;
 }
 
 void SAL_CALL VLCPlayer::setMediaTime( double fTime )
@@ -178,7 +180,9 @@ uno::Reference< css::media::XPlayerWindow > SAL_CALL VLCPlayer::createPlayerWind
 uno::Reference< css::media::XFrameGrabber > SAL_CALL VLCPlayer::createFrameGrabber()
 {
     ::osl::MutexGuard aGuard(m_aMutex);
-    return uno::Reference< css::media::XFrameGrabber >( new VLCFrameGrabber() );
+
+    VLCFrameGrabber *frameGrabber = new VLCFrameGrabber( mPlayer, mUrl );
+    return uno::Reference< css::media::XFrameGrabber >( frameGrabber );
 }
 
 ::rtl::OUString SAL_CALL VLCPlayer::getImplementationName()
diff --git a/avmedia/source/vlc/vlcplayer.hxx b/avmedia/source/vlc/vlcplayer.hxx
index 7417060..0c29f3f 100644
--- a/avmedia/source/vlc/vlcplayer.hxx
+++ b/avmedia/source/vlc/vlcplayer.hxx
@@ -39,7 +39,7 @@ class VLCPlayer : public ::cppu::BaseMutex,
 {
     boost::shared_ptr<libvlc_instance_t> mInstance;
     boost::shared_ptr<libvlc_media_player_t> mPlayer;
-    boost::shared_ptr<libvlc_media_t> mMedia;
+    const rtl::OUString mUrl;
 public:
     VLCPlayer( const rtl::OUString& url );
 
commit 6a1f5f0aebea7a7dfc58a50167408e9477564903
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Tue Jul 16 08:35:11 2013 +0300

    Possibly binds a video frame into the WIN32 window
    
    Change-Id: Ib45921e3162e7ce5f306c23b0b158a4c35102202

diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index d54cb2c..376604d 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -36,8 +36,8 @@ namespace
 VLCPlayer::VLCPlayer( const rtl::OUString& url )
     : VLC_Base(m_aMutex)
     , 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 )
-    , mMedia( InitMedia( url, mInstance), libvlc_media_release )
+    , mPlayer( libvlc_media_player_new( mInstance.get() ), libvlc_media_player_release )
+    , mMedia( InitMedia( url, mInstance ), libvlc_media_release )
 {
     libvlc_media_player_set_media( mPlayer.get(), mMedia.get() );
 }
@@ -165,7 +165,11 @@ uno::Reference< css::media::XPlayerWindow > SAL_CALL VLCPlayer::createPlayerWind
 
     if (winID != -1)
     {
+#if defined(WIN32) && !defined(UNIX)
+        libvlc_media_player_set_hwnd( mPlayer.get(), winID );
+#else
         libvlc_media_player_set_xwindow( mPlayer.get(), winID );
+#endif
     }
 
     return uno::Reference< css::media::XPlayerWindow >( window );
commit 79ae34928c134c8143cb21da651b67caabd21794
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Sat Jul 13 23:09:47 2013 +0300

    Fixing pausing/stopping media features
    
    Change-Id: I3a1c5201481be819f84e8475719a1ce9f15e20ec

diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index f62b711..d54cb2c 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -51,7 +51,7 @@ void SAL_CALL VLCPlayer::start()
 void SAL_CALL VLCPlayer::stop()
 {
     ::osl::MutexGuard aGuard(m_aMutex);
-    libvlc_media_player_stop( mPlayer.get() );
+    libvlc_media_player_pause( mPlayer.get() );
 }
 
 ::sal_Bool SAL_CALL VLCPlayer::isPlaying()
@@ -69,6 +69,12 @@ double SAL_CALL VLCPlayer::getDuration()
 void SAL_CALL VLCPlayer::setMediaTime( double fTime )
 {
     ::osl::MutexGuard aGuard(m_aMutex);
+
+    if ( fTime < 0.00000001 && !libvlc_media_player_is_playing( mPlayer.get() ) )
+    {
+        libvlc_media_player_stop( mPlayer.get() );
+    }
+
     libvlc_media_player_set_time( mPlayer.get(), fTime * MS_IN_SEC );
 }
 
diff --git a/avmedia/source/vlc/vlcwindow.cxx b/avmedia/source/vlc/vlcwindow.cxx
index e61398e..72f0572 100644
--- a/avmedia/source/vlc/vlcwindow.cxx
+++ b/avmedia/source/vlc/vlcwindow.cxx
@@ -1,3 +1,4 @@
+#include <iostream>
 #include "vlcwindow.hxx"
 
 using namespace ::com::sun::star;
@@ -81,6 +82,7 @@ void SAL_CALL VLCWindow::setVisible( sal_Bool Visible )
 void SAL_CALL VLCWindow::setEnable( sal_Bool Enable )
     throw (uno::RuntimeException)
 {
+    std::cout << __PRETTY_FUNCTION__ << " " << Enable << std::endl;
 }
 
 void SAL_CALL VLCWindow::setFocus()
commit 2fadc5a8dd2bb61869b3e39cd5acc17724899eb4
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Sat Jul 13 22:31:57 2013 +0300

    Fixing default frame size
    
    Change-Id: I82438768a8165f3ce5fdde03e89d2d2c9acc24c6

diff --git a/avmedia/source/vlc/vlcframegrabber.cxx b/avmedia/source/vlc/vlcframegrabber.cxx
index 5cf76ec..b8abf30 100644
--- a/avmedia/source/vlc/vlcframegrabber.cxx
+++ b/avmedia/source/vlc/vlcframegrabber.cxx
@@ -16,6 +16,7 @@ SAL_CALL VLCFrameGrabber::VLCFrameGrabber()
 
 ::uno::Reference< css::graphic::XGraphic > SAL_CALL VLCFrameGrabber::grabFrame( double fMediaTime )
 {
+    std::cout << __PRETTY_FUNCTION__ << std::endl;
     return ::uno::Reference< css::graphic::XGraphic >();
 }
 
diff --git a/avmedia/source/vlc/vlcframegrabber.hxx b/avmedia/source/vlc/vlcframegrabber.hxx
index cb77e41..7d4d664 100644
--- a/avmedia/source/vlc/vlcframegrabber.hxx
+++ b/avmedia/source/vlc/vlcframegrabber.hxx
@@ -20,10 +20,10 @@
 #ifndef _VLCFRAMEGRABBER_HXX
 #define _VLCFRAMEGRABBER_HXX
 
-#include "vlccommon.hxx"
 #include <boost/noncopyable.hpp>
 #include <com/sun/star/media/XFrameGrabber.hpp>
 #include <cppuhelper/implbase2.hxx>
+#include "vlccommon.hxx"
 
 namespace avmedia {
 namespace vlc {
diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index d94206c..f62b711 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -119,7 +119,7 @@ void SAL_CALL VLCPlayer::setMute( ::sal_Bool bSet )
 
 css::awt::Size SAL_CALL VLCPlayer::getPreferredPlayerWindowSize()
 {
-    return css::awt::Size( 1, 1 );
+    return css::awt::Size( 480, 360 );
 }
 
 namespace
diff --git a/avmedia/source/vlc/vlcwindow.cxx b/avmedia/source/vlc/vlcwindow.cxx
index 19f3791..e61398e 100644
--- a/avmedia/source/vlc/vlcwindow.cxx
+++ b/avmedia/source/vlc/vlcwindow.cxx
@@ -70,6 +70,7 @@ void SAL_CALL VLCWindow::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width,
 awt::Rectangle SAL_CALL VLCWindow::getPosSize()
     throw (uno::RuntimeException)
 {
+    return awt::Rectangle();
 }
 
 void SAL_CALL VLCWindow::setVisible( sal_Bool Visible )
commit d6f28a0387fbcd63098d119c7d68185695182d89
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Sat Jul 13 10:34:42 2013 +0300

    Fixing volume changing ability
    
    Change-Id: Ie6b175fd039a868a57afdfe7bd05a2de69c39a7c

diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index 0a15a72..d94206c 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -96,13 +96,13 @@ void SAL_CALL VLCPlayer::setPlaybackLoop( ::sal_Bool bSet )
 void SAL_CALL VLCPlayer::setVolumeDB( ::sal_Int16 nDB )
 {
     ::osl::MutexGuard aGuard(m_aMutex);
-    libvlc_audio_set_volume( mPlayer.get(), nDB );
+    libvlc_audio_set_volume( mPlayer.get(), static_cast<sal_Int16>( ( nDB + 40 ) * 10.0  / 4 ) );
 }
 
 ::sal_Int16 SAL_CALL VLCPlayer::getVolumeDB()
 {
     ::osl::MutexGuard aGuard(m_aMutex);
-    return libvlc_audio_get_volume( mPlayer.get() );
+    return static_cast<sal_Int16>( libvlc_audio_get_volume( mPlayer.get() ) / 10.0 * 4 - 40 );
 }
 
 void SAL_CALL VLCPlayer::setMute( ::sal_Bool bSet )
@@ -168,7 +168,7 @@ uno::Reference< css::media::XPlayerWindow > SAL_CALL VLCPlayer::createPlayerWind
 uno::Reference< css::media::XFrameGrabber > SAL_CALL VLCPlayer::createFrameGrabber()
 {
     ::osl::MutexGuard aGuard(m_aMutex);
-    return uno::Reference< css::media::XFrameGrabber >(new VLCFrameGrabber());
+    return uno::Reference< css::media::XFrameGrabber >( new VLCFrameGrabber() );
 }
 
 ::rtl::OUString SAL_CALL VLCPlayer::getImplementationName()
commit fa978db06c10a2fc83ada50118b861b29c5be4f9
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Thu Jul 11 08:29:29 2013 +0300

    Binding a video frame into a LibreOffice's widget
    
    Change-Id: Iebf5b9f8cc83e7d2a96f105b07b6fe0eaf8b2678

diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index 3c8453b..0a15a72 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -1,3 +1,6 @@
+#include <vcl/syschild.hxx>
+#include <vcl/sysdata.hxx>
+
 #include "vlcplayer.hxx"
 #include "vlcwindow.hxx"
 #include "vlcframegrabber.hxx"
@@ -22,7 +25,7 @@ const int MS_IN_SEC = 1000; // Millisec in sec
 
 namespace
 {
-    libvlc_media_t* initMedia( const rtl::OUString& url, boost::shared_ptr<libvlc_instance_t>& instance )
+    libvlc_media_t* InitMedia( const rtl::OUString& url, boost::shared_ptr<libvlc_instance_t>& instance )
     {
         rtl::OString dest;
         url.convertToString(&dest, RTL_TEXTENCODING_UTF8, 0);
@@ -34,7 +37,7 @@ VLCPlayer::VLCPlayer( const rtl::OUString& url )
     : VLC_Base(m_aMutex)
     , 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 )
-    , mMedia( initMedia( url, mInstance), libvlc_media_release )
+    , mMedia( InitMedia( url, mInstance), libvlc_media_release )
 {
     libvlc_media_player_set_media( mPlayer.get(), mMedia.get() );
 }
@@ -119,10 +122,47 @@ css::awt::Size SAL_CALL VLCPlayer::getPreferredPlayerWindowSize()
     return css::awt::Size( 1, 1 );
 }
 
+namespace
+{
+    // TODO: Move this function to the common space for avoiding duplication with
+    // gstreamer/gstwindow::createPlayerWindow functionality
+    int GetWindowID( const uno::Sequence< uno::Any >& arguments )
+    {
+        if (arguments.getLength() <= 2)
+            return -1;
+
+        sal_IntPtr pIntPtr = 0;
+
+        arguments[ 2 ] >>= pIntPtr;
+
+        SystemChildWindow *pParentWindow = reinterpret_cast< SystemChildWindow* >( pIntPtr );
+
+        const SystemEnvData* pEnvData = pParentWindow ? pParentWindow->GetSystemData() : NULL;
+
+        if (pEnvData == NULL)
+            return -1;
+
+        // Explicit converts from long to int
+        const int id = static_cast<int>( pEnvData->aWindow );
+
+        return id;
+    }
+}
+
 uno::Reference< css::media::XPlayerWindow > SAL_CALL VLCPlayer::createPlayerWindow( const uno::Sequence< uno::Any >& aArguments )
 {
     ::osl::MutexGuard aGuard(m_aMutex);
-    return uno::Reference< css::media::XPlayerWindow >(new VLCWindow( *this ));
+
+    VLCWindow * const window = new VLCWindow( *this );
+
+    const int winID = GetWindowID( aArguments );
+
+    if (winID != -1)
+    {
+        libvlc_media_player_set_xwindow( mPlayer.get(), winID );
+    }
+
+    return uno::Reference< css::media::XPlayerWindow >( window );
 }
 
 uno::Reference< css::media::XFrameGrabber > SAL_CALL VLCPlayer::createFrameGrabber()
diff --git a/avmedia/source/vlc/vlcwindow.hxx b/avmedia/source/vlc/vlcwindow.hxx
index 3449e2c..268be6f 100644
--- a/avmedia/source/vlc/vlcwindow.hxx
+++ b/avmedia/source/vlc/vlcwindow.hxx
@@ -31,6 +31,7 @@ class VLCWindow : public ::cppu::WeakImplHelper2 < ::com::sun::star::media::XPla
     VLCPlayer& mPlayer;
 public:
     SAL_CALL VLCWindow(VLCPlayer& player);
+
     void SAL_CALL update();
     ::sal_Bool SAL_CALL setZoomLevel( css::media::ZoomLevel ZoomLevel );
     css::media::ZoomLevel SAL_CALL getZoomLevel();
commit 057b2b6b7faebe3572b6993859eb1a0f7424c6eb
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Wed Jul 10 08:52:41 2013 +0300

    Fixing get/set time methods (correctly converts ms into sec).
    
    Change-Id: I64c7ddb5336a7ea255500c21ee1550eb32cbf27b

diff --git a/avmedia/source/vlc/vlcframegrabber.cxx b/avmedia/source/vlc/vlcframegrabber.cxx
index 4cf9866..5cf76ec 100644
--- a/avmedia/source/vlc/vlcframegrabber.cxx
+++ b/avmedia/source/vlc/vlcframegrabber.cxx
@@ -10,6 +10,7 @@ const ::rtl::OUString AVMEDIA_VLC_GRABBER_IMPLEMENTATIONNAME = "com.sun.star.com
 const ::rtl::OUString AVMEDIA_VLC_GRABBER_SERVICENAME = "com.sun.star.media.VLCFrameGrabber_VLC";
 
 SAL_CALL VLCFrameGrabber::VLCFrameGrabber()
+    : FrameGrabber_BASE()
 {
 }
 
diff --git a/avmedia/source/vlc/vlcframegrabber.hxx b/avmedia/source/vlc/vlcframegrabber.hxx
index 0e88d5d..cb77e41 100644
--- a/avmedia/source/vlc/vlcframegrabber.hxx
+++ b/avmedia/source/vlc/vlcframegrabber.hxx
@@ -21,6 +21,7 @@
 #define _VLCFRAMEGRABBER_HXX
 
 #include "vlccommon.hxx"
+#include <boost/noncopyable.hpp>
 #include <com/sun/star/media/XFrameGrabber.hpp>
 #include <cppuhelper/implbase2.hxx>
 
@@ -30,7 +31,7 @@ namespace vlc {
 typedef ::cppu::WeakImplHelper2< ::com::sun::star::media::XFrameGrabber,
                                  ::com::sun::star::lang::XServiceInfo > FrameGrabber_BASE;
 
-class VLCFrameGrabber : public FrameGrabber_BASE
+class VLCFrameGrabber : public FrameGrabber_BASE, boost::noncopyable
 {
 public:
     SAL_CALL VLCFrameGrabber();
diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index efb23ba..3c8453b 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -18,6 +18,8 @@ const char * const VLC_ARGS[] = {
     "--quiet"
 };
 
+const int MS_IN_SEC = 1000; // Millisec in sec
+
 namespace
 {
     libvlc_media_t* initMedia( const rtl::OUString& url, boost::shared_ptr<libvlc_instance_t>& instance )
@@ -58,19 +60,19 @@ void SAL_CALL VLCPlayer::stop()
 double SAL_CALL VLCPlayer::getDuration()
 {
     ::osl::MutexGuard aGuard(m_aMutex);
-    return libvlc_media_get_duration( mMedia.get() );
+    return static_cast<double>( libvlc_media_get_duration( mMedia.get() ) ) / MS_IN_SEC;
 }
 
 void SAL_CALL VLCPlayer::setMediaTime( double fTime )
 {
     ::osl::MutexGuard aGuard(m_aMutex);
-    libvlc_media_player_set_time( mPlayer.get(), fTime );
+    libvlc_media_player_set_time( mPlayer.get(), fTime * MS_IN_SEC );
 }
 
 double SAL_CALL VLCPlayer::getMediaTime()
 {
     ::osl::MutexGuard aGuard(m_aMutex);
-    return libvlc_media_player_get_time( mPlayer.get() );
+    return static_cast<double>( libvlc_media_player_get_time( mPlayer.get() ) ) / MS_IN_SEC;
 }
 
 double SAL_CALL VLCPlayer::getRate()
commit 5b67ee9c432745119f9c9740f88a3da17280e4b6
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Tue Jul 9 21:20:52 2013 +0100

    don't return an UNO reference to a temporary stack object.
    
    Change-Id: I0b64d6181884d416d690a936017e6e0725360d56

diff --git a/avmedia/source/vlc/vlcframegrabber.cxx b/avmedia/source/vlc/vlcframegrabber.cxx
index 11151b6..4cf9866 100644
--- a/avmedia/source/vlc/vlcframegrabber.cxx
+++ b/avmedia/source/vlc/vlcframegrabber.cxx
@@ -15,7 +15,7 @@ SAL_CALL VLCFrameGrabber::VLCFrameGrabber()
 
 ::uno::Reference< css::graphic::XGraphic > SAL_CALL VLCFrameGrabber::grabFrame( double fMediaTime )
 {
-    return Graphic().GetXGraphic();
+    return ::uno::Reference< css::graphic::XGraphic >();
 }
 
 ::rtl::OUString SAL_CALL VLCFrameGrabber::getImplementationName()
@@ -36,4 +36,4 @@ SAL_CALL VLCFrameGrabber::VLCFrameGrabber()
 }
 
 }
-}
\ No newline at end of file
+}
commit 054c2b6a51faac2b6c32c02f567a496537a15555
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Mon Jul 8 22:31:10 2013 +0300

    Fixing segfault when getting a duration
    
    Change-Id: I51e221214bb7e6c09312109ddb9d6bb71b47b181

diff --git a/avmedia/source/vlc/vlcframegrabber.cxx b/avmedia/source/vlc/vlcframegrabber.cxx
index 6e8ab13..11151b6 100644
--- a/avmedia/source/vlc/vlcframegrabber.cxx
+++ b/avmedia/source/vlc/vlcframegrabber.cxx
@@ -1,3 +1,4 @@
+#include <vcl/graph.hxx>
 #include "vlcframegrabber.hxx"
 
 using namespace ::com::sun::star;
@@ -14,6 +15,7 @@ SAL_CALL VLCFrameGrabber::VLCFrameGrabber()
 
 ::uno::Reference< css::graphic::XGraphic > SAL_CALL VLCFrameGrabber::grabFrame( double fMediaTime )
 {
+    return Graphic().GetXGraphic();
 }
 
 ::rtl::OUString SAL_CALL VLCFrameGrabber::getImplementationName()
diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index a8eda3e..efb23ba 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -34,6 +34,7 @@ VLCPlayer::VLCPlayer( const rtl::OUString& url )
     , mPlayer( libvlc_media_player_new(mInstance.get()), libvlc_media_player_release )
     , mMedia( initMedia( url, mInstance), libvlc_media_release )
 {
+    libvlc_media_player_set_media( mPlayer.get(), mMedia.get() );
 }
 
 void SAL_CALL VLCPlayer::start()
@@ -57,8 +58,7 @@ void SAL_CALL VLCPlayer::stop()
 double SAL_CALL VLCPlayer::getDuration()
 {
     ::osl::MutexGuard aGuard(m_aMutex);
-    libvlc_media_t* media = libvlc_media_player_get_media( mPlayer.get() );
-    return libvlc_media_get_duration( media );
+    return libvlc_media_get_duration( mMedia.get() );
 }
 
 void SAL_CALL VLCPlayer::setMediaTime( double fTime )
commit e2376b3db0050cb3a9f902aeaa9616d00945011e
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Mon Jul 8 09:47:40 2013 +0100

    Insert vlc at the top of the service list to try for media.
    
    Change-Id: I2abde3c4431e104f30c22a3066bb6fb243151e2d

diff --git a/avmedia/source/inc/mediamisc.hxx b/avmedia/source/inc/mediamisc.hxx
index 1e439340..b87fe43 100644
--- a/avmedia/source/inc/mediamisc.hxx
+++ b/avmedia/source/inc/mediamisc.hxx
@@ -21,14 +21,15 @@ class ResMgr;
 
 #define AVMEDIA_RESID( nId ) ResId( nId, * ::avmedia::GetResMgr() )
 
+#define AVMEDIA_MANAGER_SERVICE_PREFERRED "com.sun.star.comp.avmedia.Manager_VLC"
 #ifdef WNT
-#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_DirectX"
+#define AVMEDIA_MANAGER_SERVICE_NAME      "com.sun.star.comp.avmedia.Manager_DirectX"
 #else
 #ifdef MACOSX
-#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_QuickTime"
+#define AVMEDIA_MANAGER_SERVICE_NAME      "com.sun.star.comp.avmedia.Manager_QuickTime"
 #else
-#define AVMEDIA_MANAGER_SERVICE_NAME_OLD "com.sun.star.comp.avmedia.Manager_GStreamer_0_10"
-#define AVMEDIA_MANAGER_SERVICE_NAME "com.sun.star.comp.avmedia.Manager_GStreamer"
+#define AVMEDIA_MANAGER_SERVICE_NAME_OLD  "com.sun.star.comp.avmedia.Manager_GStreamer_0_10"
+#define AVMEDIA_MANAGER_SERVICE_NAME      "com.sun.star.comp.avmedia.Manager_GStreamer"
 #endif
 #endif
 
diff --git a/avmedia/source/viewer/mediawindowbase_impl.cxx b/avmedia/source/viewer/mediawindowbase_impl.cxx
index 71e5779..e8b4e89 100644
--- a/avmedia/source/viewer/mediawindowbase_impl.cxx
+++ b/avmedia/source/viewer/mediawindowbase_impl.cxx
@@ -56,6 +56,7 @@ uno::Reference< media::XPlayer > MediaWindowBaseImpl::createPlayer( const OUStri
     uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
 
     static const char * aServiceManagers[] = {
+        AVMEDIA_MANAGER_SERVICE_PREFERRED,
         AVMEDIA_MANAGER_SERVICE_NAME,
 // a fallback path just for gstreamer which has
 // two significant versions deployed at once ...
diff --git a/avmedia/source/vlc/vlcuno.cxx b/avmedia/source/vlc/vlcuno.cxx
index 0c9690e..5421f62 100644
--- a/avmedia/source/vlc/vlcuno.cxx
+++ b/avmedia/source/vlc/vlcuno.cxx
@@ -37,6 +37,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL avmediavlc_component_getFactory(
     uno::Reference< lang::XSingleServiceFactory > xFactory;
     void*                                   pRet = 0;
 
+    fprintf (stderr, "Create VLC Media component: '%s'\n", pImplName);
     if( rtl_str_compare( pImplName, IMPL_NAME ) == 0 )
     {
         const OUString aServiceName( SERVICE_NAME );
commit 8c6b8a7ca42d8c103a0439d1d15eb6c68ebc5e43
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Sat Jul 6 22:01:24 2013 +0300

    Build fix
    
    Change-Id: I2db954ae56aacd023d7521c20db0e50b1a5b60e1

diff --git a/avmedia/source/vlc/vlccommon.hxx b/avmedia/source/vlc/vlccommon.hxx
index efc022f..6b8e2ca 100644
--- a/avmedia/source/vlc/vlccommon.hxx
+++ b/avmedia/source/vlc/vlccommon.hxx
@@ -21,6 +21,7 @@
 #define _VLCCOMMON_HXX
 
 #include <vlc/libvlc.h>
+#include <vlc/libvlc_media.h>
 
 #include <osl/mutex.hxx>
 #include <tools/stream.hxx>
diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index 12133c1..a8eda3e 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -20,7 +20,7 @@ const char * const VLC_ARGS[] = {
 
 namespace
 {
-    libvlc_media_t* initMedia( const rtl::OUString& url, boost::scoped_ptr<libvlc_instance_t>& instance)
+    libvlc_media_t* initMedia( const rtl::OUString& url, boost::shared_ptr<libvlc_instance_t>& instance )
     {
         rtl::OString dest;
         url.convertToString(&dest, RTL_TEXTENCODING_UTF8, 0);
diff --git a/avmedia/source/vlc/vlcplayer.hxx b/avmedia/source/vlc/vlcplayer.hxx
index c569594..7417060 100644
--- a/avmedia/source/vlc/vlcplayer.hxx
+++ b/avmedia/source/vlc/vlcplayer.hxx
@@ -22,7 +22,7 @@
 
 #include "vlccommon.hxx"
 #include <vlc/vlc.h>
-#include <boost/scoped_ptr.hpp>
+#include <boost/shared_ptr.hpp>
 #include <cppuhelper/compbase2.hxx>
 #include <com/sun/star/media/XPlayer.hpp>
 #include <cppuhelper/basemutex.hxx>
@@ -37,9 +37,9 @@ typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::media::XPlayer,
 class VLCPlayer : public ::cppu::BaseMutex,
                   public VLC_Base
 {
-    boost::scoped_ptr<libvlc_instance_t> mInstance;
-    boost::scoped_ptr<libvlc_media_player_t> mPlayer;
-    boost::scoped_ptr<libvlc_media_t> mMedia;
+    boost::shared_ptr<libvlc_instance_t> mInstance;
+    boost::shared_ptr<libvlc_media_player_t> mPlayer;
+    boost::shared_ptr<libvlc_media_t> mMedia;
 public:
     VLCPlayer( const rtl::OUString& url );
 
commit b9af45c1f21dde339df5e80676c414efd43d0aa2
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Sat Jul 6 21:11:07 2013 +0300

    Setting url into the player class
    
    Change-Id: I7175b3ac9a818c6ae0ac0fdbea70b0416df34446

diff --git a/avmedia/source/vlc/vlcmanager.cxx b/avmedia/source/vlc/vlcmanager.cxx
index 18681de..1ded627 100644
--- a/avmedia/source/vlc/vlcmanager.cxx
+++ b/avmedia/source/vlc/vlcmanager.cxx
@@ -20,7 +20,7 @@ Manager::~Manager()
 uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const rtl::OUString& rURL )
     throw (uno::RuntimeException)
 {
-    VLCPlayer* pPlayer( new VLCPlayer( /* mxMgr */ ) );
+    VLCPlayer* pPlayer( new VLCPlayer( rURL/*, mxMgr */ ) );
     uno::Reference< media::XPlayer > xRet( pPlayer );
 
     return xRet;
diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index fb1ad01..12133c1 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -18,10 +18,21 @@ const char * const VLC_ARGS[] = {
     "--quiet"
 };
 
-VLCPlayer::VLCPlayer()
+namespace
+{
+    libvlc_media_t* initMedia( const rtl::OUString& url, boost::scoped_ptr<libvlc_instance_t>& instance)
+    {
+        rtl::OString dest;
+        url.convertToString(&dest, RTL_TEXTENCODING_UTF8, 0);
+        return libvlc_media_new_path(instance.get(), dest.getStr());
+    }
+}
+
+VLCPlayer::VLCPlayer( const rtl::OUString& url )
     : VLC_Base(m_aMutex)
     , 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 )
+    , mMedia( initMedia( url, mInstance), libvlc_media_release )
 {
 }
 
diff --git a/avmedia/source/vlc/vlcplayer.hxx b/avmedia/source/vlc/vlcplayer.hxx
index d1e5511..c569594 100644
--- a/avmedia/source/vlc/vlcplayer.hxx
+++ b/avmedia/source/vlc/vlcplayer.hxx
@@ -22,7 +22,7 @@
 
 #include "vlccommon.hxx"
 #include <vlc/vlc.h>
-#include <boost/shared_ptr.hpp>
+#include <boost/scoped_ptr.hpp>
 #include <cppuhelper/compbase2.hxx>
 #include <com/sun/star/media/XPlayer.hpp>
 #include <cppuhelper/basemutex.hxx>
@@ -37,10 +37,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;
+    boost::scoped_ptr<libvlc_instance_t> mInstance;
+    boost::scoped_ptr<libvlc_media_player_t> mPlayer;
+    boost::scoped_ptr<libvlc_media_t> mMedia;
 public:
-    VLCPlayer();
+    VLCPlayer( const rtl::OUString& url );
 
     void SAL_CALL start();
     void SAL_CALL stop();
commit d8ea5e105bb0d65a05cc87b13e9b9ab58fba3ab6
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Sat Jun 29 22:23:50 2013 +0300

    Frame grabber interface. Adding service/implementation names.
    
    Change-Id: I5bb36f6108a3ac1a36867e41e3148e3431ff8ff4

diff --git a/avmedia/Library_avmediavlc.mk b/avmedia/Library_avmediavlc.mk
index ced6c41..06fb035 100644
--- a/avmedia/Library_avmediavlc.mk
+++ b/avmedia/Library_avmediavlc.mk
@@ -43,6 +43,7 @@ $(eval $(call gb_Library_add_exception_objects,avmediavlc,\
 	avmedia/source/vlc/vlcplayer \
 	avmedia/source/vlc/vlcuno \
 	avmedia/source/vlc/vlcwindow \
+	avmedia/source/vlc/vlcframegrabber \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/avmedia/source/vlc/vlcframegrabber.cxx b/avmedia/source/vlc/vlcframegrabber.cxx
new file mode 100644
index 0000000..6e8ab13
--- /dev/null
+++ b/avmedia/source/vlc/vlcframegrabber.cxx
@@ -0,0 +1,37 @@
+#include "vlcframegrabber.hxx"
+
+using namespace ::com::sun::star;
+
+namespace avmedia {
+namespace vlc {
+
+const ::rtl::OUString AVMEDIA_VLC_GRABBER_IMPLEMENTATIONNAME = "com.sun.star.comp.avmedia.VLCFrameGrabber_VLC";
+const ::rtl::OUString AVMEDIA_VLC_GRABBER_SERVICENAME = "com.sun.star.media.VLCFrameGrabber_VLC";
+
+SAL_CALL VLCFrameGrabber::VLCFrameGrabber()
+{
+}
+
+::uno::Reference< css::graphic::XGraphic > SAL_CALL VLCFrameGrabber::grabFrame( double fMediaTime )
+{
+}
+
+::rtl::OUString SAL_CALL VLCFrameGrabber::getImplementationName()
+{
+    return AVMEDIA_VLC_GRABBER_IMPLEMENTATIONNAME;
+}
+
+::sal_Bool SAL_CALL VLCFrameGrabber::supportsService( const ::rtl::OUString& serviceName )
+{
+    return AVMEDIA_VLC_GRABBER_SERVICENAME == serviceName;
+}
+
+::uno::Sequence< ::rtl::OUString > SAL_CALL VLCFrameGrabber::getSupportedServiceNames()
+{
+    ::uno::Sequence< OUString > aRet(1);
+    aRet[0] = AVMEDIA_VLC_GRABBER_SERVICENAME;
+    return aRet;
+}
+
+}
+}
\ No newline at end of file
diff --git a/avmedia/source/vlc/vlcframegrabber.hxx b/avmedia/source/vlc/vlcframegrabber.hxx
new file mode 100644
index 0000000..0e88d5d
--- /dev/null
+++ b/avmedia/source/vlc/vlcframegrabber.hxx
@@ -0,0 +1,48 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _VLCFRAMEGRABBER_HXX
+#define _VLCFRAMEGRABBER_HXX
+
+#include "vlccommon.hxx"
+#include <com/sun/star/media/XFrameGrabber.hpp>
+#include <cppuhelper/implbase2.hxx>
+
+namespace avmedia {
+namespace vlc {
+
+typedef ::cppu::WeakImplHelper2< ::com::sun::star::media::XFrameGrabber,
+                                 ::com::sun::star::lang::XServiceInfo > FrameGrabber_BASE;
+
+class VLCFrameGrabber : public FrameGrabber_BASE
+{
+public:
+    SAL_CALL VLCFrameGrabber();
+
+    ::com::sun::star::uno::Reference< css::graphic::XGraphic > SAL_CALL grabFrame( double fMediaTime );
+
+    ::rtl::OUString SAL_CALL getImplementationName();
+    ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& serviceName );
+    ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames();
+};
+
+}
+}
+
+#endif // _VLCFRAMEGRABBER_HXX
\ No newline at end of file
diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index 647ec67..fb1ad01 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -1,11 +1,15 @@
 #include "vlcplayer.hxx"
 #include "vlcwindow.hxx"
+#include "vlcframegrabber.hxx"
 
 using namespace ::com::sun::star;
 
 namespace avmedia {
 namespace vlc {
 
+const ::rtl::OUString AVMEDIA_VLC_PLAYER_IMPLEMENTATIONNAME = "com.sun.star.comp.avmedia.Player_VLC";
+const ::rtl::OUString AVMEDIA_VLC_PLAYER_SERVICENAME = "com.sun.star.media.Player_VLC";
+
 const char * const VLC_ARGS[] = {
     "-I",
     "dummy",
@@ -105,28 +109,30 @@ css::awt::Size SAL_CALL VLCPlayer::getPreferredPlayerWindowSize()
 uno::Reference< css::media::XPlayerWindow > SAL_CALL VLCPlayer::createPlayerWindow( const uno::Sequence< uno::Any >& aArguments )
 {
     ::osl::MutexGuard aGuard(m_aMutex);
-    return uno::Reference< css::media::XPlayerWindow >(new VLCWindow());
+    return uno::Reference< css::media::XPlayerWindow >(new VLCWindow( *this ));
 }
 
 uno::Reference< css::media::XFrameGrabber > SAL_CALL VLCPlayer::createFrameGrabber()
 {
     ::osl::MutexGuard aGuard(m_aMutex);
-    return uno::Reference< css::media::XFrameGrabber >();
+    return uno::Reference< css::media::XFrameGrabber >(new VLCFrameGrabber());
 }
 
 ::rtl::OUString SAL_CALL VLCPlayer::getImplementationName()
 {
-    return ::rtl::OUString();
+    return AVMEDIA_VLC_PLAYER_IMPLEMENTATIONNAME;
 }
 
-::sal_Bool SAL_CALL VLCPlayer::supportsService( const ::rtl::OUString& ServiceName )
+::sal_Bool SAL_CALL VLCPlayer::supportsService( const ::rtl::OUString& serviceName )
 {
-    return false;
+    return serviceName == AVMEDIA_VLC_PLAYER_SERVICENAME;
 }
 
 ::uno::Sequence< ::rtl::OUString > SAL_CALL VLCPlayer::getSupportedServiceNames()
 {
-    return ::uno::Sequence< ::rtl::OUString >();
+    uno::Sequence< OUString > aRet(1);
+    aRet[0] = AVMEDIA_VLC_PLAYER_SERVICENAME;
+    return aRet;
 }
 
 }
diff --git a/avmedia/source/vlc/vlcplayer.hxx b/avmedia/source/vlc/vlcplayer.hxx
index da1673a..d1e5511 100644
--- a/avmedia/source/vlc/vlcplayer.hxx
+++ b/avmedia/source/vlc/vlcplayer.hxx
@@ -60,7 +60,7 @@ public:
     ::com::sun::star::uno::Reference< css::media::XFrameGrabber > SAL_CALL createFrameGrabber();
 
     ::rtl::OUString SAL_CALL getImplementationName();
-    ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName );
+    ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& serviceName );
     ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames();
 };
 
diff --git a/avmedia/source/vlc/vlcwindow.cxx b/avmedia/source/vlc/vlcwindow.cxx
index 67501fa..19f3791 100644
--- a/avmedia/source/vlc/vlcwindow.cxx
+++ b/avmedia/source/vlc/vlcwindow.cxx
@@ -5,6 +5,14 @@ using namespace ::com::sun::star;
 namespace avmedia {
 namespace vlc {
 
+const ::rtl::OUString AVMEDIA_VLC_WINDOW_IMPLEMENTATIONNAME = "com.sun.star.comp.avmedia.Window_VLC";
+const ::rtl::OUString AVMEDIA_VLC_WINDOW_SERVICENAME = "com.sun.star.media.Window_VLC";
+
+SAL_CALL VLCWindow::VLCWindow(VLCPlayer& player)
+    : mPlayer( player )
+{
+}
+
 void SAL_CALL VLCWindow::update()
 {
 }
@@ -25,96 +33,117 @@ void SAL_CALL VLCWindow::setPointerType( ::sal_Int32 SystemPointerType )
 
 ::rtl::OUString SAL_CALL VLCWindow::getImplementationName()
 {
-    return ::rtl::OUString();
+    return AVMEDIA_VLC_WINDOW_IMPLEMENTATIONNAME;
 }
 
-::sal_Bool SAL_CALL VLCWindow::supportsService( const ::rtl::OUString& ServiceName )
+::sal_Bool SAL_CALL VLCWindow::supportsService( const ::rtl::OUString& serviceName )
 {
-    return false;
+    return serviceName == AVMEDIA_VLC_WINDOW_SERVICENAME;
 }
 
 uno::Sequence< ::rtl::OUString > SAL_CALL VLCWindow::getSupportedServiceNames()
 {
-    return uno::Sequence< ::rtl::OUString >();
+    uno::Sequence< OUString > aRet(1);
+    aRet[0] = AVMEDIA_VLC_WINDOW_SERVICENAME;
+    return aRet;
 }
 
 void SAL_CALL VLCWindow::dispose() throw (uno::RuntimeException)
 {
 }
 
-void SAL_CALL VLCWindow::addEventListener( const uno::Reference< lang::XEventListener >& xListener ) throw (uno::RuntimeException)
+void SAL_CALL VLCWindow::addEventListener( const uno::Reference< lang::XEventListener >& xListener )
+    throw (uno::RuntimeException)
 {
 }
 
-void SAL_CALL VLCWindow::removeEventListener( const uno::Reference< lang::XEventListener >& xListener ) throw (uno::RuntimeException)
+void SAL_CALL VLCWindow::removeEventListener( const uno::Reference< lang::XEventListener >& xListener )
+    throw (uno::RuntimeException)
 {
 }
 
-void SAL_CALL VLCWindow::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) throw (uno::RuntimeException)
+void SAL_CALL VLCWindow::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags )
+    throw (uno::RuntimeException)
 {
 }
 
-awt::Rectangle SAL_CALL VLCWindow::getPosSize() throw (uno::RuntimeException)
+awt::Rectangle SAL_CALL VLCWindow::getPosSize()
+    throw (uno::RuntimeException)
 {
 }
 
-void SAL_CALL VLCWindow::setVisible( sal_Bool Visible ) throw (uno::RuntimeException)
+void SAL_CALL VLCWindow::setVisible( sal_Bool Visible )
+    throw (uno::RuntimeException)
 {
 }
 
-void SAL_CALL VLCWindow::setEnable( sal_Bool Enable ) throw (uno::RuntimeException)
+void SAL_CALL VLCWindow::setEnable( sal_Bool Enable )
+    throw (uno::RuntimeException)
 {
 }
 
-void SAL_CALL VLCWindow::setFocus() throw (uno::RuntimeException)
+void SAL_CALL VLCWindow::setFocus()
+    throw (uno::RuntimeException)
 {
 }
 
-void SAL_CALL VLCWindow::addWindowListener( const uno::Reference< awt::XWindowListener >& xListener ) throw (uno::RuntimeException)
+void SAL_CALL VLCWindow::addWindowListener( const uno::Reference< awt::XWindowListener >& xListener )
+    throw (uno::RuntimeException)
 {
 }
 
-void SAL_CALL VLCWindow::removeWindowListener( const uno::Reference< awt::XWindowListener >& xListener ) throw (uno::RuntimeException)
+void SAL_CALL VLCWindow::removeWindowListener( const uno::Reference< awt::XWindowListener >& xListener )
+    throw (uno::RuntimeException)
 {
 }
 
-void SAL_CALL VLCWindow::addFocusListener( const uno::Reference< awt::XFocusListener >& xListener ) throw (uno::RuntimeException)
+void SAL_CALL VLCWindow::addFocusListener( const uno::Reference< awt::XFocusListener >& xListener )
+    throw (uno::RuntimeException)
 {
 }
 
-void SAL_CALL VLCWindow::removeFocusListener( const uno::Reference< awt::XFocusListener >& xListener ) throw (uno::RuntimeException)
+void SAL_CALL VLCWindow::removeFocusListener( const uno::Reference< awt::XFocusListener >& xListener )
+    throw (uno::RuntimeException)
 {
 }
 
-void SAL_CALL VLCWindow::addKeyListener( const uno::Reference< awt::XKeyListener >& xListener ) throw (uno::RuntimeException)
+void SAL_CALL VLCWindow::addKeyListener( const uno::Reference< awt::XKeyListener >& xListener )
+    throw (uno::RuntimeException)
 {
 }
 
-void SAL_CALL VLCWindow::removeKeyListener( const uno::Reference< awt::XKeyListener >& xListener ) throw (uno::RuntimeException)
+void SAL_CALL VLCWindow::removeKeyListener( const uno::Reference< awt::XKeyListener >& xListener )
+    throw (uno::RuntimeException)
 {
 }
 
-void SAL_CALL VLCWindow::addMouseListener( const uno::Reference< awt::XMouseListener >& xListener ) throw (uno::RuntimeException)
+void SAL_CALL VLCWindow::addMouseListener( const uno::Reference< awt::XMouseListener >& xListener )
+    throw (uno::RuntimeException)
 {
 }
 
-void SAL_CALL VLCWindow::removeMouseListener( const uno::Reference< awt::XMouseListener >& xListener ) throw (uno::RuntimeException)
+void SAL_CALL VLCWindow::removeMouseListener( const uno::Reference< awt::XMouseListener >& xListener )
+    throw (uno::RuntimeException)
 {
 }
 
-void SAL_CALL VLCWindow::addMouseMotionListener( const uno::Reference< awt::XMouseMotionListener >& xListener ) throw (uno::RuntimeException)
+void SAL_CALL VLCWindow::addMouseMotionListener( const uno::Reference< awt::XMouseMotionListener >& xListener )
+    throw (uno::RuntimeException)
 {
 }
 
-void SAL_CALL VLCWindow::removeMouseMotionListener( const uno::Reference< awt::XMouseMotionListener >& xListener ) throw (uno::RuntimeException)
+void SAL_CALL VLCWindow::removeMouseMotionListener( const uno::Reference< awt::XMouseMotionListener >& xListener )
+    throw (uno::RuntimeException)
 {
 }
 
-void SAL_CALL VLCWindow::addPaintListener( const uno::Reference< awt::XPaintListener >& xListener ) throw (uno::RuntimeException)
+void SAL_CALL VLCWindow::addPaintListener( const uno::Reference< awt::XPaintListener >& xListener )
+    throw (uno::RuntimeException)
 {
 }
 
-void SAL_CALL VLCWindow::removePaintListener( const uno::Reference< awt::XPaintListener >& xListener ) throw (uno::RuntimeException)
+void SAL_CALL VLCWindow::removePaintListener( const uno::Reference< awt::XPaintListener >& xListener )
+    throw (uno::RuntimeException)
 {
 }
 
diff --git a/avmedia/source/vlc/vlcwindow.hxx b/avmedia/source/vlc/vlcwindow.hxx
index 7b05535..3449e2c 100644
--- a/avmedia/source/vlc/vlcwindow.hxx
+++ b/avmedia/source/vlc/vlcwindow.hxx
@@ -23,18 +23,21 @@
 
 namespace avmedia {
 namespace vlc {
+class VLCPlayer;
 
 class VLCWindow : public ::cppu::WeakImplHelper2 < ::com::sun::star::media::XPlayerWindow,
                                                    ::com::sun::star::lang::XServiceInfo >
 {
+    VLCPlayer& mPlayer;
 public:
+    SAL_CALL VLCWindow(VLCPlayer& player);
     void SAL_CALL update();
     ::sal_Bool SAL_CALL setZoomLevel( css::media::ZoomLevel ZoomLevel );
     css::media::ZoomLevel SAL_CALL getZoomLevel();
     void SAL_CALL setPointerType( ::sal_Int32 SystemPointerType );
 
     ::rtl::OUString SAL_CALL getImplementationName();
-    ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName );
+    ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& serviceName );
     ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames();
 
     void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
commit 70466a927ecbd7535e76721b707d1a7d2a03beb5
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Thu Jun 27 13:29:40 2013 +0100

    get vlcwindow compiling.
    
    Change-Id: I188a8ecf30e3816bd915ccdd452f6a93bd9d021d

diff --git a/avmedia/Library_avmediavlc.mk b/avmedia/Library_avmediavlc.mk
index 465fe2f..ced6c41 100644
--- a/avmedia/Library_avmediavlc.mk
+++ b/avmedia/Library_avmediavlc.mk
@@ -42,6 +42,7 @@ $(eval $(call gb_Library_add_exception_objects,avmediavlc,\
 	avmedia/source/vlc/vlcmanager \
 	avmedia/source/vlc/vlcplayer \
 	avmedia/source/vlc/vlcuno \
+	avmedia/source/vlc/vlcwindow \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/avmedia/source/vlc/vlccommon.hxx b/avmedia/source/vlc/vlccommon.hxx
index e9cc864..efc022f 100644
--- a/avmedia/source/vlc/vlccommon.hxx
+++ b/avmedia/source/vlc/vlccommon.hxx
@@ -40,6 +40,7 @@
 #include <com/sun/star/awt/KeyModifier.hpp>
 #include <com/sun/star/awt/MouseButton.hpp>
 #include <com/sun/star/media/XManager.hpp>
+#include <com/sun/star/media/XPlayerWindow.hpp>
 
 #endif // _VLCCOMMOM_HXX
 
diff --git a/avmedia/source/vlc/vlcwindow.cpp b/avmedia/source/vlc/vlcwindow.cpp
deleted file mode 100644
index c92dd7a..0000000
--- a/avmedia/source/vlc/vlcwindow.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-#include "vlcwindow.hxx"
-
-using namespace ;
-
-namespace avmedia {
-namespace vlc {
-
-void SAL_CALL VLCWindow::pdate()
-{
-}
-
-::sal_Bool SAL_CALL VLCWindow::setZoomLevel( css::media::ZoomLevel ZoomLevel )
-{
-    return false;
-}
-
-css::media::ZoomLevel SAL_CALL VLCWindow::getZoomLevel()
-{
-    return css::media::ZoomLevel_NOT_AVAILABLE;
-}
-
-void SAL_CALL VLCWindow::setPointerType( ::sal_Int32 SystemPointerType )
-{
-}
-
-::rtl::OUString SAL_CALL VLCWindow::getImplementationName()
-{
-    return ::rtl::OUString();
-}
-
-::sal_Bool SAL_CALL VLCWindow::supportsService( const ::rtl::OUString& ServiceName )
-{
-    return false;
-}
-
-::uno::Sequence< ::rtl::OUString > SAL_CALL VLCWindow::getSupportedServiceNames()
-{
-    return ::uno::Sequence< ::rtl::OUString >();
-}
-
-void SAL_CALL VLCWindow::dispose() throw (::uno::RuntimeException)
-{
-}
-
-void SAL_CALL VLCWindow::addEventListener( const ::uno::Reference< ::lang::XEventListener >& xListener ) throw (::uno::RuntimeException)
-{
-}
-
-void SAL_CALL VLCWindow::removeEventListener( const ::uno::Reference< :::lang::XEventListener >& aListener ) throw (::uno::RuntimeException)
-{
-}
-
-void SAL_CALL VLCWindow::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) throw (::uno::RuntimeException)
-{
-}
-
-::awt::Rectangle SAL_CALL VLCWindow::getPosSize() throw (::uno::RuntimeException)
-{
-}
-
-void SAL_CALL VLCWindow::setVisible( sal_Bool Visible ) throw (::uno::RuntimeException)
-{
-}
-
-void SAL_CALL VLCWindow::setEnable( sal_Bool Enable ) throw (::uno::RuntimeException)
-{
-}
-
-void SAL_CALL VLCWindow::setFocus() throw (::uno::RuntimeException)
-{
-}
-
-void SAL_CALL VLCWindow::addWindowListener( const ::uno::Reference< ::awt::XWindowListener >& xListener ) throw (::uno::RuntimeException)
-{
-}
-
-void SAL_CALL VLCWindow::removeWindowListener( const ::uno::Reference< ::awt::XWindowListener >& xListener ) throw (::uno::RuntimeException)
-{
-}
-
-void SAL_CALL VLCWindow::addFocusListener( const ::uno::Reference< ::awt::XFocusListener >& xListener ) throw (::uno::RuntimeException)
-{
-}
-
-void SAL_CALL VLCWindow::removeFocusListener( const ::uno::Reference< ::awt::XFocusListener >& xListener ) throw (::uno::RuntimeException)
-{
-}
-
-void SAL_CALL VLCWindow::addKeyListener( const ::uno::Reference< ::awt::XKeyListener >& xListener ) throw (::uno::RuntimeException)
-{
-}
-
-void SAL_CALL VLCWindow::removeKeyListener( const ::uno::Reference< ::awt::XKeyListener >& xListener ) throw (::uno::RuntimeException)
-{
-}
-
-void SAL_CALL VLCWindow::addMouseListener( const ::uno::Reference< ::awt::XMouseListener >& xListener ) throw (::uno::RuntimeException)
-{
-}
-
-void SAL_CALL VLCWindow::removeMouseListener( const ::uno::Reference< ::awt::XMouseListener >& xListener ) throw (::uno::RuntimeException)
-{
-}
-
-void SAL_CALL VLCWindow::addMouseMotionListener( const ::uno::Reference< ::awt::XMouseMotionListener >& xListener ) throw (::uno::RuntimeException)
-{
-}
-
-void SAL_CALL VLCWindow::removeMouseMotionListener( const ::uno::Reference< ::awt::XMouseMotionListener >& xListener ) throw (::uno::RuntimeException)
-{
-}
-
-void SAL_CALL VLCWindow::addPaintListener( const ::uno::Reference< ::awt::XPaintListener >& xListener ) throw (::uno::RuntimeException)
-{
-}
-
-void SAL_CALL VLCWindow::removePaintListener( const ::uno::Reference< ::awt::XPaintListener >& xListener ) throw (::uno::RuntimeException)
-{
-}
-
-}
-}
\ No newline at end of file
diff --git a/avmedia/source/vlc/vlcwindow.cxx b/avmedia/source/vlc/vlcwindow.cxx
new file mode 100644
index 0000000..67501fa
--- /dev/null
+++ b/avmedia/source/vlc/vlcwindow.cxx
@@ -0,0 +1,122 @@
+#include "vlcwindow.hxx"
+
+using namespace ::com::sun::star;
+
+namespace avmedia {
+namespace vlc {
+
+void SAL_CALL VLCWindow::update()
+{
+}
+
+::sal_Bool SAL_CALL VLCWindow::setZoomLevel( css::media::ZoomLevel ZoomLevel )
+{
+    return false;
+}
+
+css::media::ZoomLevel SAL_CALL VLCWindow::getZoomLevel()
+{
+    return css::media::ZoomLevel_NOT_AVAILABLE;
+}
+
+void SAL_CALL VLCWindow::setPointerType( ::sal_Int32 SystemPointerType )
+{
+}
+
+::rtl::OUString SAL_CALL VLCWindow::getImplementationName()
+{
+    return ::rtl::OUString();
+}
+
+::sal_Bool SAL_CALL VLCWindow::supportsService( const ::rtl::OUString& ServiceName )
+{
+    return false;
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL VLCWindow::getSupportedServiceNames()
+{
+    return uno::Sequence< ::rtl::OUString >();
+}
+
+void SAL_CALL VLCWindow::dispose() throw (uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::addEventListener( const uno::Reference< lang::XEventListener >& xListener ) throw (uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::removeEventListener( const uno::Reference< lang::XEventListener >& xListener ) throw (uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) throw (uno::RuntimeException)
+{
+}
+
+awt::Rectangle SAL_CALL VLCWindow::getPosSize() throw (uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::setVisible( sal_Bool Visible ) throw (uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::setEnable( sal_Bool Enable ) throw (uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::setFocus() throw (uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::addWindowListener( const uno::Reference< awt::XWindowListener >& xListener ) throw (uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::removeWindowListener( const uno::Reference< awt::XWindowListener >& xListener ) throw (uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::addFocusListener( const uno::Reference< awt::XFocusListener >& xListener ) throw (uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::removeFocusListener( const uno::Reference< awt::XFocusListener >& xListener ) throw (uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::addKeyListener( const uno::Reference< awt::XKeyListener >& xListener ) throw (uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::removeKeyListener( const uno::Reference< awt::XKeyListener >& xListener ) throw (uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::addMouseListener( const uno::Reference< awt::XMouseListener >& xListener ) throw (uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::removeMouseListener( const uno::Reference< awt::XMouseListener >& xListener ) throw (uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::addMouseMotionListener( const uno::Reference< awt::XMouseMotionListener >& xListener ) throw (uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::removeMouseMotionListener( const uno::Reference< awt::XMouseMotionListener >& xListener ) throw (uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::addPaintListener( const uno::Reference< awt::XPaintListener >& xListener ) throw (uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::removePaintListener( const uno::Reference< awt::XPaintListener >& xListener ) throw (uno::RuntimeException)
+{
+}
+
+}
+}
commit b6090460d9b596b8814d9a93e2cfa49b5b9a7dfd
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Tue Jun 25 00:06:34 2013 +0300

    Fixing source for building
    
    Change-Id: I0470684c8e2f043e891a58e11f498706c9a7a7f6

diff --git a/avmedia/source/vlc/vlccommon.hxx b/avmedia/source/vlc/vlccommon.hxx
index 62551d0..e9cc864 100644
--- a/avmedia/source/vlc/vlccommon.hxx
+++ b/avmedia/source/vlc/vlccommon.hxx
@@ -19,8 +19,6 @@
 
 #ifndef _VLCCOMMON_HXX
 #define _VLCCOMMON_HXX
-//TODO: Remove it before committing
-#define SAL_CALL
 
 #include <vlc/libvlc.h>
 
diff --git a/avmedia/source/vlc/vlcmanager.cxx b/avmedia/source/vlc/vlcmanager.cxx
index 5286eb6..18681de 100644
--- a/avmedia/source/vlc/vlcmanager.cxx
+++ b/avmedia/source/vlc/vlcmanager.cxx
@@ -20,7 +20,7 @@ Manager::~Manager()
 uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const rtl::OUString& rURL )
     throw (uno::RuntimeException)
 {
-    VLCPlayer* pPlayer( new VLCPlayer( mxMgr ) );
+    VLCPlayer* pPlayer( new VLCPlayer( /* mxMgr */ ) );
     uno::Reference< media::XPlayer > xRet( pPlayer );
 
     return xRet;
diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index 24375ad..647ec67 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -15,7 +15,8 @@ const char * const VLC_ARGS[] = {
 };
 
 VLCPlayer::VLCPlayer()
-    : mInstance( libvlc_new( sizeof( VLC_ARGS ) / sizeof( VLC_ARGS[0] ), VLC_ARGS ), libvlc_release )
+    : VLC_Base(m_aMutex)
+    , 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 )
 {
 }
@@ -106,12 +107,28 @@ uno::Reference< css::media::XPlayerWindow > SAL_CALL VLCPlayer::createPlayerWind
     ::osl::MutexGuard aGuard(m_aMutex);
     return uno::Reference< css::media::XPlayerWindow >(new VLCWindow());
 }
+
 uno::Reference< css::media::XFrameGrabber > SAL_CALL VLCPlayer::createFrameGrabber()
 {
     ::osl::MutexGuard aGuard(m_aMutex);
     return uno::Reference< css::media::XFrameGrabber >();
 }
 
+::rtl::OUString SAL_CALL VLCPlayer::getImplementationName()
+{
+    return ::rtl::OUString();
+}
+
+::sal_Bool SAL_CALL VLCPlayer::supportsService( const ::rtl::OUString& ServiceName )
+{
+    return false;
+}
+
+::uno::Sequence< ::rtl::OUString > SAL_CALL VLCPlayer::getSupportedServiceNames()
+{
+    return ::uno::Sequence< ::rtl::OUString >();
+}
+
 }
 }
 
diff --git a/avmedia/source/vlc/vlcplayer.hxx b/avmedia/source/vlc/vlcplayer.hxx
index ee1ebba..da1673a 100644
--- a/avmedia/source/vlc/vlcplayer.hxx
+++ b/avmedia/source/vlc/vlcplayer.hxx
@@ -20,10 +20,13 @@
 #ifndef _VLCPLAYER_HXX
 #define _VLCPLAYER_HXX
 
+#include "vlccommon.hxx"
 #include <vlc/vlc.h>
+#include <boost/shared_ptr.hpp>
+#include <cppuhelper/compbase2.hxx>
 #include <com/sun/star/media/XPlayer.hpp>
 #include <cppuhelper/basemutex.hxx>
-#include "vlccommon.hxx"
+
 
 namespace avmedia {
 namespace vlc {
@@ -55,6 +58,10 @@ public:
     css::awt::Size SAL_CALL getPreferredPlayerWindowSize();
     ::com::sun::star::uno::Reference< css::media::XPlayerWindow > SAL_CALL createPlayerWindow( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments );
     ::com::sun::star::uno::Reference< css::media::XFrameGrabber > SAL_CALL createFrameGrabber();
+
+    ::rtl::OUString SAL_CALL getImplementationName();
+    ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName );
+    ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames();
 };
 
 }
diff --git a/avmedia/source/vlc/vlcwindow.cpp b/avmedia/source/vlc/vlcwindow.cpp
index 77656eb..c92dd7a 100644
--- a/avmedia/source/vlc/vlcwindow.cpp
+++ b/avmedia/source/vlc/vlcwindow.cpp
@@ -1,6 +1,6 @@
 #include "vlcwindow.hxx"
 
-using namespace ::com::sun::star;
+using namespace ;
 
 namespace avmedia {
 namespace vlc {
@@ -38,5 +38,85 @@ void SAL_CALL VLCWindow::setPointerType( ::sal_Int32 SystemPointerType )
     return ::uno::Sequence< ::rtl::OUString >();
 }
 
+void SAL_CALL VLCWindow::dispose() throw (::uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::addEventListener( const ::uno::Reference< ::lang::XEventListener >& xListener ) throw (::uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::removeEventListener( const ::uno::Reference< :::lang::XEventListener >& aListener ) throw (::uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) throw (::uno::RuntimeException)
+{
+}
+
+::awt::Rectangle SAL_CALL VLCWindow::getPosSize() throw (::uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::setVisible( sal_Bool Visible ) throw (::uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::setEnable( sal_Bool Enable ) throw (::uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::setFocus() throw (::uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::addWindowListener( const ::uno::Reference< ::awt::XWindowListener >& xListener ) throw (::uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::removeWindowListener( const ::uno::Reference< ::awt::XWindowListener >& xListener ) throw (::uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::addFocusListener( const ::uno::Reference< ::awt::XFocusListener >& xListener ) throw (::uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::removeFocusListener( const ::uno::Reference< ::awt::XFocusListener >& xListener ) throw (::uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::addKeyListener( const ::uno::Reference< ::awt::XKeyListener >& xListener ) throw (::uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::removeKeyListener( const ::uno::Reference< ::awt::XKeyListener >& xListener ) throw (::uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::addMouseListener( const ::uno::Reference< ::awt::XMouseListener >& xListener ) throw (::uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::removeMouseListener( const ::uno::Reference< ::awt::XMouseListener >& xListener ) throw (::uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::addMouseMotionListener( const ::uno::Reference< ::awt::XMouseMotionListener >& xListener ) throw (::uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::removeMouseMotionListener( const ::uno::Reference< ::awt::XMouseMotionListener >& xListener ) throw (::uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::addPaintListener( const ::uno::Reference< ::awt::XPaintListener >& xListener ) throw (::uno::RuntimeException)
+{
+}
+
+void SAL_CALL VLCWindow::removePaintListener( const ::uno::Reference< ::awt::XPaintListener >& xListener ) throw (::uno::RuntimeException)
+{
+}
+
 }
 }
\ No newline at end of file
diff --git a/avmedia/source/vlc/vlcwindow.hxx b/avmedia/source/vlc/vlcwindow.hxx
index 3c4afcb..7b05535 100644
--- a/avmedia/source/vlc/vlcwindow.hxx
+++ b/avmedia/source/vlc/vlcwindow.hxx
@@ -36,6 +36,28 @@ public:
     ::rtl::OUString SAL_CALL getImplementationName();
     ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName );
     ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames();
+
+    void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
+    void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+    void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
+
+    void SAL_CALL setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) throw (::com::sun::star::uno::RuntimeException);
+    ::com::sun::star::awt::Rectangle SAL_CALL getPosSize() throw (::com::sun::star::uno::RuntimeException);
+    void SAL_CALL setVisible( sal_Bool Visible ) throw (::com::sun::star::uno::RuntimeException);
+    void SAL_CALL setEnable( sal_Bool Enable ) throw (::com::sun::star::uno::RuntimeException);
+    void SAL_CALL setFocus() throw (::com::sun::star::uno::RuntimeException);
+    void SAL_CALL addWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+    void SAL_CALL removeWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+    void SAL_CALL addFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+    void SAL_CALL removeFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+    void SAL_CALL addKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+    void SAL_CALL removeKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+    void SAL_CALL addMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+    void SAL_CALL removeMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+    void SAL_CALL addMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+    void SAL_CALL removeMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+    void SAL_CALL addPaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
+    void SAL_CALL removePaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
 };
 
 }
commit 49e622c5cadbd42ee85311d7f2a35dd8880f538e
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Mon Jun 24 23:08:15 2013 +0300

    Lockguards for threadsafe. VLCWindow class templates.
    
    Change-Id: I3e56f1752ebb101f05a231007ffce5cc5b9c97d2

diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index b308636..24375ad 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -1,4 +1,5 @@
 #include "vlcplayer.hxx"
+#include "vlcwindow.hxx"
 
 using namespace ::com::sun::star;
 
@@ -21,37 +22,44 @@ VLCPlayer::VLCPlayer()
 
 void SAL_CALL VLCPlayer::start()
 {
+    ::osl::MutexGuard aGuard(m_aMutex);
     libvlc_media_player_play( mPlayer.get() );
 }
 
 void SAL_CALL VLCPlayer::stop()
 {
+    ::osl::MutexGuard aGuard(m_aMutex);
     libvlc_media_player_stop( mPlayer.get() );
 }
 
 ::sal_Bool SAL_CALL VLCPlayer::isPlaying()
 {
+    ::osl::MutexGuard aGuard(m_aMutex);
     return (libvlc_media_player_is_playing( mPlayer.get() ) == 1);
 }
 
 double SAL_CALL VLCPlayer::getDuration()
 {
+    ::osl::MutexGuard aGuard(m_aMutex);
     libvlc_media_t* media = libvlc_media_player_get_media( mPlayer.get() );
     return libvlc_media_get_duration( media );
 }
 
 void SAL_CALL VLCPlayer::setMediaTime( double fTime )
 {
+    ::osl::MutexGuard aGuard(m_aMutex);
     libvlc_media_player_set_time( mPlayer.get(), fTime );
 }
 
 double SAL_CALL VLCPlayer::getMediaTime()
 {
+    ::osl::MutexGuard aGuard(m_aMutex);
     return libvlc_media_player_get_time( mPlayer.get() );
 }
 
 double SAL_CALL VLCPlayer::getRate()
 {
+    ::osl::MutexGuard aGuard(m_aMutex);
     return libvlc_media_player_get_rate( mPlayer.get() );
 }
 
@@ -66,21 +74,25 @@ void SAL_CALL VLCPlayer::setPlaybackLoop( ::sal_Bool bSet )
 
 void SAL_CALL VLCPlayer::setVolumeDB( ::sal_Int16 nDB )
 {
+    ::osl::MutexGuard aGuard(m_aMutex);
     libvlc_audio_set_volume( mPlayer.get(), nDB );
 }
 
 ::sal_Int16 SAL_CALL VLCPlayer::getVolumeDB()
 {
+    ::osl::MutexGuard aGuard(m_aMutex);
     return libvlc_audio_get_volume( mPlayer.get() );
 }
 
 void SAL_CALL VLCPlayer::setMute( ::sal_Bool bSet )
 {
+    ::osl::MutexGuard aGuard(m_aMutex);
     libvlc_audio_set_mute( mPlayer.get(), bSet );
 }
 
 ::sal_Bool SAL_CALL VLCPlayer::isMute()
 {
+    ::osl::MutexGuard aGuard(m_aMutex);
     return libvlc_audio_get_mute( mPlayer.get() );
 }
 
@@ -91,10 +103,12 @@ css::awt::Size SAL_CALL VLCPlayer::getPreferredPlayerWindowSize()
 
 uno::Reference< css::media::XPlayerWindow > SAL_CALL VLCPlayer::createPlayerWindow( const uno::Sequence< uno::Any >& aArguments )
 {
-    return uno::Reference< css::media::XPlayerWindow >();
+    ::osl::MutexGuard aGuard(m_aMutex);
+    return uno::Reference< css::media::XPlayerWindow >(new VLCWindow());
 }
 uno::Reference< css::media::XFrameGrabber > SAL_CALL VLCPlayer::createFrameGrabber()
 {
+    ::osl::MutexGuard aGuard(m_aMutex);
     return uno::Reference< css::media::XFrameGrabber >();
 }
 
diff --git a/avmedia/source/vlc/vlcwindow.cpp b/avmedia/source/vlc/vlcwindow.cpp
new file mode 100644
index 0000000..77656eb
--- /dev/null
+++ b/avmedia/source/vlc/vlcwindow.cpp
@@ -0,0 +1,42 @@
+#include "vlcwindow.hxx"
+
+using namespace ::com::sun::star;
+
+namespace avmedia {
+namespace vlc {
+
+void SAL_CALL VLCWindow::pdate()
+{
+}
+
+::sal_Bool SAL_CALL VLCWindow::setZoomLevel( css::media::ZoomLevel ZoomLevel )
+{
+    return false;
+}
+
+css::media::ZoomLevel SAL_CALL VLCWindow::getZoomLevel()
+{
+    return css::media::ZoomLevel_NOT_AVAILABLE;
+}
+
+void SAL_CALL VLCWindow::setPointerType( ::sal_Int32 SystemPointerType )
+{
+}
+
+::rtl::OUString SAL_CALL VLCWindow::getImplementationName()
+{
+    return ::rtl::OUString();
+}
+
+::sal_Bool SAL_CALL VLCWindow::supportsService( const ::rtl::OUString& ServiceName )
+{
+    return false;
+}
+
+::uno::Sequence< ::rtl::OUString > SAL_CALL VLCWindow::getSupportedServiceNames()
+{
+    return ::uno::Sequence< ::rtl::OUString >();
+}
+
+}
+}
\ No newline at end of file
diff --git a/avmedia/source/vlc/vlcwindow.hxx b/avmedia/source/vlc/vlcwindow.hxx
new file mode 100644
index 0000000..3c4afcb
--- /dev/null
+++ b/avmedia/source/vlc/vlcwindow.hxx
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef _VLCWINDOW_HXX
+#define _VLCWINDOW_HXX
+
+#include "vlccommon.hxx"
+
+namespace avmedia {
+namespace vlc {
+
+class VLCWindow : public ::cppu::WeakImplHelper2 < ::com::sun::star::media::XPlayerWindow,
+                                                   ::com::sun::star::lang::XServiceInfo >
+{
+public:
+    void SAL_CALL update();
+    ::sal_Bool SAL_CALL setZoomLevel( css::media::ZoomLevel ZoomLevel );
+    css::media::ZoomLevel SAL_CALL getZoomLevel();
+    void SAL_CALL setPointerType( ::sal_Int32 SystemPointerType );
+
+    ::rtl::OUString SAL_CALL getImplementationName();
+    ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName );
+    ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames();
+};
+
+}
+}
+
+#endif // _VLCWINDOW_HXX
commit 51d7b654a556db96a2870918bc51a348f1b32260
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Mon Jun 24 09:53:22 2013 +0300

    get/set methods implementations
    
    Change-Id: Ia60d54def159b2ffc18d63315d23fc195ecece94

diff --git a/avmedia/source/vlc/vlccommon.hxx b/avmedia/source/vlc/vlccommon.hxx
index e9cc864..62551d0 100644
--- a/avmedia/source/vlc/vlccommon.hxx
+++ b/avmedia/source/vlc/vlccommon.hxx
@@ -19,6 +19,8 @@
 
 #ifndef _VLCCOMMON_HXX
 #define _VLCCOMMON_HXX
+//TODO: Remove it before committing
+#define SAL_CALL
 
 #include <vlc/libvlc.h>
 
diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index c48b1f3..b308636 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -36,16 +36,18 @@ void SAL_CALL VLCPlayer::stop()
 
 double SAL_CALL VLCPlayer::getDuration()
 {
-    return 0.f;
+    libvlc_media_t* media = libvlc_media_player_get_media( mPlayer.get() );
+    return libvlc_media_get_duration( media );
 }
 
 void SAL_CALL VLCPlayer::setMediaTime( double fTime )
 {
+    libvlc_media_player_set_time( mPlayer.get(), fTime );
 }
 
 double SAL_CALL VLCPlayer::getMediaTime()
 {
-    return 0.f;
+    return libvlc_media_player_get_time( mPlayer.get() );
 }
 
 double SAL_CALL VLCPlayer::getRate()
@@ -64,20 +66,22 @@ void SAL_CALL VLCPlayer::setPlaybackLoop( ::sal_Bool bSet )
 
 void SAL_CALL VLCPlayer::setVolumeDB( ::sal_Int16 nDB )
 {
+    libvlc_audio_set_volume( mPlayer.get(), nDB );
 }
 
 ::sal_Int16 SAL_CALL VLCPlayer::getVolumeDB()
 {
-    return 1;
+    return libvlc_audio_get_volume( mPlayer.get() );
 }
 
 void SAL_CALL VLCPlayer::setMute( ::sal_Bool bSet )
 {
+    libvlc_audio_set_mute( mPlayer.get(), bSet );
 }
 
 ::sal_Bool SAL_CALL VLCPlayer::isMute()
 {
-    return false;
+    return libvlc_audio_get_mute( mPlayer.get() );
 }
 
 css::awt::Size SAL_CALL VLCPlayer::getPreferredPlayerWindowSize()
commit a1c329f6b5a482d8339db6213c8d40f73e176883
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Fri Jun 21 09:19:51 2013 +0300

    Media player/VLC instance initializing.
    
    + implementing some methods in vlcplayer
    
    Change-Id: I9b9ca9ecd56f85b73fb7e79fcab5fc2968bd20fb

diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index e977de4..c48b1f3 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 f82bd59..ee1ebba 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();
commit 16ae4845685653c0fe67b8658c34e24c40fb297f
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Thu Jun 13 10:05:10 2013 +0100

    build the new modules, and close a couple of namespaces.
    
    Change-Id: I04bc100310f886cd07eb1440a37028a2e52d879e

diff --git a/avmedia/Library_avmediavlc.mk b/avmedia/Library_avmediavlc.mk
index f4b1b24..465fe2f 100644
--- a/avmedia/Library_avmediavlc.mk
+++ b/avmedia/Library_avmediavlc.mk
@@ -39,6 +39,8 @@ $(eval $(call gb_Library_use_libraries,avmediavlc,\
 ))
 
 $(eval $(call gb_Library_add_exception_objects,avmediavlc,\
+	avmedia/source/vlc/vlcmanager \
+	avmedia/source/vlc/vlcplayer \
 	avmedia/source/vlc/vlcuno \
 ))
 
diff --git a/avmedia/source/vlc/vlcmanager.cxx b/avmedia/source/vlc/vlcmanager.cxx
index 74f4111..5286eb6 100644
--- a/avmedia/source/vlc/vlcmanager.cxx
+++ b/avmedia/source/vlc/vlcmanager.cxx
@@ -44,4 +44,7 @@ uno::Sequence< rtl::OUString > SAL_CALL Manager::getSupportedServiceNames()
     return uno::Sequence< rtl::OUString >();
 }
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
+} // end namespace vlc
+} // end namespace avmedia
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 7c16e27ad0417764af9f21d2ddfeae95850630a9
Author: Minh Ngo <nlminhtl at gmail.com>
Date:   Thu Jun 13 09:43:51 2013 +0300

    Initial player/manager patterns for the vlc module
    
    Change-Id: I600c3b273343906fbaed18629f425ce5b590b92e

diff --git a/avmedia/source/vlc/vlcmanager.cxx b/avmedia/source/vlc/vlcmanager.cxx
new file mode 100644
index 0000000..74f4111
--- /dev/null
+++ b/avmedia/source/vlc/vlcmanager.cxx
@@ -0,0 +1,47 @@
+#include "vlcmanager.hxx"
+#include "vlcplayer.hxx"
+
+using namespace ::com::sun::star;
+
+namespace avmedia {
+namespace vlc {
+
+const rtl::OUString VLC_IMPLEMENTATION_NAME = "com.sun.star.comp.avmedia.Manager_VLC";
+
+Manager::Manager( const uno::Reference< lang::XMultiServiceFactory >& rxMgr )
+    : mxMgr( rxMgr )
+{
+}
+
+Manager::~Manager()
+{
+}
+
+uno::Reference< media::XPlayer > SAL_CALL Manager::createPlayer( const rtl::OUString& rURL )
+    throw (uno::RuntimeException)
+{
+    VLCPlayer* pPlayer( new VLCPlayer( mxMgr ) );
+    uno::Reference< media::XPlayer > xRet( pPlayer );
+
+    return xRet;
+}
+
+rtl::OUString SAL_CALL Manager::getImplementationName()
+    throw (uno::RuntimeException)
+{
+    return VLC_IMPLEMENTATION_NAME;
+}
+
+sal_Bool SAL_CALL Manager::supportsService( const rtl::OUString& ServiceName )
+    throw (uno::RuntimeException)
+{
+    return false;
+}
+
+uno::Sequence< rtl::OUString > SAL_CALL Manager::getSupportedServiceNames()
+    throw (uno::RuntimeException)
+{
+    return uno::Sequence< rtl::OUString >();
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/avmedia/source/vlc/vlcmanager.hxx b/avmedia/source/vlc/vlcmanager.hxx
new file mode 100644
index 0000000..2632161
--- /dev/null
+++ b/avmedia/source/vlc/vlcmanager.hxx
@@ -0,0 +1,53 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _VLCMANAGER_HXX
+#define _VLCMANAGER_HXX
+
+#include "vlccommon.hxx"
+
+#include "com/sun/star/media/XManager.hpp"
+
+namespace avmedia {
+namespace vlc {
+
+class Manager : public ::cppu::WeakImplHelper2 < ::com::sun::star::media::XManager,
+                                                    ::com::sun::star::lang::XServiceInfo >
+{
+public:
+    Manager( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxMgr );
+    ~Manager();
+
+    ::com::sun::star::uno::Reference< ::com::sun::star::media::XPlayer > SAL_CALL createPlayer( const rtl::OUString& aURL ) throw (::com::sun::star::uno::RuntimeException);
+
+    rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException);
+    sal_Bool SAL_CALL supportsService( const rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+    ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() throw (::com::sun::star::uno::RuntimeException);
+
+private:
+    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMgr;
+};
+
+}
+}
+
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
new file mode 100644
index 0000000..e977de4
--- /dev/null
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -0,0 +1,84 @@
+#include "vlcplayer.hxx"
+
+using namespace ::com::sun::star;
+
+namespace avmedia {
+namespace vlc {
+
+void SAL_CALL VLCPlayer::start()
+{
+}
+
+void SAL_CALL VLCPlayer::stop()
+{
+}
+
+::sal_Bool SAL_CALL VLCPlayer::isPlaying()
+{
+    return false;
+}
+
+double SAL_CALL VLCPlayer::getDuration()
+{
+    return 0.f;
+}
+
+void SAL_CALL VLCPlayer::setMediaTime( double fTime )
+{
+}
+
+double SAL_CALL VLCPlayer::getMediaTime()
+{
+    return 0.f;
+}
+
+double SAL_CALL VLCPlayer::getRate()
+{
+    return 0.f;
+}
+
+void SAL_CALL VLCPlayer::setPlaybackLoop( ::sal_Bool bSet )
+{
+}
+
+::sal_Bool SAL_CALL VLCPlayer::isPlaybackLoop()
+{
+    return false;
+}
+
+void SAL_CALL VLCPlayer::setVolumeDB( ::sal_Int16 nDB )
+{
+}
+
+::sal_Int16 SAL_CALL VLCPlayer::getVolumeDB()
+{
+    return 1;
+}
+
+void SAL_CALL VLCPlayer::setMute( ::sal_Bool bSet )
+{
+}
+
+::sal_Bool SAL_CALL VLCPlayer::isMute()
+{
+    return false;
+}
+
+css::awt::Size SAL_CALL VLCPlayer::getPreferredPlayerWindowSize()
+{
+    return css::awt::Size( 1, 1 );
+}
+
+uno::Reference< css::media::XPlayerWindow > SAL_CALL VLCPlayer::createPlayerWindow( const uno::Sequence< uno::Any >& aArguments )
+{
+    return uno::Reference< css::media::XPlayerWindow >();
+}
+uno::Reference< css::media::XFrameGrabber > SAL_CALL VLCPlayer::createFrameGrabber()
+{
+    return uno::Reference< css::media::XFrameGrabber >();
+}
+
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/avmedia/source/vlc/vlcplayer.hxx b/avmedia/source/vlc/vlcplayer.hxx
new file mode 100644
index 0000000..f82bd59
--- /dev/null
+++ b/avmedia/source/vlc/vlcplayer.hxx
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _VLCPLAYER_HXX
+#define _VLCPLAYER_HXX
+
+#include "vlccommon.hxx"
+
+#include "com/sun/star/media/XPlayer.hpp"
+#include <cppuhelper/basemutex.hxx>
+
+namespace avmedia {
+namespace vlc {
+
+typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::media::XPlayer,
+                                          ::com::sun::star::lang::XServiceInfo > VLC_Base;
+
+class VLCPlayer : public ::cppu::BaseMutex,
+                  public VLC_Base
+{
+public:
+    void SAL_CALL start();
+    void SAL_CALL stop();
+    ::sal_Bool SAL_CALL isPlaying();
+    double SAL_CALL getDuration();
+    void SAL_CALL setMediaTime( double fTime );
+    double SAL_CALL getMediaTime();
+    double SAL_CALL getRate();
+    void SAL_CALL setPlaybackLoop( ::sal_Bool bSet );
+    ::sal_Bool SAL_CALL isPlaybackLoop();
+    void SAL_CALL setVolumeDB( ::sal_Int16 nDB );
+    ::sal_Int16 SAL_CALL getVolumeDB();
+    void SAL_CALL setMute( ::sal_Bool bSet );
+    ::sal_Bool SAL_CALL isMute();
+    css::awt::Size SAL_CALL getPreferredPlayerWindowSize();
+    ::com::sun::star::uno::Reference< css::media::XPlayerWindow > SAL_CALL createPlayerWindow( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments );
+    ::com::sun::star::uno::Reference< css::media::XFrameGrabber > SAL_CALL createFrameGrabber();
+};
+
+}
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/avmedia/source/vlc/vlcuno.cxx b/avmedia/source/vlc/vlcuno.cxx
index e907a1b..0c9690e 100644
--- a/avmedia/source/vlc/vlcuno.cxx
+++ b/avmedia/source/vlc/vlcuno.cxx
@@ -18,6 +18,7 @@
  */
 
 #include "vlccommon.hxx"
+#include "vlcmanager.hxx"
 
 using namespace ::com::sun::star;
 
@@ -28,7 +29,7 @@ static uno::Reference< uno::XInterface > SAL_CALL create_MediaPlayer( const uno:
 {
     fprintf (stderr, "create VLC Media player !\n");
     (void) rxFact;
-    return uno::Reference< uno::XInterface >(); // *new ::avmedia::vlc::Manager( rxFact ) );
+    return uno::Reference< uno::XInterface >(*new ::avmedia::vlc::Manager( rxFact ) );
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL avmediavlc_component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /*pRegistryKey*/ )
commit ed05db48c00f5892dad3704885c8621d68c1298d
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Wed May 29 12:31:22 2013 +0100

    trivial build fix.
    
    Change-Id: I6c5254e2087fed0664255619f080741f8ffb2a6e

diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk
index 2cd0d06..337575a 100644
--- a/postprocess/Rdb_services.mk
+++ b/postprocess/Rdb_services.mk
@@ -205,7 +205,7 @@ $(eval $(call gb_Rdb_add_components,services,\
 		avmedia/source/gstreamer/avmediagstreamer_0_10 \
 	) \
 	$(if $(ENABLE_VLC), \
-		avmedia/source/gstreamer/avmediavlc \
+		avmedia/source/vlc/avmediavlc \
 	) \
 	$(if $(ENABLE_KAB), \
 		connectivity/source/drivers/kab/kab1 \
commit 791e2f66652f9fd4af100776730c62484927c144
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Wed May 29 12:27:08 2013 +0100

    initial vlc component build / conditionals and hookup.
    
    Change-Id: I12e4a368e18a58099160ee65eebe837744e11378

diff --git a/Repository.mk b/Repository.mk
index 95ad515..398396e 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -484,6 +484,7 @@ $(eval $(call gb_Helper_register_libraries,PLAINLIBS_URE, \
 ))
 
 $(eval $(call gb_Helper_register_libraries_for_install,PLAINLIBS_OOO,ooo, \
+	$(if $(ENABLE_VLC),avmediavlc) \
 	$(if $(ENABLE_GSTREAMER),avmediagst) \
 	$(if $(ENABLE_GSTREAMER_0_10),avmediagst_0_10) \
 	$(if $(ENABLE_DIRECTX),avmediawin) \
diff --git a/avmedia/Library_avmediavlc.mk b/avmedia/Library_avmediavlc.mk
new file mode 100644
index 0000000..f4b1b24
--- /dev/null
+++ b/avmedia/Library_avmediavlc.mk
@@ -0,0 +1,45 @@
+# -*- Mode: makefile; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+
+$(eval $(call gb_Library_Library,avmediavlc))
+
+$(eval $(call gb_Library_set_componentfile,avmediavlc,avmedia/source/vlc/avmediavlc))
+
+$(eval $(call gb_Library_set_include,avmediavlc,\
+	$$(INCLUDE) \
+	-I$(SRCDIR)/avmedia/source/inc \
+	$(VLC_CFLAGS) \
+))
+$(eval $(call gb_Library_add_libs,avmediavlc,$(VLC_LIBS)))
+
+$(eval $(call gb_Library_use_external,avmediavlc,boost_headers))
+
+$(eval $(call gb_Library_use_sdk_api,avmediavlc))
+
+ifeq ($(OS),WNT)
+$(eval $(call gb_Library_add_defs,avmediavlc,\
+	-DWINNT
+))
+endif
+
+$(eval $(call gb_Library_use_libraries,avmediavlc,\
+	comphelper \
+	cppu \
+	cppuhelper \
+	sal \
+	tl \
+	vcl \
+	$(gb_UWINAPI) \
+))
+
+$(eval $(call gb_Library_add_exception_objects,avmediavlc,\
+	avmedia/source/vlc/vlcuno \
+))
+
+# vim: set noet sw=4 ts=4:
diff --git a/avmedia/Module_avmedia.mk b/avmedia/Module_avmedia.mk
index 3579081..68d2e74 100644
--- a/avmedia/Module_avmedia.mk
+++ b/avmedia/Module_avmedia.mk
@@ -26,6 +26,12 @@ $(eval $(call gb_Module_add_targets,avmedia,\
 ))
 endif
 
+ifeq ($(ENABLE_VLC),TRUE)
+$(eval $(call gb_Module_add_targets,avmedia,\
+	Library_avmediavlc \
+))
+endif
+
 ifeq ($(OS),MACOSX)
 ifneq ($(CPUNAME),X86_64)
 $(eval $(call gb_Module_add_targets,avmedia,\
diff --git a/avmedia/source/vlc/avmediavlc.component b/avmedia/source/vlc/avmediavlc.component
new file mode 100644
index 0000000..95e99a9
--- /dev/null
+++ b/avmedia/source/vlc/avmediavlc.component
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+<component loader="com.sun.star.loader.SharedLibrary" prefix="avmediavlc" xmlns="http://openoffice.org/2010/uno-components">
+  <implementation name="com.sun.star.comp.media.Manager_VLC">
+    <service name="com.sun.star.comp.avmedia.Manager_VLC"/>
+  </implementation>
+</component>
diff --git a/avmedia/source/vlc/vlccommon.hxx b/avmedia/source/vlc/vlccommon.hxx
new file mode 100644
index 0000000..e9cc864
--- /dev/null
+++ b/avmedia/source/vlc/vlccommon.hxx
@@ -0,0 +1,46 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef _VLCCOMMON_HXX
+#define _VLCCOMMON_HXX
+
+#include <vlc/libvlc.h>
+
+#include <osl/mutex.hxx>
+#include <tools/stream.hxx>
+#include <tools/urlobj.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/weak.hxx>
+#include <cppuhelper/factory.hxx>
+
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/uno/RuntimeException.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/registry/XRegistryKey.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/awt/Rectangle.hpp>
+#include <com/sun/star/awt/KeyModifier.hpp>
+#include <com/sun/star/awt/MouseButton.hpp>
+#include <com/sun/star/media/XManager.hpp>
+
+#endif // _VLCCOMMOM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/avmedia/source/vlc/vlcuno.cxx b/avmedia/source/vlc/vlcuno.cxx
new file mode 100644
index 0000000..e907a1b
--- /dev/null
+++ b/avmedia/source/vlc/vlcuno.cxx
@@ -0,0 +1,56 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include "vlccommon.hxx"
+
+using namespace ::com::sun::star;
+
+#define IMPL_NAME    "com.sun.star.comp.media.Manager_VLC"
+#define SERVICE_NAME "com.sun.star.comp.avmedia.Manager_VLC"
+
+static uno::Reference< uno::XInterface > SAL_CALL create_MediaPlayer( const uno::Reference< lang::XMultiServiceFactory >& rxFact )
+{
+    fprintf (stderr, "create VLC Media player !\n");
+    (void) rxFact;
+    return uno::Reference< uno::XInterface >(); // *new ::avmedia::vlc::Manager( rxFact ) );
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL avmediavlc_component_getFactory( const sal_Char* pImplName, void* pServiceManager, void* /*pRegistryKey*/ )
+{
+    uno::Reference< lang::XSingleServiceFactory > xFactory;
+    void*                                   pRet = 0;
+
+    if( rtl_str_compare( pImplName, IMPL_NAME ) == 0 )
+    {
+        const OUString aServiceName( SERVICE_NAME );
+        xFactory = uno::Reference< lang::XSingleServiceFactory >( ::cppu::createSingleFactory(
+                        reinterpret_cast< lang::XMultiServiceFactory* >( pServiceManager ),
+                        IMPL_NAME, create_MediaPlayer, uno::Sequence< OUString >( &aServiceName, 1 ) ) );
+    }
+
+    if( xFactory.is() )
+    {
+        xFactory->acquire();
+        pRet = xFactory.get();
+    }
+
+    return pRet;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk
index 12a327d..2cd0d06 100644
--- a/postprocess/Rdb_services.mk
+++ b/postprocess/Rdb_services.mk
@@ -204,6 +204,9 @@ $(eval $(call gb_Rdb_add_components,services,\
 	$(if $(ENABLE_GSTREAMER_0_10), \
 		avmedia/source/gstreamer/avmediagstreamer_0_10 \
 	) \
+	$(if $(ENABLE_VLC), \
+		avmedia/source/gstreamer/avmediavlc \
+	) \
 	$(if $(ENABLE_KAB), \
 		connectivity/source/drivers/kab/kab1 \
 	) \
commit 4426b03a38279c99857202871917a5b9cef02758
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Wed May 29 12:08:31 2013 +0100

    initial configure pieces for VLC detection.
    
    Change-Id: I1001d7f87c3e3194c04ea9d1ef97a87898f891ea

diff --git a/config_host.mk.in b/config_host.mk.in
index 6fb1cc8..a96bfba 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -163,6 +163,7 @@ export ENABLE_TDE=@ENABLE_TDE@
 export ENABLE_TDEAB=@ENABLE_TDEAB@
 export ENABLE_TELEPATHY=@ENABLE_TELEPATHY@
 export ENABLE_VALGRIND=@ENABLE_VALGRIND@
+export ENABLE_VLC=@ENABLE_VLC@
 export EPM=@EPM@
 export EPM_FLAGS=@EPM_FLAGS@
 export EXTERNAL_WARNINGS_NOT_ERRORS=@EXTERNAL_WARNINGS_NOT_ERRORS@
@@ -545,6 +546,8 @@ export VCVER=@VCVER@
 export VERBOSE=@VERBOSE@
 export VISIO_CFLAGS=$(gb_SPACE)@VISIO_CFLAGS@
 export VISIO_LIBS=$(gb_SPACE)@VISIO_LIBS@
+export VLC_CFLAGS=@VLC_CFLAGS@
+export VLC_LIBS=@VLC_LIBS@
 export WATCH_WINDOW_EXTENSION_PACK=@WATCH_WINDOW_EXTENSION_PACK@
 export WGET=@WGET@
 export WINDOWS_BUILD_SIGNING=@WINDOWS_BUILD_SIGNING@
diff --git a/configure.ac b/configure.ac
index b45b175..9eb04ea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1015,6 +1015,11 @@ AC_ARG_ENABLE(gstreamer-0-10,
         [Disable building the gstreamer avmedia backend.]),
 ,enable_gstreamer_0_10=yes)
 
+AC_ARG_ENABLE(vlc,
+    AS_HELP_STRING([--enable-vlc],
+        [Enable building with the VLC avmedia backend.]),
+,enable_vlc=no)
+
 AC_ARG_ENABLE(neon,
     AS_HELP_STRING([--disable-neon],
         [Disable neon and the compilation of webdav binding.]),
@@ -9910,6 +9915,27 @@ AC_SUBST(GSTREAMER_0_10_LIBS)
 AC_SUBST(ENABLE_GSTREAMER_0_10)
 

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list