xine-lib: xine-lib-1.2.13/include/xine/buffer.h Source File

xine-lib 1.2.13-20230125hg15249

buffer.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2000-2021 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 *
21 * contents:
22 *
23 * buffer_entry structure - serves as a transport encapsulation
24 * of the mpeg audio/video data through xine
25 *
26 * free buffer pool management routines
27 *
28 * FIFO buffer structures/routines
29 */
30
31#ifndef HAVE_BUFFER_H
32#define HAVE_BUFFER_H
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38#include <string.h> /* memcmp */
39#include <sys/types.h> /* pthread_* */
40#include <pthread.h> /* clang systems seem to need this */
41
42#include <xine/os_types.h>
43#include <xine/attributes.h>
44#include <xine/tickets.h>
45
46#define BUF_MAX_CALLBACKS 5
47
61
62#define BUF_MAJOR_MASK 0xFF000000
63#define BUF_DECODER_MASK 0x00FF0000
64
69#define BUF_CONTROL_BASE 0x01000000
70#define BUF_CONTROL_START 0x01000000
71#define BUF_CONTROL_END 0x01010000
72#define BUF_CONTROL_QUIT 0x01020000
73#define BUF_CONTROL_DISCONTINUITY 0x01030000
74#define BUF_CONTROL_NOP 0x01040000
75#define BUF_CONTROL_AUDIO_CHANNEL 0x01050000
76#define BUF_CONTROL_SPU_CHANNEL 0x01060000
77#define BUF_CONTROL_NEWPTS 0x01070000
78#define BUF_CONTROL_RESET_DECODER 0x01080000
79#define BUF_CONTROL_HEADERS_DONE 0x01090000
80#define BUF_CONTROL_FLUSH_DECODER 0x010a0000
81#define BUF_CONTROL_RESET_TRACK_MAP 0x010b0000
89#define BUF_VIDEO_BASE 0x02000000
90#define BUF_VIDEO_UNKNOWN 0x02ff0000
91#define BUF_VIDEO_MPEG 0x02000000
92#define BUF_VIDEO_MPEG4 0x02010000
93#define BUF_VIDEO_CINEPAK 0x02020000
94#define BUF_VIDEO_SORENSON_V1 0x02030000
95#define BUF_VIDEO_MSMPEG4_V2 0x02040000
96#define BUF_VIDEO_MSMPEG4_V3 0x02050000
97#define BUF_VIDEO_MJPEG 0x02060000
98#define BUF_VIDEO_IV50 0x02070000
99#define BUF_VIDEO_IV41 0x02080000
100#define BUF_VIDEO_IV32 0x02090000
101#define BUF_VIDEO_IV31 0x020a0000
102#define BUF_VIDEO_ATIVCR1 0x020b0000
103#define BUF_VIDEO_ATIVCR2 0x020c0000
104#define BUF_VIDEO_I263 0x020d0000
105#define BUF_VIDEO_RV10 0x020e0000
106#define BUF_VIDEO_RGB 0x02100000
107#define BUF_VIDEO_YUY2 0x02110000
108#define BUF_VIDEO_JPEG 0x02120000
109#define BUF_VIDEO_WMV7 0x02130000
110#define BUF_VIDEO_WMV8 0x02140000
111#define BUF_VIDEO_MSVC 0x02150000
112#define BUF_VIDEO_DV 0x02160000
113#define BUF_VIDEO_REAL 0x02170000
114#define BUF_VIDEO_VP31 0x02180000
115#define BUF_VIDEO_H263 0x02190000
116#define BUF_VIDEO_3IVX 0x021A0000
117#define BUF_VIDEO_CYUV 0x021B0000
118#define BUF_VIDEO_DIVX5 0x021C0000
119#define BUF_VIDEO_XVID 0x021D0000
120#define BUF_VIDEO_SMC 0x021E0000
121#define BUF_VIDEO_RPZA 0x021F0000
122#define BUF_VIDEO_QTRLE 0x02200000
123#define BUF_VIDEO_MSRLE 0x02210000
124#define BUF_VIDEO_DUCKTM1 0x02220000
125#define BUF_VIDEO_FLI 0x02230000
126#define BUF_VIDEO_ROQ 0x02240000
127#define BUF_VIDEO_SORENSON_V3 0x02250000
128#define BUF_VIDEO_MSMPEG4_V1 0x02260000
129#define BUF_VIDEO_MSS1 0x02270000
130#define BUF_VIDEO_IDCIN 0x02280000
131#define BUF_VIDEO_PGVV 0x02290000
132#define BUF_VIDEO_ZYGO 0x022A0000
133#define BUF_VIDEO_TSCC 0x022B0000
134#define BUF_VIDEO_YVU9 0x022C0000
135#define BUF_VIDEO_VQA 0x022D0000
136#define BUF_VIDEO_GREY 0x022E0000
137#define BUF_VIDEO_XXAN 0x022F0000
138#define BUF_VIDEO_WC3 0x02300000
139#define BUF_VIDEO_YV12 0x02310000
140#define BUF_VIDEO_SEGA 0x02320000
141#define BUF_VIDEO_RV20 0x02330000
142#define BUF_VIDEO_RV30 0x02340000
143#define BUF_VIDEO_MVI2 0x02350000
144#define BUF_VIDEO_UCOD 0x02360000
145#define BUF_VIDEO_WMV9 0x02370000
146#define BUF_VIDEO_INTERPLAY 0x02380000
147#define BUF_VIDEO_RV40 0x02390000
148#define BUF_VIDEO_PSX_MDEC 0x023A0000
149#define BUF_VIDEO_YUV_FRAMES 0x023B0000
150#define BUF_VIDEO_HUFFYUV 0x023C0000
151#define BUF_VIDEO_IMAGE 0x023D0000
152#define BUF_VIDEO_THEORA 0x023E0000
153#define BUF_VIDEO_4XM 0x023F0000
154#define BUF_VIDEO_I420 0x02400000
155#define BUF_VIDEO_VP4 0x02410000
156#define BUF_VIDEO_VP5 0x02420000
157#define BUF_VIDEO_VP6 0x02430000
158#define BUF_VIDEO_VMD 0x02440000
159#define BUF_VIDEO_MSZH 0x02450000
160#define BUF_VIDEO_ZLIB 0x02460000
161#define BUF_VIDEO_8BPS 0x02470000
162#define BUF_VIDEO_ASV1 0x02480000
163#define BUF_VIDEO_ASV2 0x02490000
164#define BUF_VIDEO_BITPLANE 0x024A0000
165#define BUF_VIDEO_BITPLANE_BR1 0x024B0000
166#define BUF_VIDEO_FLV1 0x024C0000
167#define BUF_VIDEO_H264 0x024D0000
168#define BUF_VIDEO_MJPEG_B 0x024E0000
169#define BUF_VIDEO_H261 0x024F0000
170#define BUF_VIDEO_AASC 0x02500000
171#define BUF_VIDEO_LOCO 0x02510000
172#define BUF_VIDEO_QDRW 0x02520000
173#define BUF_VIDEO_QPEG 0x02530000
174#define BUF_VIDEO_ULTI 0x02540000
175#define BUF_VIDEO_WNV1 0x02550000
176#define BUF_VIDEO_XL 0x02560000
177#define BUF_VIDEO_RT21 0x02570000
178#define BUF_VIDEO_FPS1 0x02580000
179#define BUF_VIDEO_DUCKTM2 0x02590000
180#define BUF_VIDEO_CSCD 0x025A0000
181#define BUF_VIDEO_ALGMM 0x025B0000
182#define BUF_VIDEO_ZMBV 0x025C0000
183#define BUF_VIDEO_AVS 0x025D0000
184#define BUF_VIDEO_SMACKER 0x025E0000
185#define BUF_VIDEO_NUV 0x025F0000
186#define BUF_VIDEO_KMVC 0x02600000
187#define BUF_VIDEO_FLASHSV 0x02610000
188#define BUF_VIDEO_CAVS 0x02620000
189#define BUF_VIDEO_VP6F 0x02630000
190#define BUF_VIDEO_THEORA_RAW 0x02640000
191#define BUF_VIDEO_VC1 0x02650000
192#define BUF_VIDEO_VMNC 0x02660000
193#define BUF_VIDEO_SNOW 0x02670000
194#define BUF_VIDEO_VP8 0x02680000
195#define BUF_VIDEO_VP9 0x02690000
196#define BUF_VIDEO_HEVC 0x026A0000
197#define BUF_VIDEO_AV1 0x026B0000
198#define BUF_VIDEO_PNG 0x026C0000
199
207#define BUF_AUDIO_BASE 0x03000000
208#define BUF_AUDIO_UNKNOWN 0x03ff0000
209#define BUF_AUDIO_A52 0x03000000
210#define BUF_AUDIO_MPEG 0x03010000
211#define BUF_AUDIO_LPCM_BE 0x03020000
212#define BUF_AUDIO_LPCM_LE 0x03030000
213#define BUF_AUDIO_WMAV1 0x03040000
214#define BUF_AUDIO_DTS 0x03050000
215#define BUF_AUDIO_MSADPCM 0x03060000
216#define BUF_AUDIO_MSIMAADPCM 0x03070000
217#define BUF_AUDIO_MSGSM 0x03080000
218#define BUF_AUDIO_VORBIS 0x03090000
219#define BUF_AUDIO_IMC 0x030a0000
220#define BUF_AUDIO_LH 0x030b0000
221#define BUF_AUDIO_VOXWARE 0x030c0000
222#define BUF_AUDIO_ACELPNET 0x030d0000
223#define BUF_AUDIO_AAC 0x030e0000
224#define BUF_AUDIO_DNET 0x030f0000
225#define BUF_AUDIO_VIVOG723 0x03100000
226#define BUF_AUDIO_DK3ADPCM 0x03110000
227#define BUF_AUDIO_DK4ADPCM 0x03120000
228#define BUF_AUDIO_ROQ 0x03130000
229#define BUF_AUDIO_QTIMAADPCM 0x03140000
230#define BUF_AUDIO_MAC3 0x03150000
231#define BUF_AUDIO_MAC6 0x03160000
232#define BUF_AUDIO_QDESIGN1 0x03170000
233#define BUF_AUDIO_QDESIGN2 0x03180000
234#define BUF_AUDIO_QCLP 0x03190000
235#define BUF_AUDIO_SMJPEG_IMA 0x031A0000
236#define BUF_AUDIO_VQA_IMA 0x031B0000
237#define BUF_AUDIO_MULAW 0x031C0000
238#define BUF_AUDIO_ALAW 0x031D0000
239#define BUF_AUDIO_GSM610 0x031E0000
240#define BUF_AUDIO_EA_ADPCM 0x031F0000
241#define BUF_AUDIO_WMAV2 0x03200000
242#define BUF_AUDIO_COOK 0x03210000
243#define BUF_AUDIO_ATRK 0x03220000
244#define BUF_AUDIO_14_4 0x03230000
245#define BUF_AUDIO_28_8 0x03240000
246#define BUF_AUDIO_SIPRO 0x03250000
247#define BUF_AUDIO_WMAPRO 0x03260000
248#define BUF_AUDIO_WMAV3 BUF_AUDIO_WMAPRO
249#define BUF_AUDIO_INTERPLAY 0x03270000
250#define BUF_AUDIO_XA_ADPCM 0x03280000
251#define BUF_AUDIO_WESTWOOD 0x03290000
252#define BUF_AUDIO_DIALOGIC_IMA 0x032A0000
253#define BUF_AUDIO_NSF 0x032B0000
254#define BUF_AUDIO_FLAC 0x032C0000
255#define BUF_AUDIO_DV 0x032D0000
256#define BUF_AUDIO_WMAV 0x032E0000
257#define BUF_AUDIO_SPEEX 0x032F0000
258#define BUF_AUDIO_RAWPCM 0x03300000
259#define BUF_AUDIO_4X_ADPCM 0x03310000
260#define BUF_AUDIO_VMD 0x03320000
261#define BUF_AUDIO_XAN_DPCM 0x03330000
262#define BUF_AUDIO_ALAC 0x03340000
263#define BUF_AUDIO_MPC 0x03350000
264#define BUF_AUDIO_SHORTEN 0x03360000
265#define BUF_AUDIO_WESTWOOD_SND1 0x03370000
266#define BUF_AUDIO_WMALL 0x03380000
267#define BUF_AUDIO_TRUESPEECH 0x03390000
268#define BUF_AUDIO_TTA 0x033A0000
269#define BUF_AUDIO_SMACKER 0x033B0000
270#define BUF_AUDIO_FLVADPCM 0x033C0000
271#define BUF_AUDIO_WAVPACK 0x033D0000
272#define BUF_AUDIO_MP3ADU 0x033E0000
273#define BUF_AUDIO_AMR_NB 0x033F0000
274#define BUF_AUDIO_AMR_WB 0x03400000
275#define BUF_AUDIO_EAC3 0x03410000
276#define BUF_AUDIO_AAC_LATM 0x03420000
277#define BUF_AUDIO_ADPCM_G726 0x03430000
278#define BUF_AUDIO_OPUS 0x03440000
279#define BUF_AUDIO_TRUEHD 0x03450000
286#define BUF_SPU_BASE 0x04000000
287#define BUF_SPU_DVD 0x04000000
288#define BUF_SPU_TEXT 0x04010000
289#define BUF_SPU_CC 0x04020000
290#define BUF_SPU_DVB 0x04030000
291#define BUF_SPU_SVCD 0x04040000
292#define BUF_SPU_CVD 0x04050000
293#define BUF_SPU_OGM 0x04060000
294#define BUF_SPU_CMML 0x04070000
295#define BUF_SPU_HDMV 0x04080000
296#define BUF_SPU_HDMV_TEXT 0x04090000
303#define BUF_DEMUX_BLOCK 0x05000000
307
308 typedef struct extra_info_s extra_info_t;
309
318 struct extra_info_s {
319
320 int input_normpos;
323 int input_time;
325 uint32_t frame_number;
327 int seek_count;
328 int64_t vpts;
330 int invalid;
331 int total_time;
332};
333
334
335#define BUF_NUM_DEC_INFO 5
336
337 typedef struct buf_element_s buf_element_t;
338 struct buf_element_s {
339 buf_element_t *next;
340
341 unsigned char *mem;
342 unsigned char *content;
344 int32_t size ;
345 int32_t max_size;
346 int64_t pts;
347 int64_t disc_off;
349 extra_info_t *extra_info;
351 uint32_t decoder_flags;
354 uint32_t decoder_info[BUF_NUM_DEC_INFO];
356 void *decoder_info_ptr[BUF_NUM_DEC_INFO];
357
358 void (*free_buffer) (buf_element_t *buf);
359
360 void *source;
363 uint32_t type;
364} ;
365
368#define BUF_FLAG_KEYFRAME 0x0001
369
371#define BUF_FLAG_FRAME_START 0x0002
372#define BUF_FLAG_FRAME_END 0x0004
373
376#define BUF_FLAG_HEADER 0x0008
377
381#define BUF_FLAG_PREVIEW 0x0010
382
384#define BUF_FLAG_END_USER 0x0020
385
387#define BUF_FLAG_END_STREAM 0x0040
388
390#define BUF_FLAG_FRAMERATE 0x0080
391
393#define BUF_FLAG_SEEK 0x0100
394
396#define BUF_FLAG_SPECIAL 0x0200
397
402#define BUF_FLAG_STDHEADER 0x0400
403
406#define BUF_FLAG_ASPECT 0x0800
407
408/* represent the state of gapless_switch at the time buf was enqueued */
409#define BUF_FLAG_GAPLESS_SW 0x1000
410
411/* Amount of audio padding added by encoder (mp3, aac). These empty
412 * audio frames are causing a gap when switching between mp3 files.
413 * decoder_info[1] carries amount of audio frames padded at the
414 * beginning of the buffer
415 * decoder_info[2] carries amount of audio frames padded at the end of
416 * the buffer */
417#define BUF_FLAG_AUDIO_PADDING 0x2000
418
422#define BUF_FLAG_COLOR_MATRIX 0x4000
423
427#define BUF_FLAG_MERGE 0x8000
428
450
463#define BUF_SPECIAL_PALETTE 1
464
465
466/* special buffer type 2 used to be defined but is now available for use */
467
468
480#define BUF_SPECIAL_ASPECT 3
481
490#define BUF_SPECIAL_DECODER_CONFIG 4
491
504#define BUF_SPECIAL_STSD_ATOM 5
505
514#define BUF_SPECIAL_LPCM_CONFIG 6
515
525#define BUF_SPECIAL_CHARSET_ENCODING 7
526
527
535#define BUF_SPECIAL_SPU_DVD_SUBTYPE 8
536
537
538#define SPU_DVD_SUBTYPE_CLUT 1
539#define SPU_DVD_SUBTYPE_PACKAGE 2
540#define SPU_DVD_SUBTYPE_VOBSUB_PACKAGE 3
541#define SPU_DVD_SUBTYPE_NAV 4
542
554#define BUF_SPECIAL_SPU_DVB_DESCRIPTOR 9
555
564#define BUF_SPECIAL_RV_CHUNK_TABLE 10
567 typedef struct spu_dvb_descriptor_s spu_dvb_descriptor_t;
568 struct spu_dvb_descriptor_s
569{
570 char lang[4];
571 long comp_page_id;
572 long aux_page_id;
573} ;
574
575 typedef struct palette_entry_s palette_entry_t;
576 struct palette_entry_s
577{
578 unsigned char r, g, b;
579} ;
580
581/* NOTE well: unfortunately, early libxine design made all these details public.
582 * Please
583 * a) use _x_[dummy_]fifo_buffer_new (), and dont assume anything about
584 * the non function members, or
585 * b) provide a full own implementation, which is tricky because fifo_buffer_t
586 * has been enlarged with libxine version bumps, or
587 * ?) at least never pass your own to engine or unaware plugins.
588 * vdr-xineliboutput builds its own fifo_buffer_t structs from a partly copy
589 * of a libxine one (including some functions) as pools.
590 * We are trying hard to keep that vdr compatibility, with no guarantee. */
591 typedef struct fifo_buffer_s fifo_buffer_t;
592 struct fifo_buffer_s
593{
594 buf_element_t *first, *last;
595
596 int fifo_size;
597 uint32_t fifo_data_size;
598 void *fifo_empty_cb_data;
599
600 pthread_mutex_t mutex;
601 pthread_cond_t not_empty;
602
603 /*
604 * functions to access this fifo:
605 */
606
607 void (*put) (fifo_buffer_t *fifo, buf_element_t *buf);
608
609 buf_element_t *(*get) (fifo_buffer_t *fifo);
610
611 void (*clear) (fifo_buffer_t *fifo) ;
612
613 int (*size) (fifo_buffer_t *fifo);
614
615 int (*num_free) (fifo_buffer_t *fifo);
616
617 uint32_t (*data_size) (fifo_buffer_t *fifo);
618
619 void (*dispose) (fifo_buffer_t *fifo);
620
621 /*
622 * alloc buffer for this fifo from global buf pool
623 * you don't have to use this function to allocate a buffer,
624 * an input plugin can decide to implement it's own
625 * buffer allocation functions
626 */
627
628 buf_element_t *(*buffer_pool_alloc) (fifo_buffer_t *self);
629
630
631 /*
632 * special functions, not used by demuxers
633 */
634
635 /* the same as buffer_pool_alloc but may fail if none is available */
636 buf_element_t *(*buffer_pool_try_alloc) (fifo_buffer_t *self);
637
638 /* the same as put but insert at the head of the fifo */
639 void (*insert) (fifo_buffer_t *fifo, buf_element_t *buf);
640
641 /* callbacks */
642 void (*register_alloc_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, void *), void *cb_data);
643 void (*register_put_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *), void *cb_data);
644 void (*register_get_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *), void *cb_data);
645 void (*unregister_alloc_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, void *));
646 void (*unregister_put_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *));
647 void (*unregister_get_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *));
648
649 /*
650 * private variables for buffer pool management
651 */
652 buf_element_t *buffer_pool_top; /* a heap actually */
653 pthread_mutex_t buffer_pool_mutex;
654 pthread_cond_t buffer_pool_cond_not_empty;
655 int buffer_pool_num_free;
656 int buffer_pool_capacity;
657 int buffer_pool_buf_size;
658 void *buffer_pool_base; /*used to free mem chunk */
659 void (*alloc_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, void *data_cb);
660 void (*put_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, buf_element_t *buf, void *data_cb);
661 void (*get_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, buf_element_t *buf, void *data_cb);
662 void *alloc_cb_data[BUF_MAX_CALLBACKS];
663 void *put_cb_data[BUF_MAX_CALLBACKS];
664 void *get_cb_data[BUF_MAX_CALLBACKS];
665
666 /* get a buffer large enough for given byte size.
667 * result may still be smaller, do check buf->max_size.
668 */
669 buf_element_t *(*buffer_pool_size_alloc) (fifo_buffer_t *self, size_t size);
670
671 /* private */
672 int buffer_pool_num_waiters;
673 int buffer_pool_large_wait;
674 int fifo_num_waiters;
675
676 /* Same as get but if ticket is not NULL
677 * - release it while waiting for a buf, or
678 * - renew it when revoked.
679 */
680 buf_element_t *(*tget) (fifo_buffer_t *fifo, xine_ticket_t *ticket);
681
682 /* Try to enlarge an allocated buf.
683 * There are 2 possible results:
684 * a) The buffer has been enlarged, and NULL is returned.
685 * b) The buffer cannot be enlarged due to internal memory fragmentation,
686 * and a new buffer for the extra data is returned.
687 * No need for an extra buffer_pool_size_alloc ().
688 * Any result may still be smaller, do check buf->max_size.
689 */
690 buf_element_t *(*buffer_pool_realloc) (buf_element_t *buf, size_t new_size);
691} ;
692
699 fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE_PROTECTED;
700
707 fifo_buffer_t *_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE_PROTECTED;
708
713void _x_free_buf_elements (buf_element_t *head) XINE_PROTECTED;
714
715
723uint32_t _x_fourcc_to_buf_video( uint32_t fourcc_int ) XINE_PROTECTED;
724
730const char * _x_buf_video_name( uint32_t buf_type ) XINE_PROTECTED;
731
737uint32_t _x_formattag_to_buf_audio( uint32_t formattag ) XINE_PROTECTED;
738
744const char * _x_buf_audio_name( uint32_t buf_type ) XINE_PROTECTED;
745
746
753 typedef struct XINE_PACKED {
754 int32_t biSize;
755 int32_t biWidth;
756 int32_t biHeight;
757 int16_t biPlanes;
758 int16_t biBitCount;
759 uint32_t biCompression;
760 int32_t biSizeImage;
761 int32_t biXPelsPerMeter;
762 int32_t biYPelsPerMeter;
763 int32_t biClrUsed;
764 int32_t biClrImportant;
765} xine_bmiheader;
766
771 typedef struct XINE_PACKED {
772 int16_t wFormatTag;
773 int16_t nChannels;
774 int32_t nSamplesPerSec;
775 int32_t nAvgBytesPerSec;
776 int16_t nBlockAlign;
777 int16_t wBitsPerSample;
778 int16_t cbSize;
779} xine_waveformatex;
780
782void _x_bmiheader_le2me( xine_bmiheader *bih ) XINE_PROTECTED;
783
785void _x_waveformatex_le2me( xine_waveformatex *wavex ) XINE_PROTECTED;
786
787 static __inline int _x_is_fourcc(const void *ptr, const void *tag) {
788 return memcmp(ptr, tag, 4) == 0;
789}
790
797size_t _x_tag32_me2str (char *s, uint32_t tag) XINE_PROTECTED;
798
799#ifdef __cplusplus
800}
801#endif
802
803#endif
_x_buf_audio_name
const char * _x_buf_audio_name(uint32_t buf_type)
Returns audio codec name given the buffer type.
Definition buffer_types.c:594
_x_free_buf_elements
void _x_free_buf_elements(buf_element_t *head)
Free chained list of buffer elements.
Definition buffer.c:1182
_x_waveformatex_le2me
void _x_waveformatex_le2me(xine_waveformatex *wavex)
Definition buffer_types.c:657
_x_buf_video_name
const char * _x_buf_video_name(uint32_t buf_type)
Returns video codec name given the buffer type.
Definition buffer_types.c:512
_x_fourcc_to_buf_video
uint32_t _x_fourcc_to_buf_video(uint32_t fourcc_int)
Returns the BUF_VIDEO_xxx for the given fourcc.
Definition buffer_types.c:357
_x_is_fourcc
static __inline int _x_is_fourcc(const void *ptr, const void *tag)
Definition buffer.h:787
BUF_NUM_DEC_INFO
#define BUF_NUM_DEC_INFO
Definition buffer.h:335
BUF_MAX_CALLBACKS
#define BUF_MAX_CALLBACKS
Definition buffer.h:46
_x_tag32_me2str
size_t _x_tag32_me2str(char *s, uint32_t tag)
Make string from machine endian 32bit tag, eg a fourcc or a chunk ID.
Definition buffer_types.c:668
_x_formattag_to_buf_audio
uint32_t _x_formattag_to_buf_audio(uint32_t formattag)
Returns the BUF_AUDIO_xxx for the given formattag.
Definition buffer_types.c:127
_x_fifo_buffer_new
fifo_buffer_t * _x_fifo_buffer_new(int num_buffers, uint32_t buf_size)
Allocate and initialise new (empty) FIFO buffers.
Definition buffer.c:1070
_x_bmiheader_le2me
void _x_bmiheader_le2me(xine_bmiheader *bih)
Definition buffer_types.c:640
_x_dummy_fifo_buffer_new
fifo_buffer_t * _x_dummy_fifo_buffer_new(int num_buffers, uint32_t buf_size)
Allocate and initialise new dummy FIFO buffers.
Definition buffer.c:1173
buf_type
uint32_t buf_type
Definition demux_ivf.c:38
attributes.h
XINE_PROTECTED
#define XINE_PROTECTED
Definition attributes.h:75
XINE_PACKED
#define XINE_PACKED
Definition attributes.h:147
os_types.h
buf_element_s
Definition buffer.h:338
buf_element_s::decoder_info
uint32_t decoder_info[5]
Definition buffer.h:354
buf_element_s::disc_off
int64_t disc_off
Definition buffer.h:347
buf_element_s::source
void * source
Definition buffer.h:360
buf_element_s::mem
unsigned char * mem
Definition buffer.h:341
buf_element_s::decoder_flags
uint32_t decoder_flags
Definition buffer.h:351
buf_element_s::type
uint32_t type
Definition buffer.h:363
buf_element_s::size
int32_t size
Definition buffer.h:344
buf_element_s::decoder_info_ptr
void * decoder_info_ptr[5]
Definition buffer.h:356
buf_element_s::next
buf_element_t * next
Definition buffer.h:339
buf_element_s::free_buffer
void(* free_buffer)(buf_element_t *buf)
Definition buffer.h:358
buf_element_s::extra_info
extra_info_t * extra_info
Definition buffer.h:349
buf_element_s::max_size
int32_t max_size
Definition buffer.h:345
buf_element_s::pts
int64_t pts
Definition buffer.h:346
buf_element_s::content
unsigned char * content
Definition buffer.h:342
extra_info_s
Structure to pass information from input or demuxer plugins to output frames (past decoder).
Definition buffer.h:318
extra_info_s::input_time
int input_time
Definition buffer.h:323
extra_info_s::invalid
int invalid
Definition buffer.h:330
extra_info_s::frame_number
uint32_t frame_number
Definition buffer.h:325
extra_info_s::total_time
int total_time
Definition buffer.h:331
extra_info_s::input_normpos
int input_normpos
Definition buffer.h:320
extra_info_s::seek_count
int seek_count
Definition buffer.h:327
extra_info_s::vpts
int64_t vpts
Definition buffer.h:328
fifo_buffer_s
Definition buffer.h:593
fifo_buffer_s::buffer_pool_num_free
int buffer_pool_num_free
Definition buffer.h:655
fifo_buffer_s::size
int(* size)(fifo_buffer_t *fifo)
Definition buffer.h:613
fifo_buffer_s::unregister_put_cb
void(* unregister_put_cb)(fifo_buffer_t *fifo, void(*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *))
Definition buffer.h:646
fifo_buffer_s::register_get_cb
void(* register_get_cb)(fifo_buffer_t *fifo, void(*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *), void *cb_data)
Definition buffer.h:644
fifo_buffer_s::num_free
int(* num_free)(fifo_buffer_t *fifo)
Definition buffer.h:615
fifo_buffer_s::buffer_pool_mutex
pthread_mutex_t buffer_pool_mutex
Definition buffer.h:653
fifo_buffer_s::buffer_pool_base
void * buffer_pool_base
Definition buffer.h:658
fifo_buffer_s::buffer_pool_large_wait
int buffer_pool_large_wait
Definition buffer.h:673
fifo_buffer_s::put_cb_data
void * put_cb_data[5]
Definition buffer.h:663
fifo_buffer_s::put_cb
void(* put_cb[5])(fifo_buffer_t *fifo, buf_element_t *buf, void *data_cb)
Definition buffer.h:660
fifo_buffer_s::data_size
uint32_t(* data_size)(fifo_buffer_t *fifo)
Definition buffer.h:617
fifo_buffer_s::fifo_num_waiters
int fifo_num_waiters
Definition buffer.h:674
fifo_buffer_s::register_put_cb
void(* register_put_cb)(fifo_buffer_t *fifo, void(*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *), void *cb_data)
Definition buffer.h:643
fifo_buffer_s::clear
void(* clear)(fifo_buffer_t *fifo)
Definition buffer.h:611
fifo_buffer_s::fifo_data_size
uint32_t fifo_data_size
Definition buffer.h:597
fifo_buffer_s::put
void(* put)(fifo_buffer_t *fifo, buf_element_t *buf)
Definition buffer.h:607
fifo_buffer_s::buffer_pool_num_waiters
int buffer_pool_num_waiters
Definition buffer.h:672
fifo_buffer_s::unregister_get_cb
void(* unregister_get_cb)(fifo_buffer_t *fifo, void(*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *))
Definition buffer.h:647
fifo_buffer_s::buffer_pool_cond_not_empty
pthread_cond_t buffer_pool_cond_not_empty
Definition buffer.h:654
fifo_buffer_s::alloc_cb_data
void * alloc_cb_data[5]
Definition buffer.h:662
fifo_buffer_s::fifo_size
int fifo_size
Definition buffer.h:596
fifo_buffer_s::first
buf_element_t * first
Definition buffer.h:594
fifo_buffer_s::dispose
void(* dispose)(fifo_buffer_t *fifo)
Definition buffer.h:619
fifo_buffer_s::fifo_empty_cb_data
void * fifo_empty_cb_data
Definition buffer.h:598
fifo_buffer_s::mutex
pthread_mutex_t mutex
Definition buffer.h:600
fifo_buffer_s::buffer_pool_buf_size
int buffer_pool_buf_size
Definition buffer.h:657
fifo_buffer_s::unregister_alloc_cb
void(* unregister_alloc_cb)(fifo_buffer_t *fifo, void(*cb)(fifo_buffer_t *fifo, void *))
Definition buffer.h:645
fifo_buffer_s::buffer_pool_capacity
int buffer_pool_capacity
Definition buffer.h:656
fifo_buffer_s::insert
void(* insert)(fifo_buffer_t *fifo, buf_element_t *buf)
Definition buffer.h:639
fifo_buffer_s::alloc_cb
void(* alloc_cb[5])(fifo_buffer_t *fifo, void *data_cb)
Definition buffer.h:659
fifo_buffer_s::register_alloc_cb
void(* register_alloc_cb)(fifo_buffer_t *fifo, void(*cb)(fifo_buffer_t *fifo, void *), void *cb_data)
Definition buffer.h:642
fifo_buffer_s::get_cb_data
void * get_cb_data[5]
Definition buffer.h:664
fifo_buffer_s::last
buf_element_t * last
Definition buffer.h:594
fifo_buffer_s::get_cb
void(* get_cb[5])(fifo_buffer_t *fifo, buf_element_t *buf, void *data_cb)
Definition buffer.h:661
fifo_buffer_s::buffer_pool_top
buf_element_t * buffer_pool_top
Definition buffer.h:652
fifo_buffer_s::not_empty
pthread_cond_t not_empty
Definition buffer.h:601
palette_entry_s
Definition buffer.h:577
palette_entry_s::r
unsigned char r
Definition buffer.h:578
palette_entry_s::b
unsigned char b
Definition buffer.h:578
palette_entry_s::g
unsigned char g
Definition buffer.h:578
spu_dvb_descriptor_s
Definition buffer.h:569
spu_dvb_descriptor_s::lang
char lang[4]
Definition buffer.h:570
spu_dvb_descriptor_s::aux_page_id
long aux_page_id
Definition buffer.h:572
spu_dvb_descriptor_s::comp_page_id
long comp_page_id
Definition buffer.h:571
xine_bmiheader
xine version of BITMAPINFOHEADER.
Definition buffer.h:753
xine_bmiheader::biSize
int32_t biSize
Definition buffer.h:754
xine_bmiheader::biXPelsPerMeter
int32_t biXPelsPerMeter
Definition buffer.h:761
xine_bmiheader::biBitCount
int16_t biBitCount
Definition buffer.h:758
xine_bmiheader::biHeight
int32_t biHeight
Definition buffer.h:756
xine_bmiheader::biClrUsed
int32_t biClrUsed
Definition buffer.h:763
xine_bmiheader::biSizeImage
int32_t biSizeImage
Definition buffer.h:760
xine_bmiheader::biPlanes
int16_t biPlanes
Definition buffer.h:757
xine_bmiheader::biYPelsPerMeter
int32_t biYPelsPerMeter
Definition buffer.h:762
xine_bmiheader::biClrImportant
int32_t biClrImportant
Definition buffer.h:764
xine_bmiheader::biCompression
uint32_t biCompression
Definition buffer.h:759
xine_bmiheader::biWidth
int32_t biWidth
Definition buffer.h:755
xine_ticket_s
Definition tickets.h:53
xine_waveformatex
xine version of WAVEFORMATEX.
Definition buffer.h:771
xine_waveformatex::wFormatTag
int16_t wFormatTag
Definition buffer.h:772
xine_waveformatex::cbSize
int16_t cbSize
Definition buffer.h:778
xine_waveformatex::nSamplesPerSec
int32_t nSamplesPerSec
Definition buffer.h:774
xine_waveformatex::wBitsPerSample
int16_t wBitsPerSample
Definition buffer.h:777
xine_waveformatex::nAvgBytesPerSec
int32_t nAvgBytesPerSec
Definition buffer.h:775
xine_waveformatex::nChannels
int16_t nChannels
Definition buffer.h:773
xine_waveformatex::nBlockAlign
int16_t nBlockAlign
Definition buffer.h:776
tickets.h