VLC  4.0.0-dev
vlc_common.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * vlc_common.h: common definitions
3  * Collection of useful common types and macros definitions
4  *****************************************************************************
5  * Copyright (C) 1998-2011 VLC authors and VideoLAN
6  *
7  * Authors: Samuel Hocevar <sam@via.ecp.fr>
8  * Vincent Seguin <seguin@via.ecp.fr>
9  * Gildas Bazin <gbazin@videolan.org>
10  * RĂ©mi Denis-Courmont
11  *
12  * This program is free software; you can redistribute it and/or modify it
13  * under the terms of the GNU Lesser General Public License as published by
14  * the Free Software Foundation; either version 2.1 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * along with this program; if not, write to the Free Software Foundation,
24  * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25  *****************************************************************************/
26 
27 #ifndef VLC_COMMON_H
28 # define VLC_COMMON_H 1
29 
30 /**
31  * \defgroup vlc VLC plug-in programming interface
32  * \file
33  * \ingroup vlc
34  * This file is a collection of common definitions and types
35  */
36 
37 /*****************************************************************************
38  * Required vlc headers
39  *****************************************************************************/
40 #include "vlc_config.h"
41 
42 /*****************************************************************************
43  * Required system headers
44  *****************************************************************************/
45 #include <stdlib.h>
46 #include <stdarg.h>
47 
48 #include <string.h>
49 #include <stdio.h>
50 #include <inttypes.h>
51 #include <stddef.h>
52 
53 #ifndef __cplusplus
54 # include <stdbool.h>
55 #endif
56 
57 /**
58  * \defgroup cext C programming language extensions
59  * \ingroup vlc
60  *
61  * This section defines a number of macros and inline functions extending the
62  * C language. Most extensions are implemented by GCC and LLVM/Clang, and have
63  * unoptimized fallbacks for other C11/C++11 conforming compilers.
64  * @{
65  */
66 #ifdef __GNUC__
67 # define VLC_GCC_VERSION(maj,min) \
68  ((__GNUC__ > (maj)) || (__GNUC__ == (maj) && __GNUC_MINOR__ >= (min)))
69 #else
70 /** GCC version check */
71 # define VLC_GCC_VERSION(maj,min) (0)
72 #endif
73 
74 /* Try to fix format strings for all versions of mingw and mingw64 */
75 #if defined( _WIN32 ) && defined( __USE_MINGW_ANSI_STDIO )
76  #undef PRId64
77  #define PRId64 "lld"
78  #undef PRIi64
79  #define PRIi64 "lli"
80  #undef PRIu64
81  #define PRIu64 "llu"
82  #undef PRIo64
83  #define PRIo64 "llo"
84  #undef PRIx64
85  #define PRIx64 "llx"
86  #define snprintf __mingw_snprintf
87  #define vsnprintf __mingw_vsnprintf
88  #define swprintf _snwprintf
89 #endif
90 
91 /* Function attributes for compiler warnings */
92 #ifdef __GNUC__
93 # define VLC_DEPRECATED __attribute__((deprecated))
94 # if VLC_GCC_VERSION(6,0)
95 # define VLC_DEPRECATED_ENUM __attribute__((deprecated))
96 # else
97 # define VLC_DEPRECATED_ENUM
98 # endif
99 
100 # if defined( _WIN32 ) && !defined( __clang__ )
101 # define VLC_FORMAT(x,y) __attribute__ ((format(gnu_printf,x,y)))
102 # else
103 # define VLC_FORMAT(x,y) __attribute__ ((format(printf,x,y)))
104 # endif
105 # define VLC_FORMAT_ARG(x) __attribute__ ((format_arg(x)))
106 # define VLC_MALLOC __attribute__ ((malloc))
107 # define VLC_USED __attribute__ ((warn_unused_result))
108 
109 #else
110 /**
111  * Deprecated functions or compound members annotation
112  *
113  * Use this macro in front of a function declaration or compound member
114  * within a compound type declaration.
115  * The compiler may emit a warning every time the function or member is used.
116  *
117  * Use \ref VLC_DEPRECATED_ENUM instead for enumeration members.
118  */
119 # define VLC_DEPRECATED
120 
121 /**
122  * Deprecated enum member annotation
123  *
124  * Use this macro after an enumerated type member declaration.
125  * The compiler may emit a warning every time the enumeration member is used.
126  *
127  * See also \ref VLC_DEPRECATED.
128  */
129 # define VLC_DEPRECATED_ENUM
130 
131 /**
132  * String format function annotation
133  *
134  * Use this macro after a function prototype/declaration if the function
135  * expects a standard C format string. This helps compiler diagnostics.
136  *
137  * @param x the position (starting from 1) of the format string argument
138  * @param y the first position (also starting from 1) of the variable arguments
139  * following the format string (usually but not always \p x+1).
140  */
141 # define VLC_FORMAT(x,y)
142 
143 /**
144  * Format string translation function annotation
145  *
146  * Use this macro after a function prototype/declaration if the function
147  * expects a format string as input and returns another format string as output
148  * to another function.
149  *
150  * This is primarily intended for localization functions such as gettext().
151  */
152 # define VLC_FORMAT_ARG(x)
153 
154 /**
155  * Heap allocated result function annotation
156  *
157  * Use this macro to annotate a function that returns a pointer to memory that
158  * cannot alias any other valid pointer.
159  *
160  * This is primarily used for functions that return a pointer to heap-allocated
161  * memory, but it can be used for other applicable purposes.
162  *
163  * \warning Do not use this annotation if the returned pointer can in any way
164  * alias a valid pointer at the time the function exits. This could lead to
165  * very weird memory corruption bugs.
166  */
167 # define VLC_MALLOC
168 
169 /**
170  * Used result function annotation
171  *
172  * Use this macro to annotate a function whose result must be used.
173  *
174  * There are several cases where this is useful:
175  * - If a function has no side effects (or no useful side effects), such that
176  * the only useful purpose of calling said function is to obtain its
177  * return value.
178  * - If ignoring the function return value would lead to a resource leak
179  * (including but not limited to a memory leak).
180  * - If a function cannot be used correctly without checking its return value.
181  * For instance, if the function can fail at any time.
182  *
183  * The compiler may warn if the return value of a function call is ignored.
184  */
185 # define VLC_USED
186 #endif
187 
188 #if defined (__ELF__) || defined (__MACH__)
189 # define VLC_WEAK __attribute__((weak))
190 #else
191 /**
192  * Weak symbol annotation
193  *
194  * Use this macro before an external identifier \b definition to mark it as a
195  * weak symbol. A weak symbol can be overriden by another symbol of the same
196  * name at the link time.
197  */
198 # define VLC_WEAK
199 #endif
200 
201 /* Branch prediction */
202 #if defined (__GNUC__) || defined (__clang__)
203 # define likely(p) __builtin_expect(!!(p), 1)
204 # define unlikely(p) __builtin_expect(!!(p), 0)
205 # define unreachable() __builtin_unreachable()
206 #else
207 /**
208  * Predicted true condition
209  *
210  * This macro indicates that the condition is expected most often true.
211  * The compiler may optimize the code assuming that this condition is usually
212  * met.
213  */
214 # define likely(p) (!!(p))
215 
216 /**
217  * Predicted false condition
218  *
219  * This macro indicates that the condition is expected most often false.
220  * The compiler may optimize the code assuming that this condition is rarely
221  * met.
222  */
223 # define unlikely(p) (!!(p))
224 
225 /**
226  * Impossible branch
227  *
228  * This macro indicates that the branch cannot be reached at run-time, and
229  * represents undefined behaviour.
230  * The compiler may optimize the code assuming that the call flow will never
231  * logically reach the point where this macro is expanded.
232  *
233  * See also \ref vlc_assert_unreachable.
234  */
235 # define unreachable() ((void)0)
236 #endif
237 
238 /**
239  * Impossible branch assertion
240  *
241  * This macro asserts that the branch cannot be reached at run-time.
242  *
243  * If the branch is reached in a debug build, it will trigger an assertion
244  * failure and abnormal program termination.
245  *
246  * If the branch is reached in a non-debug build, this macro is equivalent to
247  * \ref unreachable and the behaviour is undefined.
248  */
249 #define vlc_assert_unreachable() (vlc_assert(!"unreachable"), unreachable())
250 
251 /**
252  * Run-time assertion
253  *
254  * This macro performs a run-time assertion if C assertions are enabled
255  * and the following preprocessor symbol is defined:
256  * @verbatim __LIBVLC__ @endverbatim
257  * That restriction ensures that assertions in public header files are not
258  * unwittingly <i>leaked</i> to externally-compiled plug-ins
259  * including those header files.
260  *
261  * Within the LibVLC code base, this is exactly the same as assert(), which can
262  * and probably should be used directly instead.
263  */
264 #ifdef __LIBVLC__
265 # define vlc_assert(pred) assert(pred)
266 #else
267 # define vlc_assert(pred) ((void)0)
268 #endif
269 
270 /* Linkage */
271 #ifdef __cplusplus
272 # define VLC_EXTERN extern "C"
273 #else
274 # define VLC_EXTERN
275 #endif
276 
277 #if defined (_WIN32) && defined (DLL_EXPORT)
278 # define VLC_EXPORT __declspec(dllexport)
279 #elif defined (__GNUC__)
280 # define VLC_EXPORT __attribute__((visibility("default")))
281 #else
282 # define VLC_EXPORT
283 #endif
284 
285 /**
286  * Exported API call annotation
287  *
288  * This macro is placed before a function declaration to indicate that the
289  * function is an API call of the LibVLC plugin API.
290  */
291 #define VLC_API VLC_EXTERN VLC_EXPORT
292 
293 /** @} */
294 
295 /*****************************************************************************
296  * Basic types definitions
297  *****************************************************************************/
298 /**
299  * The vlc_fourcc_t type.
300  *
301  * See http://www.webartz.com/fourcc/ for a very detailed list.
302  */
303 typedef uint32_t vlc_fourcc_t;
304 
305 #ifdef WORDS_BIGENDIAN
306 # define VLC_FOURCC( a, b, c, d ) \
307  ( ((uint32_t)d) | ( ((uint32_t)c) << 8 ) \
308  | ( ((uint32_t)b) << 16 ) | ( ((uint32_t)a) << 24 ) )
309 # define VLC_TWOCC( a, b ) \
310  ( (uint16_t)(b) | ( (uint16_t)(a) << 8 ) )
311 
312 #else
313 # define VLC_FOURCC( a, b, c, d ) \
314  ( ((uint32_t)a) | ( ((uint32_t)b) << 8 ) \
315  | ( ((uint32_t)c) << 16 ) | ( ((uint32_t)d) << 24 ) )
316 # define VLC_TWOCC( a, b ) \
317  ( (uint16_t)(a) | ( (uint16_t)(b) << 8 ) )
318 
319 #endif
320 
321 /**
322  * Translate a vlc_fourcc into its string representation. This function
323  * assumes there is enough room in psz_fourcc to store 4 characters in.
324  *
325  * \param fcc a vlc_fourcc_t
326  * \param psz_fourcc string to store string representation of vlc_fourcc in
327  */
328 static inline void vlc_fourcc_to_char( vlc_fourcc_t fcc, char *psz_fourcc )
329 {
330  memcpy( psz_fourcc, &fcc, 4 );
331 }
332 
333 /*****************************************************************************
334  * Classes declaration
335  *****************************************************************************/
336 
337 /* Internal types */
338 typedef struct vlc_object_t vlc_object_t;
339 typedef struct libvlc_int_t libvlc_int_t;
340 typedef struct date_t date_t;
341 
342 /* Playlist */
343 
344 typedef struct playlist_t playlist_t;
349 
350 /* Modules */
351 typedef struct module_t module_t;
353 
355 
356 /* Input */
357 typedef struct input_item_t input_item_t;
360 typedef struct stream_t stream_t;
361 typedef struct stream_t demux_t;
362 typedef struct es_out_t es_out_t;
363 typedef struct es_out_id_t es_out_id_t;
364 typedef struct seekpoint_t seekpoint_t;
365 typedef struct info_t info_t;
368 
369 /* Format */
373 typedef struct es_format_t es_format_t;
375 typedef struct vlc_es_id_t vlc_es_id_t;
376 
377 /* Audio */
380 
381 /* Video */
384 
386 typedef struct picture_t picture_t;
387 
388 /* Subpictures */
389 typedef struct spu_t spu_t;
390 typedef struct subpicture_t subpicture_t;
392 
394 
395 /* Stream output */
397 
398 typedef struct sout_input_t sout_input_t;
400 
402 
403 typedef struct sout_mux_t sout_mux_t;
404 
406 
409 
410 /* Decoders */
411 typedef struct decoder_t decoder_t;
412 
413 /* Encoders */
414 typedef struct encoder_t encoder_t;
415 
416 /* Filters */
417 typedef struct filter_t filter_t;
418 
419 /* Network */
420 typedef struct vlc_url_t vlc_url_t;
421 
422 /* Misc */
424 
425 /* block */
426 typedef struct block_t block_t;
427 typedef struct block_fifo_t block_fifo_t;
428 
429 /* Hashing */
430 typedef struct md5_s md5_t;
431 
432 /* XML */
433 typedef struct xml_t xml_t;
434 typedef struct xml_reader_t xml_reader_t;
435 
436 /* vod server */
437 typedef struct vod_t vod_t;
438 typedef struct vod_media_t vod_media_t;
439 
440 /* VLM */
441 typedef struct vlm_t vlm_t;
443 
444 /* misc */
445 typedef struct vlc_meta_t vlc_meta_t;
448 
449 /* Update */
450 typedef struct update_t update_t;
451 
452 /**
453  * VLC value structure
454  */
455 typedef union
456 {
457  int64_t i_int;
458  bool b_bool;
459  float f_float;
460  char * psz_string;
461  void * p_address;
462  struct { int32_t x; int32_t y; } coords;
463 
464 } vlc_value_t;
465 
466 /*****************************************************************************
467  * Error values (shouldn't be exposed)
468  *****************************************************************************/
469 /** No error */
470 #define VLC_SUCCESS (-0)
471 /** Unspecified error */
472 #define VLC_EGENERIC (-1)
473 /** Not enough memory */
474 #define VLC_ENOMEM (-2)
475 /** Timeout */
476 #define VLC_ETIMEOUT (-3)
477 /** Module not found */
478 #define VLC_ENOMOD (-4)
479 /** Object not found */
480 #define VLC_ENOOBJ (-5)
481 /** Variable not found */
482 #define VLC_ENOVAR (-6)
483 /** Bad variable value */
484 #define VLC_EBADVAR (-7)
485 /** Item not found */
486 #define VLC_ENOITEM (-8)
487 
488 /*****************************************************************************
489  * Variable callbacks: called when the value is modified
490  *****************************************************************************/
491 typedef int ( * vlc_callback_t ) ( vlc_object_t *, /* variable's object */
492  char const *, /* variable name */
493  vlc_value_t, /* old value */
494  vlc_value_t, /* new value */
495  void * ); /* callback data */
496 
497 /*****************************************************************************
498  * List callbacks: called when elements are added/removed from the list
499  *****************************************************************************/
500 typedef int ( * vlc_list_callback_t ) ( vlc_object_t *, /* variable's object */
501  char const *, /* variable name */
502  int, /* VLC_VAR_* action */
503  vlc_value_t *, /* new/deleted value */
504  void *); /* callback data */
505 
506 /*****************************************************************************
507  * OS-specific headers and thread types
508  *****************************************************************************/
509 #if defined( _WIN32 )
510 # include <malloc.h>
511 # ifndef PATH_MAX
512 # define PATH_MAX MAX_PATH
513 # endif
514 # include <windows.h>
515 #endif
516 
517 #ifdef __APPLE__
518 #include <sys/syslimits.h>
519 #include <AvailabilityMacros.h>
520 #endif
521 
522 #ifdef __OS2__
523 # define OS2EMX_PLAIN_CHAR
524 # define INCL_BASE
525 # define INCL_PM
526 # include <os2safe.h>
527 # include <os2.h>
528 #endif
529 
530 #include "vlc_tick.h"
531 #include "vlc_threads.h"
532 
533 /**
534  * \defgroup intops Integer operations
535  * \ingroup cext
536  *
537  * Common integer functions.
538  * @{
539  */
540 /* __MAX and __MIN: self explanatory */
541 #ifndef __MAX
542 # define __MAX(a, b) ( ((a) > (b)) ? (a) : (b) )
543 #endif
544 #ifndef __MIN
545 # define __MIN(a, b) ( ((a) < (b)) ? (a) : (b) )
546 #endif
547 
548 /* clip v in [min, max] */
549 #define VLC_CLIP(v, min, max) __MIN(__MAX((v), (min)), (max))
550 
551 /**
552  * Make integer v a multiple of align
553  *
554  * \note align must be a power of 2
555  */
556 VLC_USED
557 static inline size_t vlc_align(size_t v, size_t align)
558 {
559  return (v + (align - 1)) & ~(align - 1);
560 }
561 
562 #if defined(__clang__) && __has_attribute(diagnose_if)
563 static inline size_t vlc_align(size_t v, size_t align)
564  __attribute__((diagnose_if(((align & (align - 1)) || (align == 0)),
565  "align must be power of 2", "error")));
566 #endif
567 
568 /** Greatest common divisor */
569 VLC_USED
570 static inline int64_t GCD ( int64_t a, int64_t b )
571 {
572  while( b )
573  {
574  int64_t c = a % b;
575  a = b;
576  b = c;
577  }
578  return a;
579 }
580 
581 /* function imported from libavutil/common.h */
582 VLC_USED
583 static inline uint8_t clip_uint8_vlc( int32_t a )
584 {
585  if( a&(~255) ) return (-a)>>31;
586  else return a;
587 }
588 
589 /**
590  * \defgroup bitops Bit operations
591  * @{
592  */
593 
594 #define VLC_INT_FUNC(basename) \
595  VLC_INT_FUNC_TYPE(basename, unsigned, ) \
596  VLC_INT_FUNC_TYPE(basename, unsigned long, l) \
597  VLC_INT_FUNC_TYPE(basename, unsigned long long, ll)
598 
599 #if defined (__GNUC__) || defined (__clang__)
600 # define VLC_INT_FUNC_TYPE(basename,type,suffix) \
601 VLC_USED static inline int vlc_##basename##suffix(type x) \
602 { \
603  return __builtin_##basename##suffix(x); \
604 }
605 
607 #else
608 VLC_USED static inline int vlc_clzll(unsigned long long x)
609 {
610  int i = sizeof (x) * 8;
611 
612  while (x)
613  {
614  x >>= 1;
615  i--;
616  }
617  return i;
618 }
619 
620 VLC_USED static inline int vlc_clzl(unsigned long x)
621 {
622  return vlc_clzll(x) - ((sizeof (long long) - sizeof (long)) * 8);
623 }
624 
625 VLC_USED static inline int vlc_clz(unsigned x)
626 {
627  return vlc_clzll(x) - ((sizeof (long long) - sizeof (int)) * 8);
628 }
629 
630 VLC_USED static inline int vlc_ctz_generic(unsigned long long x)
631 {
632  unsigned i = sizeof (x) * 8;
633 
634  while (x)
635  {
636  x <<= 1;
637  i--;
638  }
639  return i;
640 }
641 
642 VLC_USED static inline int vlc_parity_generic(unsigned long long x)
643 {
644  for (unsigned i = 4 * sizeof (x); i > 0; i /= 2)
645  x ^= x >> i;
646  return x & 1;
647 }
648 
649 VLC_USED static inline int vlc_popcount_generic(unsigned long long x)
650 {
651  int count = 0;
652  while (x)
653  {
654  count += x & 1;
655  x = x >> 1;
656  }
657  return count;
658 }
659 
660 # define VLC_INT_FUNC_TYPE(basename,type,suffix) \
661 VLC_USED static inline int vlc_##basename##suffix(type x) \
662 { \
663  return vlc_##basename##_generic(x); \
664 }
665 #endif
666 
669 VLC_INT_FUNC(popcount)
671 #ifndef __cplusplus
672 # define VLC_INT_GENERIC(func,x) \
673  _Generic((x), \
674  unsigned char: func(x), \
675  signed char: func(x), \
676  unsigned short: func(x), \
677  signed short: func(x), \
678  unsigned int: func(x), \
679  signed int: func(x), \
680  unsigned long: func##l(x), \
681  signed long: func##l(x), \
682  unsigned long long: func##ll(x), \
683  signed long long: func##ll(x))
684 
685 /**
686  * Count leading zeroes
687  *
688  * This function counts the number of consecutive zero (clear) bits
689  * down from the highest order bit in an unsigned integer.
690  *
691  * \param x a non-zero integer
692  * \note This macro assumes that CHAR_BIT equals 8.
693  * \warning By definition, the result depends on the (width of the) type of x.
694  * \return The number of leading zero bits in x.
695  */
696 # define clz(x) \
697  _Generic((x), \
698  unsigned char: (vlc_clz(x) - (sizeof (unsigned) - 1) * 8), \
699  unsigned short: (vlc_clz(x) \
700  - (sizeof (unsigned) - sizeof (unsigned short)) * 8), \
701  unsigned: vlc_clz(x), \
702  unsigned long: vlc_clzl(x), \
703  unsigned long long: vlc_clzll(x))
704 
705 /**
706  * Count trailing zeroes
707  *
708  * This function counts the number of consecutive zero bits
709  * up from the lowest order bit in an unsigned integer.
710  *
711  * \param x a non-zero integer
712  * \note This function assumes that CHAR_BIT equals 8.
713  * \return The number of trailing zero bits in x.
714  */
715 # define ctz(x) VLC_INT_GENERIC(vlc_ctz, x)
716 
717 /**
718  * Parity
719  *
720  * This function determines the parity of an integer.
721  * \retval 0 if x has an even number of set bits.
722  * \retval 1 if x has an odd number of set bits.
723  */
724 # define parity(x) VLC_INT_GENERIC(vlc_parity, x)
725 
726 /**
727  * Bit weight / population count
728  *
729  * This function counts the number of non-zero bits in an integer.
730  *
731  * \return The count of non-zero bits.
732  */
733 # define vlc_popcount(x) \
734  _Generic((x), \
735  signed char: vlc_popcount((unsigned char)(x)), \
736  signed short: vlc_popcount((unsigned short)(x)), \
737  default: VLC_INT_GENERIC(vlc_popcount ,x))
738 #else
739 VLC_USED static inline int vlc_popcount(unsigned char x)
740 {
741  return vlc_popcount((unsigned)x);
742 }
743 
744 VLC_USED static inline int vlc_popcount(unsigned short x)
745 {
746  return vlc_popcount((unsigned)x);
747 }
748 
749 VLC_USED static inline int vlc_popcount(unsigned long x)
750 {
751  return vlc_popcountl(x);
752 }
753 
754 VLC_USED static inline int vlc_popcount(unsigned long long x)
755 {
756  return vlc_popcountll(x);
757 }
758 #endif
759 
760 /** Byte swap (16 bits) */
761 VLC_USED
762 static inline uint16_t vlc_bswap16(uint16_t x)
763 {
764  return (x << 8) | (x >> 8);
765 }
766 
767 /** Byte swap (32 bits) */
768 VLC_USED
769 static inline uint32_t vlc_bswap32(uint32_t x)
770 {
771 #if defined (__GNUC__) || defined(__clang__)
772  return __builtin_bswap32 (x);
773 #else
774  return ((x & 0x000000FF) << 24)
775  | ((x & 0x0000FF00) << 8)
776  | ((x & 0x00FF0000) >> 8)
777  | ((x & 0xFF000000) >> 24);
778 #endif
779 }
780 
781 /** Byte swap (64 bits) */
782 VLC_USED
783 static inline uint64_t vlc_bswap64(uint64_t x)
784 {
785 #if defined (__GNUC__) || defined(__clang__)
786  return __builtin_bswap64 (x);
787 #elif !defined (__cplusplus)
788  return ((x & 0x00000000000000FF) << 56)
789  | ((x & 0x000000000000FF00) << 40)
790  | ((x & 0x0000000000FF0000) << 24)
791  | ((x & 0x00000000FF000000) << 8)
792  | ((x & 0x000000FF00000000) >> 8)
793  | ((x & 0x0000FF0000000000) >> 24)
794  | ((x & 0x00FF000000000000) >> 40)
795  | ((x & 0xFF00000000000000) >> 56);
796 #else
797  return ((x & 0x00000000000000FFULL) << 56)
798  | ((x & 0x000000000000FF00ULL) << 40)
799  | ((x & 0x0000000000FF0000ULL) << 24)
800  | ((x & 0x00000000FF000000ULL) << 8)
801  | ((x & 0x000000FF00000000ULL) >> 8)
802  | ((x & 0x0000FF0000000000ULL) >> 24)
803  | ((x & 0x00FF000000000000ULL) >> 40)
804  | ((x & 0xFF00000000000000ULL) >> 56);
805 #endif
806 }
807 /** @} */
808 
809 /**
810  * \defgroup overflow Overflowing arithmetic
811  * @{
812  */
813 static inline bool uadd_overflow(unsigned a, unsigned b, unsigned *res)
814 {
815 #if VLC_GCC_VERSION(5,0) || defined(__clang__)
816  return __builtin_uadd_overflow(a, b, res);
817 #else
818  *res = a + b;
819  return (a + b) < a;
820 #endif
821 }
822 
823 static inline bool uaddl_overflow(unsigned long a, unsigned long b,
824  unsigned long *res)
825 {
826 #if VLC_GCC_VERSION(5,0) || defined(__clang__)
827  return __builtin_uaddl_overflow(a, b, res);
828 #else
829  *res = a + b;
830  return (a + b) < a;
831 #endif
832 }
833 
834 static inline bool uaddll_overflow(unsigned long long a, unsigned long long b,
835  unsigned long long *res)
836 {
837 #if VLC_GCC_VERSION(5,0) || defined(__clang__)
838  return __builtin_uaddll_overflow(a, b, res);
839 #else
840  *res = a + b;
841  return (a + b) < a;
842 #endif
843 }
844 
845 #ifndef __cplusplus
846 /**
847  * Overflowing addition
848  *
849  * Converts \p a and \p b to the type of \p *r.
850  * Then computes the sum of both conversions while checking for overflow.
851  * Finally stores the result in \p *r.
852  *
853  * \param a an integer
854  * \param b an integer
855  * \param r a pointer to an integer [OUT]
856  * \retval false The sum did not overflow.
857  * \retval true The sum overflowed.
858  */
859 # define add_overflow(a,b,r) \
860  _Generic(*(r), \
861  unsigned: uadd_overflow(a, b, (unsigned *)(r)), \
862  unsigned long: uaddl_overflow(a, b, (unsigned long *)(r)), \
863  unsigned long long: uaddll_overflow(a, b, (unsigned long long *)(r)))
864 #else
865 static inline bool add_overflow(unsigned a, unsigned b, unsigned *res)
866 {
867  return uadd_overflow(a, b, res);
868 }
869 
870 static inline bool add_overflow(unsigned long a, unsigned long b,
871  unsigned long *res)
872 {
873  return uaddl_overflow(a, b, res);
874 }
875 
876 static inline bool add_overflow(unsigned long long a, unsigned long long b,
877  unsigned long long *res)
878 {
879  return uaddll_overflow(a, b, res);
880 }
881 #endif
882 
883 #if !(VLC_GCC_VERSION(5,0) || defined(__clang__))
884 # include <limits.h>
885 #endif
886 
887 static inline bool umul_overflow(unsigned a, unsigned b, unsigned *res)
888 {
889 #if VLC_GCC_VERSION(5,0) || defined(__clang__)
890  return __builtin_umul_overflow(a, b, res);
891 #else
892  *res = a * b;
893  return b > 0 && a > (UINT_MAX / b);
894 #endif
895 }
896 
897 static inline bool umull_overflow(unsigned long a, unsigned long b,
898  unsigned long *res)
899 {
900 #if VLC_GCC_VERSION(5,0) || defined(__clang__)
901  return __builtin_umull_overflow(a, b, res);
902 #else
903  *res = a * b;
904  return b > 0 && a > (ULONG_MAX / b);
905 #endif
906 }
907 
908 static inline bool umulll_overflow(unsigned long long a, unsigned long long b,
909  unsigned long long *res)
910 {
911 #if VLC_GCC_VERSION(5,0) || defined(__clang__)
912  return __builtin_umulll_overflow(a, b, res);
913 #else
914  *res = a * b;
915  return b > 0 && a > (ULLONG_MAX / b);
916 #endif
917 }
918 
919 #ifndef __cplusplus
920 /**
921  * Overflowing multiplication
922  *
923  * Converts \p a and \p b to the type of \p *r.
924  * Then computes the product of both conversions while checking for overflow.
925  * Finally stores the result in \p *r.
926  *
927  * \param a an integer
928  * \param b an integer
929  * \param r a pointer to an integer [OUT]
930  * \retval false The product did not overflow.
931  * \retval true The product overflowed.
932  */
933 #define mul_overflow(a,b,r) \
934  _Generic(*(r), \
935  unsigned: umul_overflow(a, b, (unsigned *)(r)), \
936  unsigned long: umull_overflow(a, b, (unsigned long *)(r)), \
937  unsigned long long: umulll_overflow(a, b, (unsigned long long *)(r)))
938 #else
939 static inline bool mul_overflow(unsigned a, unsigned b, unsigned *res)
940 {
941  return umul_overflow(a, b, res);
942 }
943 
944 static inline bool mul_overflow(unsigned long a, unsigned long b,
945  unsigned long *res)
946 {
947  return umull_overflow(a, b, res);
948 }
949 
950 static inline bool mul_overflow(unsigned long long a, unsigned long long b,
951  unsigned long long *res)
952 {
953  return umulll_overflow(a, b, res);
954 }
955 #endif
956 /** @} */
957 /** @} */
959 /* Free and set set the variable to NULL */
960 #define FREENULL(a) do { free( a ); a = NULL; } while(0)
961 
962 #define EMPTY_STR(str) (!str || !*str)
963 
964 #include <vlc_arrays.h>
965 
966 /* MSB (big endian)/LSB (little endian) conversions - network order is always
967  * MSB, and should be used for both network communications and files. */
968 
969 #ifdef WORDS_BIGENDIAN
970 # define hton16(i) ((uint16_t)(i))
971 # define hton32(i) ((uint32_t)(i))
972 # define hton64(i) ((uint64_t)(i))
973 #else
974 # define hton16(i) vlc_bswap16(i)
975 # define hton32(i) vlc_bswap32(i)
976 # define hton64(i) vlc_bswap64(i)
977 #endif
978 #define ntoh16(i) hton16(i)
979 #define ntoh32(i) hton32(i)
980 #define ntoh64(i) hton64(i)
981 
982 /** Reads 16 bits in network byte order */
983 VLC_USED
984 static inline uint16_t U16_AT (const void *p)
985 {
986  uint16_t x;
987 
988  memcpy (&x, p, sizeof (x));
989  return ntoh16 (x);
990 }
991 
992 /** Reads 32 bits in network byte order */
993 VLC_USED
994 static inline uint32_t U32_AT (const void *p)
995 {
996  uint32_t x;
997 
998  memcpy (&x, p, sizeof (x));
999  return ntoh32 (x);
1000 }
1001 
1002 /** Reads 64 bits in network byte order */
1003 VLC_USED
1004 static inline uint64_t U64_AT (const void *p)
1005 {
1006  uint64_t x;
1007 
1008  memcpy (&x, p, sizeof (x));
1009  return ntoh64 (x);
1012 #define GetWBE(p) U16_AT(p)
1013 #define GetDWBE(p) U32_AT(p)
1014 #define GetQWBE(p) U64_AT(p)
1015 
1016 /** Reads 16 bits in little-endian order */
1017 VLC_USED
1018 static inline uint16_t GetWLE (const void *p)
1019 {
1020  uint16_t x;
1021 
1022  memcpy (&x, p, sizeof (x));
1023 #ifdef WORDS_BIGENDIAN
1024  x = vlc_bswap16 (x);
1025 #endif
1026  return x;
1027 }
1028 
1029 /** Reads 32 bits in little-endian order */
1030 VLC_USED
1031 static inline uint32_t GetDWLE (const void *p)
1032 {
1033  uint32_t x;
1034 
1035  memcpy (&x, p, sizeof (x));
1036 #ifdef WORDS_BIGENDIAN
1037  x = vlc_bswap32 (x);
1038 #endif
1039  return x;
1040 }
1041 
1042 /** Reads 64 bits in little-endian order */
1043 VLC_USED
1044 static inline uint64_t GetQWLE (const void *p)
1045 {
1046  uint64_t x;
1047 
1048  memcpy (&x, p, sizeof (x));
1049 #ifdef WORDS_BIGENDIAN
1050  x = vlc_bswap64 (x);
1051 #endif
1052  return x;
1053 }
1055 /** Writes 16 bits in network byte order */
1056 static inline void SetWBE (void *p, uint16_t w)
1057 {
1058  w = hton16 (w);
1059  memcpy (p, &w, sizeof (w));
1060 }
1062 /** Writes 32 bits in network byte order */
1063 static inline void SetDWBE (void *p, uint32_t dw)
1064 {
1065  dw = hton32 (dw);
1066  memcpy (p, &dw, sizeof (dw));
1067 }
1069 /** Writes 64 bits in network byte order */
1070 static inline void SetQWBE (void *p, uint64_t qw)
1071 {
1072  qw = hton64 (qw);
1073  memcpy (p, &qw, sizeof (qw));
1074 }
1076 /** Writes 16 bits in little endian order */
1077 static inline void SetWLE (void *p, uint16_t w)
1078 {
1079 #ifdef WORDS_BIGENDIAN
1080  w = vlc_bswap16 (w);
1081 #endif
1082  memcpy (p, &w, sizeof (w));
1083 }
1085 /** Writes 32 bits in little endian order */
1086 static inline void SetDWLE (void *p, uint32_t dw)
1087 {
1088 #ifdef WORDS_BIGENDIAN
1089  dw = vlc_bswap32 (dw);
1090 #endif
1091  memcpy (p, &dw, sizeof (dw));
1092 }
1094 /** Writes 64 bits in little endian order */
1095 static inline void SetQWLE (void *p, uint64_t qw)
1096 {
1097 #ifdef WORDS_BIGENDIAN
1098  qw = vlc_bswap64 (qw);
1099 #endif
1100  memcpy (p, &qw, sizeof (qw));
1101 }
1103 /* */
1104 #define VLC_UNUSED(x) (void)(x)
1105 
1106 /* Stuff defined in src/extras/libc.c */
1107 
1108 #if defined(_WIN32)
1109 /* several type definitions */
1110 # if defined( __MINGW32__ )
1111 # if !defined( _OFF_T_ )
1112  typedef long long _off_t;
1113  typedef _off_t off_t;
1114 # define _OFF_T_
1115 # else
1116 # ifdef off_t
1117 # undef off_t
1118 # endif
1119 # define off_t long long
1120 # endif
1121 # endif
1122 
1123 # ifndef O_NONBLOCK
1124 # define O_NONBLOCK 0
1125 # endif
1126 
1127 /* the mingw32 swab() and win32 _swab() prototypes expect a char* instead of a
1128  const void* */
1129 # define swab(a,b,c) swab((char*) (a), (char*) (b), (c))
1130 
1131 #endif /* _WIN32 */
1132 
1133 typedef struct {
1134  unsigned num, den;
1135 } vlc_rational_t;
1136 
1137 VLC_API bool vlc_ureduce( unsigned *, unsigned *, uint64_t, uint64_t, uint64_t );
1138 
1139 #define container_of(ptr, type, member) \
1140  ((type *)(((char *)(ptr)) - offsetof(type, member)))
1142 VLC_USED VLC_MALLOC
1143 static inline void *vlc_alloc(size_t count, size_t size)
1144 {
1145  return mul_overflow(count, size, &size) ? NULL : malloc(size);
1146 }
1148 VLC_USED
1149 static inline void *vlc_reallocarray(void *ptr, size_t count, size_t size)
1150 {
1151  return mul_overflow(count, size, &size) ? NULL : realloc(ptr, size);
1152 }
1153 
1154 /*****************************************************************************
1155  * I18n stuff
1156  *****************************************************************************/
1157 VLC_API const char *vlc_gettext(const char *msgid) VLC_FORMAT_ARG(1);
1158 VLC_API const char *vlc_ngettext(const char *s, const char *p, unsigned long n)
1159 VLC_FORMAT_ARG(1) VLC_FORMAT_ARG(2);
1160 
1161 #define vlc_pgettext( ctx, id ) \
1162  vlc_pgettext_aux( ctx "\004" id, id )
1164 VLC_FORMAT_ARG(2)
1165 static inline const char *vlc_pgettext_aux( const char *ctx, const char *id )
1166 {
1167  const char *tr = vlc_gettext( ctx );
1168  return (tr == ctx) ? id : tr;
1169 }
1170 
1171 /*****************************************************************************
1172  * Loosy memory allocation functions. Do not use in new code.
1173  *****************************************************************************/
1174 static inline void *xmalloc(size_t len)
1175 {
1176  void *ptr = malloc(len);
1177  if (unlikely(ptr == NULL && len > 0))
1178  abort();
1179  return ptr;
1181 
1182 static inline void *xrealloc(void *ptr, size_t len)
1183 {
1184  void *nptr = realloc(ptr, len);
1185  if (unlikely(nptr == NULL && len > 0))
1186  abort();
1187  return nptr;
1189 
1190 static inline char *xstrdup (const char *str)
1191 {
1192  char *ptr = strdup (str);
1193  if (unlikely(ptr == NULL))
1194  abort ();
1195  return ptr;
1196 }
1197 
1198 /*****************************************************************************
1199  * libvlc features
1200  *****************************************************************************/
1201 VLC_API const char * VLC_CompileBy( void ) VLC_USED;
1202 VLC_API const char * VLC_CompileHost( void ) VLC_USED;
1203 VLC_API const char * VLC_Compiler( void ) VLC_USED;
1204 
1205 /*****************************************************************************
1206  * Additional vlc stuff
1207  *****************************************************************************/
1208 #include "vlc_messages.h"
1209 #include "vlc_objects.h"
1210 #include "vlc_variables.h"
1211 #include "vlc_configuration.h"
1212 
1213 #if defined( _WIN32 ) || defined( __OS2__ )
1214 # define DIR_SEP_CHAR '\\'
1215 # define DIR_SEP "\\"
1216 # define PATH_SEP_CHAR ';'
1217 # define PATH_SEP ";"
1218 #else
1219 # define DIR_SEP_CHAR '/'
1220 # define DIR_SEP "/"
1221 # define PATH_SEP_CHAR ':'
1222 # define PATH_SEP ":"
1223 #endif
1224 
1225 #define LICENSE_MSG \
1226  _("This program comes with NO WARRANTY, to the extent permitted by " \
1227  "law.\nYou may redistribute it under the terms of the GNU General " \
1228  "Public License;\nsee the file named COPYING for details.\n" \
1229  "Written by the VideoLAN team; see the AUTHORS file.\n")
1230 
1231 #endif /* !VLC_COMMON_H */
Definition: vlc_input.h:160
static int64_t GCD(int64_t a, int64_t b)
Greatest common divisor.
Definition: vlc_common.h:570
#define add_overflow(a, b, r)
Overflowing addition.
Definition: vlc_common.h:857
#define hton32(i)
Definition: vlc_common.h:973
const char * VLC_CompileHost(void)
Definition: version.c:44
#define clz(x)
Count leading zeroes.
Definition: vlc_common.h:694
static bool umulll_overflow(unsigned long long a, unsigned long long b, unsigned long long *res)
Definition: vlc_common.h:906
Definition: vlc_addons.h:72
Video picture.
Definition: vlc_picture.h:127
static int vlc_popcount_generic(unsigned long long x)
Definition: vlc_common.h:649
Definition: vlc_vlm.h:176
char * strdup(const char *)
struct vod_media_t vod_media_t
Definition: vlc_common.h:438
struct playlist_item_t playlist_item_t
Definition: vlc_common.h:345
Describes an input and is used to spawn input_thread_t objects.
Definition: vlc_input_item.h:77
Internal state for block queues.
Definition: fifo.c:38
#define ntoh16(i)
Definition: vlc_common.h:976
Video subtitle region.
Definition: vlc_subpicture.h:59
static int vlc_clzl(unsigned long x)
Definition: vlc_common.h:620
#define parity(x)
Parity.
Definition: vlc_common.h:722
static void * xrealloc(void *ptr, size_t len)
Definition: vlc_common.h:1180
static uint64_t GetQWLE(const void *p)
Reads 64 bits in little-endian order.
Definition: vlc_common.h:1042
Definition: vlc_configuration.h:53
static int vlc_popcountl(unsigned long x)
Definition: vlc_common.h:667
static void SetQWBE(void *p, uint64_t qw)
Writes 64 bits in network byte order.
Definition: vlc_common.h:1068
Definition: vlc_input_item.h:191
Configuration item.
Definition: vlc_configuration.h:76
static const char * vlc_pgettext_aux(const char *ctx, const char *id)
Definition: vlc_common.h:1163
#define VLC_FORMAT_ARG(x)
Format string translation function annotation.
Definition: vlc_common.h:152
static int vlc_ctz_generic(unsigned long long x)
Definition: vlc_common.h:630
Video subtitle.
Definition: vlc_subpicture.h:166
VLC object variables and callbacks interface.
Definition: vlc_objects.h:115
static uint64_t U64_AT(const void *p)
Reads 64 bits in network byte order.
Definition: vlc_common.h:1002
static int vlc_popcountll(unsigned long long x)
Definition: vlc_common.h:667
Main service discovery structure to build a SD module.
Definition: vlc_services_discovery.h:59
const char * vlc_ngettext(const char *s, const char *p, unsigned long n)
Definition: textdomain.c:88
Definition: vlc_sout.h:156
static int vlc_clz(unsigned x)
Definition: vlc_common.h:625
Definition: vlc_image.h:39
Internal module descriptor.
Definition: modules.h:75
static char * xstrdup(const char *str)
Definition: vlc_common.h:1188
VLC value structure.
Definition: vlc_common.h:455
static uint16_t vlc_bswap16(uint16_t x)
Byte swap (16 bits)
Definition: vlc_common.h:760
Definition: vlc_md5.h:33
static bool uaddl_overflow(unsigned long a, unsigned long b, unsigned long *res)
Definition: vlc_common.h:821
This file describes the programming interface for the configuration module.
Definition: renderer_discovery.c:34
Timestamps without long-term rounding errors.
Definition: vlc_tick.h:226
bool vlc_ureduce(unsigned *, unsigned *, uint64_t, uint64_t, uint64_t)
This file defines of values used in interface, vout, aout and vlc core functions. ...
audio format description
Definition: vlc_es.h:81
static void SetDWLE(void *p, uint32_t dw)
Writes 32 bits in little endian order.
Definition: vlc_common.h:1084
static int vlc_parity_generic(unsigned long long x)
Definition: vlc_common.h:642
audio_format_t audio_sample_format_t
Definition: vlc_common.h:379
Definition: vlc_es.h:43
Definition: vlc_input.h:52
static uint16_t GetWLE(const void *p)
Reads 16 bits in little-endian order.
Definition: vlc_common.h:1016
const char * vlc_gettext(const char *msgid)
In-tree plugins share their gettext domain with LibVLC.
Definition: textdomain.c:79
const char * VLC_CompileBy(void)
Definition: version.c:43
Definition: fourcc_gen.c:34
static void SetWBE(void *p, uint16_t w)
Writes 16 bits in network byte order.
Definition: vlc_common.h:1054
Definition: vlc_configuration.h:331
Definition: vlc_es_out.h:143
#define VLC_INT_FUNC(basename)
Definition: vlc_common.h:594
#define VLC_MALLOC
Heap allocated result function annotation.
Definition: vlc_common.h:167
Stream output access_output.
Definition: vlc_sout.h:69
#define VLC_USED
Used result function annotation.
Definition: vlc_common.h:185
Definition: stream_output.h:35
The update object.
Definition: update.h:158
Definition: vlc_url.h:145
static void SetDWBE(void *p, uint32_t dw)
Writes 32 bits in network byte order.
Definition: vlc_common.h:1061
Viewpoints.
Definition: vlc_viewpoint.h:41
#define hton16(i)
Definition: vlc_common.h:972
static uint32_t GetDWLE(const void *p)
Reads 32 bits in little-endian order.
Definition: vlc_common.h:1029
subtitles format description
Definition: vlc_es.h:550
Definition: vlc_es.h:617
Common VLC object defintions.
static bool umull_overflow(unsigned long a, unsigned long b, unsigned long *res)
Definition: vlc_common.h:895
static uint16_t U16_AT(const void *p)
Reads 16 bits in network byte order.
Definition: vlc_common.h:982
#define unlikely(p)
Predicted false condition.
Definition: vlc_common.h:223
Definition: es_out.c:103
size_t count
Definition: core.c:402
Video output thread descriptor.
Definition: vlc_vout.h:60
Definition: vlc_input_item.h:53
float f_float
Definition: vlc_common.h:459
video format description
Definition: vlc_es.h:349
int32_t y
Definition: vlc_common.h:462
#define hton64(i)
Definition: vlc_common.h:974
int(* vlc_list_callback_t)(vlc_object_t *, char const *, int, vlc_value_t *, void *)
Definition: vlc_common.h:500
struct playlist_t playlist_t
Definition: vlc_common.h:344
Opaque structure representing an ES (Elementary Stream) track.
Definition: es_out.c:92
static bool uadd_overflow(unsigned a, unsigned b, unsigned *res)
Definition: vlc_common.h:811
bool b_bool
Definition: vlc_common.h:458
Definition: vlc_sout.h:192
video_format_t video_frame_format_t
Definition: vlc_common.h:385
static void SetQWLE(void *p, uint64_t qw)
Writes 64 bits in little endian order.
Definition: vlc_common.h:1093
Definition: vlm_internal.h:77
const char * VLC_Compiler(void)
Definition: version.c:45
Definition: vlc_input_item.h:44
#define ntoh64(i)
Definition: vlc_common.h:978
Audio output object.
Definition: vlc_aout.h:140
static uint32_t vlc_bswap32(uint32_t x)
Byte swap (32 bits)
Definition: vlc_common.h:767
stream_t definition
Definition: vlc_stream.h:46
Muxer structure.
Definition: vlc_sout.h:117
Subpicture unit descriptor.
Definition: vlc_spu.h:47
#define ctz(x)
Count trailing zeroes.
Definition: vlc_common.h:713
Definition: vlc_codec.h:103
static int vlc_clzll(unsigned long long x)
Definition: vlc_common.h:608
Structure describing a filter.
Definition: vlc_filter.h:72
static uint64_t vlc_bswap64(uint64_t x)
Byte swap (64 bits)
Definition: vlc_common.h:781
Definition: meta.c:39
Definition: vlc_renderer_discovery.h:165
static size_t vlc_align(size_t v, size_t align)
Make integer v a multiple of align.
Definition: vlc_common.h:557
uint32_t vlc_fourcc_t
The vlc_fourcc_t type.
Definition: vlc_common.h:303
int(* vlc_callback_t)(vlc_object_t *, char const *, vlc_value_t, vlc_value_t, void *)
Definition: vlc_common.h:491
#define vlc_popcount(x)
Bit weight / population count.
Definition: vlc_common.h:731
Thread primitive declarations.
static void * vlc_alloc(size_t count, size_t size)
Definition: vlc_common.h:1141
#define ntoh32(i)
Definition: vlc_common.h:977
Definition: vlc_xml.h:37
Stream output instance (FIXME: should be private to src/ to avoid invalid unsynchronized access) ...
Definition: vlc_sout.h:48
#define VLC_API
Exported API call annotation.
Definition: vlc_common.h:291
Definition: vlc_block.h:117
Logging functions.
static uint32_t U32_AT(const void *p)
Reads 32 bits in network byte order.
Definition: vlc_common.h:992
int64_t i_int
Definition: vlc_common.h:457
Definition: vlc_xml.h:66
static void * vlc_reallocarray(void *ptr, size_t count, size_t size)
Definition: vlc_common.h:1147
void * p_address
Definition: vlc_common.h:461
Definition: vlc_input_item.h:504
This file defines functions, structures and macros for handling arrays in vlc.
#define mul_overflow(a, b, r)
Overflowing multiplication.
Definition: vlc_common.h:931
static uint8_t clip_uint8_vlc(int32_t a)
Definition: vlc_common.h:583
static bool umul_overflow(unsigned a, unsigned b, unsigned *res)
Definition: vlc_common.h:885
static void vlc_fourcc_to_char(vlc_fourcc_t fcc, char *psz_fourcc)
Translate a vlc_fourcc into its string representation.
Definition: vlc_common.h:328
struct vod_t vod_t
Definition: vlc_common.h:437
VLC object common members.
Definition: vlc_objects.h:43
char * psz_string
Definition: vlc_common.h:460
static void * xmalloc(size_t len)
Definition: vlc_common.h:1172
static bool uaddll_overflow(unsigned long long a, unsigned long long b, unsigned long long *res)
Definition: vlc_common.h:832
Definition: vlc_codec.h:244
Definition: input_internal.h:373
static void SetWLE(void *p, uint16_t w)
Writes 16 bits in little endian order.
Definition: vlc_common.h:1075
Definition: vlc_iso_lang.h:30
Definition: sap.c:48