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,
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,
SetFocus();
b_shown = VLC_TRUE;
}
+
p_intf->p_sys->p_video_sizer->SetMinSize( event->GetSize() );
i_creation_date = mdate();
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;
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
*****************************************************************************/
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,
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
*****************************************************************************/
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,
*****************************************************************************/
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;
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;
}