[vlmc-devel] VLCMediaPlayer: Refactor setDrawable tackle platform specific drawing methods.

Rohit Yadav git at videolan.org
Fri Mar 25 09:06:09 CET 2011


vlmc | branch: master | Rohit Yadav <rohityadav89 at gmail.com> | Fri Mar 25 19:01:26 2011 +0530| [e1870821e958a9afe88ab7ca4c9781bf29a457b2] | committer: Rohit Yadav

VLCMediaPlayer: Refactor setDrawable tackle platform specific drawing methods.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=e1870821e958a9afe88ab7ca4c9781bf29a457b2
---

 src/LibVLCpp/VLCMediaPlayer.cpp |   20 +++++++++++---------
 src/LibVLCpp/VLCMediaPlayer.h   |    3 +--
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/src/LibVLCpp/VLCMediaPlayer.cpp b/src/LibVLCpp/VLCMediaPlayer.cpp
index d60a86e..e9f2dd3 100644
--- a/src/LibVLCpp/VLCMediaPlayer.cpp
+++ b/src/LibVLCpp/VLCMediaPlayer.cpp
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
+#include <QtGlobal>
 #include <QtDebug>
 #include <cassert>
 #include "VLCMediaPlayer.h"
@@ -219,15 +220,16 @@ MediaPlayer::isSeekable()
 }
 
 void
-MediaPlayer::setDrawable( void* hwnd )
+MediaPlayer::setDrawable( void* drawable )
 {
-    libvlc_media_player_set_hwnd( m_internalPtr, hwnd );
-}
-
-void
-MediaPlayer::setDrawable( uint32_t drawable )
-{
-    libvlc_media_player_set_xwindow( m_internalPtr, drawable );
+    qDebug() << "In MediaPlayer::setDrawable(hwnd), == " << drawable;
+#if defined ( Q_WS_MAC )
+    libvlc_media_player_set_nsobject( m_internalPtr, drawable );
+#elif defined ( Q_OS_UNIX )
+    libvlc_media_player_set_xwindow( m_internalPtr, static_cast< uint32_t >(drawable) );
+#elif defined ( Q_OS_WIN )
+    libvlc_media_player_set_hwnd( m_internalPtr, drawable );
+#endif
 }
 
 void
diff --git a/src/LibVLCpp/VLCMediaPlayer.h b/src/LibVLCpp/VLCMediaPlayer.h
index 07c7b26..6de9cd5 100644
--- a/src/LibVLCpp/VLCMediaPlayer.h
+++ b/src/LibVLCpp/VLCMediaPlayer.h
@@ -60,8 +60,7 @@ namespace   LibVLCpp
         void                                takeSnapshot( const char* outputFile, unsigned int width, unsigned int heigth );
         bool                                isPlaying();
         bool                                isSeekable();
-        void                                setDrawable( void* hwnd );
-        void                                setDrawable( quint32 drawable );
+        void                                setDrawable( void* drawable );
         void                                setMedia(Media* media);
         void                                getSize( quint32 *outWidth, quint32 *outHeight);
         float                               getFps();



More information about the Vlmc-devel mailing list