diff options
-rw-r--r-- | avmedia/source/vlc/vlcplayer.cxx | 8 | ||||
-rw-r--r-- | avmedia/source/vlc/wrapper/Player.cxx | 9 | ||||
-rw-r--r-- | avmedia/source/vlc/wrapper/Player.hxx | 2 |
3 files changed, 11 insertions, 8 deletions
diff --git a/avmedia/source/vlc/vlcplayer.cxx b/avmedia/source/vlc/vlcplayer.cxx index 64d8565a19c7..945d7d9bc404 100644 --- a/avmedia/source/vlc/vlcplayer.cxx +++ b/avmedia/source/vlc/vlcplayer.cxx @@ -179,13 +179,9 @@ uno::Reference< css::media::XPlayerWindow > SAL_CALL VLCPlayer::createPlayerWind const int winID = GetWindowID( aArguments ); - if (winID != -1) + if ( winID != -1 ) { -#if defined(WIN32) && !defined(UNIX) - //TODO: Not works, will be crashed -#else - mPlayer.setXWindow( winID ); -#endif + mPlayer.setWindow( winID ); } return uno::Reference< css::media::XPlayerWindow >( window ); diff --git a/avmedia/source/vlc/wrapper/Player.cxx b/avmedia/source/vlc/wrapper/Player.cxx index 29f2536b5045..37779d1a5ea0 100644 --- a/avmedia/source/vlc/wrapper/Player.cxx +++ b/avmedia/source/vlc/wrapper/Player.cxx @@ -131,9 +131,16 @@ namespace VLC return libvlc_audio_get_mute( mPlayer ); } - void Player::setXWindow( int id ) + + void Player::setWindow( int id ) { +#if defined( UNX ) libvlc_media_player_set_xwindow( mPlayer, id ); +#elif defined( MACOS ) + libvlc_media_player_set_nsobject( mPlayer, reinterpret_cast<void*>( id ) ); +#elif defined( WNT ) + libvlc_media_player_set_hwnd( mPlayer, reinterpret_cast<void*>( id ) ); +#endif } void Player::takeSnapshot(const rtl::OUString& file) diff --git a/avmedia/source/vlc/wrapper/Player.hxx b/avmedia/source/vlc/wrapper/Player.hxx index f1b395841a44..7832ad9c3676 100644 --- a/avmedia/source/vlc/wrapper/Player.hxx +++ b/avmedia/source/vlc/wrapper/Player.hxx @@ -52,7 +52,7 @@ namespace VLC void setMute( bool mute); bool getMute() const; - void setXWindow( int id ); + void setWindow( int id ); void takeSnapshot(const rtl::OUString& file); |