| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
#if defined(MODULE_NAME_IS_xvideo) || defined(MODULE_NAME_IS_xvmc) |
|---|
| 31 |
# define IMAGE_TYPE XvImage |
|---|
| 32 |
# define EXTRA_ARGS int i_xvport, int i_chroma, int i_bits_per_pixel |
|---|
| 33 |
# define EXTRA_ARGS_SHM int i_xvport, int i_chroma, XShmSegmentInfo *p_shm |
|---|
| 34 |
# define DATA_SIZE(p) (p)->data_size |
|---|
| 35 |
# define IMAGE_FREE XFree |
|---|
| 36 |
#else |
|---|
| 37 |
# define IMAGE_TYPE XImage |
|---|
| 38 |
# define EXTRA_ARGS Visual *p_visual, int i_depth, int i_bytes_per_pixel |
|---|
| 39 |
# define EXTRA_ARGS_SHM Visual *p_visual, int i_depth, XShmSegmentInfo *p_shm |
|---|
| 40 |
# define DATA_SIZE(p) ((p)->bytes_per_line * (p)->height) |
|---|
| 41 |
# define IMAGE_FREE XDestroyImage |
|---|
| 42 |
#endif |
|---|
| 43 |
|
|---|
| 44 |
#define X11_FOURCC( a, b, c, d ) \ |
|---|
| 45 |
( ((uint32_t)a) | ( ((uint32_t)b) << 8 ) \ |
|---|
| 46 |
| ( ((uint32_t)c) << 16 ) | ( ((uint32_t)d) << 24 ) ) |
|---|
| 47 |
#define VLC2X11_FOURCC( i ) \ |
|---|
| 48 |
X11_FOURCC( ((char *)&i)[0], ((char *)&i)[1], ((char *)&i)[2], \ |
|---|
| 49 |
((char *)&i)[3] ) |
|---|
| 50 |
#define X112VLC_FOURCC( i ) \ |
|---|
| 51 |
VLC_FOURCC( i & 0xff, (i >> 8) & 0xff, (i >> 16) & 0xff, \ |
|---|
| 52 |
(i >> 24) & 0xff ) |
|---|
| 53 |
|
|---|
| 54 |
#ifdef HAVE_OSSO |
|---|
| 55 |
#include <libosso.h> |
|---|
| 56 |
#endif |
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
|
|---|
| 64 |
typedef struct x11_window_t |
|---|
| 65 |
{ |
|---|
| 66 |
Window owner_window; |
|---|
| 67 |
Window base_window; |
|---|
| 68 |
Window video_window; |
|---|
| 69 |
GC gc; |
|---|
| 70 |
|
|---|
| 71 |
unsigned int i_width; |
|---|
| 72 |
unsigned int i_height; |
|---|
| 73 |
int i_x; |
|---|
| 74 |
int i_y; |
|---|
| 75 |
|
|---|
| 76 |
Atom wm_protocols; |
|---|
| 77 |
Atom wm_delete_window; |
|---|
| 78 |
|
|---|
| 79 |
#ifdef HAVE_XINERAMA |
|---|
| 80 |
int i_screen; |
|---|
| 81 |
#endif |
|---|
| 82 |
|
|---|
| 83 |
} x11_window_t; |
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 |
#ifdef MODULE_NAME_IS_xvmc |
|---|
| 90 |
|
|---|
| 91 |
typedef struct |
|---|
| 92 |
{ |
|---|
| 93 |
uint8_t cb; |
|---|
| 94 |
uint8_t cr; |
|---|
| 95 |
uint8_t y; |
|---|
| 96 |
uint8_t foo; |
|---|
| 97 |
} clut_t; |
|---|
| 98 |
|
|---|
| 99 |
#define XX44_PALETTE_SIZE 32 |
|---|
| 100 |
#define OVL_PALETTE_SIZE 256 |
|---|
| 101 |
#define XVMC_MAX_SURFACES 16 |
|---|
| 102 |
#define XVMC_MAX_SUBPICTURES 4 |
|---|
| 103 |
#define FOURCC_IA44 0x34344149 |
|---|
| 104 |
#define FOURCC_AI44 0x34344941 |
|---|
| 105 |
|
|---|
| 106 |
typedef struct |
|---|
| 107 |
{ |
|---|
| 108 |
unsigned size; |
|---|
| 109 |
unsigned max_used; |
|---|
| 110 |
uint32_t cluts[XX44_PALETTE_SIZE]; |
|---|
| 111 |
|
|---|
| 112 |
int lookup_cache[OVL_PALETTE_SIZE*2]; |
|---|
| 113 |
} xx44_palette_t; |
|---|
| 114 |
|
|---|
| 115 |
|
|---|
| 116 |
|
|---|
| 117 |
|
|---|
| 118 |
|
|---|
| 119 |
void clear_xx44_palette( xx44_palette_t *p ); |
|---|
| 120 |
|
|---|
| 121 |
|
|---|
| 122 |
|
|---|
| 123 |
|
|---|
| 124 |
|
|---|
| 125 |
void xx44_to_xvmc_palette( const xx44_palette_t *p,unsigned char *xvmc_palette, |
|---|
| 126 |
unsigned first_xx44_entry, unsigned num_xx44_entries, |
|---|
| 127 |
unsigned num_xvmc_components, char *xvmc_components ); |
|---|
| 128 |
|
|---|
| 129 |
typedef struct |
|---|
| 130 |
{ |
|---|
| 131 |
vlc_macroblocks_t vlc_mc; |
|---|
| 132 |
XvMCBlockArray blocks; |
|---|
| 133 |
int num_blocks; |
|---|
| 134 |
XvMCMacroBlock *macroblockptr; |
|---|
| 135 |
XvMCMacroBlock *macroblockbaseptr; |
|---|
| 136 |
XvMCMacroBlockArray macro_blocks; |
|---|
| 137 |
int slices; |
|---|
| 138 |
} xvmc_macroblocks_t; |
|---|
| 139 |
|
|---|
| 140 |
typedef struct |
|---|
| 141 |
{ |
|---|
| 142 |
unsigned int mpeg_flags; |
|---|
| 143 |
unsigned int accel_flags; |
|---|
| 144 |
unsigned int max_width; |
|---|
| 145 |
unsigned int max_height; |
|---|
| 146 |
unsigned int sub_max_width; |
|---|
| 147 |
unsigned int sub_max_height; |
|---|
| 148 |
int type_id; |
|---|
| 149 |
XvImageFormatValues subPicType; |
|---|
| 150 |
int flags; |
|---|
| 151 |
} xvmc_capabilities_t; |
|---|
| 152 |
|
|---|
| 153 |
typedef struct xvmc_surface_handler_s |
|---|
| 154 |
{ |
|---|
| 155 |
XvMCSurface surfaces[XVMC_MAX_SURFACES]; |
|---|
| 156 |
int surfInUse[XVMC_MAX_SURFACES]; |
|---|
| 157 |
int surfValid[XVMC_MAX_SURFACES]; |
|---|
| 158 |
XvMCSubpicture subpictures[XVMC_MAX_SUBPICTURES]; |
|---|
| 159 |
int subInUse[XVMC_MAX_SUBPICTURES]; |
|---|
| 160 |
int subValid[XVMC_MAX_SUBPICTURES]; |
|---|
| 161 |
pthread_mutex_t mutex; |
|---|
| 162 |
} xvmc_surface_handler_t; |
|---|
| 163 |
|
|---|
| 164 |
typedef struct context_lock_s |
|---|
| 165 |
{ |
|---|
| 166 |
pthread_mutex_t mutex; |
|---|
| 167 |
pthread_cond_t cond; |
|---|
| 168 |
int num_readers; |
|---|
| 169 |
} context_lock_t; |
|---|
| 170 |
|
|---|
| 171 |
#define XVMCLOCKDISPLAY(display) XLockDisplay(display); |
|---|
| 172 |
#define XVMCUNLOCKDISPLAY(display) XUnlockDisplay(display); |
|---|
| 173 |
|
|---|
| 174 |
void xvmc_context_reader_unlock( context_lock_t *c ); |
|---|
| 175 |
void xvmc_context_reader_lock( context_lock_t *c ); |
|---|
| 176 |
void xvmc_context_writer_lock( context_lock_t *c ); |
|---|
| 177 |
void xvmc_context_writer_unlock( context_lock_t *c ); |
|---|
| 178 |
void free_context_lock( context_lock_t *c ); |
|---|
| 179 |
void xxmc_dispose_context( vout_thread_t *p_vout ); |
|---|
| 180 |
|
|---|
| 181 |
int xxmc_xvmc_surface_valid( vout_thread_t *p_vout, XvMCSurface *surf ); |
|---|
| 182 |
void xxmc_xvmc_free_surface( vout_thread_t *p_vout, XvMCSurface *surf ); |
|---|
| 183 |
|
|---|
| 184 |
void xvmc_vld_slice( picture_t *picture ); |
|---|
| 185 |
void xvmc_vld_frame( picture_t *picture ); |
|---|
| 186 |
|
|---|
| 187 |
void xxmc_do_update_frame( picture_t *picture, uint32_t width, uint32_t height, |
|---|
| 188 |
double ratio, int format, int flags); |
|---|
| 189 |
|
|---|
| 190 |
int checkXvMCCap( vout_thread_t *p_vout); |
|---|
| 191 |
|
|---|
| 192 |
XvMCSubpicture *xxmc_xvmc_alloc_subpicture( vout_thread_t *p_vout, |
|---|
| 193 |
XvMCContext *context, unsigned short width, unsigned short height, |
|---|
| 194 |
int xvimage_id ); |
|---|
| 195 |
|
|---|
| 196 |
void xxmc_xvmc_free_subpicture( vout_thread_t *p_vout, XvMCSubpicture *sub ); |
|---|
| 197 |
void blend_xx44( uint8_t *dst_img, subpicture_t *sub_img, int dst_width, |
|---|
| 198 |
int dst_height, int dst_pitch, xx44_palette_t *palette,int ia44); |
|---|
| 199 |
|
|---|
| 200 |
#endif |
|---|
| 201 |
|
|---|
| 202 |
|
|---|
| 203 |
|
|---|
| 204 |
|
|---|
| 205 |
|
|---|
| 206 |
|
|---|
| 207 |
|
|---|
| 208 |
struct vout_sys_t |
|---|
| 209 |
{ |
|---|
| 210 |
|
|---|
| 211 |
Display * p_display; |
|---|
| 212 |
|
|---|
| 213 |
Visual * p_visual; |
|---|
| 214 |
int i_screen; |
|---|
| 215 |
|
|---|
| 216 |
vlc_mutex_t lock; |
|---|
| 217 |
|
|---|
| 218 |
|
|---|
| 219 |
x11_window_t * p_win; |
|---|
| 220 |
|
|---|
| 221 |
|
|---|
| 222 |
x11_window_t original_window; |
|---|
| 223 |
x11_window_t fullscreen_window; |
|---|
| 224 |
|
|---|
| 225 |
|
|---|
| 226 |
bool b_altfullscreen; |
|---|
| 227 |
#ifdef HAVE_SYS_SHM_H |
|---|
| 228 |
int i_shm_opcode; |
|---|
| 229 |
#endif |
|---|
| 230 |
|
|---|
| 231 |
#if defined(MODULE_NAME_IS_xvideo) || defined(MODULE_NAME_IS_xvmc) |
|---|
| 232 |
int i_xvport; |
|---|
| 233 |
bool b_paint_colourkey; |
|---|
| 234 |
int i_colourkey; |
|---|
| 235 |
#else |
|---|
| 236 |
Colormap colormap; |
|---|
| 237 |
|
|---|
| 238 |
unsigned int i_screen_depth; |
|---|
| 239 |
unsigned int i_bytes_per_pixel; |
|---|
| 240 |
unsigned int i_bytes_per_line; |
|---|
| 241 |
#endif |
|---|
| 242 |
|
|---|
| 243 |
|
|---|
| 244 |
int i_ss_timeout; |
|---|
| 245 |
int i_ss_interval; |
|---|
| 246 |
int i_ss_blanking; |
|---|
| 247 |
int i_ss_exposure; |
|---|
| 248 |
#ifdef DPMSINFO_IN_DPMS_H |
|---|
| 249 |
BOOL b_ss_dpms; |
|---|
| 250 |
#endif |
|---|
| 251 |
|
|---|
| 252 |
|
|---|
| 253 |
bool b_mouse_pointer_visible; |
|---|
| 254 |
mtime_t i_time_mouse_last_moved; |
|---|
| 255 |
mtime_t i_mouse_hide_timeout; |
|---|
| 256 |
Cursor blank_cursor; |
|---|
| 257 |
mtime_t i_time_button_last_pressed; |
|---|
| 258 |
Pixmap cursor_pixmap; |
|---|
| 259 |
|
|---|
| 260 |
|
|---|
| 261 |
Atom net_wm_state; |
|---|
| 262 |
Atom net_wm_state_fullscreen; |
|---|
| 263 |
bool b_net_wm_state_fullscreen; |
|---|
| 264 |
Atom net_wm_state_above; |
|---|
| 265 |
bool b_net_wm_state_above; |
|---|
| 266 |
Atom net_wm_state_stays_on_top; |
|---|
| 267 |
bool b_net_wm_state_stays_on_top; |
|---|
| 268 |
Atom net_wm_state_below; |
|---|
| 269 |
bool b_net_wm_state_below; |
|---|
| 270 |
|
|---|
| 271 |
#ifdef MODULE_NAME_IS_glx |
|---|
| 272 |
|
|---|
| 273 |
int b_glx13; |
|---|
| 274 |
GLXContext gwctx; |
|---|
| 275 |
GLXWindow gwnd; |
|---|
| 276 |
#endif |
|---|
| 277 |
|
|---|
| 278 |
#ifdef MODULE_NAME_IS_xvmc |
|---|
| 279 |
|
|---|
| 280 |
xvmc_macroblocks_t macroblocks; |
|---|
| 281 |
xvmc_capabilities_t *xvmc_cap; |
|---|
| 282 |
unsigned int xvmc_num_cap; |
|---|
| 283 |
unsigned int xvmc_max_subpic_x; |
|---|
| 284 |
unsigned int xvmc_max_subpic_y; |
|---|
| 285 |
int xvmc_eventbase; |
|---|
| 286 |
int xvmc_errbase; |
|---|
| 287 |
int hwSubpictures; |
|---|
| 288 |
XvMCSubpicture *old_subpic; |
|---|
| 289 |
XvMCSubpicture *new_subpic; |
|---|
| 290 |
xx44_palette_t palette; |
|---|
| 291 |
int first_overlay; |
|---|
| 292 |
float cpu_saver; |
|---|
| 293 |
int cpu_save_enabled; |
|---|
| 294 |
int reverse_nvidia_palette; |
|---|
| 295 |
int context_flags; |
|---|
| 296 |
|
|---|
| 297 |
|
|---|
| 298 |
|
|---|
| 299 |
|
|---|
| 300 |
unsigned xvmc_cur_cap; |
|---|
| 301 |
int xvmc_backend_subpic; |
|---|
| 302 |
XvMCContext context; |
|---|
| 303 |
int contextActive; |
|---|
| 304 |
xvmc_surface_handler_t xvmc_surf_handler; |
|---|
| 305 |
unsigned xvmc_mpeg; |
|---|
| 306 |
unsigned xvmc_accel; |
|---|
| 307 |
unsigned last_accel_request; |
|---|
| 308 |
unsigned xvmc_width; |
|---|
| 309 |
unsigned xvmc_height; |
|---|
| 310 |
int have_xvmc_autopaint; |
|---|
| 311 |
int xvmc_xoverlay_type; |
|---|
| 312 |
int unsigned_intra; |
|---|
| 313 |
|
|---|
| 314 |
|
|---|
| 315 |
|
|---|
| 316 |
|
|---|
| 317 |
char *xvmc_palette; |
|---|
| 318 |
XvImage *subImage; |
|---|
| 319 |
XShmSegmentInfo subShmInfo; |
|---|
| 320 |
|
|---|
| 321 |
|
|---|
| 322 |
|
|---|
| 323 |
|
|---|
| 324 |
|
|---|
| 325 |
context_lock_t xvmc_lock; |
|---|
| 326 |
subpicture_t * p_last_subtitle_save; |
|---|
| 327 |
int xvmc_deinterlace_method; |
|---|
| 328 |
int xvmc_crop_style; |
|---|
| 329 |
mtime_t last_date; |
|---|
| 330 |
|
|---|
| 331 |
|
|---|
| 332 |
#endif |
|---|
| 333 |
|
|---|
| 334 |
#ifdef HAVE_XSP |
|---|
| 335 |
int i_hw_scale; |
|---|
| 336 |
#endif |
|---|
| 337 |
|
|---|
| 338 |
#ifdef HAVE_OSSO |
|---|
| 339 |
osso_context_t *p_octx; |
|---|
| 340 |
int i_backlight_on_counter; |
|---|
| 341 |
#endif |
|---|
| 342 |
}; |
|---|
| 343 |
|
|---|
| 344 |
|
|---|
| 345 |
|
|---|
| 346 |
|
|---|
| 347 |
|
|---|
| 348 |
|
|---|
| 349 |
|
|---|
| 350 |
struct picture_sys_t |
|---|
| 351 |
{ |
|---|
| 352 |
IMAGE_TYPE * p_image; |
|---|
| 353 |
|
|---|
| 354 |
#ifdef HAVE_SYS_SHM_H |
|---|
| 355 |
XShmSegmentInfo shminfo; |
|---|
| 356 |
#endif |
|---|
| 357 |
|
|---|
| 358 |
#ifdef MODULE_NAME_IS_xvmc |
|---|
| 359 |
XvMCSurface *xvmc_surf; |
|---|
| 360 |
vlc_xxmc_t xxmc_data; |
|---|
| 361 |
int last_sw_format; |
|---|
| 362 |
vout_thread_t *p_vout; |
|---|
| 363 |
int nb_display; |
|---|
| 364 |
#endif |
|---|
| 365 |
}; |
|---|
| 366 |
|
|---|
| 367 |
|
|---|
| 368 |
|
|---|
| 369 |
|
|---|
| 370 |
|
|---|
| 371 |
|
|---|
| 372 |
|
|---|
| 373 |
#define MWM_HINTS_DECORATIONS (1L << 1) |
|---|
| 374 |
#define PROP_MWM_HINTS_ELEMENTS 5 |
|---|
| 375 |
|
|---|
| 376 |
typedef struct mwmhints_t |
|---|
| 377 |
{ |
|---|
| 378 |
unsigned long flags; |
|---|
| 379 |
unsigned long functions; |
|---|
| 380 |
unsigned long decorations; |
|---|
| 381 |
signed long input_mode; |
|---|
| 382 |
unsigned long status; |
|---|
| 383 |
} mwmhints_t; |
|---|
| 384 |
|
|---|
| 385 |
|
|---|
| 386 |
|
|---|
| 387 |
|
|---|
| 388 |
#ifdef MODULE_NAME_IS_xvideo |
|---|
| 389 |
# define MAX_DIRECTBUFFERS 10 |
|---|
| 390 |
#elif defined(MODULE_NAME_IS_xvmc) |
|---|
| 391 |
# define MAX_DIRECTBUFFERS 12 |
|---|
| 392 |
#else |
|---|
| 393 |
# define MAX_DIRECTBUFFERS 2 |
|---|
| 394 |
#endif |
|---|
| 395 |
|
|---|
| 396 |
|
|---|