summaryrefslogtreecommitdiff
path: root/src/libfaad/faad.h
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-07-14 23:43:01 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2002-07-14 23:43:01 +0000
commit53c5ec96b87ef2bb61c7d3188d549623495d4500 (patch)
treea1b4904418281d23a2ab750b70be88db40062aa3 /src/libfaad/faad.h
parent0ee981a355115c35cc9b6aa5066d6b7271c4b28a (diff)
downloadxine-lib-53c5ec96b87ef2bb61c7d3188d549623495d4500.tar.gz
xine-lib-53c5ec96b87ef2bb61c7d3188d549623495d4500.tar.bz2
merge FAAD2 - the GPL AAC decoder library.
xine_decoder.c is working, but demux_qt must send some needed initialization data. currently it's hardcoded to play my test stream, so it's not usable yet. CVS patchset: 2267 CVS date: 2002/07/14 23:43:01
Diffstat (limited to 'src/libfaad/faad.h')
-rw-r--r--src/libfaad/faad.h121
1 files changed, 121 insertions, 0 deletions
diff --git a/src/libfaad/faad.h b/src/libfaad/faad.h
new file mode 100644
index 000000000..68e5bf3a6
--- /dev/null
+++ b/src/libfaad/faad.h
@@ -0,0 +1,121 @@
+/*
+** FAAD - Freeware Advanced Audio Decoder
+** Copyright (C) 2002 M. Bakker
+**
+** This program 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.
+**
+** This program 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.
+**
+** $Id: faad.h,v 1.1 2002/07/14 23:43:01 miguelfreitas Exp $
+**/
+
+#ifndef __AACDEC_H__
+#define __AACDEC_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#ifdef _WIN32
+ #pragma pack(push, 8)
+ #ifndef FAADAPI
+ #define FAADAPI __cdecl
+ #endif
+#else
+ #ifndef FAADAPI
+ #define FAADAPI
+ #endif
+#endif
+
+
+#define MAIN 0
+#define LC 1
+#define SSR 2
+#define LTP 3
+#define ER_LC 17
+#define LD 23
+#define DRM_ER_LC 27 /* special object type for DRM */
+
+#define FAAD_FMT_16BIT 1
+#define FAAD_FMT_24BIT 2
+#define FAAD_FMT_32BIT 3
+#define FAAD_FMT_FLOAT 4
+
+/* A decode call can eat up to FAAD_MIN_STREAMSIZE octets per decoded channel,
+ so at least so much octets per channel should be available in this stream */
+#define FAAD_MIN_STREAMSIZE 768 /* 6144 bits/channel */
+
+
+typedef void *faacDecHandle;
+
+
+typedef struct faacDecConfiguration
+{
+ unsigned char defObjectType;
+ unsigned long defSampleRate;
+ unsigned char outputFormat;
+} faacDecConfiguration, *faacDecConfigurationPtr;
+
+typedef struct faacDecFrameInfo
+{
+ unsigned long bytesconsumed;
+ unsigned long samples;
+ unsigned char channels;
+ unsigned char error;
+} faacDecFrameInfo;
+
+unsigned char* FAADAPI faacDecGetErrorMessage(unsigned char errcode);
+
+faacDecHandle FAADAPI faacDecOpen();
+
+faacDecConfigurationPtr FAADAPI faacDecGetCurrentConfiguration(faacDecHandle hDecoder);
+
+unsigned char FAADAPI faacDecSetConfiguration(faacDecHandle hDecoder,
+ faacDecConfigurationPtr config);
+
+/* Init the library based on info from the AAC file (ADTS/ADIF) */
+long FAADAPI faacDecInit(faacDecHandle hDecoder,
+ unsigned char *buffer,
+ unsigned long *samplerate,
+ unsigned char *channels);
+
+/* Init the library using a DecoderSpecificInfo */
+char FAADAPI faacDecInit2(faacDecHandle hDecoder, unsigned char *pBuffer,
+ unsigned long SizeOfDecoderSpecificInfo,
+ unsigned long *samplerate, unsigned char *channels);
+
+void FAADAPI faacDecClose(faacDecHandle hDecoder);
+
+void* FAADAPI faacDecDecode(faacDecHandle hDecoder,
+ faacDecFrameInfo *hInfo,
+ unsigned char *buffer);
+
+char FAADAPI AudioSpecificConfig(unsigned char *pBuffer,
+ unsigned long *samplerate,
+ unsigned char *channels,
+ unsigned char *sf_index,
+ unsigned char *object_type,
+ unsigned char *aacSectionDataResilienceFlag,
+ unsigned char *aacScalefactorDataResilienceFlag,
+ unsigned char *aacSpectralDataResilienceFlag,
+ unsigned char *frameLengthFlag);
+
+#ifdef _WIN32
+ #pragma pack(pop)
+#endif
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif