[Libreoffice-commits] core.git: avmedia/source

Stephan Bergmann sbergman at redhat.com
Tue Sep 3 04:25:41 PDT 2013


 avmedia/source/vlc/vlcframegrabber.cxx      |    2 +-
 avmedia/source/vlc/vlcframegrabber.hxx      |    4 ++--
 avmedia/source/vlc/vlcplayer.cxx            |    5 +++++
 avmedia/source/vlc/vlcwindow.cxx            |    2 +-
 avmedia/source/vlc/vlcwindow.hxx            |    2 +-
 avmedia/source/vlc/wrapper/Player.cxx       |   12 ++++++++++++
 avmedia/source/vlc/wrapper/SymbolLoader.hxx |    6 ++++--
 7 files changed, 26 insertions(+), 7 deletions(-)

New commits:
commit 6cb1ddb7cc351f33673d846fedef0962ac49606f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Sep 3 13:23:40 2013 +0200

    Make --enable-vlc at least compile on Windows
    
    ...no idea whether the changes are actually any good, though.
    
    Change-Id: I43965f6c10b572ee098bfacfa0995414a53af45f

diff --git a/avmedia/source/vlc/vlcframegrabber.cxx b/avmedia/source/vlc/vlcframegrabber.cxx
index a90a908..6a25d39 100644
--- a/avmedia/source/vlc/vlcframegrabber.cxx
+++ b/avmedia/source/vlc/vlcframegrabber.cxx
@@ -24,7 +24,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";
 const int MSEC_IN_SEC = 1000;
 
-SAL_CALL VLCFrameGrabber::VLCFrameGrabber( VLC::Player& player, boost::shared_ptr<VLC::EventHandler> eh, const rtl::OUString& url )
+VLCFrameGrabber::VLCFrameGrabber( VLC::Player& player, boost::shared_ptr<VLC::EventHandler> eh, const rtl::OUString& url )
     : FrameGrabber_BASE()
     , mPlayer( player )
     , mUrl( url )
diff --git a/avmedia/source/vlc/vlcframegrabber.hxx b/avmedia/source/vlc/vlcframegrabber.hxx
index afc02d0..8dc7b56 100644
--- a/avmedia/source/vlc/vlcframegrabber.hxx
+++ b/avmedia/source/vlc/vlcframegrabber.hxx
@@ -43,7 +43,7 @@ class VLCFrameGrabber : public FrameGrabber_BASE
     const rtl::OUString& mUrl;
     boost::shared_ptr<VLC::EventHandler> mEventHandler;
 public:
-    SAL_CALL VLCFrameGrabber( VLC::Player& player, boost::shared_ptr<VLC::EventHandler> eh, const rtl::OUString& url );
+    VLCFrameGrabber( VLC::Player& player, boost::shared_ptr<VLC::EventHandler> eh, const rtl::OUString& url );
 
     ::com::sun::star::uno::Reference< css::graphic::XGraphic > SAL_CALL grabFrame( double fMediaTime ) throw ( ::com::sun::star::uno::RuntimeException );
 
@@ -55,4 +55,4 @@ public:
 }
 }
 
-#endif // _VLCFRAMEGRABBER_HXX
\ No newline at end of file
+#endif // _VLCFRAMEGRABBER_HXX
diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index 247b0ef..2671571 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -167,8 +167,13 @@ namespace
         if (pEnvData == NULL)
             return -1;
 
+#if defined WNT
+        // Explicit converts from HWND to int
+        const int id = reinterpret_cast<int>( pEnvData->hWnd );
+#else
         // Explicit converts from long to int
         const int id = static_cast<int>( pEnvData->aWindow );
+#endif
 
         return id;
     }
diff --git a/avmedia/source/vlc/vlcwindow.cxx b/avmedia/source/vlc/vlcwindow.cxx
index 9d74fc2..9306392 100644
--- a/avmedia/source/vlc/vlcwindow.cxx
+++ b/avmedia/source/vlc/vlcwindow.cxx
@@ -9,7 +9,7 @@ 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)
+VLCWindow::VLCWindow(VLCPlayer& player)
     : mPlayer( player )
 {
 }
