Commit 1a29fc3c authored by Gildas Bazin's avatar Gildas Bazin

* ALL: changed VOUT_SET_ZOOM into VOUT_SET_SIZE and implemented a...

* ALL: changed VOUT_SET_ZOOM into VOUT_SET_SIZE and implemented a VOUT_GET_SIZE for some of the vouts.
parent e0364b09
......@@ -254,7 +254,8 @@ static inline int vout_Control( vout_thread_t *p_vout, int i_query, ... )
enum output_query_e
{
VOUT_SET_ZOOM,
VOUT_GET_SIZE, /* arg1= unsigned int*, arg2= unsigned int*, res= */
VOUT_SET_SIZE, /* arg1= unsigned int, arg2= unsigned int, res= */
VOUT_SET_STAY_ON_TOP, /* arg1= vlc_bool_t res= */
VOUT_REPARENT,
VOUT_SNAPSHOT,
......
......@@ -511,10 +511,15 @@ int VlcProc::controlWindow( intf_thread_t *pIntf, void *pWindow,
switch( query )
{
case VOUT_SET_ZOOM:
case VOUT_SET_SIZE:
{
if( pThis->m_pVout )
{
unsigned int i_width = va_arg( args, unsigned int );
unsigned int i_height = va_arg( args, unsigned int );
if( !i_width ) i_width = pThis->m_pVout->i_window_width;
if( !i_height ) i_height = pThis->m_pVout->i_window_height;
// Post a resize vout command
CmdResizeVout *pCmd =
new CmdResizeVout( pThis->getIntf(), pWindow,
......
......@@ -273,6 +273,7 @@ void VideoWindow::UpdateSize( wxEvent &_event )
SetFocus();
b_shown = VLC_TRUE;
}
p_intf->p_sys->p_video_sizer->SetMinSize( event->GetSize() );
i_creation_date = mdate();
......@@ -327,16 +328,32 @@ int VideoWindow::ControlWindow( void *p_window, int i_query, va_list args )
switch( i_query )
{
case VOUT_SET_ZOOM:
case VOUT_GET_SIZE:
{
unsigned int *pi_width = va_arg( args, unsigned int * );
unsigned int *pi_height = va_arg( args, unsigned int * );
*pi_width = GetSize().GetWidth();
*pi_height = GetSize().GetHeight();
i_ret = VLC_SUCCESS;
}
break;
case VOUT_SET_SIZE:
{
if( !b_auto_size ) break;
unsigned int i_width = va_arg( args, unsigned int );
unsigned int i_height = va_arg( args, unsigned int );
vlc_mutex_lock( &lock );
if( !i_width && p_vout ) i_width = p_vout->i_window_width;
if( !i_height && p_vout ) i_height = p_vout->i_window_height;
vlc_mutex_unlock( &lock );
/* Update dimensions */
wxSizeEvent event( wxSize( p_vout->i_window_width,
p_vout->i_window_height ),
UpdateSize_Event );
wxSizeEvent event( wxSize( i_width, i_height ), UpdateSize_Event );
AddPendingEvent( event );
i_ret = VLC_SUCCESS;
......
......@@ -555,7 +555,6 @@ static int Manage( vout_thread_t *p_vout )
p_vout->fmt_out.i_sar_den = p_vout->fmt_in.i_sar_den;
p_vout->output.i_aspect = p_vout->fmt_in.i_aspect;
E_(DirectXUpdateRects)( p_vout, VLC_TRUE );
vout_Control( p_vout, VOUT_SET_ZOOM );
}
/* We used to call the Win32 PeekMessage function here to read the window
......
......@@ -889,21 +889,37 @@ static int DirectXConvertKey( int i_key )
*****************************************************************************/
static int Control( vout_thread_t *p_vout, int i_query, va_list args )
{
double f_arg;
unsigned int *pi_width, *pi_height;
RECT rect_window;
POINT point;
switch( i_query )
{
case VOUT_SET_ZOOM:
case VOUT_GET_SIZE:
if( p_vout->p_sys->hparent )
return vout_ControlWindow( p_vout,
(void *)p_vout->p_sys->hparent, i_query, args );
pi_width = va_arg( args, unsigned int * );
pi_height = va_arg( args, unsigned int * );
GetClientRect( p_vout->p_sys->hwnd, &rect_window );
*pi_width = rect_window.right - rect_window.left;
*pi_height = rect_window.bottom - rect_window.top;
return VLC_SUCCESS;
case VOUT_SET_SIZE:
if( p_vout->p_sys->hparent )
return vout_ControlWindow( p_vout,
(void *)p_vout->p_sys->hparent, i_query, args );
/* Update dimensions */
rect_window.top = rect_window.left = 0;
rect_window.right = p_vout->i_window_width;
rect_window.bottom = p_vout->i_window_height;
rect_window.right = va_arg( args, unsigned int );
rect_window.bottom = va_arg( args, unsigned int );
if( !rect_window.right ) rect_window.right = p_vout->i_window_width;
if( !rect_window.bottom ) rect_window.bottom = p_vout->i_window_height;
AdjustWindowRect( &rect_window, p_vout->p_sys->i_window_style, 0 );
SetWindowPos( p_vout->p_sys->hwnd, 0, 0, 0,
......
......@@ -318,7 +318,6 @@ static int Manage( vout_thread_t *p_vout )
p_vout->fmt_out.i_sar_den = p_vout->fmt_in.i_sar_den;
p_vout->output.i_aspect = p_vout->fmt_in.i_aspect;
E_(DirectXUpdateRects)( p_vout, VLC_TRUE );
vout_Control( p_vout, VOUT_SET_ZOOM );
}
/* We used to call the Win32 PeekMessage function here to read the window
......
......@@ -1282,22 +1282,38 @@ static void InitBuffers( vout_thread_t *p_vout )
*****************************************************************************/
static int Control( vout_thread_t *p_vout, int i_query, va_list args )
{
unsigned int *pi_width, *pi_height;
vlc_bool_t b_bool;
double f_arg;
RECT rect_window;
POINT point;
switch( i_query )
{
case VOUT_SET_ZOOM:
case VOUT_GET_SIZE:
if( p_vout->p_sys->hparent )
return vout_ControlWindow( p_vout,
(void *)p_vout->p_sys->hparent, i_query, args );
pi_width = va_arg( args, unsigned int * );
pi_height = va_arg( args, unsigned int * );
GetClientRect( p_vout->p_sys->hwnd, &rect_window );
*pi_width = rect_window.right - rect_window.left;
*pi_height = rect_window.bottom - rect_window.top;
return VLC_SUCCESS;
case VOUT_SET_SIZE:
if( p_vout->p_sys->hparent )
return vout_ControlWindow( p_vout,
(void *)p_vout->p_sys->hparent, i_query, args );
/* Update dimensions */
rect_window.top = rect_window.left = 0;
rect_window.right = p_vout->i_window_width;
rect_window.bottom = p_vout->i_window_height;
rect_window.right = va_arg( args, unsigned int );
rect_window.bottom = va_arg( args, unsigned int );
if( !rect_window.right ) rect_window.right = p_vout->i_window_width;
if( !rect_window.bottom ) rect_window.bottom = p_vout->i_window_height;
AdjustWindowRect( &rect_window, p_vout->p_sys->i_window_style, 0 );
SetWindowPos( p_vout->p_sys->hwnd, 0, 0, 0,
......
......@@ -2288,23 +2288,42 @@ static void SetPalette( vout_thread_t *p_vout,
*****************************************************************************/
static int Control( vout_thread_t *p_vout, int i_query, va_list args )
{
double f_arg;
vlc_bool_t b_arg;
unsigned int i_width, i_height;
unsigned int *pi_width, *pi_height;
switch( i_query )
{
case VOUT_SET_ZOOM:
case VOUT_GET_SIZE:
if( p_vout->p_sys->p_win->owner_window )
return vout_ControlWindow( p_vout,
(void *)p_vout->p_sys->p_win->owner_window, i_query, args);
pi_width = va_arg( args, unsigned int * );
pi_height = va_arg( args, unsigned int * );
vlc_mutex_lock( &p_vout->p_sys->lock );
*pi_width = p_vout->p_sys->p_win->i_width;
*pi_height = p_vout->p_sys->p_win->i_height;
vlc_mutex_unlock( &p_vout->p_sys->lock );
return VLC_SUCCESS;
case VOUT_SET_SIZE:
if( p_vout->p_sys->p_win->owner_window )
return vout_ControlWindow( p_vout,
(void *)p_vout->p_sys->p_win->owner_window, i_query, args);
vlc_mutex_lock( &p_vout->p_sys->lock );
i_width = va_arg( args, unsigned int );
i_height = va_arg( args, unsigned int );
if( !i_width ) i_width = p_vout->i_window_width;
if( !i_height ) i_height = p_vout->i_window_height;
/* Update dimensions */
XResizeWindow( p_vout->p_sys->p_display,
p_vout->p_sys->p_win->base_window,
p_vout->i_window_width,
p_vout->i_window_height );
i_width, i_height );
vlc_mutex_unlock( &p_vout->p_sys->lock );
return VLC_SUCCESS;
......
......@@ -610,7 +610,7 @@ static int ZoomCallback( vlc_object_t *p_this, char const *psz_cmd,
vout_thread_t *p_vout = (vout_thread_t *)p_this;
InitWindowSize( p_vout, &p_vout->i_window_width,
&p_vout->i_window_height );
vout_Control( p_vout, VOUT_SET_ZOOM );
vout_Control( p_vout, VOUT_SET_SIZE, 0, 0 );
return VLC_SUCCESS;
}
......
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