From b502e15322d2fe9c41645a0905683e7783cf2a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Wed, 18 Apr 2007 16:58:51 +0200 Subject: Permit to build against libdca 0.0.5. To build against this, we need to make sure that the system dts.h header is used instead of the internal copy of it, as the internal copy will declare the functions with the old names, while libdca's system header will create macro aliases between the old names and the new ones. Better fix will be implemented in 1.2 series. --HG-- rename : src/libdts/dts.h => src/libdts/internal-dts.h --- src/libdts/Makefile.am | 2 +- src/libdts/dts.h | 85 ------------------------------------------- src/libdts/internal-dts.h | 85 +++++++++++++++++++++++++++++++++++++++++++ src/libdts/xine_dts_decoder.c | 7 +++- 4 files changed, 92 insertions(+), 87 deletions(-) delete mode 100644 src/libdts/dts.h create mode 100644 src/libdts/internal-dts.h (limited to 'src') diff --git a/src/libdts/Makefile.am b/src/libdts/Makefile.am index 207755f1f..ea09aab2e 100644 --- a/src/libdts/Makefile.am +++ b/src/libdts/Makefile.am @@ -24,5 +24,5 @@ else xineplug_decode_dts_la_LIBADD = $(XINE_LIB) -lm endif -noinst_HEADERS = bitstream.h dts.h dts_internal.h tables.h tables_adpcm.h \ +noinst_HEADERS = bitstream.h internal-dts.h dts_internal.h tables.h tables_adpcm.h \ tables_fir.h tables_huffman.h tables_quantization.h tables_vq.h diff --git a/src/libdts/dts.h b/src/libdts/dts.h deleted file mode 100644 index 30f3a197b..000000000 --- a/src/libdts/dts.h +++ /dev/null @@ -1,85 +0,0 @@ -/* - * dts.h - * Copyright (C) 2004 Gildas Bazin - * - * This file is part of dtsdec, a free DTS Coherent Acoustics stream decoder. - * See http://www.videolan.org/dtsdec.html for updates. - * - * dtsdec 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 - * (at your option) any later version. - * - * dtsdec is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef DTS_H -#define DTS_H - -/* x86 accelerations */ -#define MM_ACCEL_X86_MMX 0x80000000 -#define MM_ACCEL_X86_3DNOW 0x40000000 -#define MM_ACCEL_X86_MMXEXT 0x20000000 - -uint32_t mm_accel (void); - -#if defined(LIBDTS_FIXED) -typedef int32_t sample_t; -typedef int32_t level_t; -#elif defined(LIBDTS_DOUBLE) -typedef double sample_t; -typedef double level_t; -#else -typedef float sample_t; -typedef float level_t; -#endif - -typedef struct dts_state_s dts_state_t; - -#define DTS_MONO 0 -#define DTS_CHANNEL 1 -#define DTS_STEREO 2 -#define DTS_STEREO_SUMDIFF 3 -#define DTS_STEREO_TOTAL 4 -#define DTS_3F 5 -#define DTS_2F1R 6 -#define DTS_3F1R 7 -#define DTS_2F2R 8 -#define DTS_3F2R 9 -#define DTS_4F2R 10 - -#define DTS_DOLBY 101 /* FIXME */ - -#define DTS_CHANNEL_MAX DTS_3F2R /* We don't handle anything above that */ -#define DTS_CHANNEL_BITS 6 -#define DTS_CHANNEL_MASK 0x3F - -#define DTS_LFE 0x80 -#define DTS_ADJUST_LEVEL 0x100 - -dts_state_t * dts_init (uint32_t mm_accel); - -int dts_syncinfo (dts_state_t *state, uint8_t * buf, int * flags, - int * sample_rate, int * bit_rate, int *frame_length); - -int dts_frame (dts_state_t * state, uint8_t * buf, int * flags, - level_t * level, sample_t bias); - -void dts_dynrng (dts_state_t * state, - level_t (* call) (level_t, void *), void * data); - -int dts_blocks_num (dts_state_t * state); -int dts_block (dts_state_t * state); - -sample_t * dts_samples (dts_state_t * state); - -void dts_free (dts_state_t * state); - -#endif /* DTS_H */ diff --git a/src/libdts/internal-dts.h b/src/libdts/internal-dts.h new file mode 100644 index 000000000..30f3a197b --- /dev/null +++ b/src/libdts/internal-dts.h @@ -0,0 +1,85 @@ +/* + * dts.h + * Copyright (C) 2004 Gildas Bazin + * + * This file is part of dtsdec, a free DTS Coherent Acoustics stream decoder. + * See http://www.videolan.org/dtsdec.html for updates. + * + * dtsdec 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 + * (at your option) any later version. + * + * dtsdec is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef DTS_H +#define DTS_H + +/* x86 accelerations */ +#define MM_ACCEL_X86_MMX 0x80000000 +#define MM_ACCEL_X86_3DNOW 0x40000000 +#define MM_ACCEL_X86_MMXEXT 0x20000000 + +uint32_t mm_accel (void); + +#if defined(LIBDTS_FIXED) +typedef int32_t sample_t; +typedef int32_t level_t; +#elif defined(LIBDTS_DOUBLE) +typedef double sample_t; +typedef double level_t; +#else +typedef float sample_t; +typedef float level_t; +#endif + +typedef struct dts_state_s dts_state_t; + +#define DTS_MONO 0 +#define DTS_CHANNEL 1 +#define DTS_STEREO 2 +#define DTS_STEREO_SUMDIFF 3 +#define DTS_STEREO_TOTAL 4 +#define DTS_3F 5 +#define DTS_2F1R 6 +#define DTS_3F1R 7 +#define DTS_2F2R 8 +#define DTS_3F2R 9 +#define DTS_4F2R 10 + +#define DTS_DOLBY 101 /* FIXME */ + +#define DTS_CHANNEL_MAX DTS_3F2R /* We don't handle anything above that */ +#define DTS_CHANNEL_BITS 6 +#define DTS_CHANNEL_MASK 0x3F + +#define DTS_LFE 0x80 +#define DTS_ADJUST_LEVEL 0x100 + +dts_state_t * dts_init (uint32_t mm_accel); + +int dts_syncinfo (dts_state_t *state, uint8_t * buf, int * flags, + int * sample_rate, int * bit_rate, int *frame_length); + +int dts_frame (dts_state_t * state, uint8_t * buf, int * flags, + level_t * level, sample_t bias); + +void dts_dynrng (dts_state_t * state, + level_t (* call) (level_t, void *), void * data); + +int dts_blocks_num (dts_state_t * state); +int dts_block (dts_state_t * state); + +sample_t * dts_samples (dts_state_t * state); + +void dts_free (dts_state_t * state); + +#endif /* DTS_H */ diff --git a/src/libdts/xine_dts_decoder.c b/src/libdts/xine_dts_decoder.c index 902d8c5b6..0ef9afa17 100644 --- a/src/libdts/xine_dts_decoder.c +++ b/src/libdts/xine_dts_decoder.c @@ -49,7 +49,12 @@ #include "xineutils.h" #include "audio_out.h" #include "buffer.h" -#include "dts.h" + +#ifdef HAVE_DTS_H +# include +#else +# include "internal-dts.h" +#endif #define MAX_AC5_FRAME 4096 -- cgit v1.2.3