diff --git a/avmedia/source/vlc/vlcwindow.hxx b/avmedia/source/vlc/vlcwindow.hxx
index bc0568c..17a8c88 100644
--- a/avmedia/source/vlc/vlcwindow.hxx
+++ b/avmedia/source/vlc/vlcwindow.hxx
@@ -30,7 +30,7 @@ class VLCWindow : public ::cppu::WeakImplHelper2 < ::com::sun::star::media::XPla
 {
     VLCPlayer& mPlayer;
 public:
-    SAL_CALL VLCWindow(VLCPlayer& player);
+    VLCWindow(VLCPlayer& player);
 
     void SAL_CALL update() throw (css::uno::RuntimeException);
     ::sal_Bool SAL_CALL setZoomLevel( css::media::ZoomLevel ZoomLevel ) throw (css::uno::RuntimeException);
diff --git a/avmedia/source/vlc/wrapper/Player.cxx b/avmedia/source/vlc/wrapper/Player.cxx
index a36a15d..763e5c9 100644
--- a/avmedia/source/vlc/wrapper/Player.cxx
+++ b/avmedia/source/vlc/wrapper/Player.cxx
@@ -18,7 +18,11 @@ namespace VLC
 {
     namespace
     {
+#if defined WNT
+        typedef __int64 libvlc_time_t;
+#else
         typedef int64_t libvlc_time_t;
+#endif
 
         void ( *libvlc_media_player_retain ) ( libvlc_media_player_t *p_mi );
         libvlc_media_player_t * ( *libvlc_media_player_new_from_media ) ( libvlc_media_t *p_md );
@@ -38,7 +42,11 @@ namespace VLC
         int ( *libvlc_video_take_snapshot ) ( libvlc_media_player_t *p_mi, unsigned num,
                                 const char *psz_filepath, unsigned int i_width,
                                 unsigned int i_height );
+#if defined WNT
+        void ( *libvlc_media_player_set_hwnd ) ( libvlc_media_player_t *p_mi, void *drawable );
+#else
         void ( *libvlc_media_player_set_xwindow ) ( libvlc_media_player_t *p_mi, uint32_t drawable );
+#endif
         unsigned ( *libvlc_media_player_has_vout ) ( libvlc_media_player_t *p_mi );
         void ( *libvlc_video_set_mouse_input ) ( libvlc_media_player_t *p_mi, unsigned on);
     }
@@ -62,7 +70,11 @@ namespace VLC
             SYM_MAP( libvlc_audio_set_mute ),
             SYM_MAP( libvlc_audio_get_mute ),
             SYM_MAP( libvlc_video_take_snapshot ),
+#if defined WNT
+            SYM_MAP( libvlc_media_player_set_hwnd ),
+#else
             SYM_MAP( libvlc_media_player_set_xwindow ),
+#endif
             SYM_MAP( libvlc_media_player_has_vout ),
             SYM_MAP( libvlc_video_set_mouse_input ),
             SYM_MAP( libvlc_media_player_retain )
diff --git a/avmedia/source/vlc/wrapper/SymbolLoader.hxx b/avmedia/source/vlc/wrapper/SymbolLoader.hxx
index ae4cf66..bf75ac5 100644
--- a/avmedia/source/vlc/wrapper/SymbolLoader.hxx
+++ b/avmedia/source/vlc/wrapper/SymbolLoader.hxx
@@ -10,6 +10,7 @@
 #ifndef _SYMBOL_LOADER_HXX
 #define _SYMBOL_LOADER_HXX
 #if defined( WNT )
+# include <tchar.h>
 # include <windows.h>
 # include <winreg.h>
 #endif
@@ -48,11 +49,12 @@ namespace
             if ( ::RegQueryValueEx( hKey, _T( "InstallDir" ), NULL, &dwType, ( LPBYTE )arCurrent, &dwCurrentSize ) == ERROR_SUCCESS )
             {
                 ::RegCloseKey( hKey );
-                return OUString( arCurrent, MAX_PATH, rtl_TextEncoding, RTL_TEXTENCODING_UTF8 ) + "/";
+                return OUString( arCurrent, strlen(arCurrent), RTL_TEXTENCODING_UTF8 ) + "/";
             }
 
             ::RegCloseKey( hKey );
         }
+        return OUString();
     }
 #endif
 
@@ -60,7 +62,7 @@ namespace
     template<size_t N>
     bool tryLink( oslModule &aModule, const ApiMap ( &pMap )[N] )
     {
-        for (uint i = 0; i < N; ++i)
+        for (size_t i = 0; i < N; ++i)
         {
             SymbolFunc aMethod = ( SymbolFunc )osl_getFunctionSymbol
                 ( aModule, OUString::createFromAscii( pMap[ i ].symName ).pData );


More information about the Libreoffice-commits mailing list