X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fvideo_output%2Fx11%2Fxcommon.h;h=240cb6387db824c66913da2d6d09b7a6a12262cf;hb=fd964450e1eba43b68adbb82a2f684c460f93700;hp=b16768b5255becb892041f9947ec7c2f9299dba4;hpb=4b4bd31f0a522c3dc58c4b80dfb92563e522f525;p=vlc diff --git a/modules/video_output/x11/xcommon.h b/modules/video_output/x11/xcommon.h index b16768b525..240cb6387d 100644 --- a/modules/video_output/x11/xcommon.h +++ b/modules/video_output/x11/xcommon.h @@ -51,6 +51,10 @@ VLC_FOURCC( i & 0xff, (i >> 8) & 0xff, (i >> 16) & 0xff, \ (i >> 24) & 0xff ) +#ifdef HAVE_OSSO +#include +#endif + /***************************************************************************** * x11_window_t: X11 window descriptor @@ -78,6 +82,123 @@ typedef struct x11_window_t } x11_window_t; +/***************************************************************************** + * Xxmc defines + *****************************************************************************/ + +#ifdef MODULE_NAME_IS_xvmc + +typedef struct +{ /* CLUT == Color LookUp Table */ + uint8_t cb; + uint8_t cr; + uint8_t y; + uint8_t foo; +} clut_t; + +#define XX44_PALETTE_SIZE 32 +#define OVL_PALETTE_SIZE 256 +#define XVMC_MAX_SURFACES 16 +#define XVMC_MAX_SUBPICTURES 4 +#define FOURCC_IA44 0x34344149 +#define FOURCC_AI44 0x34344941 + +typedef struct +{ + unsigned size; + unsigned max_used; + uint32_t cluts[XX44_PALETTE_SIZE]; + /* cache palette entries for both colors and clip_colors */ + int lookup_cache[OVL_PALETTE_SIZE*2]; +} xx44_palette_t; + +/* + * Functions to handle the vlc-specific palette. + */ + +void clear_xx44_palette( xx44_palette_t *p ); + +/* + * Convert the xine-specific palette to something useful. + */ + +void xx44_to_xvmc_palette( const xx44_palette_t *p,unsigned char *xvmc_palette, + unsigned first_xx44_entry, unsigned num_xx44_entries, + unsigned num_xvmc_components, char *xvmc_components ); + +typedef struct +{ + vlc_macroblocks_t vlc_mc; + XvMCBlockArray blocks; /* pointer to memory for dct block array */ + int num_blocks; + XvMCMacroBlock *macroblockptr; /* pointer to current macro block */ + XvMCMacroBlock *macroblockbaseptr; /* pointer to base MacroBlock in MB array */ + XvMCMacroBlockArray macro_blocks; /* pointer to memory for macroblock array */ + int slices; +} xvmc_macroblocks_t; + +typedef struct +{ + unsigned int mpeg_flags; + unsigned int accel_flags; + unsigned int max_width; + unsigned int max_height; + unsigned int sub_max_width; + unsigned int sub_max_height; + int type_id; + XvImageFormatValues subPicType; + int flags; +} xvmc_capabilities_t; + +typedef struct xvmc_surface_handler_s +{ + XvMCSurface surfaces[XVMC_MAX_SURFACES]; + int surfInUse[XVMC_MAX_SURFACES]; + int surfValid[XVMC_MAX_SURFACES]; + XvMCSubpicture subpictures[XVMC_MAX_SUBPICTURES]; + int subInUse[XVMC_MAX_SUBPICTURES]; + int subValid[XVMC_MAX_SUBPICTURES]; + pthread_mutex_t mutex; +} xvmc_surface_handler_t; + +typedef struct context_lock_s +{ + pthread_mutex_t mutex; + pthread_cond_t cond; + int num_readers; +} context_lock_t; + +#define XVMCLOCKDISPLAY(display) XLockDisplay(display); +#define XVMCUNLOCKDISPLAY(display) XUnlockDisplay(display); + +void xvmc_context_reader_unlock( context_lock_t *c ); +void xvmc_context_reader_lock( context_lock_t *c ); +void xvmc_context_writer_lock( context_lock_t *c ); +void xvmc_context_writer_unlock( context_lock_t *c ); +void free_context_lock( context_lock_t *c ); +void xxmc_dispose_context( vout_thread_t *p_vout ); + +int xxmc_xvmc_surface_valid( vout_thread_t *p_vout, XvMCSurface *surf ); +void xxmc_xvmc_free_surface( vout_thread_t *p_vout, XvMCSurface *surf ); + +void xvmc_vld_slice( picture_t *picture ); +void xvmc_vld_frame( picture_t *picture ); + +void xxmc_do_update_frame( picture_t *picture, uint32_t width, uint32_t height, + double ratio, int format, int flags); + +int checkXvMCCap( vout_thread_t *p_vout); + +XvMCSubpicture *xxmc_xvmc_alloc_subpicture( vout_thread_t *p_vout, + XvMCContext *context, unsigned short width, unsigned short height, + int xvimage_id ); + +void xxmc_xvmc_free_subpicture( vout_thread_t *p_vout, XvMCSubpicture *sub ); +void blend_xx44( uint8_t *dst_img, subpicture_t *sub_img, int dst_width, + int dst_height, int dst_pitch, xx44_palette_t *palette,int ia44); + +#endif /* XvMC defines */ + /***************************************************************************** * vout_sys_t: video output method descriptor ***************************************************************************** @@ -102,13 +223,15 @@ struct vout_sys_t x11_window_t fullscreen_window; /* X11 generic properties */ - vlc_bool_t b_altfullscreen; /* which fullscreen method */ + bool b_altfullscreen; /* which fullscreen method */ #ifdef HAVE_SYS_SHM_H - vlc_bool_t b_shm; /* shared memory extension flag */ + int i_shm_opcode; /* shared memory extension opcode */ #endif #if defined(MODULE_NAME_IS_xvideo) || defined(MODULE_NAME_IS_xvmc) int i_xvport; + bool b_paint_colourkey; + int i_colourkey; #else Colormap colormap; /* colormap used (8bpp only) */ @@ -127,8 +250,9 @@ struct vout_sys_t #endif /* Mouse pointer properties */ - vlc_bool_t b_mouse_pointer_visible; + bool b_mouse_pointer_visible; mtime_t i_time_mouse_last_moved; /* used to auto-hide pointer*/ + mtime_t i_mouse_hide_timeout; /* after time hide cursor */ Cursor blank_cursor; /* the hidden cursor */ mtime_t i_time_button_last_pressed; /* to track dbl-clicks */ Pixmap cursor_pixmap; @@ -136,13 +260,13 @@ struct vout_sys_t /* Window manager properties */ Atom net_wm_state; Atom net_wm_state_fullscreen; - vlc_bool_t b_net_wm_state_fullscreen; + bool b_net_wm_state_fullscreen; Atom net_wm_state_above; - vlc_bool_t b_net_wm_state_above; + bool b_net_wm_state_above; Atom net_wm_state_stays_on_top; - vlc_bool_t b_net_wm_state_stays_on_top; + bool b_net_wm_state_stays_on_top; Atom net_wm_state_below; - vlc_bool_t b_net_wm_state_below; + bool b_net_wm_state_below; #ifdef MODULE_NAME_IS_glx /* GLX properties */ @@ -206,6 +330,15 @@ struct vout_sys_t //alphablend_t alphablend_extra_data; #endif + +#ifdef HAVE_XSP + int i_hw_scale; +#endif + +#ifdef HAVE_OSSO + osso_context_t *p_octx; + int i_backlight_on_counter; +#endif }; /***************************************************************************** @@ -260,119 +393,4 @@ typedef struct mwmhints_t # define MAX_DIRECTBUFFERS 2 #endif -/***************************************************************************** - * Xxmc defines - *****************************************************************************/ - -#ifdef MODULE_NAME_IS_xvmc - -typedef struct -{ /* CLUT == Color LookUp Table */ - uint8_t cb; - uint8_t cr; - uint8_t y; - uint8_t foo; -} clut_t; - -#define XX44_PALETTE_SIZE 32 -#define OVL_PALETTE_SIZE 256 -#define XVMC_MAX_SURFACES 16 -#define XVMC_MAX_SUBPICTURES 4 -#define FOURCC_IA44 0x34344149 -#define FOURCC_AI44 0x34344941 - -typedef struct -{ - unsigned size; - unsigned max_used; - uint32_t cluts[XX44_PALETTE_SIZE]; - /* cache palette entries for both colors and clip_colors */ - int lookup_cache[OVL_PALETTE_SIZE*2]; -} xx44_palette_t; - -/* - * Functions to handle the vlc-specific palette. - */ - -void clear_xx44_palette( xx44_palette_t *p ); - -/* - * Convert the xine-specific palette to something useful. - */ - -void xx44_to_xvmc_palette( const xx44_palette_t *p,unsigned char *xvmc_palette, - unsigned first_xx44_entry, unsigned num_xx44_entries, - unsigned num_xvmc_components, char *xvmc_components ); - -typedef struct -{ - vlc_macroblocks_t vlc_mc; - XvMCBlockArray blocks; /* pointer to memory for dct block array */ - int num_blocks; - XvMCMacroBlock *macroblockptr; /* pointer to current macro block */ - XvMCMacroBlock *macroblockbaseptr; /* pointer to base MacroBlock in MB array */ - XvMCMacroBlockArray macro_blocks; /* pointer to memory for macroblock array */ - int slices; -} xvmc_macroblocks_t; - -typedef struct -{ - unsigned int mpeg_flags; - unsigned int accel_flags; - unsigned int max_width; - unsigned int max_height; - unsigned int sub_max_width; - unsigned int sub_max_height; - int type_id; - XvImageFormatValues subPicType; - int flags; -} xvmc_capabilities_t; - -typedef struct xvmc_surface_handler_s -{ - XvMCSurface surfaces[XVMC_MAX_SURFACES]; - int surfInUse[XVMC_MAX_SURFACES]; - int surfValid[XVMC_MAX_SURFACES]; - XvMCSubpicture subpictures[XVMC_MAX_SUBPICTURES]; - int subInUse[XVMC_MAX_SUBPICTURES]; - int subValid[XVMC_MAX_SUBPICTURES]; - pthread_mutex_t mutex; -} xvmc_surface_handler_t; - -typedef struct context_lock_s -{ - pthread_mutex_t mutex; - pthread_cond_t cond; - int num_readers; -} context_lock_t; -#define XVMCLOCKDISPLAY(display) XLockDisplay(display); -#define XVMCUNLOCKDISPLAY(display) XUnlockDisplay(display); - -void xvmc_context_reader_unlock( context_lock_t *c ); -void xvmc_context_reader_lock( context_lock_t *c ); -void xvmc_context_writer_lock( context_lock_t *c ); -void xvmc_context_writer_unlock( context_lock_t *c ); -void free_context_lock( context_lock_t *c ); -void xxmc_dispose_context( vout_thread_t *p_vout ); - -int xxmc_xvmc_surface_valid( vout_thread_t *p_vout, XvMCSurface *surf ); -void xxmc_xvmc_free_surface( vout_thread_t *p_vout, XvMCSurface *surf ); - -void xvmc_vld_slice( picture_t *picture ); -void xvmc_vld_frame( picture_t *picture ); - -void xxmc_do_update_frame( picture_t *picture, uint32_t width, uint32_t height, - double ratio, int format, int flags); - -int checkXvMCCap( vout_thread_t *p_vout); - -XvMCSubpicture *xxmc_xvmc_alloc_subpicture( vout_thread_t *p_vout, - XvMCContext *context, unsigned short width, unsigned short height, - int xvimage_id ); - -void xxmc_xvmc_free_subpicture( vout_thread_t *p_vout, XvMCSubpicture *sub ); -void blend_xx44( uint8_t *dst_img, subpicture_t *sub_img, int dst_width, - int dst_height, int dst_pitch, xx44_palette_t *palette,int ia44); - -#endif