Commit 05985a98 authored by Filippo Carone's avatar Filippo Carone

Real VOUT_REPARENT (UNIX only ATM).

if (vout_Control VOUT_REPARENT is called giving a Drawable in args)
then 
     that Drawable is used as new parent
otherwise
     DefaultRootWindow will be the parent
     
parent 89471fa0
...@@ -31,6 +31,10 @@ extern "C" { ...@@ -31,6 +31,10 @@ extern "C" {
#include <vlc/vlc.h> #include <vlc/vlc.h>
#ifndef WIN32
#include <X11/Xlib.h>
#endif
struct libvlc_instance_t struct libvlc_instance_t
{ {
vlc_t *p_vlc; vlc_t *p_vlc;
......
...@@ -34,6 +34,10 @@ ...@@ -34,6 +34,10 @@
#include <vlc/vlc.h> #include <vlc/vlc.h>
#ifndef WIN32
#include <X11/Xlib.h>
#endif
# ifdef __cplusplus # ifdef __cplusplus
extern "C" { extern "C" {
# endif # endif
...@@ -327,6 +331,12 @@ int libvlc_video_get_width( libvlc_input_t *, libvlc_exception_t * ); ...@@ -327,6 +331,12 @@ int libvlc_video_get_width( libvlc_input_t *, libvlc_exception_t * );
*/ */
void libvlc_video_take_snapshot( libvlc_input_t *, char *, libvlc_exception_t * ); void libvlc_video_take_snapshot( libvlc_input_t *, char *, libvlc_exception_t * );
int libvlc_video_destroy( libvlc_input_t *, libvlc_exception_t *);
#ifndef WIN32
int libvlc_video_reparent( libvlc_input_t *, Drawable, libvlc_exception_t * );
#endif
/** @} */ /** @} */
......
...@@ -2346,7 +2346,8 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args ) ...@@ -2346,7 +2346,8 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
vlc_bool_t b_arg; vlc_bool_t b_arg;
unsigned int i_width, i_height; unsigned int i_width, i_height;
unsigned int *pi_width, *pi_height; unsigned int *pi_width, *pi_height;
Drawable d;
switch( i_query ) switch( i_query )
{ {
case VOUT_GET_SIZE: case VOUT_GET_SIZE:
...@@ -2392,10 +2393,17 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args ) ...@@ -2392,10 +2393,17 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
case VOUT_REPARENT: case VOUT_REPARENT:
vlc_mutex_lock( &p_vout->p_sys->lock ); vlc_mutex_lock( &p_vout->p_sys->lock );
d = va_arg( args, Drawable );
if ( !d )
XReparentWindow( p_vout->p_sys->p_display, XReparentWindow( p_vout->p_sys->p_display,
p_vout->p_sys->original_window.base_window, p_vout->p_sys->original_window.base_window,
DefaultRootWindow( p_vout->p_sys->p_display ), DefaultRootWindow( p_vout->p_sys->p_display ),
0, 0 ); 0, 0 );
else
XReparentWindow( p_vout->p_sys->p_display,
p_vout->p_sys->original_window.base_window,
d,
0, 0);
XSync( p_vout->p_sys->p_display, False ); XSync( p_vout->p_sys->p_display, False );
p_vout->p_sys->original_window.owner_window = 0; p_vout->p_sys->original_window.owner_window = 0;
vlc_mutex_unlock( &p_vout->p_sys->lock ); vlc_mutex_unlock( &p_vout->p_sys->lock );
......
/***************************************************************************** /*****************************************************************************
* video.c: ibvlc new API video functions * video.c: libvlc new API video functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2005 the VideoLAN team * Copyright (C) 2005 the VideoLAN team
* $Id: core.c 14187 2006-02-07 16:37:40Z courmisch $ * $Id: core.c 14187 2006-02-07 16:37:40Z courmisch $
...@@ -208,3 +208,27 @@ vlc_bool_t libvlc_input_has_vout( libvlc_input_t *p_input, ...@@ -208,3 +208,27 @@ vlc_bool_t libvlc_input_has_vout( libvlc_input_t *p_input,
return VLC_TRUE; return VLC_TRUE;
} }
#ifndef WIN32
int libvlc_video_reparent( libvlc_input_t *p_input, Drawable d,
libvlc_exception_t *p_e )
{
vout_thread_t *p_vout = GetVout( p_input, p_e );
vout_Control( p_vout , VOUT_REPARENT, d);
return 0;
}
#endif
int libvlc_video_destroy( libvlc_input_t *p_input,
libvlc_exception_t *p_e )
{
vout_thread_t *p_vout = GetVout( p_input, p_e );
vlc_object_detach( p_vout );
vlc_object_release( p_vout );
vout_Destroy( p_vout );
return 0;
}
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