Commit 6894293c authored by Jean-Paul Saman's avatar Jean-Paul Saman

mozilla: Fix #2678 resizing browser plugin during playback.

parent 09b400c4
/***************************************************************************** /*****************************************************************************
* libvlc.h: libvlc external API * libvlc.h: libvlc external API
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2005 the VideoLAN team * Copyright (C) 1998-2009 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Clément Stenac <zorglub@videolan.org> * Authors: Clément Stenac <zorglub@videolan.org>
...@@ -1059,7 +1059,7 @@ VLC_PUBLIC_API void libvlc_video_set_track( libvlc_media_player_t *, int, libvlc ...@@ -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 AND i_height is 0, original size is used.
* If i_width XOR i_height is 0, original aspect-ratio is preserved. * 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 psz_filepath the path where to save the screenshot to
* \param i_width the snapshot's width * \param i_width the snapshot's width
* \param i_height the snapshot's height * \param i_height the snapshot's height
...@@ -1070,7 +1070,7 @@ VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, char *, ...@@ -1070,7 +1070,7 @@ VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, char *,
/** /**
* Resize the current video output window. * 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 width new width for video output window
* \param height new height for video output window * \param height new height for video output window
* \param p_e an initialized exception pointer * \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 ...@@ -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). * 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 area coordinates within video drawable
* \param p_e an initialized exception pointer * \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 ...@@ -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. * This setting will be used as default for all video outputs.
* *
* \param p_instance libvlc instance * \param p_instance libvlc instance
* \param p_mi media player instance
* \param view coordinates within video drawable * \param view coordinates within video drawable
* \param clip coordinates within video drawable * \param clip coordinates within video drawable
* \param p_e an initialized exception pointer * \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 */ /** @} video */
......
...@@ -416,7 +416,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -416,7 +416,7 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
clip.bottom = window->clipRect.bottom; clip.bottom = window->clipRect.bottom;
clip.right = window->clipRect.right; 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) ) if( libvlc_exception_raised(&ex) )
fprintf( stderr, "Exception: %s\n", libvlc_exception_get_message(&ex) ); fprintf( stderr, "Exception: %s\n", libvlc_exception_get_message(&ex) );
libvlc_exception_clear(&ex); libvlc_exception_clear(&ex);
......
...@@ -296,7 +296,7 @@ void libvlc_video_set_size( libvlc_instance_t *p_instance, int width, int height ...@@ -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, const libvlc_rectangle_t *view, const libvlc_rectangle_t *clip,
libvlc_exception_t *p_e ) libvlc_exception_t *p_e )
{ {
...@@ -321,19 +321,17 @@ void libvlc_video_set_viewport( libvlc_instance_t *p_instance, ...@@ -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-bottom", clip->bottom );
var_SetInteger( p_instance->p_libvlc_int, "drawable-clip-right", clip->right ); 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 ) if( p_mi )
{ {
vout_thread_t *p_vout = GetVout( p_mi, p_e ); vout_thread_t *p_vout = GetVout( p_mi, p_e );
if( p_vout ) if( p_vout )
{ {
/* change viewport for running 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, view->top, view->left, view->bottom, view->right,
clip->top, clip->left, clip->bottom, clip->right ); clip->top, clip->left, clip->bottom, clip->right );
vlc_object_release( p_vout ); vlc_object_release( p_vout );
} }
libvlc_media_player_release(p_mi);
} }
#else #else
(void) p_instance; (void) view; (void) clip; (void) p_e; (void) p_instance; (void) view; (void) clip; (void) p_e;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment