mirror of
https://github.com/videolan/vlc.git
synced 2024-12-15 12:43:34 +08:00
mozilla: Fix #2678 resizing browser plugin during playback.
This commit is contained in:
parent
09b400c41e
commit
6894293c69
@ -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@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 */
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user