Commit bc138de9 authored by Gildas Bazin's avatar Gildas Bazin

* src/libvlc.h, modules/video_output/directx/events.c:

   + added a --video-title option, courtesy of Hornsby Adrian.
* modules/video_output/directx/directx.c: minor changes.
parent eb22c298
......@@ -208,6 +208,7 @@ static int OpenVideo( vlc_object_t *p_this )
var_Create( p_vout, "directx-hw-yuv", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Create( p_vout, "directx-3buffering", VLC_VAR_BOOL|VLC_VAR_DOINHERIT );
var_Create( p_vout, "directx-device", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Create( p_vout, "video-title", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
p_vout->p_sys->b_cursor_hidden = 0;
p_vout->p_sys->i_lastmoved = mdate();
......@@ -457,6 +458,8 @@ static int Manage( vout_thread_t *p_vout )
*/
if( p_vout->p_sys->i_changes & DX_POSITION_CHANGE )
{
p_vout->p_sys->i_changes &= ~DX_POSITION_CHANGE;
if( p_vout->p_sys->b_using_overlay )
DirectXUpdateOverlay( p_vout );
......@@ -469,8 +472,6 @@ static int Manage( vout_thread_t *p_vout )
/* This will force the vout core to recreate the picture buffers */
p_vout->i_changes |= VOUT_PICTURE_BUFFERS_CHANGE;
}
p_vout->p_sys->i_changes &= ~DX_POSITION_CHANGE;
}
/* We used to call the Win32 PeekMessage function here to read the window
......@@ -1087,6 +1088,8 @@ int DirectXUpdateOverlay( vout_thread_t *p_vout )
DDOVERLAYFX ddofx;
DWORD dwFlags;
HRESULT dxresult;
RECT rect_src = p_vout->p_sys->rect_src_clipped;
RECT rect_dest = p_vout->p_sys->rect_dest_clipped;
if( p_vout->p_sys->p_current_surface == NULL ||
!p_vout->p_sys->b_using_overlay )
......@@ -1105,14 +1108,11 @@ int DirectXUpdateOverlay( vout_thread_t *p_vout )
dxresult = IDirectDrawSurface2_UpdateOverlay(
p_vout->p_sys->p_current_surface,
&p_vout->p_sys->rect_src_clipped,
p_vout->p_sys->p_display,
&p_vout->p_sys->rect_dest_clipped,
&rect_src, p_vout->p_sys->p_display, &rect_dest,
dwFlags, &ddofx );
if(dxresult != DD_OK)
{
msg_Warn( p_vout,
"DirectXUpdateOverlay cannot move or resize overlay" );
msg_Warn( p_vout, "DirectXUpdateOverlay cannot move/resize overlay" );
return VLC_EGENERIC;
}
......
......@@ -272,6 +272,10 @@ void DirectXEventThread( event_thread_t *p_event )
break;
case WM_VLC_CHANGE_TEXT:
var_Get( p_event->p_vout, "video-title", &val );
if( !val.psz_string || !*val.psz_string ) /* Default video title */
{
if( p_event->p_vout->p_sys->b_using_overlay )
SetWindowText( p_event->p_vout->p_sys->hwnd,
VOUT_TITLE " (hardware YUV overlay DirectX output)" );
......@@ -280,6 +284,11 @@ void DirectXEventThread( event_thread_t *p_event )
VOUT_TITLE " (hardware YUV DirectX output)" );
else SetWindowText( p_event->p_vout->p_sys->hwnd,
VOUT_TITLE " (software RGB DirectX output)" );
}
else
{
SetWindowText( p_event->p_vout->p_sys->hwnd, val.psz_string );
}
break;
default:
......
......@@ -205,6 +205,10 @@ static char *ppsz_language_text[] =
"You can enforce the position of the top left corner of the video window "\
"here (y coordinate).")
#define VIDEO_TITLE_TEXT N_("Video title")
#define VIDEO_TITLE_LONGTEXT N_( \
"You can specify a custom video window title here.")
#define ALIGN_TEXT N_("Video alignment")
#define ALIGN_LONGTEXT N_( \
"You can enforce the video alignement in its window. By default (0) it " \
......@@ -778,6 +782,8 @@ vlc_module_begin();
add_integer( "height", -1, NULL, HEIGHT_TEXT, HEIGHT_LONGTEXT, VLC_TRUE );
add_integer( "video-x", -1, NULL, VIDEOX_TEXT, VIDEOX_LONGTEXT, VLC_TRUE );
add_integer( "video-y", -1, NULL, VIDEOY_TEXT, VIDEOY_LONGTEXT, VLC_TRUE );
add_string( "video-title", NULL, NULL, VIDEO_TITLE_TEXT,
VIDEO_TITLE_LONGTEXT, VLC_TRUE );
add_integer( "align", 0, NULL, ALIGN_TEXT, ALIGN_LONGTEXT, VLC_TRUE );
change_integer_list( pi_align_values, ppsz_align_descriptions, 0 );
add_float( "zoom", 1, NULL, ZOOM_TEXT, ZOOM_LONGTEXT, VLC_TRUE );
......
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