xine-lib  1.2.9
xineutils.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2000-2017 the xine project
3  *
4  * This file is part of xine, a free video player.
5  *
6  * xine is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * xine is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19  */
20 #ifndef XINEUTILS_H
21 #define XINEUTILS_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 #include <stdlib.h>
28 #include <string.h>
29 #include <stdarg.h>
30 #include <pthread.h>
31 
32 #ifdef WIN32
33 #else
34 # include <sys/time.h>
35 #endif
36 #include <xine/os_types.h>
37 #include <xine/attributes.h>
38 #include <xine/compat.h>
39 #include <xine/xmlparser.h>
40 #include <xine/xine_buffer.h>
41 #include <xine/configfile.h>
42 #include <xine/list.h>
43 #include <xine/array.h>
44 #include <xine/sorted_array.h>
45 
46 #include <stdio.h>
47 #include <string.h>
48 
49 /*
50  * Mark exported data symbols for link engine library clients with older
51  * Win32 compilers
52  */
53 #if defined(WIN32) && !defined(XINE_LIBRARY_COMPILE)
54 # define DL_IMPORT __declspec(dllimport)
55 # define extern DL_IMPORT extern
56 #endif
57 
58 
59 /* Amiga style doubly linked lists, taken from TJtools. */
60 /* Why does this work with aliasing? */
61 
62 #define DLIST_IS_EMPTY(l) ((void *)((l)->head) == (void *)(&(l)->null))
63 
64 #define DLIST_REMOVE(n) { \
65  dnode_t *dl_rm_this = (dnode_t *)(n); \
66  dnode_t *dl_rm_prev = dl_rm_this->prev; \
67  dnode_t *dl_rm_next = dl_rm_this->next; \
68  dl_rm_next->prev = dl_rm_prev; \
69  dl_rm_prev->next = dl_rm_next; \
70 }
71 
72 #define DLIST_ADD_HEAD(n,l) { \
73  dlist_t *dl_ah_list = (dlist_t *)(l); \
74  dnode_t *dl_ah_node = (dnode_t *)(n); \
75  dnode_t *dl_ah_head = dl_ah_list->head; \
76  dl_ah_node->next = dl_ah_head; \
77  dl_ah_node->prev = (void *)dl_ah_list; \
78  dl_ah_list->head = dl_ah_node; \
79  dl_ah_head->prev = dl_ah_node; \
80 }
81 
82 #define DLIST_ADD_TAIL(n,l) { \
83  dlist_t *dl_at_list = (dlist_t *)(l); \
84  dnode_t *dl_at_node = (dnode_t *)(n); \
85  dnode_t *dl_at_tail = dl_at_list->tail; \
86  dl_at_node->next = (void *)(&dl_at_list->null); \
87  dl_at_node->prev = dl_at_tail; \
88  dl_at_tail->next = dl_at_node; \
89  dl_at_list->tail = dl_at_node; \
90 }
91 
92 #define DLIST_INIT(l) { \
93  dlist_t *dl_in_list = (dlist_t *)(l); \
94  dl_in_list->head = (void *)(&dl_in_list->null); \
95  dl_in_list->null = NULL; \
96  dl_in_list->tail = (void *)(&dl_in_list->head); }
97 
98 typedef struct dnode_st {
99  struct dnode_st *next, *prev;
100 } dnode_t;
101 
102 typedef struct {
103  dnode_t *head, *null, *tail;
104 } dlist_t;
105 
106 
107  /*
108  * debugable mutexes
109  */
110 
111  typedef struct {
112  pthread_mutex_t mutex;
113  char id[80];
114  char *locked_by;
115  } xine_mutex_t;
116 
117  int xine_mutex_init (xine_mutex_t *mutex, const pthread_mutexattr_t *mutexattr,
118  const char *id) XINE_PROTECTED;
119 
120  int xine_mutex_lock (xine_mutex_t *mutex, const char *who) XINE_PROTECTED;
121  int xine_mutex_unlock (xine_mutex_t *mutex, const char *who) XINE_PROTECTED;
123 
124 
125 
126  /* CPU Acceleration */
127 
128 /*
129  * The type of an value that fits in an MMX register (note that long
130  * long constant values MUST be suffixed by LL and unsigned long long
131  * values by ULL, lest they be truncated by the compiler)
132  */
133 
134 /* generic accelerations */
135 #define MM_ACCEL_MLIB 0x00000001
136 
137 /* x86 accelerations */
138 #define MM_ACCEL_X86_MMX 0x80000000
139 #define MM_ACCEL_X86_3DNOW 0x40000000
140 #define MM_ACCEL_X86_MMXEXT 0x20000000
141 #define MM_ACCEL_X86_SSE 0x10000000
142 #define MM_ACCEL_X86_SSE2 0x08000000
143 #define MM_ACCEL_X86_SSE3 0x04000000
144 #define MM_ACCEL_X86_SSSE3 0x02000000
145 #define MM_ACCEL_X86_SSE4 0x01000000
146 #define MM_ACCEL_X86_SSE42 0x00800000
147 #define MM_ACCEL_X86_AVX 0x00400000
148 
149 /* powerpc accelerations and features */
150 #define MM_ACCEL_PPC_ALTIVEC 0x04000000
151 #define MM_ACCEL_PPC_CACHE32 0x02000000
152 
153 /* SPARC accelerations */
154 
155 #define MM_ACCEL_SPARC_VIS 0x01000000
156 #define MM_ACCEL_SPARC_VIS2 0x00800000
157 
158 /* x86 compat defines */
159 #define MM_MMX MM_ACCEL_X86_MMX
160 #define MM_3DNOW MM_ACCEL_X86_3DNOW
161 #define MM_MMXEXT MM_ACCEL_X86_MMXEXT
162 #define MM_SSE MM_ACCEL_X86_SSE
163 #define MM_SSE2 MM_ACCEL_X86_SSE2
164 
165 uint32_t xine_mm_accel (void) XINE_CONST XINE_PROTECTED;
166 
167 
168 
169  /* Optimized/fast memcpy */
170 
171 extern void *(* xine_fast_memcpy)(void *to, const void *from, size_t len) XINE_PROTECTED;
172 
173 /*
174  * Debug stuff
175  */
176 /*
177  * profiling (unworkable in non DEBUG isn't defined)
178  */
180 int xine_profiler_allocate_slot (const char *label) XINE_PROTECTED;
184 
185 /*
186  * Allocate and clean memory size_t 'size', then return the pointer
187  * to the allocated memory.
188  */
190 
191 void *xine_xcalloc(size_t nmemb, size_t size) XINE_MALLOC XINE_PROTECTED;
192 
193 /*
194  * Free allocated memory and set pointer to NULL
195  * @param ptr Pointer to the pointer to the memory block which should be freed.
196  */
197 static inline void _x_freep(void *ptr) {
198  void **p = (void **)ptr;
199  free (*p);
200  *p = NULL;
201 }
202 
203 /*
204  * Copy blocks of memory.
205  */
206 void *xine_memdup (const void *src, size_t length) XINE_PROTECTED;
207 void *xine_memdup0 (const void *src, size_t length) XINE_PROTECTED;
208 
213 #ifndef XINE_MEM_ALIGN
214 # define XINE_MEM_ALIGN 32
215 #endif
216 
219 void xine_free_aligned (void *ptr) XINE_PROTECTED;
220 void *xine_realloc_aligned (void *ptr, size_t size) XINE_PROTECTED;
221 #define xine_freep_aligned(xinefreepptr) do {xine_free_aligned (*(xinefreepptr)); *(xinefreepptr) = NULL; } while (0)
222 
231 size_t xine_base64_encode (uint8_t *from, char *to, size_t size) XINE_PROTECTED;
238 size_t xine_base64_decode (const char *from, uint8_t *to) XINE_PROTECTED;
239 
243 uint32_t xine_crc32_ieee (uint32_t crc, const uint8_t *data, size_t len) XINE_PROTECTED;
244 uint32_t xine_crc16_ansi (uint32_t crc, const uint8_t *data, size_t len) XINE_PROTECTED;
245 
246 /*
247  * Get user home directory.
248  */
249 const char *xine_get_homedir(void) XINE_PROTECTED;
250 
251 #if defined(WIN32) || defined(__CYGWIN__)
252 /*
253  * Get other xine directories.
254  */
255 const char *xine_get_pluginroot(void) XINE_PROTECTED;
256 const char *xine_get_plugindir(void) XINE_PROTECTED;
257 const char *xine_get_fontdir(void) XINE_PROTECTED;
258 const char *xine_get_localedir(void) XINE_PROTECTED;
259 #endif
260 
261 /*
262  * Clean a string (remove spaces and '=' at the begin,
263  * and '\n', '\r' and spaces at the end.
264  */
265 char *xine_chomp (char *str) XINE_PROTECTED;
266 
267 /*
268  * A thread-safe usecond sleep
269  */
270 void xine_usec_sleep(unsigned usec) XINE_PROTECTED;
271 
272 /* compatibility macros */
273 #define xine_strpbrk(S, ACCEPT) strpbrk((S), (ACCEPT))
274 #define xine_strsep(STRINGP, DELIM) strsep((STRINGP), (DELIM))
275 #define xine_setenv(NAME, VAL, XX) setenv((NAME), (VAL), (XX))
276 
282 char *xine_strcat_realloc (char **dest, char *append) XINE_PROTECTED;
283 
290 char *_x_asprintf(const char *format, ...) XINE_PROTECTED XINE_MALLOC XINE_FORMAT_PRINTF(1, 2);
291 
296 int xine_open_cloexec(const char *name, int flags) XINE_PROTECTED;
297 
302 int xine_create_cloexec(const char *name, int flags, mode_t mode) XINE_PROTECTED;
303 
308 int xine_socket_cloexec(int domain, int type, int protocol) XINE_PROTECTED;
309 
310 /*
311  * Color Conversion Utility Functions
312  * The following data structures and functions facilitate the conversion
313  * of RGB images to packed YUV (YUY2) images. There are also functions to
314  * convert from YUV9 -> YV12. All of the meaty details are written in
315  * color.c.
316  */
317 
318 typedef struct yuv_planes_s {
319 
320  unsigned char *y;
321  unsigned char *u;
322  unsigned char *v;
323  unsigned int row_width; /* frame width */
324  unsigned int row_count; /* frame height */
325 
326 } yuv_planes_t;
327 
329 void init_yuv_planes(yuv_planes_t *yuv_planes, int width, int height) XINE_PROTECTED;
331 
332 extern void (*yuv444_to_yuy2)
333  (const yuv_planes_t *yuv_planes, unsigned char *yuy2_map, int pitch) XINE_PROTECTED;
334 extern void (*yuv9_to_yv12)
335  (const unsigned char *y_src, int y_src_pitch, unsigned char *y_dest, int y_dest_pitch,
336  const unsigned char *u_src, int u_src_pitch, unsigned char *u_dest, int u_dest_pitch,
337  const unsigned char *v_src, int v_src_pitch, unsigned char *v_dest, int v_dest_pitch,
338  int width, int height) XINE_PROTECTED;
339 extern void (*yuv411_to_yv12)
340  (const unsigned char *y_src, int y_src_pitch, unsigned char *y_dest, int y_dest_pitch,
341  const unsigned char *u_src, int u_src_pitch, unsigned char *u_dest, int u_dest_pitch,
342  const unsigned char *v_src, int v_src_pitch, unsigned char *v_dest, int v_dest_pitch,
343  int width, int height) XINE_PROTECTED;
344 extern void (*yv12_to_yuy2)
345  (const unsigned char *y_src, int y_src_pitch,
346  const unsigned char *u_src, int u_src_pitch,
347  const unsigned char *v_src, int v_src_pitch,
348  unsigned char *yuy2_map, int yuy2_pitch,
349  int width, int height, int progressive) XINE_PROTECTED;
350 extern void (*yuy2_to_yv12)
351  (const unsigned char *yuy2_map, int yuy2_pitch,
352  unsigned char *y_dst, int y_dst_pitch,
353  unsigned char *u_dst, int u_dst_pitch,
354  unsigned char *v_dst, int v_dst_pitch,
355  int width, int height) XINE_PROTECTED;
356 
357 /* convert full range rgb to mpeg range yuv */
358 #define SCALESHIFT 16
359 #define SCALEFACTOR (1<<SCALESHIFT)
360 #define CENTERSAMPLE 128
361 
362 /* new fast and more accurate macros. Simply recompile to use them */
363 #define COMPUTE_Y(r, g, b) \
364  (unsigned char) \
365  ((y_r_table[r] + y_g_table[g] + y_b_table[b]) >> SCALESHIFT)
366 #define COMPUTE_U(r, g, b) \
367  (unsigned char) \
368  ((u_r_table[r] + u_g_table[g] + uv_br_table[b]) >> SCALESHIFT)
369 #define COMPUTE_V(r, g, b) \
370  (unsigned char) \
371  ((uv_br_table[r] + v_g_table[g] + v_b_table[b]) >> SCALESHIFT)
372 
373 /* Binaries using these old ones keep working,
374  and get the full vs mpeg range bug fixed transparently as well.
375 #define COMPUTE_Y(r, g, b) \
376  (unsigned char) \
377  ((y_r_table[r] + y_g_table[g] + y_b_table[b]) / SCALEFACTOR)
378 #define COMPUTE_U(r, g, b) \
379  (unsigned char) \
380  ((u_r_table[r] + u_g_table[g] + u_b_table[b]) / SCALEFACTOR + CENTERSAMPLE)
381 #define COMPUTE_V(r, g, b) \
382  (unsigned char) \
383  ((v_r_table[r] + v_g_table[g] + v_b_table[b]) / SCALEFACTOR + CENTERSAMPLE)
384 */
385 
386 #define UNPACK_BGR15(packed_pixel, r, g, b) \
387  b = (packed_pixel & 0x7C00) >> 7; \
388  g = (packed_pixel & 0x03E0) >> 2; \
389  r = (packed_pixel & 0x001F) << 3;
390 
391 #define UNPACK_BGR16(packed_pixel, r, g, b) \
392  b = (packed_pixel & 0xF800) >> 8; \
393  g = (packed_pixel & 0x07E0) >> 3; \
394  r = (packed_pixel & 0x001F) << 3;
395 
396 #define UNPACK_RGB15(packed_pixel, r, g, b) \
397  r = (packed_pixel & 0x7C00) >> 7; \
398  g = (packed_pixel & 0x03E0) >> 2; \
399  b = (packed_pixel & 0x001F) << 3;
400 
401 #define UNPACK_RGB16(packed_pixel, r, g, b) \
402  r = (packed_pixel & 0xF800) >> 8; \
403  g = (packed_pixel & 0x07E0) >> 3; \
404  b = (packed_pixel & 0x001F) << 3;
405 
406 extern int y_r_table[256] XINE_PROTECTED;
407 extern int y_g_table[256] XINE_PROTECTED;
408 extern int y_b_table[256] XINE_PROTECTED;
409 
410 extern int uv_br_table[256] XINE_PROTECTED;
411 
412 extern int u_r_table[256] XINE_PROTECTED;
413 extern int u_g_table[256] XINE_PROTECTED;
414 extern int u_b_table[256] XINE_PROTECTED;
415 
416 extern int v_r_table[256] XINE_PROTECTED;
417 extern int v_g_table[256] XINE_PROTECTED;
418 extern int v_b_table[256] XINE_PROTECTED;
419 
420 /* TJ. direct sliced rgb -> yuy2 conversion */
421 extern void *rgb2yuy2_alloc (int color_matrix, const char *format) XINE_PROTECTED;
422 extern void rgb2yuy2_free (void *rgb2yuy2) XINE_PROTECTED;
423 extern void rgb2yuy2_slice (void *rgb2yuy2, const uint8_t *in, int ipitch, uint8_t *out, int opitch,
424  int width, int height) XINE_PROTECTED;
425 extern void rgb2yuy2_palette (void *rgb2yuy2, const uint8_t *pal, int num_colors, int bits_per_pixel)
427 
428 
429 /* frame copying functions */
430 extern void yv12_to_yv12
431  (const unsigned char *y_src, int y_src_pitch, unsigned char *y_dst, int y_dst_pitch,
432  const unsigned char *u_src, int u_src_pitch, unsigned char *u_dst, int u_dst_pitch,
433  const unsigned char *v_src, int v_src_pitch, unsigned char *v_dst, int v_dst_pitch,
434  int width, int height) XINE_PROTECTED;
435 extern void yuy2_to_yuy2
436  (const unsigned char *src, int src_pitch,
437  unsigned char *dst, int dst_pitch,
438  int width, int height) XINE_PROTECTED;
439 
440 /* print a hexdump of the given data */
441 void xine_hexdump (const void *buf, int length) XINE_PROTECTED;
442 
443 /*
444  * Optimization macros for conditions
445  * Taken from the FIASCO L4 microkernel sources
446  */
447 #if !defined(__GNUC__) || __GNUC__ < 3
448 # define EXPECT_TRUE(x) (x)
449 # define EXPECT_FALSE(x) (x)
450 #else
451 # define EXPECT_TRUE(x) __builtin_expect((x),1)
452 # define EXPECT_FALSE(x) __builtin_expect((x),0)
453 #endif
454 
455 #ifdef NDEBUG
456 #define _x_assert(exp) \
457  do { \
458  if (!(exp)) \
459  fprintf(stderr, "assert: %s:%d: %s: Assertion `%s' failed.\n", \
460  __FILE__, __LINE__, __XINE_FUNCTION__, #exp); \
461  } while(0)
462 #else
463 #define _x_assert(exp) \
464  do { \
465  if (!(exp)) { \
466  fprintf(stderr, "assert: %s:%d: %s: Assertion `%s' failed.\n", \
467  __FILE__, __LINE__, __XINE_FUNCTION__, #exp); \
468  abort(); \
469  } \
470  } while(0)
471 #endif
472 
473 #define _x_abort() \
474  do { \
475  fprintf(stderr, "abort: %s:%d: %s: Aborting.\n", \
476  __FILE__, __LINE__, __XINE_FUNCTION__); \
477  abort(); \
478  } while(0)
479 
480 
481 /****** logging with xine **********************************/
482 
483 #ifndef LOG_MODULE
484  #define LOG_MODULE __FILE__
485 #endif /* LOG_MODULE */
486 
487 #define LOG_MODULE_STRING printf("%s: ", LOG_MODULE );
488 
489 #ifdef LOG_VERBOSE
490  #define LONG_LOG_MODULE_STRING \
491  printf("%s: (%s:%d) ", LOG_MODULE, __XINE_FUNCTION__, __LINE__ );
492 #else
493  #define LONG_LOG_MODULE_STRING LOG_MODULE_STRING
494 #endif /* LOG_VERBOSE */
495 
496 #ifdef LOG
497  #ifdef __GNUC__
498  #define lprintf(fmt, args...) \
499  do { \
500  LONG_LOG_MODULE_STRING \
501  printf(fmt, ##args); \
502  fflush(stdout); \
503  } while(0)
504  #else /* __GNUC__ */
505  #ifdef _MSC_VER
506  #define lprintf(fmtargs) \
507  do { \
508  LONG_LOG_MODULE_STRING \
509  printf("%s", fmtargs); \
510  fflush(stdout); \
511  } while(0)
512  #else /* _MSC_VER */
513  #define lprintf(...) \
514  do { \
515  LONG_LOG_MODULE_STRING \
516  printf(__VA_ARGS__); \
517  fflush(stdout); \
518  } while(0)
519  #endif /* _MSC_VER */
520  #endif /* __GNUC__ */
521 #else /* LOG */
522  #ifdef __GNUC__
523  #ifdef DEBUG
524  #define lprintf(fmt, args...) \
525  do { if (0) { printf(fmt, ##args); } } while(0) /* silence unused warnings, check format, ... */
526  #else
527  #define lprintf(fmt, args...) do {} while(0)
528  #endif
529  #else
530  #ifdef _MSC_VER
531 void __inline lprintf(const char * fmt, ...) {}
532  #else
533  #define lprintf(...) do {} while(0)
534  #endif /* _MSC_VER */
535  #endif /* __GNUC__ */
536 #endif /* LOG */
537 
538 #ifdef __GNUC__
539  #define llprintf(cat, fmt, args...) \
540  do{ \
541  if(cat){ \
542  LONG_LOG_MODULE_STRING \
543  printf( fmt, ##args ); \
544  } \
545  }while(0)
546 #else
547 #ifdef _MSC_VER
548  #define llprintf(cat, fmtargs) \
549  do{ \
550  if(cat){ \
551  LONG_LOG_MODULE_STRING \
552  printf( "%s", fmtargs ); \
553  } \
554  }while(0)
555 #else
556  #define llprintf(cat, ...) \
557  do{ \
558  if(cat){ \
559  LONG_LOG_MODULE_STRING \
560  printf( __VA_ARGS__ ); \
561  } \
562  }while(0)
563 #endif /* _MSC_VER */
564 #endif /* __GNUC__ */
565 
566 #ifdef __GNUC__
567  #define xprintf(xine, verbose, fmt, args...) \
568  do { \
569  if((xine) && (xine)->verbosity >= verbose){ \
570  xine_log(xine, XINE_LOG_TRACE, fmt, ##args); \
571  } \
572  } while(0)
573 #else
574 #ifdef _MSC_VER
575 void xine_xprintf(xine_t *xine, int verbose, const char *fmt, ...);
576  #define xprintf xine_xprintf
577 #else
578  #define xprintf(xine, verbose, ...) \
579  do { \
580  if((xine) && (xine)->verbosity >= verbose){ \
581  xine_log(xine, XINE_LOG_TRACE, __VA_ARGS__); \
582  } \
583  } while(0)
584 #endif /* _MSC_VER */
585 #endif /* __GNUC__ */
586 
587 /* time measuring macros for profiling tasks */
588 
589 #ifdef DEBUG
590 # define XINE_PROFILE(function) \
591  do { \
592  struct timeval current_time; \
593  double dtime; \
594  gettimeofday(&current_time, NULL); \
595  dtime = -(current_time.tv_sec + (current_time.tv_usec / 1000000.0)); \
596  function; \
597  gettimeofday(&current_time, NULL); \
598  dtime += current_time.tv_sec + (current_time.tv_usec / 1000000.0); \
599  printf("%s: (%s:%d) took %lf seconds\n", \
600  LOG_MODULE, __XINE_FUNCTION__, __LINE__, dtime); \
601  } while(0)
602 # define XINE_PROFILE_ACCUMULATE(function) \
603  do { \
604  struct timeval current_time; \
605  static double dtime = 0; \
606  gettimeofday(&current_time, NULL); \
607  dtime -= current_time.tv_sec + (current_time.tv_usec / 1000000.0); \
608  function; \
609  gettimeofday(&current_time, NULL); \
610  dtime += current_time.tv_sec + (current_time.tv_usec / 1000000.0); \
611  printf("%s: (%s:%d) took %lf seconds\n", \
612  LOG_MODULE, __XINE_FUNCTION__, __LINE__, dtime); \
613  } while(0)
614 #else
615 # define XINE_PROFILE(function) function
616 # define XINE_PROFILE_ACCUMULATE(function) function
617 #endif /* DEBUG */
618 
623 
624 /*
625  * guess default encoding for the subtitles
626  */
627 const char *xine_guess_spu_encoding(void) XINE_PROTECTED;
628 
629 /*
630  * use the best clock reference (API compatible with gettimeofday)
631  * note: it will be a monotonic clock, if available.
632  */
633 int xine_monotonic_clock(struct timeval *tv, struct timezone *tz) XINE_PROTECTED;
634 
638 void _x_report_video_fourcc (xine_t *, const char *module, uint32_t) XINE_PROTECTED;
639 void _x_report_audio_format_tag (xine_t *, const char *module, uint32_t) XINE_PROTECTED;
640 
641 /* don't harm following code */
642 #ifdef extern
643 # undef extern
644 #endif
645 
646 #ifdef __cplusplus
647 }
648 #endif
649 
650 #endif
void yuy2_to_yuy2(const unsigned char *src, int src_pitch, unsigned char *dst, int dst_pitch, int width, int height)
Definition: copy.c:68
unsigned int height
Definition: gfontrle.c:5
enable disable number of frames of telecine pattern sync required before mode change make frames evenly spaced for film mode(24 fps)" ) PARAM_ITEM( POST_PARAM_TYPE_BOOL
int xine_socket_cloexec(int domain, int type, int protocol)
Definition: utils.c:837
void xine_profiler_stop_count(int id)
Definition: monitor.c:96
#define XINE_MALLOC
Definition: attributes.h:119
void xine_free_aligned(void *ptr)
Definition: utils.c:882
void(* yv12_to_yuy2)(const unsigned char *y_src, int y_src_pitch, const unsigned char *u_src, int u_src_pitch, const unsigned char *v_src, int v_src_pitch, unsigned char *yuy2_map, int yuy2_pitch, int width, int height, int progressive)
Definition: color.c:102
void xine_profiler_start_count(int id)
Definition: monitor.c:88
Definition: xineutils.h:98
char * _x_asprintf(const char *format,...) XINE_FORMAT_PRINTF(1
int y_r_table[256]
Definition: color.c:76
void * xine_xcalloc(size_t nmemb, size_t size)
Wrapper around calloc() function.
Definition: utils.c:296
int xine_profiler_allocate_slot(const char *label)
Definition: monitor.c:51
NULL
Definition: xine_plugin.c:91
int xine_create_cloexec(const char *name, int flags, mode_t mode)
Definition: utils.c:826
void * xine_mallocz_aligned(size_t size)
Definition: utils.c:856
void xine_profiler_init(void)
Definition: monitor.c:45
char * locked_by
Definition: xineutils.h:114
void(* yuy2_to_yv12)(const unsigned char *yuy2_map, int yuy2_pitch, unsigned char *y_dst, int y_dst_pitch, unsigned char *u_dst, int u_dst_pitch, unsigned char *v_dst, int v_dst_pitch, int width, int height)
Definition: color.c:108
struct dnode_st dnode_t
void rgb2yuy2_free(void *rgb2yuy2)
Definition: color.c:1905
unsigned char * y
Definition: xineutils.h:320
static void _x_freep(void *ptr)
Definition: xineutils.h:197
unsigned char * u
Definition: xineutils.h:321
char * xine_get_system_encoding(void)
Definition: utils.c:646
void rgb2yuy2_slice(void *rgb2yuy2, const uint8_t *in, int ipitch, uint8_t *out, int opitch, int width, int height)
Definition: color.c:2009
const char * xine_guess_spu_encoding(void)
Definition: utils.c:694
char int xine_open_cloexec(const char *name, int flags)
Definition: utils.c:815
void(* yuv444_to_yuy2)(const yuv_planes_t *yuv_planes, unsigned char *yuy2_map, int pitch)
Definition: color.c:90
size_t xine_base64_encode(uint8_t *from, char *to, size_t size)
Definition: utils.c:918
int v_g_table[256]
Definition: color.c:85
int u_r_table[256]
Definition: color.c:82
void _x_report_audio_format_tag(xine_t *, const char *module, uint32_t)
Definition: buffer_types.c:1350
dnode_t * tail
Definition: xineutils.h:103
#define lprintf(...)
Definition: xineutils.h:533
uint32_t xine_crc32_ieee(uint32_t crc, const uint8_t *data, size_t len)
Definition: utils.c:998
int u_g_table[256]
Definition: color.c:83
void xine_usec_sleep(unsigned usec)
Definition: utils.c:546
int xine_mutex_lock(xine_mutex_t *mutex, const char *who)
Definition: xine_mutex.c:44
pthread_mutex_t mutex
Definition: xineutils.h:112
#define XINE_DEPRECATED
Definition: attributes.h:85
struct yuv_planes_s yuv_planes_t
int v_b_table[256]
Definition: color.c:84
void * xine_memdup(const void *src, size_t length)
Definition: utils.c:308
struct dnode_st * prev
Definition: xineutils.h:99
#define XINE_FORMAT_PRINTF(fmt, var)
Definition: attributes.h:107
#define XINE_CONST
Definition: attributes.h:131
int y_b_table[256]
Definition: color.c:78
void xine_hexdump(const void *buf, int length)
Definition: utils.c:576
unsigned int row_count
Definition: xineutils.h:324
void init_yuv_conversion(void)
Definition: color.c:1648
void * xine_memdup0(const void *src, size_t length)
Definition: utils.c:317
void(* yuv411_to_yv12)(const unsigned char *y_src, int y_src_pitch, unsigned char *y_dest, int y_dest_pitch, const unsigned char *u_src, int u_src_pitch, unsigned char *u_dest, int u_dest_pitch, const unsigned char *v_src, int v_src_pitch, unsigned char *v_dest, int v_dest_pitch, int width, int height)
Definition: color.c:97
int v_r_table[256]
Definition: color.c:88
void * rgb2yuy2_alloc(int color_matrix, const char *format)
Definition: color.c:1730
unsigned char * v
Definition: xineutils.h:322
int u_b_table[256]
Definition: color.c:87
uint32_t xine_crc16_ansi(uint32_t crc, const uint8_t *data, size_t len)
Definition: utils.c:1071
const char * name
Definition: asfheader.h:137
Definition: xineutils.h:102
#define XINE_PROTECTED
Definition: attributes.h:73
unsigned int width
Definition: gfontrle.c:4
void * xine_realloc_aligned(void *ptr, size_t size)
Definition: utils.c:890
Definition: xine_internal.h:81
size_t xine_base64_decode(const char *from, uint8_t *to)
Definition: utils.c:943
struct dnode_st * next
Definition: xineutils.h:99
char * xine_chomp(char *str)
Definition: utils.c:525
const char * xine_get_homedir(void)
Definition: utils.c:380
int xine_monotonic_clock(struct timeval *tv, struct timezone *tz)
Definition: utils.c:727
int y_g_table[256]
Definition: color.c:77
void yv12_to_yv12(const unsigned char *y_src, int y_src_pitch, unsigned char *y_dst, int y_dst_pitch, const unsigned char *u_src, int u_src_pitch, unsigned char *u_dst, int u_dst_pitch, const unsigned char *v_src, int v_src_pitch, unsigned char *v_dst, int v_dst_pitch, int width, int height)
Definition: copy.c:31
int xine_mutex_destroy(xine_mutex_t *mutex)
Definition: xine_mutex.c:75
void * xine_malloc_aligned(size_t size)
Definition: utils.c:869
void * xine_xmalloc(size_t size) XINE_DEPRECATED
Allocate and clean memory size_t &#39;size&#39;, then return the pointer to the allocated memory...
Definition: utils.c:271
void free_yuv_planes(yuv_planes_t *yuv_planes)
Definition: color.c:138
Definition: xineutils.h:111
unsigned int row_width
Definition: xineutils.h:323
uint32_t xine_mm_accel(void) XINE_CONST
Definition: cpu_accel.c:380
void _x_report_video_fourcc(xine_t *, const char *module, uint32_t)
Definition: buffer_types.c:1338
char * xine_strcat_realloc(char **dest, char *append)
Definition: utils.c:775
Definition: xineutils.h:318
void rgb2yuy2_palette(void *rgb2yuy2, const uint8_t *pal, int num_colors, int bits_per_pixel)
Definition: color.c:1909
int xine_mutex_unlock(xine_mutex_t *mutex, const char *who)
Definition: xine_mutex.c:68
int uv_br_table[256]
Definition: color.c:80
void init_yuv_planes(yuv_planes_t *yuv_planes, int width, int height)
Definition: color.c:120
void xine_profiler_print_results(void)
Definition: monitor.c:105
int xine_mutex_init(xine_mutex_t *mutex, const pthread_mutexattr_t *mutexattr, const char *id)
Definition: xine_mutex.c:33
void(* yuv9_to_yv12)(const unsigned char *y_src, int y_src_pitch, unsigned char *y_dest, int y_dest_pitch, const unsigned char *u_src, int u_src_pitch, unsigned char *u_dest, int u_dest_pitch, const unsigned char *v_src, int v_src_pitch, unsigned char *v_dest, int v_dest_pitch, int width, int height)
Definition: color.c:92