| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
#define ALLOCATE_DIRECTBUFFERS( i_max ) \ |
|---|
| 25 |
\ |
|---|
| 26 |
while( I_OUTPUTPICTURES < ( i_max ) ) \ |
|---|
| 27 |
{ \ |
|---|
| 28 |
p_pic = NULL; \ |
|---|
| 29 |
\ |
|---|
| 30 |
\ |
|---|
| 31 |
for( i_index = 0 ; i_index < VOUT_MAX_PICTURES ; i_index++ ) \ |
|---|
| 32 |
{ \ |
|---|
| 33 |
if( p_vout->p_picture[ i_index ].i_status == FREE_PICTURE ) \ |
|---|
| 34 |
{ \ |
|---|
| 35 |
p_pic = p_vout->p_picture + i_index; \ |
|---|
| 36 |
break; \ |
|---|
| 37 |
} \ |
|---|
| 38 |
} \ |
|---|
| 39 |
\ |
|---|
| 40 |
if( p_pic == NULL ) \ |
|---|
| 41 |
{ \ |
|---|
| 42 |
break; \ |
|---|
| 43 |
} \ |
|---|
| 44 |
\ |
|---|
| 45 |
\ |
|---|
| 46 |
vout_AllocatePicture( VLC_OBJECT(p_vout), p_pic, p_vout->output.i_chroma, \ |
|---|
| 47 |
p_vout->output.i_width, \ |
|---|
| 48 |
p_vout->output.i_height, \ |
|---|
| 49 |
p_vout->output.i_aspect ); \ |
|---|
| 50 |
\ |
|---|
| 51 |
if( !p_pic->i_planes ) \ |
|---|
| 52 |
{ \ |
|---|
| 53 |
break; \ |
|---|
| 54 |
} \ |
|---|
| 55 |
\ |
|---|
| 56 |
p_pic->i_status = DESTROYED_PICTURE; \ |
|---|
| 57 |
p_pic->i_type = DIRECT_PICTURE; \ |
|---|
| 58 |
\ |
|---|
| 59 |
PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic; \ |
|---|
| 60 |
\ |
|---|
| 61 |
I_OUTPUTPICTURES++; \ |
|---|
| 62 |
} \ |
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
static int SetParentVal( vlc_object_t *p_this, char const *psz_var, |
|---|
| 69 |
vlc_value_t oldval, vlc_value_t newval, void *p_data ) |
|---|
| 70 |
{ |
|---|
| 71 |
VLC_UNUSED(p_this); VLC_UNUSED(oldval); |
|---|
| 72 |
var_Change( (vlc_object_t *)p_data, psz_var, VLC_VAR_SETVALUE, |
|---|
| 73 |
&newval, NULL ); |
|---|
| 74 |
return VLC_SUCCESS; |
|---|
| 75 |
} |
|---|
| 76 |
|
|---|
| 77 |
#define ADD_CALLBACKS( newvout, handler ) \ |
|---|
| 78 |
var_AddCallback( newvout, "fullscreen", SetParentVal, p_vout ); \ |
|---|
| 79 |
var_AddCallback( newvout, "mouse-x", SendEvents, p_vout ); \ |
|---|
| 80 |
var_AddCallback( newvout, "mouse-y", SendEvents, p_vout ); \ |
|---|
| 81 |
var_AddCallback( newvout, "mouse-moved", SendEvents, p_vout ); \ |
|---|
| 82 |
var_AddCallback( newvout, "mouse-clicked", SendEvents, p_vout ); |
|---|
| 83 |
|
|---|
| 84 |
#define DEL_CALLBACKS( newvout, handler ) \ |
|---|
| 85 |
var_DelCallback( newvout, "fullscreen", SetParentVal, p_vout ); \ |
|---|
| 86 |
var_DelCallback( newvout, "mouse-x", SendEvents, p_vout ); \ |
|---|
| 87 |
var_DelCallback( newvout, "mouse-y", SendEvents, p_vout ); \ |
|---|
| 88 |
var_DelCallback( newvout, "mouse-moved", SendEvents, p_vout ); \ |
|---|
| 89 |
var_DelCallback( newvout, "mouse-clicked", SendEvents, p_vout ); |
|---|
| 90 |
|
|---|
| 91 |
#define ADD_PARENT_CALLBACKS( handler ) \ |
|---|
| 92 |
var_AddCallback( p_vout, "fullscreen", handler, NULL ); \ |
|---|
| 93 |
var_AddCallback( p_vout, "aspect-ratio", handler, NULL ); \ |
|---|
| 94 |
var_AddCallback( p_vout, "crop", handler, NULL ); |
|---|
| 95 |
|
|---|
| 96 |
#define DEL_PARENT_CALLBACKS( handler ) \ |
|---|
| 97 |
var_DelCallback( p_vout, "fullscreen", handler, NULL ); \ |
|---|
| 98 |
var_DelCallback( p_vout, "aspect-ratio", handler, NULL ); \ |
|---|
| 99 |
var_DelCallback( p_vout, "crop", handler, NULL ); |
|---|
| 100 |
|
|---|
| 101 |
static int SendEventsToChild( vlc_object_t *, char const *, |
|---|
| 102 |
vlc_value_t, vlc_value_t, void * ); |
|---|