xine-lib: xine-lib-1.2.13/src/xine-engine/xine_private.h Source File

xine-lib 1.2.13-20230125hg15249

xine_private.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2000-2022 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
29#ifndef XINE_PRIVATE_H__
30#define XINE_PRIVATE_H__
31
32#ifndef XINE_LIBRARY_COMPILE
33# error xine_private.h is for libxine private use only!
34#endif
35#if defined(HAVE_CONFIG_H) && !defined(__XINE_LIB_CONFIG_H__)
36# error config.h not included
37#endif
38
39#include <xine/xine_internal.h>
40
41#if SUPPORT_ATTRIBUTE_VISIBILITY_INTERNAL
42# define INTERNAL __attribute__((visibility("internal")))
43#elif SUPPORT_ATTRIBUTE_VISIBILITY_DEFAULT
44# define INTERNAL __attribute__((__visibility__("default")))
45#else
46# define INTERNAL
47#endif
48
49#if defined (__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6 ))
50# define XINE_DISABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
51# define XINE_ENABLE_DEPRECATION_WARNINGS _Pragma("GCC diagnostic warning \"-Wdeprecated-declarations\"")
52#else
53# define XINE_DISABLE_DEPRECATION_WARNINGS
54# define XINE_ENABLE_DEPRECATION_WARNINGS
55#endif
56
57#ifdef __cplusplus
58# define EXTERN_C_START extern "C" {
59# define EXTERN_C_STOP }
60#else
61# define EXTERN_C_START
62# define EXTERN_C_STOP
63#endif
64
65 EXTERN_C_START
66
67/* NOTE: casting char * to int * requires a higher alignment (1 -> 4)
68 * on some machines. on x86, this merely gives a little speedup.
69 * gcc -Wcast-align only warns in the former case.
70 * clang seems to warn always, even if the code clearly shows that
71 * the address _is_ aligned. lets try another kind of hack. */
72 static inline uint32_t xine_find_byte (const char *s, uint32_t byte) {
73 const uint32_t eor = ~((byte << 24) | (byte << 16) | (byte << 8) | byte);
74 const union {
75 const char *b;
76 const uint32_t *u;
77 } u = { s - ((uintptr_t)s & 3) };
78 const uint32_t *p = u.u;
79 static const union {
80 uint8_t b[4];
81 uint32_t v;
82 } mask[4] = {
83 {{0xff, 0xff, 0xff, 0xff}},
84 {{0x00, 0xff, 0xff, 0xff}},
85 {{0x00, 0x00, 0xff, 0xff}},
86 {{0x00, 0x00, 0x00, 0xff}},
87 };
88 static const uint8_t rest[32] = {
89 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, /* big wndian */
90 0, 4, 3, 4, 2, 4, 3, 4, 1, 4, 3, 4, 2, 4, 3, 4 /* little endian */
91 };
92 const union {
93 uint32_t v;
94 uint8_t b[4];
95 } endian = {16};
96 uint32_t w = (*p++ ^ eor) & mask[(uintptr_t)s & 3].v;
97 while (1) {
98 w = w & 0x80808080 & ((w & 0x7f7f7f7f) + 0x01010101);
99 if (w)
100 break;
101 w = *p++ ^ eor;
102 }
103 /* bits 31, 23, 15, 7 -> 3, 2, 1, 0 */
104 w = (w * 0x00204081) & 0xffffffff;
105 w >>= 28;
106 return ((const char *)p - s) - rest[endian.b[0] + w];
107}
108
109/* HAVE_ATOMIC_VARS: 0 = none, 1 = stdatomic.h, 2 = __atomic_*, 3 = __sync_* */
110#if (HAVE_ATOMIC_VARS > 0)
111# if (HAVE_ATOMIC_VARS == 1)
112# include <stdatomic.h>
113# define XINE_ATINT_T atomic_int
114# define XINE_ATINIT(xatfa_refs,xatfa_n) atomic_init (&(xatfa_refs), (xatfa_n))
115# define XINE_ATFA(xatfa_refs,xatfa_n) atomic_fetch_add_explicit (&(xatfa_refs), (xatfa_n), memory_order_acq_rel)
116# define XINE_ATGET(xatfa_refs) atomic_load_explicit (&(xatfa_refs), memory_order_acquire)
117# elif (HAVE_ATOMIC_VARS == 2)
118# define XINE_ATINT_T int
119# define XINE_ATINIT(xatfa_refs,xatfa_n) __atomic_store_n (&(xatfa_refs), (xatfa_n), __ATOMIC_RELAXED)
120# define XINE_ATFA(xatfa_refs,xatfa_n) __atomic_fetch_add (&(xatfa_refs), (xatfa_n), __ATOMIC_ACQ_REL)
121# define XINE_ATGET(xatfa_refs) __atomic_load_n (&(xatfa_refs), __ATOMIC_ACQUIRE)
122# else /* HAVE_ATOMIC_VARS == 3 */
123# define XINE_ATINT_T volatile int
124# define XINE_ATINIT(xatfa_refs,xatfa_n) xatfa_refs = xatfa_n
125# define XINE_ATFA(xatfa_refs,xatfa_n) __sync_fetch_and_add (&(xatfa_refs), (xatfa_n))
126# if defined (ARCH_X86)
127# define XINE_ATGET(xatfa_refs) (xatfa_refs)
128# else
129# define XINE_ATGET(xatfa_refs) __sync_fetch_and_add (&(xatfa_refs), 0)
130# endif
131# endif
132
133typedef struct {
134 XINE_ATINT_T refs;
135 void (*destructor) (void *object);
136 void *object;
137} xine_refs_t;
138
139static inline void xine_refs_init (xine_refs_t *refs,
140 void (*destructor) (void *object), void *object) {
141 refs->destructor = destructor;
142 refs->object = object;
143 XINE_ATINIT (refs->refs, 1);
144}
145
146static inline int xine_refs_add (xine_refs_t *refs, int n) {
147 return XINE_ATFA (refs->refs, n) + n;
148}
149
150static inline int xine_refs_sub (xine_refs_t *refs, int n) {
151 int v = XINE_ATFA (refs->refs, -n) - n;
152 if (v == 0)
153 refs->destructor (refs->object);
154 return v;
155}
156
157static inline int xine_refs_get (xine_refs_t *refs) {
158 return XINE_ATGET (refs->refs);
159}
160
161#else
162
163 typedef struct {
164 pthread_mutex_t mutex;
165 int refs;
166 void (*destructor) (void *object);
167 void *object;
168} xine_refs_t;
169
170 static inline void xine_refs_init (xine_refs_t *refs,
171 void (*destructor) (void *object), void *object) {
172 refs->destructor = destructor;
173 refs->object = object;
174 refs->refs = 1;
175 pthread_mutex_init (&refs->mutex, NULL);
176}
177
178 static inline int xine_refs_add (xine_refs_t *refs, int n) {
179 int v;
180 pthread_mutex_lock (&refs->mutex);
181 refs->refs += n;
182 v = refs->refs;
183 pthread_mutex_unlock (&refs->mutex);
184 return v;
185}
186
187 static inline int xine_refs_sub (xine_refs_t *refs, int n) {
188 int v;
189 pthread_mutex_lock (&refs->mutex);
190 refs->refs -= n;
191 v = refs->refs;
192 pthread_mutex_unlock (&refs->mutex);
193 if (v == 0) {
194 pthread_mutex_destroy (&refs->mutex);
195 refs->destructor (refs->object);
196 }
197 return v;
198}
199
200 static inline int xine_refs_get (xine_refs_t *refs) {
201 int v;
202 pthread_mutex_lock (&refs->mutex);
203 v = refs->refs;
204 pthread_mutex_unlock (&refs->mutex);
205 return v;
206}
207
208#endif
209
224int _x_scan_plugins (xine_t *this) INTERNAL;
225
231void _x_dispose_plugins (xine_t *this) INTERNAL;
232
233void _x_free_video_driver (xine_t *xine, vo_driver_t **driver) INTERNAL;
234void _x_free_audio_driver (xine_t *xine, ao_driver_t **driver) INTERNAL;
235
237
241 demux_plugin_t *_x_find_demux_plugin_last_probe(xine_stream_t *stream, const char *last_demux_name, input_plugin_t *input) INTERNAL;
242 input_plugin_t *_x_rip_plugin_get_instance (xine_stream_t *stream, const char *filename) INTERNAL;
243 input_plugin_t *_x_cache_plugin_get_instance (xine_stream_t *stream) INTERNAL;
245
247
252int _x_video_decoder_init (xine_stream_t *stream) INTERNAL;
253void _x_video_decoder_shutdown (xine_stream_t *stream) INTERNAL;
254
255int _x_audio_decoder_init (xine_stream_t *stream) INTERNAL;
256void _x_audio_decoder_shutdown (xine_stream_t *stream) INTERNAL;
258
262void xine_probe_fast_memcpy(xine_t *xine) INTERNAL;
263
267int _x_set_file_close_on_exec(int fd) INTERNAL;
268
269int _x_set_socket_close_on_exec(int s) INTERNAL;
270
271
272#if defined(HAVE_PTHREAD_RWLOCK)
273# define xine_rwlock_t pthread_rwlock_t
274# define xine_rwlock_init_default(l) pthread_rwlock_init (l, NULL)
275# define xine_rwlock_rdlock(l) pthread_rwlock_rdlock (l)
276# define xine_rwlock_tryrdlock(l) pthread_rwlock_tryrdlock (l)
277# define xine_rwlock_timedrdlock(l,t) pthread_rwlock_timedrdlock (l, t)
278# define xine_rwlock_wrlock(l) pthread_rwlock_wrlock (l)
279# define xine_rwlock_trywrlock(l) pthread_rwlock_trywrlock (l)
280# define xine_rwlock_timedwrlock(l,t) pthread_rwlock_timedwrlock (l, t)
281# define xine_rwlock_unlock(l) pthread_rwlock_unlock (l)
282# define xine_rwlock_destroy(l) pthread_rwlock_destroy (l)
283#else
284# define xine_rwlock_t pthread_mutex_t
285# define xine_rwlock_init_default(l) pthread_mutex_init (l, NULL)
286# define xine_rwlock_rdlock(l) pthread_mutex_lock (l)
287# define xine_rwlock_tryrdlock(l) pthread_mutex_trylock (l)
288# define xine_rwlock_timedrdlock(l,t) pthread_mutex_timedlock (l, t)
289# define xine_rwlock_wrlock(l) pthread_mutex_lock (l)
290# define xine_rwlock_trywrlock(l) pthread_mutex_trylock (l)
291# define xine_rwlock_timedwrlock(l,t) pthread_mutex_timedlock (l, t)
292# define xine_rwlock_unlock(l) pthread_mutex_unlock (l)
293# define xine_rwlock_destroy(l) pthread_mutex_destroy (l)
294#endif
295
296#ifdef HAVE_POSIX_TIMERS
297# define xine_gettime(t) clock_gettime (CLOCK_REALTIME, t)
298#else
299 static inline int xine_gettime (struct timespec *ts) {
300 struct timeval tv;
301 int r;
302 r = gettimeofday (&tv, NULL);
303 if (!r) {
304 ts->tv_sec = tv.tv_sec;
305 ts->tv_nsec = tv.tv_usec * 1000;
306 }
307 return r;
308}
309#endif
310
311#if (defined(__GNUC__) || defined(__clang__)) && defined(ARCH_X86)
312static inline uint32_t xine_uint_mul_div (uint32_t num, uint32_t mul, uint32_t den) {
313 register uint32_t eax = num, edx;
314 /* if result > 0xffffffff, return 0xffffffff without math exception. */
315 __asm__ __volatile__ (
316 "mull\t%2\n"
317 "\tmovl\t%3, %2\n"
318 "\tshrl\t%2\n"
319 "\taddl\t%2, %0\n"
320 "\tadcl\t$0, %1\n"
321 "\tcmpl\t%1, %3\n"
322 "\tjbe\t1f\n"
323 "\tdivl\t%3\n"
324 "\tjmp\t2f\n"
325 "1:\n"
326 "\txorl\t%0, %0\n"
327 "\tnotl\t%0\n"
328 "2:\n"
329 : "=a" (eax), "=d" (edx), "=r" (mul), "=g" (den)
330 : "0" (eax), "2" (mul), "3" (den)
331 : "cc"
332 );
333 (void)mul;
334 (void)den;
335 (void)edx;
336 return eax;
337}
338#else
339 static inline uint32_t xine_uint_mul_div (uint32_t num, uint32_t mul, uint32_t den) {
340 return ((uint64_t)num * mul + (den >> 1)) / den;
341}
342#endif
343
344 static inline int32_t xine_str2int32 (const char **s) {
345 const uint8_t *p = (const uint8_t *)*s;
346 uint8_t z;
347 int32_t v;
348 do {
349 z = *p;
350 if (!z) {
351 *s = (const char *)p;
352 return 0;
353 }
354 p++;
355 z ^= '0';
356 } while ((z > 9) && (z != ('-' ^ '0')));
357 if (z == ('-' ^ '0')) {
358 v = 0;
359 while (1) {
360 z = *p++ ^ '0';
361 if (z > 9)
362 break;
363 v = 10 * v - z;
364 }
365 } else {
366 v = 0;
367 do {
368 v = 10 * v + z;
369 z = *p++ ^ '0';
370 } while (z <= 9);
371 }
372 *s = (const char *)(p - 1);
373 return v;
374}
375
376 static inline uint32_t xine_str2uint32 (const char **s) {
377 const uint8_t *p = (const uint8_t *)*s;
378 uint8_t z;
379 uint32_t v;
380 do {
381 z = *p;
382 if (!z) {
383 *s = (const char *)p;
384 return 0;
385 }
386 p++;
387 z ^= '0';
388 } while (z > 9);
389 v = 0;
390 do {
391 v = 10u * v + z;
392 z = *p++ ^ '0';
393 } while (z <= 9);
394 *s = (const char *)(p - 1);
395 return v;
396}
397
398 static inline uint64_t xine_str2uint64 (const char **s) {
399 const uint8_t *p = (const uint8_t *)*s;
400 uint8_t z;
401 uint64_t v;
402#if defined(__WORDSIZE) && (__WORDSIZE == 32)
403 uint32_t u;
404#endif
405 do {
406 z = *p;
407 if (!z) {
408 *s = (const char *)p;
409 return 0;
410 }
411 p++;
412 z ^= '0';
413 } while (z > 9);
414#if defined(__WORDSIZE) && (__WORDSIZE == 32)
415 u = 0;
416 do {
417 u = 10u * u + z;
418 z = *p++ ^ '0';
419 if (z > 9) {
420 *s = (const char *)(p - 1);
421 return u;
422 }
423 } while (!(u & 0xf0000000));
424 v = u;
425#else
426 v = 0;
427#endif
428 do {
429 v = (v << 3) + (v << 1) + z;
430 z = *p++ ^ '0';
431 } while (z <= 9);
432 *s = (const char *)(p - 1);
433 return v;
434}
435
436#define XINE_MAX_INT32_STR 13
437 static inline void xine_int32_2str (char **s, int32_t v) {
438 uint8_t b[24], *t = b + 11, *q = (uint8_t *)*s;
439 uint32_t u;
440 if (v < 0) {
441 *q++ = '-';
442 u = -v;
443 } else {
444 u = v;
445 }
446 *t = 0;
447 do {
448 *--t = u % 10u + '0';
449 u /= 10u;
450 } while (u);
451 memcpy (q, t, 12);
452 *s = (char *)(q + (b + 11 - t));
453}
454
455 static inline void xine_uint32_2str (char **s, uint32_t v) {
456 uint8_t b[24], *t = b + 11, *q = (uint8_t *)*s;
457 *t = 0;
458 do {
459 *--t = v % 10u + '0';
460 v /= 10u;
461 } while (v);
462 memcpy (q, t, 12);
463 *s = (char *)(q + (b + 11 - t));
464}
465
466#define XINE_MAX_INT64_STR 21
467 static inline void xine_uint64_2str (char **s, uint64_t v) {
468 uint8_t b[44], *t = b + 21, *q = (uint8_t *)*s;
469 *t = 0;
470 do {
471 *--t = v % 10u + '0';
472 v /= 10u;
473 } while (v);
474 memcpy (q, t, 21);
475 *s = (char *)(q + (b + 21 - t));
476}
477
478/* A little helper for integers whose size is not obvious, like off_t and time_t. */
479#define xine_uint2str(s,v) do { \
480 if (sizeof (v) == 8) \
481 xine_uint64_2str (s, v); \
482 else \
483 xine_uint32_2str (s, v); \
484} while (0)
485
486#if 1 /* XXX: Is this safe everywhere? */
487# define PTR_IN_RANGE(_ptr,_start,_size) \
488 ((uintptr_t)((uint8_t *)(_ptr) - (uint8_t *)(_start)) < (uintptr_t)(_size))
489#else
490# define PTR_IN_RANGE(_ptr,_start,_size) \
491 ((uint8_t *)(_ptr) >= (uint8_t *)(_start) && ((uint8_t *)(_ptr) < (uint8_t *)(_start) + (_size)))
492#endif
493
494 typedef struct {
495 xine_t x;
496
497 xine_ticket_t *port_ticket;
498 pthread_mutex_t log_lock;
499
500 xine_log_cb_t log_cb;
501 void *log_cb_user_data;
502
503 int flags;
504 int network_timeout;
505 enum {
506 XINE_IP_PREF_AUTO = 0,
507 XINE_IP_PREF_4,
508 XINE_IP_PREF_4_6,
509 XINE_IP_PREF_6_4
510 } ip_pref;
511
512 uint32_t join_av:1;
513
514 /* lock controlling speed change access.
515 * if we should ever introduce per stream clock and ticket,
516 * move this to xine_stream_private_t below. */
517#define SPEED_FLAG_IGNORE_CHANGE 1
518#define SPEED_FLAG_CHANGING 2
519#define SPEED_FLAG_WANT_LIVE 4
520#define SPEED_FLAG_WANT_NEW 8
521 uint32_t speed_change_flags;
522 int speed_change_new_live;
523 int speed_change_new_speed;
524 pthread_mutex_t speed_change_lock;
525 pthread_cond_t speed_change_done;
526 /* set when pauseing with port ticket granted, for XINE_PARAM_VO_SINGLE_STEP. */
527 /* special values for set_speed_internal (). now defined in xine/xine_internal.h. */
528 /* # define XINE_LIVE_PAUSE_ON 0x7ffffffd */
529 /* # define XINE_LIVE_PAUSE_OFF 0x7ffffffc */
530
531 /* share some often used (localized) text as xine_ref_string_t. */
532 struct {
533 char *decoder_pri_help;
534 } strings;
535
536 struct {
537 /* 0 ... 100% */
538 int black, color;
539 /* up 1 per config change */
540 int gen;
541 /* 0 ... 15 */
542 uint8_t tab[256 * 2];
543 } dvbsub;
544} xine_private_t;
545
546 typedef struct xine_stream_private_st {
547 xine_stream_t s;
548
549 int status;
550
551 uint32_t video_thread_created:1;
552 uint32_t audio_thread_created:1;
553 uint32_t slave_is_subtitle:1; /*< ... and will be automaticaly disposed */
554 uint32_t emergency_brake:1; /*< something went really wrong and this stream must be
555 * stopped. usually due some fatal error on output
556 * layers as they cannot call xine_stop. */
557 uint32_t early_finish_event:1; /*< do not wait fifos get empty before sending event */
558 uint32_t gapless_switch:1; /*< next stream switch will be gapless */
559 uint32_t keep_ao_driver_open:1;
560 uint32_t finished_naturally:1;
561
562 input_class_t *eject_class;
563
564/* vo_driver_t *video_driver;*/
565 pthread_t video_thread;
566 video_decoder_t *video_decoder_plugin;
567 extra_info_t *video_decoder_extra_info;
568 int video_decoder_streamtype;
569 int video_channel;
570
571 int audio_track_map_entries;
572
573 int audio_decoder_streamtype;
574 pthread_t audio_thread;
575 audio_decoder_t *audio_decoder_plugin;
576 extra_info_t *audio_decoder_extra_info;
577
578 uint32_t audio_type;
579 /* *_user: -2 => off
580 -1 => auto (use *_auto value)
581 >=0 => respect the user's choice
582 */
583 int audio_channel_user;
584/* int audio_channel_auto; */
585
586/* spu_decoder_t *spu_decoder_plugin; */
587/* int spu_decoder_streamtype; */
588 int spu_track_map_entries;
589/* int spu_channel_user; */
590/* int spu_channel_auto; */
591/* int spu_channel_letterbox; */
592 int spu_channel_pan_scan;
593/* int spu_channel; */
594
595 /* lock for public xine player functions */
596 pthread_mutex_t frontend_lock;
597
598#define XINE_NUM_SIDE_STREAMS 4
599 /* HACK: protected by info_lock below.
600 * side_streams[0] always points to the master, which is the stream itself if not a side stream.
601 * It is set by init, and does not change until dispose.
602 * In other words: it may safely be read without lock. */
603 struct xine_stream_private_st *side_streams[XINE_NUM_SIDE_STREAMS];
604 /* 1 << side_stream_index (1, 2, 4, 8) */
605 uint32_t id_flag;
606
607 /* a id3v2 tag of this many bytes has been parserd, or -1. */
608 int id3v2_tag_size;
609
610 /* stream meta information */
611 /* Grab lock, or use helpers (see info_helper.c). */
612 xine_rwlock_t info_lock;
613 int stream_info[XINE_STREAM_INFO_MAX];
614 /* Broken API: _x_meta_info_get_public () returns const char *, with no go away safety.
615 * For now, we copy info to info_public when a new value is requested :-/ */
616 xine_rwlock_t meta_lock;
617 char *meta_info_public[XINE_STREAM_INFO_MAX];
618 char *meta_info[XINE_STREAM_INFO_MAX];
619
620 /* seeking slowdown */
621 struct {
622 pthread_mutex_t lock;
623 pthread_cond_t reached;
624 /* 3: wait for first frame to decode (stream start).
625 * 2: wait for first frame to display (stream seek).
626 * 1: after 2, first frame is decoded but not yet displayed.
627 * 0: waiting done.
628 */
629 uint32_t flag:2;
630 } first_frame;
631
632 /* wait for headers sent / stream decoding finished */
633 struct {
634 pthread_mutex_t lock;
635 pthread_cond_t changed;
636 int headers_audio;
637 int headers_video;
638 int finisheds_audio;
639 int finisheds_video;
640 int demuxers_running;
641 /* network buffering control. */
642 int nbc_refs;
643 xine_nbc_t *nbc;
644 } counter;
645
646 /* event mechanism */
647 struct {
648 pthread_mutex_t lock;
649 xine_list_t *queues;
650 } event;
651
652 /* demux thread stuff */
653 struct {
654 demux_plugin_t *plugin;
655 pthread_t thread;
656 pthread_mutex_t lock;
657 pthread_mutex_t action_lock;
658 pthread_cond_t resume;
659 /* used in _x_demux_... functions to synchronize order of pairwise A/V buffer operations */
660 pthread_mutex_t pair;
661 /* next 2 protected by action_lock */
662 uint32_t action_pending;
663 uint32_t input_caps;
664 uint32_t thread_created:1;
665 uint32_t thread_running:1;
666 /* filter out duplicate seek discontinuities from side streams */
667 uint32_t max_seek_bufs;
668 /* set of id_flag values */
669 uint32_t start_buffers_sent;
670 } demux;
671
672#define XINE_NUM_CURR_EXTRA_INFOS 2
673 xine_refs_t current_extra_info_index;
674 extra_info_t current_extra_info[XINE_NUM_CURR_EXTRA_INFOS];
675 int video_seek_count;
676
677 int delay_finish_event; /* delay event in 1/10 sec units. 0=>no delay, -1=>forever */
678
679 int slave_affection; /* what operations need to be propagated down to the slave? */
680
681 int err;
682
683 xine_post_out_t video_source;
684 xine_post_out_t audio_source;
685
686 broadcaster_t *broadcaster;
687
688 xine_refs_t refs;
689
690 struct {
691 pthread_mutex_t lock;
692 xine_keyframes_entry_t *array;
693 int size, used, lastadd;
694 } index;
695
696 uint32_t disable_decoder_flush_at_discontinuity;
697
698 /* all input is... */
699 uint32_t seekable;
700
701 /* _x_find_input_plugin () recursion protection */
702 input_class_t *query_input_plugins[2];
703
704#define _XINE_EI_RING_SIZE 16
705 uint32_t video_decoder_ei_index;
706 uint8_t video_decoder_ei_fast[256];
707 struct {
708 int64_t pts;
709 extra_info_t ei;
710 } ei[2 + _XINE_EI_RING_SIZE];
711} xine_stream_private_t;
712
713void xine_current_extra_info_set (xine_stream_private_t *stream, const extra_info_t *info) INTERNAL;
714
715/* Nasty net_buf_ctrl helper: inform about something outside its regular callbacks. */
716#define XINE_NBC_EVENT_AUDIO_DRY 1
717void xine_nbc_event (xine_stream_private_t *stream, uint32_t type) INTERNAL;
718
719/* Enable file_buf_ctrl optimizations when there is no net_buf_ctrl.
720 * This is a kludge to detect less compatible plugins like vdr and vdr-xineliboutput.
721 * Return actual state. */
722int xine_fbc_set (fifo_buffer_t *fifo, int on) INTERNAL;
723
725 typedef struct xine_fast_text_s xine_fast_text_t;
727 xine_fast_text_t *xine_fast_text_load (const char *filename, size_t max_size) INTERNAL;
730char *xine_fast_text_line (xine_fast_text_t *xft, size_t *linesize) INTERNAL;
732void xine_fast_text_unload (xine_fast_text_t **xft) INTERNAL;
733
734 EXTERN_C_STOP
735
736#endif
input
static int input(void)
Definition goomsl_lex.c:1495
_x_scan_plugins
int _x_scan_plugins(xine_t *this)
Load plugins into catalog.
Definition load_plugins.c:1939
_x_dispose_plugins
void _x_dispose_plugins(xine_t *this)
Dispose (shutdown) all currently loaded plugins.
Definition load_plugins.c:3595
ao_driver_s
Definition audio_out.h:43
audio_decoder_s
Definition audio_decoder.h:73
broadcaster_s
Definition broadcaster.c:82
demux_plugin_s
Definition demux.h:96
extra_info_s
Structure to pass information from input or demuxer plugins to output frames (past decoder).
Definition buffer.h:318
fifo_buffer_s
Definition buffer.h:593
input_class_s
Definition input_plugin.h:38
input_plugin_s
Definition input_plugin.h:90
video_decoder_s
Definition video_decoder.h:73
vo_driver_t
Definition video_out.h:50
xine_fast_text_s
Definition utils.c:1297
xine_keyframes_entry_t
Definition xine.h:244
xine_list_s
Definition list.c:51
xine_nbc_st
Definition net_buf_ctrl.c:83
xine_post_out_s
Definition xine.h:741
xine_private_t
Definition xine_private.h:494
xine_private_t::speed_change_lock
pthread_mutex_t speed_change_lock
Definition xine_private.h:524
xine_private_t::port_ticket
xine_ticket_t * port_ticket
Definition xine_private.h:497
xine_private_t::network_timeout
int network_timeout
Definition xine_private.h:504
xine_private_t::log_cb_user_data
void * log_cb_user_data
Definition xine_private.h:501
xine_private_t::speed_change_new_speed
int speed_change_new_speed
Definition xine_private.h:523
xine_private_t::XINE_IP_PREF_4_6
@ XINE_IP_PREF_4_6
Definition xine_private.h:508
xine_private_t::XINE_IP_PREF_4
@ XINE_IP_PREF_4
Definition xine_private.h:507
xine_private_t::speed_change_new_live
int speed_change_new_live
Definition xine_private.h:522
xine_private_t::log_cb
xine_log_cb_t log_cb
Definition xine_private.h:500
xine_private_t::x
xine_t x
Definition xine_private.h:495
xine_private_t::speed_change_flags
uint32_t speed_change_flags
Definition xine_private.h:521
xine_private_t::speed_change_done
pthread_cond_t speed_change_done
Definition xine_private.h:525
xine_private_t::flags
int flags
Definition xine_private.h:503
xine_private_t::black
int black
Definition xine_private.h:538
xine_private_t::decoder_pri_help
char * decoder_pri_help
Definition xine_private.h:533
xine_private_t::gen
int gen
Definition xine_private.h:540
xine_private_t::log_lock
pthread_mutex_t log_lock
Definition xine_private.h:498
xine_private_t::join_av
uint32_t join_av
Definition xine_private.h:512
xine_refs_t
Definition xine_private.h:163
xine_refs_t::refs
int refs
Definition xine_private.h:165
xine_refs_t::object
void * object
Definition xine_private.h:167
xine_refs_t::mutex
pthread_mutex_t mutex
Definition xine_private.h:164
xine_refs_t::destructor
void(* destructor)(void *object)
Definition xine_private.h:166
xine_s
Definition xine_internal.h:80
xine_stream_private_st
Definition xine_private.h:546
xine_stream_private_st::video_source
xine_post_out_t video_source
Definition xine_private.h:683
xine_stream_private_st::side_streams
struct xine_stream_private_st * side_streams[4]
Definition xine_private.h:603
xine_stream_private_st::delay_finish_event
int delay_finish_event
Definition xine_private.h:677
xine_stream_private_st::id_flag
uint32_t id_flag
Definition xine_private.h:605
xine_stream_private_st::lock
pthread_mutex_t lock
Definition xine_private.h:622
xine_stream_private_st::pts
int64_t pts
Definition xine_private.h:708
xine_stream_private_st::id3v2_tag_size
int id3v2_tag_size
Definition xine_private.h:608
xine_stream_private_st::headers_audio
int headers_audio
Definition xine_private.h:636
xine_stream_private_st::thread_running
uint32_t thread_running
Definition xine_private.h:665
xine_stream_private_st::s
xine_stream_t s
Definition xine_private.h:547
xine_stream_private_st::plugin
demux_plugin_t * plugin
Definition xine_private.h:654
xine_stream_private_st::stream_info
int stream_info[XINE_STREAM_INFO_MAX]
Definition xine_private.h:613
xine_stream_private_st::index
struct xine_stream_private_st::@126 index
xine_stream_private_st::video_decoder_ei_fast
uint8_t video_decoder_ei_fast[256]
Definition xine_private.h:706
xine_stream_private_st::thread_created
uint32_t thread_created
Definition xine_private.h:664
xine_stream_private_st::gapless_switch
uint32_t gapless_switch
Definition xine_private.h:558
xine_stream_private_st::ei
extra_info_t ei
Definition xine_private.h:709
xine_stream_private_st::audio_thread_created
uint32_t audio_thread_created
Definition xine_private.h:552
xine_stream_private_st::first_frame
struct xine_stream_private_st::@122 first_frame
xine_stream_private_st::current_extra_info_index
xine_refs_t current_extra_info_index
Definition xine_private.h:673
xine_stream_private_st::video_decoder_ei_index
uint32_t video_decoder_ei_index
Definition xine_private.h:705
xine_stream_private_st::info_lock
pthread_mutex_t info_lock
Definition xine_private.h:612
xine_stream_private_st::spu_track_map_entries
int spu_track_map_entries
Definition xine_private.h:588
xine_stream_private_st::headers_video
int headers_video
Definition xine_private.h:637
xine_stream_private_st::resume
pthread_cond_t resume
Definition xine_private.h:658
xine_stream_private_st::err
int err
Definition xine_private.h:681
xine_stream_private_st::frontend_lock
pthread_mutex_t frontend_lock
Definition xine_private.h:596
xine_stream_private_st::emergency_brake
uint32_t emergency_brake
Definition xine_private.h:554
xine_stream_private_st::action_pending
uint32_t action_pending
Definition xine_private.h:662
xine_stream_private_st::event
struct xine_stream_private_st::@124 event
xine_stream_private_st::video_decoder_extra_info
extra_info_t * video_decoder_extra_info
Definition xine_private.h:567
xine_stream_private_st::video_decoder_plugin
video_decoder_t * video_decoder_plugin
Definition xine_private.h:566
xine_stream_private_st::audio_track_map_entries
int audio_track_map_entries
Definition xine_private.h:571
xine_stream_private_st::array
xine_keyframes_entry_t * array
Definition xine_private.h:692
xine_stream_private_st::refs
xine_refs_t refs
Definition xine_private.h:688
xine_stream_private_st::nbc_refs
int nbc_refs
Definition xine_private.h:642
xine_stream_private_st::meta_info_public
char * meta_info_public[XINE_STREAM_INFO_MAX]
Definition xine_private.h:617
xine_stream_private_st::queues
xine_list_t * queues
Definition xine_private.h:649
xine_stream_private_st::current_extra_info
extra_info_t current_extra_info[2]
Definition xine_private.h:674
xine_stream_private_st::meta_info
char * meta_info[XINE_STREAM_INFO_MAX]
Definition xine_private.h:618
xine_stream_private_st::finished_naturally
uint32_t finished_naturally
Definition xine_private.h:560
xine_stream_private_st::max_seek_bufs
uint32_t max_seek_bufs
Definition xine_private.h:667
xine_stream_private_st::slave_is_subtitle
uint32_t slave_is_subtitle
Definition xine_private.h:553
xine_stream_private_st::audio_thread
pthread_t audio_thread
Definition xine_private.h:574
xine_stream_private_st::audio_channel_user
int audio_channel_user
Definition xine_private.h:583
xine_stream_private_st::eject_class
input_class_t * eject_class
Definition xine_private.h:562
xine_stream_private_st::keep_ao_driver_open
uint32_t keep_ao_driver_open
Definition xine_private.h:559
xine_stream_private_st::video_thread
pthread_t video_thread
Definition xine_private.h:565
xine_stream_private_st::finisheds_audio
int finisheds_audio
Definition xine_private.h:638
xine_stream_private_st::reached
pthread_cond_t reached
Definition xine_private.h:623
xine_stream_private_st::audio_source
xine_post_out_t audio_source
Definition xine_private.h:684
xine_stream_private_st::meta_lock
pthread_mutex_t meta_lock
Definition xine_private.h:616
xine_stream_private_st::used
int used
Definition xine_private.h:693
xine_stream_private_st::video_decoder_streamtype
int video_decoder_streamtype
Definition xine_private.h:568
xine_stream_private_st::query_input_plugins
input_class_t * query_input_plugins[2]
Definition xine_private.h:702
xine_stream_private_st::lastadd
int lastadd
Definition xine_private.h:693
xine_stream_private_st::thread
pthread_t thread
Definition xine_private.h:655
xine_stream_private_st::slave_affection
int slave_affection
Definition xine_private.h:679
xine_stream_private_st::flag
uint32_t flag
Definition xine_private.h:629
xine_stream_private_st::audio_decoder_streamtype
int audio_decoder_streamtype
Definition xine_private.h:573
xine_stream_private_st::size
int size
Definition xine_private.h:693
xine_stream_private_st::start_buffers_sent
uint32_t start_buffers_sent
Definition xine_private.h:669
xine_stream_private_st::disable_decoder_flush_at_discontinuity
uint32_t disable_decoder_flush_at_discontinuity
Definition xine_private.h:696
xine_stream_private_st::audio_type
uint32_t audio_type
Definition xine_private.h:578
xine_stream_private_st::audio_decoder_plugin
audio_decoder_t * audio_decoder_plugin
Definition xine_private.h:575
xine_stream_private_st::video_seek_count
int video_seek_count
Definition xine_private.h:675
xine_stream_private_st::broadcaster
broadcaster_t * broadcaster
Definition xine_private.h:686
xine_stream_private_st::video_channel
int video_channel
Definition xine_private.h:569
xine_stream_private_st::demuxers_running
int demuxers_running
Definition xine_private.h:640
xine_stream_private_st::action_lock
pthread_mutex_t action_lock
Definition xine_private.h:657
xine_stream_private_st::seekable
uint32_t seekable
Definition xine_private.h:699
xine_stream_private_st::changed
pthread_cond_t changed
Definition xine_private.h:635
xine_stream_private_st::demux
struct xine_stream_private_st::@125 demux
xine_stream_private_st::input_caps
uint32_t input_caps
Definition xine_private.h:663
xine_stream_private_st::nbc
xine_nbc_t * nbc
Definition xine_private.h:643
xine_stream_private_st::audio_decoder_extra_info
extra_info_t * audio_decoder_extra_info
Definition xine_private.h:576
xine_stream_private_st::pair
pthread_mutex_t pair
Definition xine_private.h:660
xine_stream_private_st::status
int status
Definition xine_private.h:549
xine_stream_private_st::spu_channel_pan_scan
int spu_channel_pan_scan
Definition xine_private.h:592
xine_stream_private_st::video_thread_created
uint32_t video_thread_created
Definition xine_private.h:551
xine_stream_private_st::early_finish_event
uint32_t early_finish_event
Definition xine_private.h:557
xine_stream_private_st::counter
struct xine_stream_private_st::@123 counter
xine_stream_private_st::finisheds_video
int finisheds_video
Definition xine_private.h:639
xine_stream_s
Definition xine_internal.h:123
xine_ticket_s
Definition tickets.h:53
v
uint32_t v
Definition utils.c:1157
z
uint8_t z[4]
Definition utils.c:1156
type
_xine_arg_type_t type
Definition xine.c:1574
xine_log_cb_t
void(* xine_log_cb_t)(void *user_data, int section)
Definition xine.h:937
xine_internal.h
XINE_STREAM_INFO_MAX
#define XINE_STREAM_INFO_MAX
Definition xine_internal.h:69
NULL
NULL
Definition xine_plugin.c:78
INTERNAL
#define INTERNAL
Definition xine_private.h:46
xine_fast_text_load
xine_fast_text_t * xine_fast_text_load(const char *filename, size_t max_size)
Definition utils.c:1305
_x_audio_decoder_init
int _x_audio_decoder_init(xine_stream_t *stream)
Definition audio_decoder.c:514
xine_current_extra_info_set
void xine_current_extra_info_set(xine_stream_private_t *stream, const extra_info_t *info)
Definition xine.c:168
xine_int32_2str
static void xine_int32_2str(char **s, int32_t v)
Definition xine_private.h:437
xine_nbc_event
void xine_nbc_event(xine_stream_private_t *stream, uint32_t type)
Definition net_buf_ctrl.c:556
xine_uint64_2str
static void xine_uint64_2str(char **s, uint64_t v)
Definition xine_private.h:467
_x_audio_decoder_shutdown
void _x_audio_decoder_shutdown(xine_stream_t *stream)
Definition audio_decoder.c:601
xine_str2uint64
static uint64_t xine_str2uint64(const char **s)
Definition xine_private.h:398
xine_probe_fast_memcpy
void xine_probe_fast_memcpy(xine_t *xine)
Benchmark available memcpy methods.
Definition memcpy.c:712
_x_video_decoder_shutdown
void _x_video_decoder_shutdown(xine_stream_t *stream)
Definition video_decoder.c:673
_x_set_file_close_on_exec
int _x_set_file_close_on_exec(int fd)
Make file descriptors and sockets uninheritable.
Definition utils.c:796
xine_stream_private_t
struct xine_stream_private_st xine_stream_private_t
xine_fast_text_line
char * xine_fast_text_line(xine_fast_text_t *xft, size_t *linesize)
Definition utils.c:1353
XINE_NUM_CURR_EXTRA_INFOS
#define XINE_NUM_CURR_EXTRA_INFOS
Definition xine_private.h:672
_x_free_audio_driver
void _x_free_audio_driver(xine_t *xine, ao_driver_t **driver)
Definition load_plugins.c:2770
xine_rwlock_t
#define xine_rwlock_t
Definition xine_private.h:284
xine_str2int32
static int32_t xine_str2int32(const char **s)
Definition xine_private.h:344
EXTERN_C_STOP
#define EXTERN_C_STOP
Definition xine_private.h:62
xine_find_byte
static uint32_t xine_find_byte(const char *s, uint32_t byte)
Definition xine_private.h:72
xine_refs_sub
static int xine_refs_sub(xine_refs_t *refs, int n)
Definition xine_private.h:187
xine_refs_add
static int xine_refs_add(xine_refs_t *refs, int n)
Definition xine_private.h:178
xine_uint_mul_div
static uint32_t xine_uint_mul_div(uint32_t num, uint32_t mul, uint32_t den)
Definition xine_private.h:339
xine_refs_get
static int xine_refs_get(xine_refs_t *refs)
Definition xine_private.h:200
xine_refs_init
static void xine_refs_init(xine_refs_t *refs, void(*destructor)(void *object), void *object)
Definition xine_private.h:170
xine_fast_text_unload
void xine_fast_text_unload(xine_fast_text_t **xft)
Definition utils.c:1420
xine_str2uint32
static uint32_t xine_str2uint32(const char **s)
Definition xine_private.h:376
xine_uint32_2str
static void xine_uint32_2str(char **s, uint32_t v)
Definition xine_private.h:455
xine_fbc_set
int xine_fbc_set(fifo_buffer_t *fifo, int on)
Definition buffer.c:132
_x_set_socket_close_on_exec
int _x_set_socket_close_on_exec(int s)
Definition utils.c:805
_x_video_decoder_init
int _x_video_decoder_init(xine_stream_t *stream)
Definition video_decoder.c:599
xine_gettime
static int xine_gettime(struct timespec *ts)
Definition xine_private.h:299
_x_rip_plugin_get_instance
input_plugin_t * _x_rip_plugin_get_instance(xine_stream_t *stream, const char *filename)
Definition input_rip.c:806
EXTERN_C_START
#define EXTERN_C_START
Definition xine_private.h:61
XINE_NUM_SIDE_STREAMS
#define XINE_NUM_SIDE_STREAMS
Definition xine_private.h:598
_x_find_demux_plugin_last_probe
demux_plugin_t * _x_find_demux_plugin_last_probe(xine_stream_t *stream, const char *last_demux_name, input_plugin_t *input)
Definition load_plugins.c:2324
_x_cache_plugin_get_instance
input_plugin_t * _x_cache_plugin_get_instance(xine_stream_t *stream)
Definition input_cache.c:406
_x_free_video_driver
void _x_free_video_driver(xine_t *xine, vo_driver_t **driver)
Definition load_plugins.c:2787
_XINE_EI_RING_SIZE
#define _XINE_EI_RING_SIZE
Definition xine_private.h:704