summaryrefslogtreecommitdiff
path: root/avmedia
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2013-09-03 23:05:05 +0300
committerTor Lillqvist <tml@collabora.com>2013-09-03 23:06:25 +0300
commitfd47df122a37b4fa982f9fd0000907d9aee0c80a (patch)
tree379e6b817aef3c0137c65e941b88d1c9f582a745 /avmedia
parent3105e301c4f6dc008f0532ba051ee158a28c58a7 (diff)
Fix typos and make the VLC code in theory work as 64-bit on Windows and OS X
It's MACOSX, not MACOS. We can't cast a HWND or a pointer to an int and then back. Have the UNX/MACOSX/WNT branches in the same order each time, at least in Player.cxx. Change-Id: I1a71efc2152970952cf2f12f719fd4c455f89dba
Diffstat (limited to 'avmedia')
-rw-r--r--avmedia/source/vlc/vlcplayer.cxx13
-rw-r--r--avmedia/source/vlc/wrapper/Player.cxx26
-rw-r--r--avmedia/source/vlc/wrapper/Player.hxx2
-rw-r--r--avmedia/source/vlc/wrapper/SymbolLoader.hxx4
4 files changed, 24 insertions, 21 deletions
diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx
index 060abcc698a0..9c7d714ab2b2 100644
--- a/avmedia/source/vlc/vlcplayer.cxx
+++ b/avmedia/source/vlc/vlcplayer.cxx
@@ -151,7 +151,7 @@ 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 )
+ intptr_t GetWindowID( const uno::Sequence< uno::Any >& arguments )
{
if (arguments.getLength() <= 2)
return -1;
@@ -168,14 +168,11 @@ namespace
return -1;
#if defined MACOSX
- // Explicit converts from NSView* to int
- const int id = reinterpret_cast<int>( pEnvData->pView );
+ const intptr_t id = reinterpret_cast<intptr_t>( pEnvData->pView );
#elif defined WNT
- // Explicit converts from HWND to int
- const int id = reinterpret_cast<int>( pEnvData->hWnd );
+ const intptr_t id = reinterpret_cast<intptr_t>( pEnvData->hWnd );
#else
- // Explicit converts from long to int
- const int id = static_cast<int>( pEnvData->aWindow );
+ const intptr_t id = static_cast<intptr_t>( pEnvData->aWindow );
#endif
return id;
@@ -189,7 +186,7 @@ uno::Reference< css::media::XPlayerWindow > SAL_CALL VLCPlayer::createPlayerWind
VLCWindow * const window = new VLCWindow;
- const int winID = GetWindowID( aArguments );
+ const intptr_t winID = GetWindowID( aArguments );
if ( winID != -1 )
{
diff --git a/avmedia/source/vlc/wrapper/Player.cxx b/avmedia/source/vlc/wrapper/Player.cxx
index 763e5c9f7d1c..973078a915bb 100644
--- a/avmedia/source/vlc/wrapper/Player.cxx
+++ b/avmedia/source/vlc/wrapper/Player.cxx
@@ -42,10 +42,14 @@ 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
+#if defined UNX
+ void ( *libvlc_media_player_set_xwindow ) ( libvlc_media_player_t *p_mi, uint32_t drawable );
+#elif defined MACOSX
+ void ( *libvlc_media_player_set_nsobject ) ( libvlc_media_player_t *p_mi, void *drawable );
+#elif 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 );
+#error unknown OS
#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);
@@ -70,10 +74,12 @@ 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
+#if defined UNX
SYM_MAP( libvlc_media_player_set_xwindow ),
+#elif defined MACOSX
+ SYM_MAP( libvlc_media_player_set_nsobject ),
+#elif defined WNT
+ SYM_MAP( libvlc_media_player_set_hwnd ),
#endif
SYM_MAP( libvlc_media_player_has_vout ),
SYM_MAP( libvlc_video_set_mouse_input ),
@@ -173,13 +179,13 @@ namespace VLC
}
- void Player::setWindow( int id )
+ void Player::setWindow( intptr_t id )
{
-#if defined( UNX )
- libvlc_media_player_set_xwindow( mPlayer, id );
-#elif defined( MACOS )
+#if defined UNX
+ libvlc_media_player_set_xwindow( mPlayer, (uint32_t) id );
+#elif defined MACOSX
libvlc_media_player_set_nsobject( mPlayer, reinterpret_cast<void*>( id ) );
-#elif defined( WNT )
+#elif defined WNT
libvlc_media_player_set_hwnd( mPlayer, reinterpret_cast<void*>( id ) );
#endif
}
diff --git a/avmedia/source/vlc/wrapper/Player.hxx b/avmedia/source/vlc/wrapper/Player.hxx
index 34886c91c17d..68e4f4417bac 100644
--- a/avmedia/source/vlc/wrapper/Player.hxx
+++ b/avmedia/source/vlc/wrapper/Player.hxx
@@ -46,7 +46,7 @@ namespace VLC
void setMute( bool mute);
bool getMute() const;
- void setWindow( int id );
+ void setWindow( intptr_t id );
void takeSnapshot(const rtl::OUString& file);
diff --git a/avmedia/source/vlc/wrapper/SymbolLoader.hxx b/avmedia/source/vlc/wrapper/SymbolLoader.hxx
index 8f70dab595c6..3f97fa5964e3 100644
--- a/avmedia/source/vlc/wrapper/SymbolLoader.hxx
+++ b/avmedia/source/vlc/wrapper/SymbolLoader.hxx
@@ -31,7 +31,7 @@ namespace
{
#if defined( UNX )
const char LibName[] = "libvlc.so.5";
-#elif defined( MACOS )
+#elif defined( MACOSX )
const char LibName[] = "/Applications/VLC.app/Contents/MacOS/lib/libvlc.dylib";
#elif defined( WNT )
const char LibName[] = "libvlc.dll";
@@ -87,7 +87,7 @@ namespace VLC
template<size_t N>
bool InitApiMap( const ApiMap ( &pMap )[N] )
{
-#if defined( UNX ) || defined( MACOS )
+#if defined( UNX ) || defined( MACOSX )
const OUString& fullPath = OUString::createFromAscii(LibName);
#elif defined( WNT )
const OUString& fullPath = GetVLCPath() + OUString::createFromAscii(LibName);