[vlc-devel] commit: mozilla: Fix #2678 resizing browser plugin during playback. ( Jean-Paul Saman )

git version control git at videolan.org
Tue May 5 11:48:48 CEST 2009


vlc | branch: master | Jean-Paul Saman <jpsaman at videolan.org> | Fri May  1 14:53:16 2009 +0200| [6894293c69ad3284f2c0607fb15971c1ea6c6476] | committer: Jean-Paul Saman 

mozilla: Fix #2678 resizing browser plugin during playback.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6894293c69ad3284f2c0607fb15971c1ea6c6476
---

 include/vlc/libvlc.h          |   11 ++++++-----
 projects/mozilla/vlcshell.cpp |    2 +-
 src/control/video.c           |    6 ++----
 3 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/include/vlc/libvlc.h b/include/vlc/libvlc.h
index 67acf99..4085e25 100644
--- a/include/vlc/libvlc.h
+++ b/include/vlc/libvlc.h
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * libvlc.h:  libvlc external API
  *****************************************************************************
- * Copyright (C) 1998-2005 the VideoLAN team
+ * Copyright (C) 1998-2009 the VideoLAN team
  * $Id$
  *
  * Authors: Clément Stenac <zorglub at videolan.org>
@@ -1059,7 +1059,7 @@ VLC_PUBLIC_API void libvlc_video_set_track( libvlc_media_player_t *, int, libvlc
  * If i_width AND i_height is 0, original size is used.
  * If i_width XOR i_height is 0, original aspect-ratio is preserved.
  *
- * \param p_mediaplayer the media player
+ * \param p_mi media player instance
  * \param psz_filepath the path where to save the screenshot to
  * \param i_width the snapshot's width
  * \param i_height the snapshot's height
@@ -1070,7 +1070,7 @@ VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, char *,
 /**
  * Resize the current video output window.
  *
- * \param p_instance libvlc instance
+ * \param p_mi media player instance
  * \param width new width for video output window
  * \param height new height for video output window
  * \param p_e an initialized exception pointer
@@ -1081,7 +1081,7 @@ VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_player_t *, int, int, libv
 /**
  * Tell windowless video output to redraw rectangular area (MacOS X only).
  *
- * \param p_instance libvlc instance
+ * \param p_mi media player instance
  * \param area coordinates within video drawable
  * \param p_e an initialized exception pointer
  */
@@ -1106,11 +1106,12 @@ VLC_PUBLIC_API void libvlc_video_set_size( libvlc_instance_t *, int, int, libvlc
  * This setting will be used as default for all video outputs.
  *
  * \param p_instance libvlc instance
+ * \param p_mi media player instance
  * \param view coordinates within video drawable
  * \param clip coordinates within video drawable
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
+VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, libvlc_media_player_t *, const libvlc_rectangle_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
 
 /** @} video */
 
diff --git a/projects/mozilla/vlcshell.cpp b/projects/mozilla/vlcshell.cpp
index ab4cf51..d582cf6 100644
--- a/projects/mozilla/vlcshell.cpp
+++ b/projects/mozilla/vlcshell.cpp
@@ -416,7 +416,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
         clip.bottom  = window->clipRect.bottom;
         clip.right   = window->clipRect.right;
 
-        libvlc_video_set_viewport(p_vlc, &view, &clip, &ex);
+        libvlc_video_set_viewport(p_vlc, p_plugin->getMD(&ex), &view, &clip, &ex);
         if( libvlc_exception_raised(&ex) )
             fprintf( stderr, "Exception: %s\n", libvlc_exception_get_message(&ex) );
         libvlc_exception_clear(&ex);
diff --git a/src/control/video.c b/src/control/video.c
index 0e3a2a6..567532c 100644
--- a/src/control/video.c
+++ b/src/control/video.c
@@ -296,7 +296,7 @@ void libvlc_video_set_size( libvlc_instance_t *p_instance, int width, int height
     }
 }
 
-void libvlc_video_set_viewport( libvlc_instance_t *p_instance,
+void libvlc_video_set_viewport( libvlc_instance_t *p_instance, libvlc_media_player_t *p_mi,
                             const libvlc_rectangle_t *view, const libvlc_rectangle_t *clip,
                            libvlc_exception_t *p_e )
 {
@@ -321,19 +321,17 @@ void libvlc_video_set_viewport( libvlc_instance_t *p_instance,
     var_SetInteger( p_instance->p_libvlc_int, "drawable-clip-bottom", clip->bottom );
     var_SetInteger( p_instance->p_libvlc_int, "drawable-clip-right", clip->right );
 
-    libvlc_media_player_t *p_mi = libvlc_playlist_get_media_player(p_instance, p_e);
     if( p_mi )
     {
         vout_thread_t *p_vout = GetVout( p_mi, p_e );
         if( p_vout )
         {
             /* change viewport for running vout */
-            vout_Control( p_vout , VOUT_SET_VIEWPORT,
+            vout_Control( p_vout, VOUT_SET_VIEWPORT,
                                view->top, view->left, view->bottom, view->right,
                                clip->top, clip->left, clip->bottom, clip->right );
             vlc_object_release( p_vout );
         }
-        libvlc_media_player_release(p_mi);
     }
 #else
     (void) p_instance; (void) view; (void) clip; (void) p_e;




More information about the vlc-devel mailing list