summaryrefslogtreecommitdiff
path: root/src/xine-engine/buffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/xine-engine/buffer.h')
-rw-r--r--src/xine-engine/buffer.h79
1 files changed, 48 insertions, 31 deletions
diff --git a/src/xine-engine/buffer.h b/src/xine-engine/buffer.h
index 35ab1e620..42302b30f 100644
--- a/src/xine-engine/buffer.h
+++ b/src/xine-engine/buffer.h
@@ -1,8 +1,8 @@
/*
- * Copyright (C) 2000-2004 the xine project
- *
+ * Copyright (C) 2000-2008 the xine project
+ *
* This file is part of xine, a free video player.
- *
+ *
* xine is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -35,10 +35,7 @@
extern "C" {
#endif
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
+#include <string.h>
#include <stdio.h>
#include <pthread.h>
#include <sys/types.h>
@@ -111,7 +108,7 @@ extern "C" {
#define BUF_VIDEO_WMV8 0x02140000
#define BUF_VIDEO_MSVC 0x02150000
#define BUF_VIDEO_DV 0x02160000
-#define BUF_VIDEO_REAL 0x02170000
+#define BUF_VIDEO_REAL 0x02170000
#define BUF_VIDEO_VP31 0x02180000
#define BUF_VIDEO_H263 0x02190000
#define BUF_VIDEO_3IVX 0x021A0000
@@ -190,6 +187,8 @@ extern "C" {
#define BUF_VIDEO_VP6F 0x02630000
#define BUF_VIDEO_THEORA_RAW 0x02640000
#define BUF_VIDEO_VC1 0x02650000
+#define BUF_VIDEO_VMNC 0x02660000
+#define BUF_VIDEO_SNOW 0x02670000
/* audio buffer types: (please keep in sync with buffer_types.c) */
@@ -210,7 +209,7 @@ extern "C" {
#define BUF_AUDIO_VOXWARE 0x030c0000
#define BUF_AUDIO_ACELPNET 0x030d0000
#define BUF_AUDIO_AAC 0x030e0000
-#define BUF_AUDIO_DNET 0x030f0000
+#define BUF_AUDIO_DNET 0x030f0000
#define BUF_AUDIO_VIVOG723 0x03100000
#define BUF_AUDIO_DK3ADPCM 0x03110000
#define BUF_AUDIO_DK4ADPCM 0x03120000
@@ -228,10 +227,10 @@ extern "C" {
#define BUF_AUDIO_GSM610 0x031E0000
#define BUF_AUDIO_EA_ADPCM 0x031F0000
#define BUF_AUDIO_WMAV2 0x03200000
-#define BUF_AUDIO_COOK 0x03210000
-#define BUF_AUDIO_ATRK 0x03220000
-#define BUF_AUDIO_14_4 0x03230000
-#define BUF_AUDIO_28_8 0x03240000
+#define BUF_AUDIO_COOK 0x03210000
+#define BUF_AUDIO_ATRK 0x03220000
+#define BUF_AUDIO_14_4 0x03230000
+#define BUF_AUDIO_28_8 0x03240000
#define BUF_AUDIO_SIPRO 0x03250000
#define BUF_AUDIO_WMAV3 0x03260000
#define BUF_AUDIO_INTERPLAY 0x03270000
@@ -257,6 +256,9 @@ extern "C" {
#define BUF_AUDIO_SMACKER 0x033B0000
#define BUF_AUDIO_FLVADPCM 0x033C0000
#define BUF_AUDIO_WAVPACK 0x033D0000
+#define BUF_AUDIO_MP3ADU 0x033E0000
+#define BUF_AUDIO_AMR_NB 0x033F0000
+#define BUF_AUDIO_AMR_WB 0x03400000
/* spu buffer types: */
@@ -269,6 +271,7 @@ extern "C" {
#define BUF_SPU_CVD 0x04050000
#define BUF_SPU_OGM 0x04060000
#define BUF_SPU_CMML 0x04070000
+#define BUF_SPU_HDMV 0x04080000
/* demuxer block types: */
@@ -281,7 +284,7 @@ typedef struct extra_info_s extra_info_t;
* to output frames (past decoder). new data must be added after the existing
* fields for backward compatibility.
*/
-
+
struct extra_info_s {
int input_normpos; /* remember where this buf came from in
@@ -290,10 +293,10 @@ struct extra_info_s {
int input_time; /* time offset in miliseconds from
* beginning of stream */
uint32_t frame_number; /* number of current frame if known */
-
+
int seek_count; /* internal engine use */
- int64_t vpts; /* set on output layers only */
-
+ int64_t vpts; /* set on output layers only */
+
int invalid; /* do not use this extra info to update anything */
int total_time; /* duration in miliseconds of the stream */
};
@@ -319,7 +322,7 @@ struct buf_element_s {
uint32_t decoder_flags; /* stuff like keyframe, is_header ... see below */
/* additional decoder flags and other dec-spec. stuff */
- uint32_t decoder_info[BUF_NUM_DEC_INFO];
+ uint32_t decoder_info[BUF_NUM_DEC_INFO];
/* pointers to dec-spec. stuff */
void *decoder_info_ptr[BUF_NUM_DEC_INFO];
@@ -366,12 +369,22 @@ struct buf_element_s {
* xine_waveformatex is actually optional since the most important
* information for audio init is available from decoder_info[].
* note: BUF_FLAG_HEADER must also be set. */
-#define BUF_FLAG_STDHEADER 0x0400
+#define BUF_FLAG_STDHEADER 0x0400
/* decoder_info[1] carries numerator for display aspect ratio
* decoder_info[2] carries denominator for display aspect ratio */
#define BUF_FLAG_ASPECT 0x0800
+/* represent the state of gapless_switch at the time buf was enqueued */
+#define BUF_FLAG_GAPLESS_SW 0x1000
+
+/* Amount of audio padding added by encoder (mp3, aac). These empty
+ * audio frames are causing a gap when switching between mp3 files.
+ * decoder_info[1] carries amount of audio frames padded at the
+ * beginning of the buffer
+ * decoder_info[2] carries amount of audio frames padded at the end of
+ * the buffer */
+#define BUF_FLAG_AUDIO_PADDING 0x2000
/* Special buffer types:
* Sometimes there is a need to relay special information from a demuxer
@@ -443,7 +456,7 @@ struct buf_element_s {
* four length bytes at the beginning
* decoder_info_ptr[2] = pointer to ImageDescription atom, starting with
* the codec fourcc
- * Some Quicktime decoders need information contained within the
+ * Some Quicktime decoders need information contained within the
* ImageDescription atom inside a Quicktime file's stsd atom. This
* special buffer carries the ImageDescription atom from the QT demuxer
* to an A/V decoder.
@@ -476,7 +489,7 @@ struct buf_element_s {
* In a BUF_SPECIAL_SPU_DVD_SUBTYPE:
* decoder_info[1] = BUF_SPECIAL_SPU_DVD_SUBTYPE
* decoder_info[2] = subtype
- * decoder_info[3] =
+ * decoder_info[3] =
* This buffer is pass SPU subtypes from DVDs
*/
#define BUF_SPECIAL_SPU_DVD_SUBTYPE 8
@@ -516,7 +529,7 @@ struct spu_dvb_descriptor_s
long comp_page_id;
long aux_page_id;
} ;
-
+
typedef struct palette_entry_s palette_entry_t;
struct palette_entry_s
{
@@ -605,8 +618,8 @@ struct fifo_buffer_s
* allocate num_buffers of buf_size bytes each
*/
-fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE_PROTECTED;
-fifo_buffer_t *_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE_PROTECTED;
+fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE_MALLOC XINE_PROTECTED;
+fifo_buffer_t *_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE_MALLOC XINE_PROTECTED;
/* return BUF_VIDEO_xxx given the fourcc
@@ -616,16 +629,16 @@ fifo_buffer_t *_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size) XIN
uint32_t _x_fourcc_to_buf_video( uint32_t fourcc_int ) XINE_PROTECTED;
/* return codec name given BUF_VIDEO_xxx */
-char * _x_buf_video_name( uint32_t buf_type ) XINE_PROTECTED;
+const char * _x_buf_video_name( uint32_t buf_type ) XINE_PROTECTED;
/* return BUF_AUDIO_xxx given the formattag */
uint32_t _x_formattag_to_buf_audio( uint32_t formattag ) XINE_PROTECTED;
/* return codec name given BUF_AUDIO_xxx */
-char * _x_buf_audio_name( uint32_t buf_type ) XINE_PROTECTED;
+const char * _x_buf_audio_name( uint32_t buf_type ) XINE_PROTECTED;
-#ifndef ATTRIBUTE_PACKED
+#ifndef SUPPORT_ATTRIBUTE_PACKED
/* no attribute packed? let's try with pragma pack as a last resort */
#pragma pack(2)
#endif
@@ -634,7 +647,7 @@ char * _x_buf_audio_name( uint32_t buf_type ) XINE_PROTECTED;
* - will always use machine endian format, so demuxers reading
* stuff from win32 formats must use the function below.
*/
-typedef struct __attribute__((__packed__)) {
+typedef struct XINE_PACKED {
int32_t biSize;
int32_t biWidth;
int32_t biHeight;
@@ -648,10 +661,10 @@ typedef struct __attribute__((__packed__)) {
int32_t biClrImportant;
} xine_bmiheader;
-/* this is xine version of WAVEFORMATEX
+/* this is xine version of WAVEFORMATEX
* (the same comments from xine_bmiheader)
*/
-typedef struct __attribute__((__packed__)) {
+typedef struct XINE_PACKED {
int16_t wFormatTag;
int16_t nChannels;
int32_t nSamplesPerSec;
@@ -660,7 +673,7 @@ typedef struct __attribute__((__packed__)) {
int16_t wBitsPerSample;
int16_t cbSize;
} xine_waveformatex;
-#ifndef ATTRIBUTE_PACKED
+#ifndef SUPPORT_ATTRIBUTE_PACKED
#pragma pack()
#endif
@@ -670,6 +683,10 @@ void _x_bmiheader_le2me( xine_bmiheader *bih ) XINE_PROTECTED;
/* convert xine_waveformatex struct from little endian */
void _x_waveformatex_le2me( xine_waveformatex *wavex ) XINE_PROTECTED;
+static __inline int _x_is_fourcc(void *ptr, void *tag) {
+ return memcmp(ptr, tag, 4) == 0;
+}
+
#ifdef __cplusplus
}
#endif