├── AndroidManifest.xml
├── COPYING
├── README
├── build.properties
├── build.xml
├── default.properties
├── ffmpeg-0.6.1.patch
├── jni
├── Android.mk
├── Application.mk
├── Makefile
├── aac-decoder
│ ├── Android.mk
│ ├── aac-array-common.c
│ ├── aac-array-common.h
│ ├── aac-array-decoder.c
│ ├── aac-array-decoder.h
│ ├── aac-common.c
│ ├── aac-common.h
│ ├── aac-decoder.h
│ ├── aac-faad2-decoder.c
│ ├── aac-ffmpeg-decoder.c
│ ├── aac-ffmpeg-wma-decoder.c
│ ├── aac-opencore-decoder.c
│ ├── array.mk
│ ├── faad2.mk
│ ├── ffmpeg.mk
│ └── opencore-aacdec.mk
├── check-names.pl
├── faad2
│ ├── Android.mk
│ ├── config.h
│ ├── include
│ │ ├── faad.h
│ │ └── neaacdec.h
│ └── libfaad
│ │ ├── Makefile.am
│ │ ├── Makefile.in
│ │ ├── analysis.h
│ │ ├── bits.c
│ │ ├── bits.h
│ │ ├── cfft.c
│ │ ├── cfft.h
│ │ ├── cfft_tab.h
│ │ ├── codebook
│ │ ├── hcb.h
│ │ ├── hcb_1.h
│ │ ├── hcb_10.h
│ │ ├── hcb_11.h
│ │ ├── hcb_2.h
│ │ ├── hcb_3.h
│ │ ├── hcb_4.h
│ │ ├── hcb_5.h
│ │ ├── hcb_6.h
│ │ ├── hcb_7.h
│ │ ├── hcb_8.h
│ │ ├── hcb_9.h
│ │ └── hcb_sf.h
│ │ ├── common.c
│ │ ├── common.h
│ │ ├── decoder.c
│ │ ├── drc.c
│ │ ├── drc.h
│ │ ├── drm_dec.c
│ │ ├── drm_dec.h
│ │ ├── error.c
│ │ ├── error.h
│ │ ├── filtbank.c
│ │ ├── filtbank.h
│ │ ├── fixed.h
│ │ ├── hcr.c
│ │ ├── huffman.c
│ │ ├── huffman.h
│ │ ├── ic_predict.c
│ │ ├── ic_predict.h
│ │ ├── iq_table.h
│ │ ├── is.c
│ │ ├── is.h
│ │ ├── kbd_win.h
│ │ ├── libfaad.sln
│ │ ├── libfaad.vcproj
│ │ ├── libfaad2.def
│ │ ├── libfaad2_dll.sln
│ │ ├── libfaad2_dll.vcproj
│ │ ├── lt_predict.c
│ │ ├── lt_predict.h
│ │ ├── mdct.c
│ │ ├── mdct.h
│ │ ├── mdct_tab.h
│ │ ├── mp4.c
│ │ ├── mp4.h
│ │ ├── ms.c
│ │ ├── ms.h
│ │ ├── output.c
│ │ ├── output.h
│ │ ├── pns.c
│ │ ├── pns.h
│ │ ├── ps_dec.c
│ │ ├── ps_dec.h
│ │ ├── ps_syntax.c
│ │ ├── ps_tables.h
│ │ ├── pulse.c
│ │ ├── pulse.h
│ │ ├── rvlc.c
│ │ ├── rvlc.h
│ │ ├── sbr_dct.c
│ │ ├── sbr_dct.h
│ │ ├── sbr_dec.c
│ │ ├── sbr_dec.h
│ │ ├── sbr_e_nf.c
│ │ ├── sbr_e_nf.h
│ │ ├── sbr_fbt.c
│ │ ├── sbr_fbt.h
│ │ ├── sbr_hfadj.c
│ │ ├── sbr_hfadj.h
│ │ ├── sbr_hfgen.c
│ │ ├── sbr_hfgen.h
│ │ ├── sbr_huff.c
│ │ ├── sbr_huff.h
│ │ ├── sbr_noise.h
│ │ ├── sbr_qmf.c
│ │ ├── sbr_qmf.h
│ │ ├── sbr_qmf_c.h
│ │ ├── sbr_syntax.c
│ │ ├── sbr_syntax.h
│ │ ├── sbr_tf_grid.c
│ │ ├── sbr_tf_grid.h
│ │ ├── sine_win.h
│ │ ├── specrec.c
│ │ ├── specrec.h
│ │ ├── ssr.c
│ │ ├── ssr.h
│ │ ├── ssr_fb.c
│ │ ├── ssr_fb.h
│ │ ├── ssr_ipqf.c
│ │ ├── ssr_ipqf.h
│ │ ├── ssr_win.h
│ │ ├── structs.h
│ │ ├── syntax.c
│ │ ├── syntax.h
│ │ ├── tns.c
│ │ └── tns.h
├── ffmpeg
│ ├── Android.mk
│ └── config.h
├── libmms
│ ├── Android.mk
│ ├── android-log.h
│ ├── config.h
│ ├── mms-inputstream.c
│ ├── mms-inputstream.h
│ └── src
│ │ ├── asfheader.h
│ │ ├── bswap.h
│ │ ├── mms-common-funcs.h
│ │ ├── mms-common.h
│ │ ├── mms.c
│ │ ├── mms.h
│ │ ├── mms_config.h
│ │ ├── mmsh.c
│ │ ├── mmsh.h
│ │ ├── mmsio.h
│ │ ├── mmsx.c
│ │ ├── mmsx.h
│ │ ├── uri.c
│ │ └── uri.h
├── opencore-aacdec.patch
└── opencore-aacdec
│ ├── Android.mk
│ ├── Apache-LICENSE-2.0.txt
│ └── config.h
├── res
├── layout
│ └── main.xml
├── values-cs
│ └── strings.xml
└── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── sample.ant.properties
├── sample.local.properties
└── src
└── com
└── spoledge
└── aacplayer
├── AACFileChunkPlayer.java
├── AACPlayer.java
├── AACPlayerActivity.java
├── ArrayAACPlayer.java
├── ArrayBufferReader.java
├── ArrayDecoder.java
├── ArrayPCMFeed.java
├── Decoder.java
├── History.java
├── MMSInputStream.java
├── PCMFeed.java
└── PlayerCallback.java
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
12 |
16 |
17 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/build.properties:
--------------------------------------------------------------------------------
1 | # This file is used to override default values used by the Ant build system.
2 | #
3 | # This file must be checked in Version Control Systems, as it is
4 | # integral to the build system of your project.
5 |
6 | # This file is only used by the Ant script.
7 |
8 | # You can use this to override default values such as
9 | # 'source.dir' for the location of your java source folder and
10 | # 'out.dir' for the location of your output folder.
11 |
12 | # You can also use it define how the release builds are signed by declaring
13 | # the following properties:
14 | # 'key.store' for the location of your keystore and
15 | # 'key.alias' for the name of the key to use.
16 | # The password will be asked during the build when you use the 'release' target.
17 |
18 | # The name of your application package as defined in the manifest.
19 | # Used by the 'uninstall' rule.
20 | application.package=com.spoledge.aacplayer
21 |
--------------------------------------------------------------------------------
/build.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
12 |
13 |
14 |
15 | Missing property.
16 | The property 'ndk.home' is not set. It should point to Android NDK home dir.
17 | Please add it to your '.ant.properties' file.
18 |
19 |
20 |
21 | Missing property.
22 | The property 'aac.decoders' is not set. It should contain a list of jni modules.
23 | Please add it to your '.ant.properties' file.
24 |
25 |
26 |
27 | Missing property.
28 | The property 'jni.loglevel' is not set. It should contain the target loglevel.
29 | Please add it to your '.ant.properties' file.
30 |
31 |
32 |
52 |
53 |
54 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
--------------------------------------------------------------------------------
/default.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system use,
7 | # "build.properties", and override values to adapt the script to your
8 | # project structure.
9 |
10 | # Project target.
11 | target=android-3
12 |
--------------------------------------------------------------------------------
/jni/Android.mk:
--------------------------------------------------------------------------------
1 | mydir := $(call my-dir)
2 |
3 | #
4 | # Include the aac.decoders property:
5 | #
6 | include $(mydir)/../.ant.properties
7 |
8 | AAC_DECODERS := $(aac.decoders)
9 | LOGLEVEL := $(jni.loglevel)
10 | MMS_WMA := $(mms)
11 |
12 | LOGLEVELS =
13 | # Loglevels
14 | ifeq ($(LOGLEVEL),error)
15 | LOGLEVELS += ERROR
16 | endif
17 | ifeq ($(LOGLEVEL),warn)
18 | LOGLEVELS += ERROR WARN
19 | endif
20 | ifeq ($(LOGLEVEL),info)
21 | LOGLEVELS += ERROR WARN INFO
22 | endif
23 | ifeq ($(LOGLEVEL),debug)
24 | LOGLEVELS += ERROR WARN INFO DEBUG
25 | endif
26 | ifeq ($(LOGLEVEL),trace)
27 | LOGLEVELS += ERROR WARN INFO DEBUG TRACE
28 | endif
29 |
30 | cflags_loglevels := $(foreach ll,$(LOGLEVELS),-DAACD_LOGLEVEL_$(ll))
31 |
32 | include $(mydir)/aac-decoder/Android.mk
33 |
34 | ifeq ($(MMS_WMA),yes)
35 | include $(mydir)/libmms/Android.mk
36 | endif
37 |
38 | #dump:
39 | # $(warning $(modules-dump-database))
40 | # $(warning $(dump-src-file-tags))
41 | # $(error Dump finished)
42 |
--------------------------------------------------------------------------------
/jni/Application.mk:
--------------------------------------------------------------------------------
1 | APP_ABI := armeabi armeabi-v7a
2 |
--------------------------------------------------------------------------------
/jni/Makefile:
--------------------------------------------------------------------------------
1 | #
2 | # This is a shortcut Makefile allowing to directly compile in VIM :mak
3 | #
4 |
5 | include ../.ant.properties
6 |
7 | all:
8 | make -f $(ndk.home)/build/core/build-local.mk $(make.options)
9 |
10 | dump:
11 | make -f $(ndk.home)/build/core/build-local.mk dump
12 |
13 | TAGS:
14 | ctags --links=no -R aac-decoder ffmpeg faad2 opencore-aacdec
15 |
--------------------------------------------------------------------------------
/jni/aac-decoder/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | AAC_DECODER_FEATURES =
6 | needs_mks = $(LOCAL_PATH)/array.mk
7 | needs_cpufeatures =
8 |
9 |
10 | # Decoder: FAAD2
11 | ifneq ($(findstring faad2,$(AAC_DECODERS)),)
12 | AAC_DECODER_FEATURES += FAAD2
13 | needs_mks += $(LOCAL_PATH)/faad2.mk
14 | endif
15 |
16 | # Decoder: FFMPEG
17 | ifneq ($(findstring ffmpeg,$(AAC_DECODERS)),)
18 | # needs_cpufeatures = cpufeatures
19 | AAC_DECODER_FEATURES += FFMPEG
20 | needs_mks += $(LOCAL_PATH)/ffmpeg.mk
21 | ifeq ($(MMS_WMA),yes)
22 | AAC_DECODER_FEATURES += FFMPEG_WMA
23 | endif
24 | else ifeq ($(MMS_WMA),yes)
25 | AAC_DECODER_FEATURES += FFMPEG_WMA
26 | needs_mks += $(LOCAL_PATH)/ffmpeg.mk
27 | endif
28 |
29 | # Decoder: OpenCORE
30 | ifneq ($(findstring opencore-aacdec,$(AAC_DECODERS)),)
31 | AAC_DECODER_FEATURES += OPENCORE
32 | needs_mks += $(LOCAL_PATH)/opencore-aacdec.mk
33 | endif
34 |
35 |
36 | # Build components:
37 | include $(needs_mks)
38 |
39 |
40 | # Build cpufeatures if needed
41 | ifneq ($(needs_cpufeatures),)
42 | include $(NDK_ROOT)/sources/cpufeatures/Android.mk
43 | endif
44 |
45 |
--------------------------------------------------------------------------------
/jni/aac-decoder/aac-array-common.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** AACPlayer - Freeware Advanced Audio (AAC) Player for Android
3 | ** Copyright (C) 2011 Spolecne s.r.o., http://www.spoledge.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 3 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program. If not, see .
17 | **/
18 |
19 | #ifndef AAC_ARRAY_COMMON_H
20 | #define AAC_ARRAY_COMMON_H
21 |
22 | #include "aac-common.h"
23 |
24 | #ifdef __cplusplus
25 | extern "C" {
26 | #endif
27 |
28 | typedef struct AACDArrayInfo {
29 | AACDCommonInfo cinfo;
30 |
31 | // internal input buffer
32 | unsigned char *buffer_block;
33 | unsigned char *buffer_block2;
34 | unsigned long bbsize2;
35 |
36 | // internal output buffer
37 | jshort *samples;
38 | unsigned long samplesLen;
39 |
40 | //
41 | // The following fields to be moved to AACDCommonInfo:
42 | //
43 |
44 | // the last known JNIEnv:
45 | JNIEnv *env;
46 |
47 | // the input buffer reader object:
48 | jobject *reader;
49 |
50 | // the callback variable - Decoder.Info:
51 | jobject *aacInfo;
52 |
53 | // the decoders impl methods:
54 | AACDDecoder *decoder;
55 |
56 | // extended info - each decoder can use it for its own purposes:
57 | void *ext;
58 |
59 | } AACDArrayInfo;
60 |
61 |
62 |
63 | /**
64 | * Starts the service - initializes resource.
65 | */
66 | AACDArrayInfo* aacda_start( JNIEnv *env, AACDDecoder *decoder, jobject jreader, jobject aacInfo);
67 |
68 |
69 | /**
70 | * Stops the service and frees resources.
71 | */
72 | void aacda_stop( AACDArrayInfo *ainfo );
73 |
74 |
75 | /**
76 | * Prepares input buffer by joining the rest of the old one and the new one.
77 | */
78 | unsigned char* aacda_prepare_buffer( AACDArrayInfo *ainfo, jbyteArray inBuf, jint inOff, jint inLen );
79 |
80 |
81 | /**
82 | * Reads next buffer.
83 | */
84 | unsigned char* aacda_read_buffer( AACDArrayInfo *ainfo );
85 |
86 |
87 | /**
88 | * Prepares output buffer.
89 | */
90 | jshort* aacda_prepare_samples( AACDArrayInfo *ainfo, jint outLen );
91 |
92 |
93 | /**
94 | * Decodes the stream - one round until the output buffer is (almost) filled.
95 | */
96 | void aacda_decode( AACDArrayInfo *ainfo, jshort *samples, jint outLen );
97 |
98 |
99 | #ifdef __cplusplus
100 | }
101 | #endif
102 | #endif
103 |
104 |
--------------------------------------------------------------------------------
/jni/aac-decoder/aac-array-decoder.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** AACPlayer - Freeware Advanced Audio (AAC) Player for Android
3 | ** Copyright (C) 2011 Spolecne s.r.o., http://www.spoledge.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 3 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program. If not, see .
17 | **/
18 |
19 | /* Header for class com_spoledge_aacplayer_ArrayDecoder */
20 |
21 | #ifndef _Included_com_spoledge_aacplayer_ArrayDecoder
22 | #define _Included_com_spoledge_aacplayer_ArrayDecoder
23 |
24 | #include "aac-decoder.h"
25 |
26 | #ifdef __cplusplus
27 | extern "C" {
28 | #endif
29 |
30 | /*
31 | * Class: com_spoledge_aacplayer_ArrayDecoder
32 | * Method: nativeGetFeatures
33 | * Signature: ()I
34 | */
35 | JNIEXPORT jint JNICALL Java_com_spoledge_aacplayer_ArrayDecoder_nativeGetFeatures
36 | (JNIEnv *, jclass);
37 |
38 | /*
39 | * Class: com_spoledge_aacplayer_ArrayDecoder
40 | * Method: nativeStart
41 | * Signature: (ILcom/spoledge/aacplayer/ArrayBufferReader;Lcom/spoledge/aacplayer/Decoder/Info;)I
42 | */
43 | JNIEXPORT jint JNICALL Java_com_spoledge_aacplayer_ArrayDecoder_nativeStart
44 | (JNIEnv *, jobject, jint, jobject, jobject);
45 |
46 | /*
47 | * Class: com_spoledge_aacplayer_ArrayDecoder
48 | * Method: nativeDecode
49 | * Signature: (I[SI)I
50 | */
51 | JNIEXPORT jint JNICALL Java_com_spoledge_aacplayer_ArrayDecoder_nativeDecode
52 | (JNIEnv *, jobject, jint, jshortArray, jint);
53 |
54 | /*
55 | * Class: com_spoledge_aacplayer_ArrayDecoder
56 | * Method: nativeStop
57 | * Signature: (I)V
58 | */
59 | JNIEXPORT void JNICALL Java_com_spoledge_aacplayer_ArrayDecoder_nativeStop
60 | (JNIEnv *, jobject, jint);
61 |
62 |
63 | #ifdef __cplusplus
64 | }
65 | #endif
66 | #endif
67 |
68 |
--------------------------------------------------------------------------------
/jni/aac-decoder/aac-common.c:
--------------------------------------------------------------------------------
1 | /*
2 | ** AACPlayer - Freeware Advanced Audio (AAC) Player for Android
3 | ** Copyright (C) 2011 Spolecne s.r.o., http://www.spoledge.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 3 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program. If not, see .
17 | **/
18 |
19 | #define AACD_MODULE "CommonDecoder"
20 |
21 | #include "aac-common.h"
22 |
23 | #include
24 |
25 | struct JavaDecoderInfo {
26 | jclass clazz;
27 | jfieldID sampleRate;
28 | jfieldID channels;
29 | jfieldID frameMaxBytesConsumed;
30 | jfieldID frameSamples;
31 | jfieldID roundFrames;
32 | jfieldID roundBytesConsumed;
33 | jfieldID roundSamples;
34 | };
35 |
36 | static struct JavaDecoderInfo javaDecoderInfo;
37 |
38 |
39 | int aacd_probe(unsigned char *buffer, int len)
40 | {
41 | int pos = 0;
42 | len -= 3;
43 |
44 | AACD_TRACE( "probe() start len=%d", len );
45 |
46 | while (pos < len)
47 | {
48 | if (*buffer != 0xff)
49 | {
50 | buffer++;
51 | pos++;
52 | }
53 | else if ((*(++buffer) & 0xf6) == 0xf0)
54 | {
55 | AACD_TRACE( "probe() found ADTS start at offset %d", pos );
56 | return pos;
57 | }
58 | else pos++;
59 | }
60 |
61 | AACD_WARN( "probe() could not find ADTS start" );
62 |
63 | return -1;
64 | }
65 |
66 |
67 | void aacd_start_info2java( JNIEnv *env, AACDCommonInfo *cinfo, jobject jinfo )
68 | {
69 | if (javaDecoderInfo.clazz == NULL)
70 | {
71 | AACD_TRACE( "aacd_start_info2java() - caching Java reflection" );
72 | javaDecoderInfo.clazz = (jclass) (*env)->GetObjectClass( env, jinfo );
73 | javaDecoderInfo.sampleRate = (jfieldID) (*env)->GetFieldID( env, javaDecoderInfo.clazz, "sampleRate", "I");
74 | javaDecoderInfo.channels = (jfieldID) (*env)->GetFieldID( env, javaDecoderInfo.clazz, "channels", "I");
75 | javaDecoderInfo.frameMaxBytesConsumed = (jfieldID) (*env)->GetFieldID( env, javaDecoderInfo.clazz, "frameMaxBytesConsumed", "I");
76 | javaDecoderInfo.frameSamples = (jfieldID) (*env)->GetFieldID( env, javaDecoderInfo.clazz, "frameSamples", "I");
77 | javaDecoderInfo.roundFrames = (jfieldID) (*env)->GetFieldID( env, javaDecoderInfo.clazz, "roundFrames", "I");
78 | javaDecoderInfo.roundBytesConsumed = (jfieldID) (*env)->GetFieldID( env, javaDecoderInfo.clazz, "roundBytesConsumed", "I");
79 | javaDecoderInfo.roundSamples = (jfieldID) (*env)->GetFieldID( env, javaDecoderInfo.clazz, "roundSamples", "I");
80 | }
81 |
82 | AACD_TRACE( "aacd_start_info2java() - storing info sampleRate=%d, channels=%d",
83 | cinfo->samplerate, cinfo->channels );
84 |
85 | (*env)->SetIntField( env, jinfo, javaDecoderInfo.sampleRate, (jint) cinfo->samplerate);
86 | (*env)->SetIntField( env, jinfo, javaDecoderInfo.channels, (jint) cinfo->channels);
87 |
88 | AACD_TRACE( "aacd_start_info2java() - finished" );
89 | }
90 |
91 |
92 | void aacd_decode_info2java( JNIEnv *env, AACDCommonInfo *cinfo, jobject jinfo )
93 | {
94 | AACD_TRACE( "aacd_decode_info2java() - storing info frameMaxBytesConsumed=%d, frameSamples=%d, roundFrames=%d, roundBytesConsumed=%d, roundSamples=%d",
95 | cinfo->frame_max_bytesconsumed, cinfo->frame_samples,
96 | cinfo->round_frames, cinfo->round_bytesconsumed, cinfo->round_samples );
97 |
98 | (*env)->SetIntField( env, jinfo, javaDecoderInfo.frameMaxBytesConsumed, (jint) cinfo->frame_max_bytesconsumed);
99 | (*env)->SetIntField( env, jinfo, javaDecoderInfo.frameSamples, (jint) cinfo->frame_samples);
100 | (*env)->SetIntField( env, jinfo, javaDecoderInfo.roundFrames, (jint) cinfo->round_frames);
101 | (*env)->SetIntField( env, jinfo, javaDecoderInfo.roundBytesConsumed, (jint) cinfo->round_bytesconsumed);
102 | (*env)->SetIntField( env, jinfo, javaDecoderInfo.roundSamples, (jint) cinfo->round_samples);
103 |
104 | AACD_TRACE( "aacd_decode_info2java() - finished" );
105 | }
106 |
107 |
108 |
--------------------------------------------------------------------------------
/jni/aac-decoder/aac-common.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** AACPlayer - Freeware Advanced Audio (AAC) Player for Android
3 | ** Copyright (C) 2011 Spolecne s.r.o., http://www.spoledge.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 3 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program. If not, see .
17 | **/
18 |
19 | #ifndef AAC_COMMON_H
20 | #define AAC_COMMON_H
21 |
22 | #include
23 | #include
24 |
25 | #ifndef AACD_MODULE
26 | #error "Please specify AACD_MODULE at the top of your file."
27 | #endif
28 |
29 |
30 | #ifdef AACD_LOGLEVEL_TRACE
31 | #define AACD_TRACE(...) \
32 | __android_log_print(ANDROID_LOG_VERBOSE, AACD_MODULE, __VA_ARGS__)
33 | #else
34 | #define AACD_TRACE(...) //
35 | #endif
36 |
37 | #ifdef AACD_LOGLEVEL_DEBUG
38 | #define AACD_DEBUG(...) \
39 | __android_log_print(ANDROID_LOG_DEBUG, AACD_MODULE, __VA_ARGS__)
40 | #else
41 | #define AACD_DEBUG(...) //
42 | #endif
43 |
44 | #ifdef AACD_LOGLEVEL_INFO
45 | #define AACD_INFO(...) \
46 | __android_log_print(ANDROID_LOG_INFO, AACD_MODULE, __VA_ARGS__)
47 | #else
48 | #define AACD_INFO(...) //
49 | #endif
50 |
51 | #ifdef AACD_LOGLEVEL_WARN
52 | #define AACD_WARN(...) \
53 | __android_log_print(ANDROID_LOG_WARN, AACD_MODULE, __VA_ARGS__)
54 | #else
55 | #define AACD_WARN(...) //
56 | #endif
57 |
58 | #ifdef AACD_LOGLEVEL_ERROR
59 | #define AACD_ERROR(...) \
60 | __android_log_print(ANDROID_LOG_ERROR, AACD_MODULE, __VA_ARGS__)
61 | #else
62 | #error "Ha AACD_LOGLEVEL_ERROR is not defined"
63 | #define AACD_ERROR(...) //
64 | #endif
65 |
66 |
67 | #ifdef __cplusplus
68 | extern "C" {
69 | #endif
70 |
71 | /**
72 | * This should be returned by the decoder's decode() method.
73 | */
74 | enum AACDDecodeResult {
75 | AACD_DECODE_OK = 0x0000,
76 | AACD_DECODE_EOF = 0x0001,
77 | AACD_DECODE_INPUT_NEEDED = 0x0100,
78 | AACD_DECODE_OUTPUT_NEEDED = 0x0200,
79 | AACD_DECODE_OTHER = 0x8000
80 | };
81 |
82 |
83 | /**
84 | * Common info struct used for storing info between calls.
85 | */
86 | typedef struct AACDCommonInfo {
87 | // flag for controlling the input - decoder reads the input data itself:
88 | int input_ctrl;
89 |
90 | unsigned long samplerate;
91 | unsigned char channels;
92 | unsigned long bytesconsumed;
93 | unsigned long bytesleft;
94 |
95 | unsigned char *buffer;
96 | unsigned long bbsize;
97 |
98 | // decode() function will fill these:
99 | unsigned long frame_bytesconsumed;
100 | unsigned long frame_samples;
101 |
102 | // max statistics allowing to predict when to finish decoding:
103 | unsigned long frame_max_bytesconsumed;
104 | unsigned long frame_max_bytesconsumed_exact;
105 | unsigned long frame_max_samples;
106 |
107 | // filled after each decoding round
108 | unsigned long round_frames;
109 | unsigned long round_bytesconsumed;
110 | unsigned long round_samples;
111 |
112 | } AACDCommonInfo;
113 |
114 |
115 | /**
116 | * Decoder definition.
117 | */
118 | typedef struct AACDDecoder {
119 | /**
120 | * Returns the name of the decoder.
121 | */
122 | const char* (*name)();
123 |
124 | /**
125 | * Initializes the decoder.
126 | * @param ext the decoder can allocate private data and modify the pointer
127 | * @return 0 on success; otherwise an error code
128 | */
129 | int (*init)(void** pext);
130 |
131 | /**
132 | * Start decoding.
133 | * Must fill at least sampleRate and number of channels (AACDCommonInfo).
134 | * @return either positive = number of bytes consumed; negative means an error code.
135 | */
136 | long (*start)( AACDCommonInfo*, void*, unsigned char*, unsigned long);
137 |
138 | /**
139 | * Decodes one frame.
140 | * @return AACDDecodeResult (0=OK)
141 | */
142 | int (*decode)( AACDCommonInfo*, void*, unsigned char *, unsigned long, jshort*, jint);
143 |
144 | /**
145 | * Destroys the decoder - the decoder should free all resources.
146 | */
147 | void (*destroy)( AACDCommonInfo*, void*);
148 |
149 | /**
150 | * Synchronizes stream.
151 | * @return the number of bytes to be skipped or -1 if no sync word found.
152 | */
153 | int (*sync)( unsigned char *buffer, int len );
154 | } AACDDecoder;
155 |
156 |
157 | /**************************************************************************************************
158 | * Functions
159 | *************************************************************************************************/
160 |
161 | /**
162 | * Searches for ADTS 0xfff header.
163 | * Returns the offset of ADTS frame.
164 | */
165 | int aacd_probe(unsigned char *buffer, int len);
166 |
167 |
168 | /**
169 | * Copies relevant information to Java object.
170 | * This is called in the start method.
171 | */
172 | void aacd_start_info2java( JNIEnv *env, AACDCommonInfo *info, jobject jinfo );
173 |
174 |
175 | /**
176 | * Copies relevant information to Java object.
177 | * This is called in the decode method.
178 | */
179 | void aacd_decode_info2java( JNIEnv *env, AACDCommonInfo *cinfo, jobject jinfo );
180 |
181 |
182 | #ifdef __cplusplus
183 | }
184 | #endif
185 | #endif
186 |
--------------------------------------------------------------------------------
/jni/aac-decoder/aac-decoder.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** AACPlayer - Freeware Advanced Audio (AAC) Player for Android
3 | ** Copyright (C) 2011 Spolecne s.r.o., http://www.spoledge.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 3 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program. If not, see .
17 | **/
18 |
19 | #include
20 | /* Header for class com_spoledge_aacplayer_Decoder */
21 |
22 | #ifndef _Included_com_spoledge_aacplayer_Decoder
23 | #define _Included_com_spoledge_aacplayer_Decoder
24 |
25 | #ifdef __cplusplus
26 | extern "C" {
27 | #endif
28 |
29 | #undef com_spoledge_aacplayer_Decoder_DECODER_FAAD2
30 | #define com_spoledge_aacplayer_Decoder_DECODER_FAAD2 1L
31 |
32 | #undef com_spoledge_aacplayer_Decoder_DECODER_FFMPEG
33 | #define com_spoledge_aacplayer_Decoder_DECODER_FFMPEG 2L
34 |
35 | #undef com_spoledge_aacplayer_Decoder_DECODER_OPENCORE
36 | #define com_spoledge_aacplayer_Decoder_DECODER_OPENCORE 4L
37 |
38 | #undef com_spoledge_aacplayer_Decoder_DECODER_FFMPEG_WMA
39 | #define com_spoledge_aacplayer_Decoder_DECODER_FFMPEG_WMA 8L
40 |
41 | #ifdef __cplusplus
42 | }
43 | #endif
44 | #endif
45 |
--------------------------------------------------------------------------------
/jni/aac-decoder/aac-faad2-decoder.c:
--------------------------------------------------------------------------------
1 | /*
2 | ** AACPlayer - Freeware Advanced Audio (AAC) Player for Android
3 | ** Copyright (C) 2011 Spolecne s.r.o., http://www.spoledge.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 3 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program. If not, see .
17 | **/
18 |
19 | #define AACD_MODULE "Decoder[FAAD2]"
20 |
21 | #include "aac-array-common.h"
22 | #include "neaacdec.h"
23 |
24 |
25 | static const char* aacd_faad_name()
26 | {
27 | return "FAAD2";
28 | }
29 |
30 |
31 | static int aacd_faad_init(void **pext)
32 | {
33 | (*pext) = NeAACDecOpen();
34 | AACD_INFO( "init() FAAD2 capabilities: %d", NeAACDecGetCapabilities());
35 |
36 | return 0;
37 | }
38 |
39 |
40 | static void aacd_faad_destroy( AACDCommonInfo *cinfo, void *ext )
41 | {
42 | if ( ext ) NeAACDecClose( ext );
43 | }
44 |
45 |
46 | static long aacd_faad_start( AACDCommonInfo *cinfo, void *ext, unsigned char *buffer, unsigned long buffer_size)
47 | {
48 | NeAACDecConfigurationPtr conf = NeAACDecGetCurrentConfiguration( ext );
49 | conf->outputFormat = FAAD_FMT_16BIT;
50 | conf->downMatrix = 1;
51 | //conf->useOldADTSFormat = 1;
52 |
53 | NeAACDecSetConfiguration( ext, conf);
54 |
55 | AACD_DEBUG( "start() buffer=%d size=%d", (*(unsigned long*)buffer), buffer_size );
56 |
57 | long ret = NeAACDecInit( ext, buffer, buffer_size, &cinfo->samplerate, &cinfo->channels );
58 |
59 | if (ret < 0) AACD_ERROR( "NeAACDecInit failed err=%d", ret );
60 |
61 | return ret;
62 | }
63 |
64 |
65 | static int aacd_faad_decode( AACDCommonInfo *cinfo, void *ext, unsigned char *buffer, unsigned long buffer_size, jshort *jsamples, jint outLen )
66 | {
67 | NeAACDecFrameInfo frame;
68 | jshort *ljsamples = jsamples;
69 |
70 | NeAACDecDecode2( ext, &frame, buffer, buffer_size, (void**)&jsamples, outLen*2 );
71 |
72 | if (ljsamples != jsamples) {
73 | AACD_WARN( "NeAACDecDecode CHANGE jsamples !!!");
74 | }
75 |
76 | cinfo->frame_bytesconsumed = frame.bytesconsumed;
77 | cinfo->frame_samples = frame.samples;
78 |
79 | if (frame.error != 0)
80 | {
81 | AACD_ERROR( "NeAACDecDecode bytesleft=%d, error: %s",
82 | buffer_size,
83 | NeAACDecGetErrorMessage(frame.error));
84 |
85 | // return frame.error;
86 | return AACD_DECODE_OTHER;
87 | }
88 |
89 | return AACD_DECODE_OK;
90 | }
91 |
92 |
93 | AACDDecoder aacd_faad_decoder = {
94 | aacd_faad_name,
95 | aacd_faad_init,
96 | aacd_faad_start,
97 | aacd_faad_decode,
98 | aacd_faad_destroy,
99 | aacd_probe
100 | };
101 |
--------------------------------------------------------------------------------
/jni/aac-decoder/array.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | cflags_array_features := -DAAC_ARRAY_FEATURES='0x00$(foreach feature,$(AAC_DECODER_FEATURES), | com_spoledge_aacplayer_Decoder_DECODER_$(feature))' $(foreach feature,$(AAC_DECODER_FEATURES),-DAAC_ARRAY_FEATURE_$(feature))
4 | static_libs_array := $(foreach feature,$(AAC_DECODERS), aac$(feature) $(feature))
5 |
6 | include $(CLEAR_VARS)
7 | LOCAL_MODULE := aacarray
8 | LOCAL_SRC_FILES := aac-common.c aac-array-common.c aac-array-decoder.c
9 | LOCAL_CFLAGS := $(cflags_array_features) $(cflags_loglevels)
10 | LOCAL_LDLIBS := -llog
11 | LOCAL_STATIC_LIBRARIES := $(static_libs_array)
12 | include $(BUILD_SHARED_LIBRARY)
13 |
14 |
--------------------------------------------------------------------------------
/jni/aac-decoder/faad2.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 | LOCAL_MODULE := aacfaad2
5 | LOCAL_SRC_FILES := aac-faad2-decoder.c
6 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../faad2/include
7 | LOCAL_CFLAGS := $(cflags_loglevels)
8 | include $(BUILD_STATIC_LIBRARY)
9 |
10 | include $(LOCAL_PATH)/../faad2/Android.mk
11 |
12 |
--------------------------------------------------------------------------------
/jni/aac-decoder/ffmpeg.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 | LOCAL_MODULE := aacffmpeg
5 | LOCAL_SRC_FILES := aac-ffmpeg-decoder.c
6 |
7 | ifeq ($(MMS_WMA),yes)
8 | LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) aac-ffmpeg-wma-decoder.c
9 | endif
10 |
11 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../ffmpeg $(NDK_ROOT)/sources/cpufeatures
12 | LOCAL_CFLAGS := $(cflags_loglevels)
13 | include $(BUILD_STATIC_LIBRARY)
14 |
15 | include $(LOCAL_PATH)/../ffmpeg/Android.mk
16 |
17 |
--------------------------------------------------------------------------------
/jni/aac-decoder/opencore-aacdec.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 | LOCAL_MODULE := aacopencore-aacdec
5 | LOCAL_SRC_FILES := aac-opencore-decoder.c
6 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/../opencore-aacdec/include
7 | LOCAL_CFLAGS := $(cflags_loglevels)
8 | include $(BUILD_STATIC_LIBRARY)
9 |
10 | include $(LOCAL_PATH)/../opencore-aacdec/Android.mk
11 |
12 |
--------------------------------------------------------------------------------
/jni/check-names.pl:
--------------------------------------------------------------------------------
1 | #!/usr/bin/perl -w
2 |
3 | ######################################################################
4 | # A simple duplicity function checker.
5 | # Checks for duplicit non-static functions (and variables).
6 | #
7 | # It parses the output of the ctags standard utility:
8 | # $ ctags -x --links=no -R ffmpeg/ faad2/ opencore-aacdec/ > tags.txt
9 | # $ ./check-names.pl tags.txt
10 | #
11 | # This utility expects that the input file contains the following information:
12 | #
13 | # A macro 3324 ffmpeg/libavcodec/dsputil.c #define A 0
14 | # get_int member 30 ffmpeg/libavformat/mvi.c unsigned int (*get_int)(ByteIOContext *);
15 | # get_adif_header function 2310 faad2/libfaad/syntax.c void get_adif_header(adif_header *adif, bitfile *ld)
16 | # get_adts_header function 325 opencore-aacdec/src/get_adts_header.c Int get_adts_header(
17 | # get_aiff_header function 86 ffmpeg/libavformat/aiffdec.c static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec,
18 | #
19 | ######################################################################
20 |
21 | use strict;
22 |
23 | my %tags = ();
24 | my @duplicit = ();
25 |
26 | while (<>) {
27 | chomp;
28 | my ($tag,$type,$lineno,$file, $detail) = split( /\s+/, $_, 5);
29 |
30 | next unless $type eq 'function';
31 | #next unless $type eq 'function' or $type eq 'variable';
32 | next if $detail =~ m/^static /;
33 |
34 | my ($module,$dummy) = split( /\//, $file, 2);
35 |
36 | unless (exists $tags{$tag}) {
37 | $tags{$tag} = $module;
38 | next;
39 | }
40 |
41 | my $rec = $tags{$tag};
42 | if (ref($rec)) {
43 | my $found = 0;
44 | foreach (@$rec) {
45 | if ($_ eq $module) { $found=1; last }
46 | }
47 |
48 | push @{$tags{$tag}}, $module unless $found;
49 | }
50 | elsif ($module ne $rec) {
51 | $tags{$tag} = [$rec,$module];
52 | push @duplicit, $tag;
53 | }
54 | }
55 |
56 | print "Found total ", scalar(@duplicit), " duplicit tags:\n";
57 |
58 | foreach my $tag (@duplicit) {
59 | print "Tag '$tag' in ", join( ", ", @{$tags{$tag}}), "\n";
60 | }
61 |
62 |
--------------------------------------------------------------------------------
/jni/faad2/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_MODULE := faad2
6 | LOCAL_SRC_FILES := libfaad/bits.c libfaad/cfft.c libfaad/decoder.c libfaad/drc.c \
7 | libfaad/drm_dec.c libfaad/error.c libfaad/filtbank.c \
8 | libfaad/ic_predict.c libfaad/is.c libfaad/lt_predict.c libfaad/mdct.c libfaad/mp4.c libfaad/ms.c libfaad/output.c libfaad/pns.c \
9 | libfaad/ps_dec.c libfaad/ps_syntax.c \
10 | libfaad/pulse.c libfaad/specrec.c libfaad/syntax.c libfaad/tns.c libfaad/hcr.c libfaad/huffman.c \
11 | libfaad/rvlc.c libfaad/ssr.c libfaad/ssr_fb.c libfaad/ssr_ipqf.c libfaad/common.c \
12 | libfaad/sbr_dct.c libfaad/sbr_e_nf.c libfaad/sbr_fbt.c libfaad/sbr_hfadj.c libfaad/sbr_hfgen.c \
13 | libfaad/sbr_huff.c libfaad/sbr_qmf.c libfaad/sbr_syntax.c libfaad/sbr_tf_grid.c libfaad/sbr_dec.c
14 |
15 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/libfaad
16 |
17 | LOCAL_CFLAGS := -DHAVE_CONFIG_H
18 |
19 | include $(BUILD_STATIC_LIBRARY)
20 |
21 |
--------------------------------------------------------------------------------
/jni/faad2/config.h:
--------------------------------------------------------------------------------
1 | /* config.h. Generated from config.h.in by configure. */
2 | /* config.h.in. Generated from configure.in by autoheader. */
3 |
4 | /* Define if you want to use libfaad together with Digital Radio Mondiale
5 | (DRM) */
6 | /* #undef DRM */
7 |
8 | /* Define if you want support for Digital Radio Mondiale (DRM) parametric
9 | stereo */
10 | /* #undef DRM_PS */
11 |
12 | /* Define to 1 if you have the header file. */
13 | #define HAVE_DLFCN_H 1
14 |
15 | /* Define to 1 if you have the header file. */
16 | #define HAVE_ERRNO_H 1
17 |
18 | /* Define if needed */
19 | /* #undef HAVE_FLOAT32_T */
20 |
21 | /* Define to 1 if you have the header file. */
22 | #define HAVE_FLOAT_H 1
23 |
24 | /* Define to 1 if you have the `getpwuid' function. */
25 | #define HAVE_GETPWUID 1
26 |
27 | /* Define to 1 if you have the header file. */
28 | #define HAVE_INTTYPES_H 1
29 |
30 | /* Define if you have the IOKit API */
31 | /* #undef HAVE_IOKIT_IOKITLIB_H */
32 |
33 | /* Define to 1 if you have the header file. */
34 | #define HAVE_LIMITS_H 1
35 |
36 | /* Define if you have C99's lrintf function. */
37 | #define HAVE_LRINTF 1
38 |
39 | /* Define to 1 if you have the header file. */
40 | /* #undef HAVE_MATHF_H */
41 |
42 | /* Define to 1 if you have the `memcpy' function. */
43 | #define HAVE_MEMCPY 1
44 |
45 | /* Define to 1 if you have the header file. */
46 | #define HAVE_MEMORY_H 1
47 |
48 | /* Define to 1 if you have the header file. */
49 | #define HAVE_STDINT_H 1
50 |
51 | /* Define to 1 if you have the header file. */
52 | #define HAVE_STDLIB_H 1
53 |
54 | /* Define to 1 if you have the `strchr' function. */
55 | #define HAVE_STRCHR 1
56 |
57 | /* Define to 1 if you have the header file. */
58 | #define HAVE_STRINGS_H 1
59 |
60 | /* Define to 1 if you have the header file. */
61 | #define HAVE_STRING_H 1
62 |
63 | /* Define to 1 if you have the `strsep' function. */
64 | #define HAVE_STRSEP 1
65 |
66 | /* Define to 1 if you have the header file. */
67 | /* #undef HAVE_SYSFS_LIBSYSFS_H */
68 |
69 | /* Define to 1 if you have the header file. */
70 | #define HAVE_SYS_STAT_H 1
71 |
72 | /* Define to 1 if you have the header file. */
73 | #define HAVE_SYS_TIME_H 1
74 |
75 | /* Define to 1 if you have the header file. */
76 | #define HAVE_SYS_TYPES_H 1
77 |
78 | /* Define to 1 if you have the header file. */
79 | #define HAVE_UNISTD_H 1
80 |
81 | /* Define to 1 if your C compiler doesn't accept -c and -o together. */
82 | /* #undef NO_MINUS_C_MINUS_O */
83 |
84 | /* Name of package */
85 | #define PACKAGE "faad2"
86 |
87 | /* Define to the address where bug reports for this package should be sent. */
88 | #define PACKAGE_BUGREPORT ""
89 |
90 | /* Define to the full name of this package. */
91 | #define PACKAGE_NAME ""
92 |
93 | /* Define to the full name and version of this package. */
94 | #define PACKAGE_STRING ""
95 |
96 | /* Define to the one symbol short name of this package. */
97 | #define PACKAGE_TARNAME ""
98 |
99 | /* Define to the version of this package. */
100 | #define PACKAGE_VERSION ""
101 |
102 | /* Define to 1 if you have the ANSI C header files. */
103 | #define STDC_HEADERS 1
104 |
105 | /* Define to 1 if you can safely include both and . */
106 | #define TIME_WITH_SYS_TIME 1
107 |
108 | /* Version number of package */
109 | #define VERSION "2.7.0"
110 |
111 | /* Define to 1 if your processor stores words with the most significant byte
112 | first (like Motorola and SPARC, unlike Intel and VAX). */
113 | /* #undef WORDS_BIGENDIAN */
114 |
115 | /* Define to `__inline__' or `__inline' if that's what the C compiler
116 | calls it, or to nothing if 'inline' is not supported under any name. */
117 | #ifndef __cplusplus
118 | /* #undef inline */
119 | #endif
120 |
121 | /* Define to `long int' if does not define. */
122 | /* #undef off_t */
123 |
--------------------------------------------------------------------------------
/jni/faad2/include/faad.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: faad.h,v 1.51 2007/11/01 12:33:29 menno Exp $
29 | **/
30 |
31 | /* warn people for update */
32 | #pragma message("please update faad2 include filename and function names!")
33 |
34 | /* Backwards compatible link */
35 | #include "neaacdec.h"
36 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/Makefile.am:
--------------------------------------------------------------------------------
1 | lib_LTLIBRARIES = libfaad.la
2 |
3 | AM_CFLAGS = -iquote $(top_srcdir)/include
4 | include_HEADERS = $(top_srcdir)/include/faad.h \
5 | $(top_srcdir)/include/neaacdec.h
6 |
7 | libfaad_la_LDFLAGS = -version-info 2:0:0
8 | libfaad_la_LIBADD = -lm
9 |
10 | libfaad_la_SOURCES = bits.c cfft.c decoder.c drc.c \
11 | drm_dec.c error.c filtbank.c \
12 | ic_predict.c is.c lt_predict.c mdct.c mp4.c ms.c output.c pns.c \
13 | ps_dec.c ps_syntax.c \
14 | pulse.c specrec.c syntax.c tns.c hcr.c huffman.c \
15 | rvlc.c ssr.c ssr_fb.c ssr_ipqf.c common.c \
16 | sbr_dct.c sbr_e_nf.c sbr_fbt.c sbr_hfadj.c sbr_hfgen.c \
17 | sbr_huff.c sbr_qmf.c sbr_syntax.c sbr_tf_grid.c sbr_dec.c \
18 | analysis.h bits.h cfft.h cfft_tab.h common.h \
19 | decoder.h drc.h drm_dec.h error.h fixed.h filtbank.h \
20 | huffman.h ic_predict.h iq_table.h is.h kbd_win.h lt_predict.h \
21 | mdct.h mdct_tab.h mp4.h ms.h output.h pns.h ps_dec.h ps_tables.h \
22 | pulse.h rvlc.h \
23 | sbr_dct.h sbr_dec.h sbr_e_nf.h sbr_fbt.h sbr_hfadj.h sbr_hfgen.h \
24 | sbr_huff.h sbr_noise.h sbr_qmf.h sbr_syntax.h sbr_tf_grid.h \
25 | sine_win.h specrec.h ssr.h ssr_fb.h ssr_ipqf.h \
26 | ssr_win.h syntax.h structs.h tns.h \
27 | sbr_qmf_c.h codebook/hcb.h \
28 | codebook/hcb_1.h codebook/hcb_2.h codebook/hcb_3.h codebook/hcb_4.h \
29 | codebook/hcb_5.h codebook/hcb_6.h codebook/hcb_7.h codebook/hcb_8.h \
30 | codebook/hcb_9.h codebook/hcb_10.h codebook/hcb_11.h codebook/hcb_sf.h
31 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/analysis.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: analysis.h,v 1.18 2007/11/01 12:33:29 menno Exp $
29 | **/
30 |
31 | #ifndef __ANALYSIS_H__
32 | #define __ANALYSIS_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 |
39 | #ifdef ANALYSIS
40 | #define DEBUGDEC ,uint8_t print,uint16_t var,uint8_t *dbg
41 | #define DEBUGVAR(A,B,C) ,A,B,C
42 | extern uint16_t dbg_count;
43 | #else
44 | #define DEBUGDEC
45 | #define DEBUGVAR(A,B,C)
46 | #endif
47 |
48 |
49 | #ifdef __cplusplus
50 | }
51 | #endif
52 | #endif
53 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/cfft.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: cfft.h,v 1.24 2007/11/01 12:33:29 menno Exp $
29 | **/
30 |
31 | #ifndef __CFFT_H__
32 | #define __CFFT_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | typedef struct
39 | {
40 | uint16_t n;
41 | uint16_t ifac[15];
42 | complex_t *work;
43 | complex_t *tab;
44 | } cfft_info;
45 |
46 |
47 | void cfftf(cfft_info *cfft, complex_t *c);
48 | void cfftb(cfft_info *cfft, complex_t *c);
49 | cfft_info *cffti(uint16_t n);
50 | void cfftu(cfft_info *cfft);
51 |
52 |
53 | #ifdef __cplusplus
54 | }
55 | #endif
56 | #endif
57 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/codebook/hcb.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: hcb.h,v 1.8 2007/11/01 12:34:10 menno Exp $
29 | **/
30 |
31 | #ifndef __HCB_H__
32 | #define __HCB_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | /*
39 | * Optimal huffman decoding for AAC taken from:
40 | * "SELECTING AN OPTIMAL HUFFMAN DECODER FOR AAC" by
41 | * VLADIMIR Z. MESAROVIC , RAGHUNATH RAO, MIROSLAV V. DOKIC, and SACHIN DEO
42 | * AES paper 5436
43 | *
44 | * 2 methods are used for huffman decoding:
45 | * - binary search
46 | * - 2-step table lookup
47 | *
48 | * The choice of the "optimal" method is based on the fact that if the
49 | * memory size for the Two-step is exorbitantly high then the decision
50 | * is Binary search for that codebook. However, for marginally more memory
51 | * size, if Twostep outperforms even the best case of Binary then the
52 | * decision is Two-step for that codebook.
53 | *
54 | * The following methods are used for the different tables.
55 | * codebook "optimal" method
56 | * HCB_1 2-Step
57 | * HCB_2 2-Step
58 | * HCB_3 Binary
59 | * HCB_4 2-Step
60 | * HCB_5 Binary
61 | * HCB_6 2-Step
62 | * HCB_7 Binary
63 | * HCB_8 2-Step
64 | * HCB_9 Binary
65 | * HCB_10 2-Step
66 | * HCB_11 2-Step
67 | * HCB_SF Binary
68 | *
69 | */
70 |
71 |
72 | #define ZERO_HCB 0
73 | #define FIRST_PAIR_HCB 5
74 | #define ESC_HCB 11
75 | #define QUAD_LEN 4
76 | #define PAIR_LEN 2
77 | #define NOISE_HCB 13
78 | #define INTENSITY_HCB2 14
79 | #define INTENSITY_HCB 15
80 |
81 | /* 1st step table */
82 | typedef struct
83 | {
84 | uint8_t offset;
85 | uint8_t extra_bits;
86 | } hcb;
87 |
88 | /* 2nd step table with quadruple data */
89 | typedef struct
90 | {
91 | uint8_t bits;
92 | int8_t x;
93 | int8_t y;
94 | } hcb_2_pair;
95 |
96 | typedef struct
97 | {
98 | uint8_t bits;
99 | int8_t x;
100 | int8_t y;
101 | int8_t v;
102 | int8_t w;
103 | } hcb_2_quad;
104 |
105 | /* binary search table */
106 | typedef struct
107 | {
108 | uint8_t is_leaf;
109 | int8_t data[4];
110 | } hcb_bin_quad;
111 |
112 | typedef struct
113 | {
114 | uint8_t is_leaf;
115 | int8_t data[2];
116 | } hcb_bin_pair;
117 |
118 | hcb *hcb_table[];
119 | hcb_2_quad *hcb_2_quad_table[];
120 | hcb_2_pair *hcb_2_pair_table[];
121 | hcb_bin_pair *hcb_bin_table[];
122 | uint8_t hcbN[];
123 | uint8_t unsigned_cb[];
124 | int hcb_2_quad_table_size[];
125 | int hcb_2_pair_table_size[];
126 | int hcb_bin_table_size[];
127 |
128 | #include "codebook/hcb_1.h"
129 | #include "codebook/hcb_2.h"
130 | #include "codebook/hcb_3.h"
131 | #include "codebook/hcb_4.h"
132 | #include "codebook/hcb_5.h"
133 | #include "codebook/hcb_6.h"
134 | #include "codebook/hcb_7.h"
135 | #include "codebook/hcb_8.h"
136 | #include "codebook/hcb_9.h"
137 | #include "codebook/hcb_10.h"
138 | #include "codebook/hcb_11.h"
139 | #include "codebook/hcb_sf.h"
140 |
141 |
142 | #ifdef __cplusplus
143 | }
144 | #endif
145 | #endif
146 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/codebook/hcb_8.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: hcb_8.h,v 1.5 2007/11/01 12:34:11 menno Exp $
29 | **/
30 |
31 | /* 2-step huffman table HCB_8 */
32 |
33 |
34 | /* 1st step: 5 bits
35 | * 2^5 = 32 entries
36 | *
37 | * Used to find offset into 2nd step table and number of extra bits to get
38 | */
39 | static hcb hcb8_1[] = {
40 | /* 3 bit codeword */
41 | { /* 00000 */ 0, 0 },
42 | { /* */ 0, 0 },
43 | { /* */ 0, 0 },
44 | { /* */ 0, 0 },
45 |
46 | /* 4 bit codewords */
47 | { /* 00100 */ 1, 0 },
48 | { /* */ 1, 0 },
49 | { /* 00110 */ 2, 0 },
50 | { /* */ 2, 0 },
51 | { /* 01000 */ 3, 0 },
52 | { /* */ 3, 0 },
53 | { /* 01010 */ 4, 0 },
54 | { /* */ 4, 0 },
55 | { /* 01100 */ 5, 0 },
56 | { /* */ 5, 0 },
57 |
58 | /* 5 bit codewords */
59 | { /* 01110 */ 6, 0 },
60 | { /* 01111 */ 7, 0 },
61 | { /* 10000 */ 8, 0 },
62 | { /* 10001 */ 9, 0 },
63 | { /* 10010 */ 10, 0 },
64 | { /* 10011 */ 11, 0 },
65 | { /* 10100 */ 12, 0 },
66 |
67 | /* 6 bit codewords */
68 | { /* 10101 */ 13, 1 },
69 | { /* 10110 */ 15, 1 },
70 | { /* 10111 */ 17, 1 },
71 | { /* 11000 */ 19, 1 },
72 | { /* 11001 */ 21, 1 },
73 |
74 | /* 7 bit codewords */
75 | { /* 11010 */ 23, 2 },
76 | { /* 11011 */ 27, 2 },
77 | { /* 11100 */ 31, 2 },
78 |
79 | /* 7/8 bit codewords */
80 | { /* 11101 */ 35, 3 },
81 |
82 | /* 8 bit codewords */
83 | { /* 11110 */ 43, 3 },
84 |
85 | /* 8/9/10 bit codewords */
86 | { /* 11111 */ 51, 5 }
87 | };
88 |
89 | /* 2nd step table
90 | *
91 | * Gives size of codeword and actual data (x,y,v,w)
92 | */
93 | static hcb_2_pair hcb8_2[] = {
94 | /* 3 bit codeword */
95 | { 3, 1, 1 },
96 |
97 | /* 4 bit codewords */
98 | { 4, 2, 1 },
99 | { 4, 1, 0 },
100 | { 4, 1, 2 },
101 | { 4, 0, 1 },
102 | { 4, 2, 2 },
103 |
104 | /* 5 bit codewords */
105 | { 5, 0, 0 },
106 | { 5, 2, 0 },
107 | { 5, 0, 2 },
108 | { 5, 3, 1 },
109 | { 5, 1, 3 },
110 | { 5, 3, 2 },
111 | { 5, 2, 3 },
112 |
113 | /* 6 bit codewords */
114 | { 6, 3, 3 },
115 | { 6, 4, 1 },
116 | { 6, 1, 4 },
117 | { 6, 4, 2 },
118 | { 6, 2, 4 },
119 | { 6, 3, 0 },
120 | { 6, 0, 3 },
121 | { 6, 4, 3 },
122 | { 6, 3, 4 },
123 | { 6, 5, 2 },
124 |
125 | /* 7 bit codewords */
126 | { 7, 5, 1 },
127 | { 7, 2, 5 },
128 | { 7, 1, 5 },
129 | { 7, 5, 3 },
130 | { 7, 3, 5 },
131 | { 7, 4, 4 },
132 | { 7, 5, 4 },
133 | { 7, 0, 4 },
134 | { 7, 4, 5 },
135 | { 7, 4, 0 },
136 | { 7, 2, 6 },
137 | { 7, 6, 2 },
138 |
139 | /* 7/8 bit codewords */
140 | { 7, 6, 1 }, { 7, 6, 1 },
141 | { 7, 1, 6 }, { 7, 1, 6 },
142 | { 8, 3, 6 },
143 | { 8, 6, 3 },
144 | { 8, 5, 5 },
145 | { 8, 5, 0 },
146 |
147 | /* 8 bit codewords */
148 | { 8, 6, 4 },
149 | { 8, 0, 5 },
150 | { 8, 4, 6 },
151 | { 8, 7, 1 },
152 | { 8, 7, 2 },
153 | { 8, 2, 7 },
154 | { 8, 6, 5 },
155 | { 8, 7, 3 },
156 |
157 | /* 8/9/10 bit codewords */
158 | { 8, 1, 7 }, { 8, 1, 7 }, { 8, 1, 7 }, { 8, 1, 7 },
159 | { 8, 5, 6 }, { 8, 5, 6 }, { 8, 5, 6 }, { 8, 5, 6 },
160 | { 8, 3, 7 }, { 8, 3, 7 }, { 8, 3, 7 }, { 8, 3, 7 },
161 | { 9, 6, 6 }, { 9, 6, 6 },
162 | { 9, 7, 4 }, { 9, 7, 4 },
163 | { 9, 6, 0 }, { 9, 6, 0 },
164 | { 9, 4, 7 }, { 9, 4, 7 },
165 | { 9, 0, 6 }, { 9, 0, 6 },
166 | { 9, 7, 5 }, { 9, 7, 5 },
167 | { 9, 7, 6 }, { 9, 7, 6 },
168 | { 9, 6, 7 }, { 9, 6, 7 },
169 | { 10, 5, 7 },
170 | { 10, 7, 0 },
171 | { 10, 0, 7 },
172 | { 10, 7, 7 }
173 | };
174 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/drc.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: drc.h,v 1.22 2007/11/01 12:33:30 menno Exp $
29 | **/
30 |
31 | #ifndef __DRC_H__
32 | #define __DRC_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | #define DRC_REF_LEVEL 20*4 /* -20 dB */
39 |
40 |
41 | drc_info *drc_init(real_t cut, real_t boost);
42 | void drc_end(drc_info *drc);
43 | void drc_decode(drc_info *drc, real_t *spec);
44 |
45 |
46 | #ifdef __cplusplus
47 | }
48 | #endif
49 | #endif
50 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/drm_dec.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: drm_dec.h,v 1.8 2007/11/01 12:33:30 menno Exp $
29 | **/
30 |
31 | #ifndef __DRM_DEC_H__
32 | #define __DRM_DEC_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | #include "bits.h"
39 |
40 | #define DRM_PARAMETRIC_STEREO 0
41 | #define DRM_NUM_SA_BANDS 8
42 | #define DRM_NUM_PAN_BANDS 20
43 | #define NUM_OF_LINKS 3
44 | #define NUM_OF_QMF_CHANNELS 64
45 | #define NUM_OF_SUBSAMPLES 30
46 | #define MAX_SA_BAND 46
47 | #define MAX_PAN_BAND 64
48 | #define MAX_DELAY 5
49 |
50 | typedef struct
51 | {
52 | uint8_t drm_ps_data_available;
53 | uint8_t bs_enable_sa;
54 | uint8_t bs_enable_pan;
55 |
56 | uint8_t bs_sa_dt_flag;
57 | uint8_t bs_pan_dt_flag;
58 |
59 | uint8_t g_last_had_sa;
60 | uint8_t g_last_had_pan;
61 |
62 | int8_t bs_sa_data[DRM_NUM_SA_BANDS];
63 | int8_t bs_pan_data[DRM_NUM_PAN_BANDS];
64 |
65 | int8_t g_sa_index[DRM_NUM_SA_BANDS];
66 | int8_t g_pan_index[DRM_NUM_PAN_BANDS];
67 | int8_t g_prev_sa_index[DRM_NUM_SA_BANDS];
68 | int8_t g_prev_pan_index[DRM_NUM_PAN_BANDS];
69 |
70 | int8_t sa_decode_error;
71 | int8_t pan_decode_error;
72 |
73 | int8_t g_last_good_sa_index[DRM_NUM_SA_BANDS];
74 | int8_t g_last_good_pan_index[DRM_NUM_PAN_BANDS];
75 |
76 | qmf_t SA[NUM_OF_SUBSAMPLES][MAX_SA_BAND];
77 |
78 | complex_t d_buff[2][MAX_SA_BAND];
79 | complex_t d2_buff[NUM_OF_LINKS][MAX_DELAY][MAX_SA_BAND];
80 |
81 | uint8_t delay_buf_index_ser[NUM_OF_LINKS];
82 |
83 | real_t prev_nrg[MAX_SA_BAND];
84 | real_t prev_peakdiff[MAX_SA_BAND];
85 | real_t peakdecay_fast[MAX_SA_BAND];
86 | } drm_ps_info;
87 |
88 |
89 | uint16_t drm_ps_data(drm_ps_info *ps, bitfile *ld);
90 |
91 | drm_ps_info *drm_ps_init(void);
92 | void drm_ps_free(drm_ps_info *ps);
93 |
94 | uint8_t drm_ps_decode(drm_ps_info *ps, uint8_t guess, qmf_t X_left[38][64], qmf_t X_right[38][64]);
95 |
96 | #ifdef __cplusplus
97 | }
98 | #endif
99 | #endif
100 |
101 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/error.c:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: error.c,v 1.33 2008/09/19 23:31:39 menno Exp $
29 | **/
30 |
31 | #include "common.h"
32 | #include "error.h"
33 |
34 | char *err_msg[] = {
35 | "No error",
36 | "Gain control not yet implemented",
37 | "Pulse coding not allowed in short blocks",
38 | "Invalid huffman codebook",
39 | "Scalefactor out of range",
40 | "Unable to find ADTS syncword",
41 | "Channel coupling not yet implemented",
42 | "Channel configuration not allowed in error resilient frame",
43 | "Bit error in error resilient scalefactor decoding",
44 | "Error decoding huffman scalefactor (bitstream error)",
45 | "Error decoding huffman codeword (bitstream error)",
46 | "Non existent huffman codebook number found",
47 | "Invalid number of channels",
48 | "Maximum number of bitstream elements exceeded",
49 | "Input data buffer too small",
50 | "Array index out of range",
51 | "Maximum number of scalefactor bands exceeded",
52 | "Quantised value out of range",
53 | "LTP lag out of range",
54 | "Invalid SBR parameter decoded",
55 | "SBR called without being initialised",
56 | "Unexpected channel configuration change",
57 | "Error in program_config_element",
58 | "First SBR frame is not the same as first AAC frame",
59 | "Unexpected fill element with SBR data",
60 | "Not all elements were provided with SBR data",
61 | "LTP decoding not available",
62 | "Output data buffer too small",
63 | "CRC error in DRM data",
64 | "PNS not allowed in DRM data stream",
65 | "No standard extension payload allowed in DRM",
66 | "PCE shall be the first element in a frame",
67 | "Bitstream value not allowed by specification",
68 | "MAIN prediction not initialised"
69 | };
70 |
71 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/error.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: error.h,v 1.27 2008/09/19 23:31:40 menno Exp $
29 | **/
30 |
31 | #ifndef __ERROR_H__
32 | #define __ERROR_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | #define NUM_ERROR_MESSAGES 34
39 | extern char *err_msg[];
40 |
41 | #ifdef __cplusplus
42 | }
43 | #endif
44 | #endif
45 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/filtbank.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: filtbank.h,v 1.27 2007/11/01 12:33:30 menno Exp $
29 | **/
30 |
31 | #ifndef __FILTBANK_H__
32 | #define __FILTBANK_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 |
39 | fb_info *filter_bank_init(uint16_t frame_len);
40 | void filter_bank_end(fb_info *fb);
41 |
42 | #ifdef LTP_DEC
43 | void filter_bank_ltp(fb_info *fb,
44 | uint8_t window_sequence,
45 | uint8_t window_shape,
46 | uint8_t window_shape_prev,
47 | real_t *in_data,
48 | real_t *out_mdct,
49 | uint8_t object_type,
50 | uint16_t frame_len);
51 | #endif
52 |
53 | void ifilter_bank(fb_info *fb, uint8_t window_sequence, uint8_t window_shape,
54 | uint8_t window_shape_prev, real_t *freq_in,
55 | real_t *time_out, real_t *overlap,
56 | uint8_t object_type, uint16_t frame_len);
57 |
58 | #ifdef __cplusplus
59 | }
60 | #endif
61 | #endif
62 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/huffman.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: huffman.h,v 1.28 2007/11/01 12:33:30 menno Exp $
29 | **/
30 |
31 | #ifndef __HUFFMAN_H__
32 | #define __HUFFMAN_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | int8_t huffman_scale_factor(bitfile *ld);
39 | uint8_t huffman_spectral_data(uint8_t cb, bitfile *ld, int16_t *sp);
40 | #ifdef ERROR_RESILIENCE
41 | int8_t huffman_spectral_data_2(uint8_t cb, bits_t *ld, int16_t *sp);
42 | #endif
43 |
44 | #ifdef __cplusplus
45 | }
46 | #endif
47 | #endif
48 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/is.c:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: is.c,v 1.28 2007/11/01 12:33:31 menno Exp $
29 | **/
30 |
31 | #include "common.h"
32 | #include "structs.h"
33 |
34 | #include "syntax.h"
35 | #include "is.h"
36 |
37 | #ifdef FIXED_POINT
38 | static real_t pow05_table[] = {
39 | COEF_CONST(1.68179283050743), /* 0.5^(-3/4) */
40 | COEF_CONST(1.41421356237310), /* 0.5^(-2/4) */
41 | COEF_CONST(1.18920711500272), /* 0.5^(-1/4) */
42 | COEF_CONST(1.0), /* 0.5^( 0/4) */
43 | COEF_CONST(0.84089641525371), /* 0.5^(+1/4) */
44 | COEF_CONST(0.70710678118655), /* 0.5^(+2/4) */
45 | COEF_CONST(0.59460355750136) /* 0.5^(+3/4) */
46 | };
47 | #endif
48 |
49 | void is_decode(ic_stream *ics, ic_stream *icsr, real_t *l_spec, real_t *r_spec,
50 | uint16_t frame_len)
51 | {
52 | uint8_t g, sfb, b;
53 | uint16_t i;
54 | #ifndef FIXED_POINT
55 | real_t scale;
56 | #else
57 | int32_t exp, frac;
58 | #endif
59 |
60 | uint16_t nshort = frame_len/8;
61 | uint8_t group = 0;
62 |
63 | for (g = 0; g < icsr->num_window_groups; g++)
64 | {
65 | /* Do intensity stereo decoding */
66 | for (b = 0; b < icsr->window_group_length[g]; b++)
67 | {
68 | for (sfb = 0; sfb < icsr->max_sfb; sfb++)
69 | {
70 | if (is_intensity(icsr, g, sfb))
71 | {
72 | #ifdef MAIN_DEC
73 | /* For scalefactor bands coded in intensity stereo the
74 | corresponding predictors in the right channel are
75 | switched to "off".
76 | */
77 | ics->pred.prediction_used[sfb] = 0;
78 | icsr->pred.prediction_used[sfb] = 0;
79 | #endif
80 |
81 | #ifndef FIXED_POINT
82 | scale = (real_t)pow(0.5, (0.25*icsr->scale_factors[g][sfb]));
83 | #else
84 | exp = icsr->scale_factors[g][sfb] >> 2;
85 | frac = icsr->scale_factors[g][sfb] & 3;
86 | #endif
87 |
88 | /* Scale from left to right channel,
89 | do not touch left channel */
90 | for (i = icsr->swb_offset[sfb]; i < min(icsr->swb_offset[sfb+1], ics->swb_offset_max); i++)
91 | {
92 | #ifndef FIXED_POINT
93 | r_spec[(group*nshort)+i] = MUL_R(l_spec[(group*nshort)+i], scale);
94 | #else
95 | if (exp < 0)
96 | r_spec[(group*nshort)+i] = l_spec[(group*nshort)+i] << -exp;
97 | else
98 | r_spec[(group*nshort)+i] = l_spec[(group*nshort)+i] >> exp;
99 | r_spec[(group*nshort)+i] = MUL_C(r_spec[(group*nshort)+i], pow05_table[frac + 3]);
100 | #endif
101 | if (is_intensity(icsr, g, sfb) != invert_intensity(ics, g, sfb))
102 | r_spec[(group*nshort)+i] = -r_spec[(group*nshort)+i];
103 | }
104 | }
105 | }
106 | group++;
107 | }
108 | }
109 | }
110 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/is.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: is.h,v 1.20 2007/11/01 12:33:31 menno Exp $
29 | **/
30 |
31 | #ifndef __IS_H__
32 | #define __IS_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | #include "syntax.h"
39 |
40 | void is_decode(ic_stream *ics, ic_stream *icsr, real_t *l_spec, real_t *r_spec,
41 | uint16_t frame_len);
42 |
43 | static INLINE int8_t is_intensity(ic_stream *ics, uint8_t group, uint8_t sfb)
44 | {
45 | switch (ics->sfb_cb[group][sfb])
46 | {
47 | case INTENSITY_HCB:
48 | return 1;
49 | case INTENSITY_HCB2:
50 | return -1;
51 | default:
52 | return 0;
53 | }
54 | }
55 |
56 | static INLINE int8_t invert_intensity(ic_stream *ics, uint8_t group, uint8_t sfb)
57 | {
58 | if (ics->ms_mask_present == 1)
59 | return (1-2*ics->ms_used[group][sfb]);
60 | return 1;
61 | }
62 |
63 |
64 | #ifdef __cplusplus
65 | }
66 | #endif
67 | #endif
68 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/libfaad.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 9.00
2 | # Visual C++ Express 2005
3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "libfaad.vcproj", "{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}"
4 | EndProject
5 | Global
6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
7 | Debug|Win32 = Debug|Win32
8 | Release|Win32 = Release|Win32
9 | EndGlobalSection
10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
11 | {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|Win32.ActiveCfg = Debug|Win32
12 | {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|Win32.ActiveCfg = Release|Win32
13 | EndGlobalSection
14 | GlobalSection(SolutionProperties) = preSolution
15 | HideSolutionNode = FALSE
16 | EndGlobalSection
17 | GlobalSection(DPCodeReviewSolutionGUID) = preSolution
18 | DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000}
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/libfaad2.def:
--------------------------------------------------------------------------------
1 | LIBRARY libfaad2.dll
2 | EXPORTS
3 | ;
4 | ; libfaad2 exports
5 | ;
6 | NeAACDecOpen @1
7 | NeAACDecGetCurrentConfiguration @2
8 | NeAACDecSetConfiguration @3
9 | NeAACDecInit @4
10 | NeAACDecInit2 @5
11 | NeAACDecDecode @6
12 | NeAACDecClose @7
13 | NeAACDecGetErrorMessage @8
14 | NeAACDecAudioSpecificConfig @9
15 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/libfaad2_dll.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 9.00
2 | # Visual C++ Express 2005
3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad2_dll", "libfaad2_dll.vcproj", "{482DA264-EE88-4575-B208-87C4CB80CD08}"
4 | EndProject
5 | Global
6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
7 | Debug|Win32 = Debug|Win32
8 | Release|Win32 = Release|Win32
9 | EndGlobalSection
10 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
11 | {482DA264-EE88-4575-B208-87C4CB80CD08}.Debug|Win32.ActiveCfg = Debug|Win32
12 | {482DA264-EE88-4575-B208-87C4CB80CD08}.Debug|Win32.Build.0 = Debug|Win32
13 | {482DA264-EE88-4575-B208-87C4CB80CD08}.Release|Win32.ActiveCfg = Release|Win32
14 | {482DA264-EE88-4575-B208-87C4CB80CD08}.Release|Win32.Build.0 = Release|Win32
15 | EndGlobalSection
16 | GlobalSection(SolutionProperties) = preSolution
17 | HideSolutionNode = FALSE
18 | EndGlobalSection
19 | EndGlobal
20 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/lt_predict.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: lt_predict.h,v 1.20 2007/11/01 12:33:31 menno Exp $
29 | **/
30 |
31 | #ifdef LTP_DEC
32 |
33 | #ifndef __LT_PREDICT_H__
34 | #define __LT_PREDICT_H__
35 |
36 | #ifdef __cplusplus
37 | extern "C" {
38 | #endif
39 |
40 | #include "filtbank.h"
41 |
42 | uint8_t is_ltp_ot(uint8_t object_type);
43 |
44 | void lt_prediction(ic_stream *ics,
45 | ltp_info *ltp,
46 | real_t *spec,
47 | int16_t *lt_pred_stat,
48 | fb_info *fb,
49 | uint8_t win_shape,
50 | uint8_t win_shape_prev,
51 | uint8_t sr_index,
52 | uint8_t object_type,
53 | uint16_t frame_len);
54 |
55 | void lt_update_state(int16_t *lt_pred_stat,
56 | real_t *time,
57 | real_t *overlap,
58 | uint16_t frame_len,
59 | uint8_t object_type);
60 |
61 | #ifdef __cplusplus
62 | }
63 | #endif
64 | #endif
65 |
66 | #endif
67 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/mdct.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vbartacek/aacplayer-android/9cfb86b581a52bd17e4dea2330c4e911fe79d64a/jni/faad2/libfaad/mdct.c
--------------------------------------------------------------------------------
/jni/faad2/libfaad/mdct.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: mdct.h,v 1.30 2007/11/01 12:33:31 menno Exp $
29 | **/
30 |
31 | #ifndef __MDCT_H__
32 | #define __MDCT_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 |
39 | mdct_info *faad_mdct_init(uint16_t N);
40 | void faad_mdct_end(mdct_info *mdct);
41 | void faad_imdct(mdct_info *mdct, real_t *X_in, real_t *X_out);
42 | void faad_mdct(mdct_info *mdct, real_t *X_in, real_t *X_out);
43 |
44 |
45 | #ifdef __cplusplus
46 | }
47 | #endif
48 | #endif
49 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/mp4.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: mp4.h,v 1.28 2009/02/05 00:51:03 menno Exp $
29 | **/
30 |
31 | #ifndef __MP4_H__
32 | #define __MP4_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | #include "neaacdec.h"
39 |
40 | int8_t AudioSpecificConfig2(uint8_t *pBuffer,
41 | uint32_t buffer_size,
42 | mp4AudioSpecificConfig *mp4ASC,
43 | program_config *pce, uint8_t short_form);
44 |
45 | int8_t AudioSpecificConfigFromBitfile(bitfile *ld,
46 | mp4AudioSpecificConfig *mp4ASC,
47 | program_config *pce, uint32_t bsize, uint8_t short_form);
48 |
49 | #ifdef __cplusplus
50 | }
51 | #endif
52 | #endif
53 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/ms.c:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: ms.c,v 1.21 2007/11/01 12:33:32 menno Exp $
29 | **/
30 |
31 | #include "common.h"
32 | #include "structs.h"
33 |
34 | #include "syntax.h"
35 | #include "ms.h"
36 | #include "is.h"
37 | #include "pns.h"
38 |
39 | void ms_decode(ic_stream *ics, ic_stream *icsr, real_t *l_spec, real_t *r_spec,
40 | uint16_t frame_len)
41 | {
42 | uint8_t g, b, sfb;
43 | uint8_t group = 0;
44 | uint16_t nshort = frame_len/8;
45 |
46 | uint16_t i, k;
47 | real_t tmp;
48 |
49 | if (ics->ms_mask_present >= 1)
50 | {
51 | for (g = 0; g < ics->num_window_groups; g++)
52 | {
53 | for (b = 0; b < ics->window_group_length[g]; b++)
54 | {
55 | for (sfb = 0; sfb < ics->max_sfb; sfb++)
56 | {
57 | /* If intensity stereo coding or noise substitution is on
58 | for a particular scalefactor band, no M/S stereo decoding
59 | is carried out.
60 | */
61 | if ((ics->ms_used[g][sfb] || ics->ms_mask_present == 2) &&
62 | !is_intensity(icsr, g, sfb) && !is_noise(ics, g, sfb))
63 | {
64 | for (i = ics->swb_offset[sfb]; i < min(ics->swb_offset[sfb+1], ics->swb_offset_max); i++)
65 | {
66 | k = (group*nshort) + i;
67 | tmp = l_spec[k] - r_spec[k];
68 | l_spec[k] = l_spec[k] + r_spec[k];
69 | r_spec[k] = tmp;
70 | }
71 | }
72 | }
73 | group++;
74 | }
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/ms.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: ms.h,v 1.19 2007/11/01 12:33:32 menno Exp $
29 | **/
30 |
31 | #ifndef __MS_H__
32 | #define __MS_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | void ms_decode(ic_stream *ics, ic_stream *icsr, real_t *l_spec, real_t *r_spec,
39 | uint16_t frame_len);
40 |
41 | #ifdef __cplusplus
42 | }
43 | #endif
44 | #endif
45 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/output.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: output.h,v 1.26 2009/01/26 23:51:15 menno Exp $
29 | **/
30 |
31 | #ifndef __OUTPUT_H__
32 | #define __OUTPUT_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | void* output_to_PCM(NeAACDecStruct *hDecoder,
39 | real_t **input,
40 | void *samplebuffer,
41 | uint8_t channels,
42 | uint16_t frame_len,
43 | uint8_t format);
44 |
45 | #ifdef __cplusplus
46 | }
47 | #endif
48 | #endif
49 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/pns.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: pns.h,v 1.27 2007/11/01 12:33:33 menno Exp $
29 | **/
30 |
31 | #ifndef __PNS_H__
32 | #define __PNS_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | #include "syntax.h"
39 |
40 | #define NOISE_OFFSET 90
41 |
42 | void pns_decode(ic_stream *ics_left, ic_stream *ics_right,
43 | real_t *spec_left, real_t *spec_right, uint16_t frame_len,
44 | uint8_t channel_pair, uint8_t object_type,
45 | /* RNG states */ uint32_t *__r1, uint32_t *__r2);
46 |
47 | static INLINE uint8_t is_noise(ic_stream *ics, uint8_t group, uint8_t sfb)
48 | {
49 | if (ics->sfb_cb[group][sfb] == NOISE_HCB)
50 | return 1;
51 | return 0;
52 | }
53 |
54 | #ifdef __cplusplus
55 | }
56 | #endif
57 | #endif
58 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/ps_dec.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: ps_dec.h,v 1.13 2009/01/26 22:32:31 menno Exp $
29 | **/
30 |
31 | #ifndef __PS_DEC_H__
32 | #define __PS_DEC_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | #include "bits.h"
39 |
40 | #define EXTENSION_ID_PS 2
41 |
42 | #define MAX_PS_ENVELOPES 5
43 | #define NO_ALLPASS_LINKS 3
44 |
45 | typedef struct
46 | {
47 | /* bitstream parameters */
48 | uint8_t enable_iid;
49 | uint8_t enable_icc;
50 | uint8_t enable_ext;
51 |
52 | uint8_t iid_mode;
53 | uint8_t icc_mode;
54 | uint8_t nr_iid_par;
55 | uint8_t nr_ipdopd_par;
56 | uint8_t nr_icc_par;
57 |
58 | uint8_t frame_class;
59 | uint8_t num_env;
60 |
61 | uint8_t border_position[MAX_PS_ENVELOPES+1];
62 |
63 | uint8_t iid_dt[MAX_PS_ENVELOPES];
64 | uint8_t icc_dt[MAX_PS_ENVELOPES];
65 |
66 | uint8_t enable_ipdopd;
67 | uint8_t ipd_mode;
68 | uint8_t ipd_dt[MAX_PS_ENVELOPES];
69 | uint8_t opd_dt[MAX_PS_ENVELOPES];
70 |
71 | /* indices */
72 | int8_t iid_index_prev[34];
73 | int8_t icc_index_prev[34];
74 | int8_t ipd_index_prev[17];
75 | int8_t opd_index_prev[17];
76 | int8_t iid_index[MAX_PS_ENVELOPES][34];
77 | int8_t icc_index[MAX_PS_ENVELOPES][34];
78 | int8_t ipd_index[MAX_PS_ENVELOPES][17];
79 | int8_t opd_index[MAX_PS_ENVELOPES][17];
80 |
81 | int8_t ipd_index_1[17];
82 | int8_t opd_index_1[17];
83 | int8_t ipd_index_2[17];
84 | int8_t opd_index_2[17];
85 |
86 | /* ps data was correctly read */
87 | uint8_t ps_data_available;
88 |
89 | /* a header has been read */
90 | uint8_t header_read;
91 |
92 | /* hybrid filterbank parameters */
93 | void *hyb;
94 | uint8_t use34hybrid_bands;
95 | uint8_t numTimeSlotsRate;
96 |
97 | /**/
98 | uint8_t num_groups;
99 | uint8_t num_hybrid_groups;
100 | uint8_t nr_par_bands;
101 | uint8_t nr_allpass_bands;
102 | uint8_t decay_cutoff;
103 |
104 | uint8_t *group_border;
105 | uint16_t *map_group2bk;
106 |
107 | /* filter delay handling */
108 | uint8_t saved_delay;
109 | uint8_t delay_buf_index_ser[NO_ALLPASS_LINKS];
110 | uint8_t num_sample_delay_ser[NO_ALLPASS_LINKS];
111 | uint8_t delay_D[64];
112 | uint8_t delay_buf_index_delay[64];
113 |
114 | complex_t delay_Qmf[14][64]; /* 14 samples delay max, 64 QMF channels */
115 | complex_t delay_SubQmf[2][32]; /* 2 samples delay max (SubQmf is always allpass filtered) */
116 | complex_t delay_Qmf_ser[NO_ALLPASS_LINKS][5][64]; /* 5 samples delay max (table 8.34), 64 QMF channels */
117 | complex_t delay_SubQmf_ser[NO_ALLPASS_LINKS][5][32]; /* 5 samples delay max (table 8.34) */
118 |
119 | /* transients */
120 | real_t alpha_decay;
121 | real_t alpha_smooth;
122 |
123 | real_t P_PeakDecayNrg[34];
124 | real_t P_prev[34];
125 | real_t P_SmoothPeakDecayDiffNrg_prev[34];
126 |
127 | /* mixing and phase */
128 | complex_t h11_prev[50];
129 | complex_t h12_prev[50];
130 | complex_t h21_prev[50];
131 | complex_t h22_prev[50];
132 | uint8_t phase_hist;
133 | complex_t ipd_prev[20][2];
134 | complex_t opd_prev[20][2];
135 |
136 | } ps_info;
137 |
138 | /* ps_syntax.c */
139 | uint16_t ps_data(ps_info *ps, bitfile *ld, uint8_t *header);
140 |
141 | /* ps_dec.c */
142 | ps_info *ps_init(uint8_t sr_index, uint8_t numTimeSlotsRate);
143 | void ps_free(ps_info *ps);
144 |
145 | uint8_t ps_decode(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64]);
146 |
147 |
148 | #ifdef __cplusplus
149 | }
150 | #endif
151 | #endif
152 |
153 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/pulse.c:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: pulse.c,v 1.21 2007/11/01 12:33:34 menno Exp $
29 | **/
30 | #include "common.h"
31 | #include "structs.h"
32 |
33 | #include "syntax.h"
34 | #include "pulse.h"
35 |
36 | uint8_t pulse_decode(ic_stream *ics, int16_t *spec_data, uint16_t framelen)
37 | {
38 | uint8_t i;
39 | uint16_t k;
40 | pulse_info *pul = &(ics->pul);
41 |
42 | k = min(ics->swb_offset[pul->pulse_start_sfb], ics->swb_offset_max);
43 |
44 | for (i = 0; i <= pul->number_pulse; i++)
45 | {
46 | k += pul->pulse_offset[i];
47 |
48 | if (k >= framelen)
49 | return 15; /* should not be possible */
50 |
51 | if (spec_data[k] > 0)
52 | spec_data[k] += pul->pulse_amp[i];
53 | else
54 | spec_data[k] -= pul->pulse_amp[i];
55 | }
56 |
57 | return 0;
58 | }
59 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/pulse.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: pulse.h,v 1.20 2007/11/01 12:33:34 menno Exp $
29 | **/
30 |
31 | #ifndef __PULSE_H__
32 | #define __PULSE_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | uint8_t pulse_decode(ic_stream *ics, int16_t *spec_coef, uint16_t framelen);
39 |
40 | #ifdef __cplusplus
41 | }
42 | #endif
43 | #endif
44 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/rvlc.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: rvlc.h,v 1.17 2007/11/01 12:33:34 menno Exp $
29 | **/
30 |
31 | #ifndef __RVLC_SCF_H__
32 | #define __RVLC_SCF_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | typedef struct
39 | {
40 | int8_t index;
41 | uint8_t len;
42 | uint32_t cw;
43 | } rvlc_huff_table;
44 |
45 |
46 | #define ESC_VAL 7
47 |
48 |
49 | uint8_t rvlc_scale_factor_data(ic_stream *ics, bitfile *ld);
50 | uint8_t rvlc_decode_scale_factors(ic_stream *ics, bitfile *ld);
51 |
52 |
53 | #ifdef __cplusplus
54 | }
55 | #endif
56 | #endif
57 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/sbr_dct.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: sbr_dct.h,v 1.19 2007/11/01 12:33:34 menno Exp $
29 | **/
30 |
31 | #ifndef __SBR_DCT_H__
32 | #define __SBR_DCT_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | void dct4_kernel(real_t * in_real, real_t * in_imag, real_t * out_real, real_t * out_imag);
39 |
40 | void DCT3_32_unscaled(real_t *y, real_t *x);
41 | void DCT4_32(real_t *y, real_t *x);
42 | void DST4_32(real_t *y, real_t *x);
43 | void DCT2_32_unscaled(real_t *y, real_t *x);
44 | void DCT4_16(real_t *y, real_t *x);
45 | void DCT2_16_unscaled(real_t *y, real_t *x);
46 |
47 |
48 | #ifdef __cplusplus
49 | }
50 | #endif
51 | #endif
52 |
53 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/sbr_e_nf.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: sbr_e_nf.h,v 1.18 2007/11/01 12:33:35 menno Exp $
29 | **/
30 |
31 | #ifndef __SBR_E_NF_H__
32 | #define __SBR_E_NF_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 |
39 | void extract_envelope_data(sbr_info *sbr, uint8_t ch);
40 | void extract_noise_floor_data(sbr_info *sbr, uint8_t ch);
41 | #ifndef FIXED_POINT
42 | void envelope_noise_dequantisation(sbr_info *sbr, uint8_t ch);
43 | void unmap_envelope_noise(sbr_info *sbr);
44 | #endif
45 |
46 | #ifdef __cplusplus
47 | }
48 | #endif
49 | #endif
50 |
51 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/sbr_fbt.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: sbr_fbt.h,v 1.18 2007/11/01 12:33:35 menno Exp $
29 | **/
30 |
31 | #ifndef __SBR_FBT_H__
32 | #define __SBR_FBT_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | uint8_t qmf_start_channel(uint8_t bs_start_freq, uint8_t bs_samplerate_mode,
39 | uint32_t sample_rate);
40 | uint8_t qmf_stop_channel(uint8_t bs_stop_freq, uint32_t sample_rate,
41 | uint8_t k0);
42 | uint8_t master_frequency_table_fs0(sbr_info *sbr, uint8_t k0, uint8_t k2,
43 | uint8_t bs_alter_scale);
44 | uint8_t master_frequency_table(sbr_info *sbr, uint8_t k0, uint8_t k2,
45 | uint8_t bs_freq_scale, uint8_t bs_alter_scale);
46 | uint8_t derived_frequency_table(sbr_info *sbr, uint8_t bs_xover_band,
47 | uint8_t k2);
48 | void limiter_frequency_table(sbr_info *sbr);
49 |
50 |
51 | #ifdef __cplusplus
52 | }
53 | #endif
54 | #endif
55 |
56 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/sbr_hfadj.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: sbr_hfadj.h,v 1.19 2007/11/01 12:33:35 menno Exp $
29 | **/
30 |
31 | #ifndef __SBR_HFADJ_H__
32 | #define __SBR_HFADJ_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | typedef struct
39 | {
40 | real_t G_lim_boost[MAX_L_E][MAX_M];
41 | real_t Q_M_lim_boost[MAX_L_E][MAX_M];
42 | real_t S_M_boost[MAX_L_E][MAX_M];
43 | } sbr_hfadj_info;
44 |
45 |
46 | uint8_t hf_adjustment(sbr_info *sbr, qmf_t Xsbr[MAX_NTSRHFG][64]
47 | #ifdef SBR_LOW_POWER
48 | ,real_t *deg
49 | #endif
50 | ,uint8_t ch);
51 |
52 |
53 | #ifdef __cplusplus
54 | }
55 | #endif
56 | #endif
57 |
58 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/sbr_hfgen.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: sbr_hfgen.h,v 1.20 2007/11/01 12:33:35 menno Exp $
29 | **/
30 |
31 | #ifndef __SBR_HFGEN_H__
32 | #define __SBR_HFGEN_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | void hf_generation(sbr_info *sbr, qmf_t Xlow[MAX_NTSRHFG][64],
39 | qmf_t Xhigh[MAX_NTSRHFG][64]
40 | #ifdef SBR_LOW_POWER
41 | ,real_t *deg
42 | #endif
43 | ,uint8_t ch);
44 |
45 | #ifdef __cplusplus
46 | }
47 | #endif
48 | #endif
49 |
50 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/sbr_huff.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: sbr_huff.h,v 1.21 2007/11/01 12:33:35 menno Exp $
29 | **/
30 |
31 | #ifndef __SBR_HUFF_H__
32 | #define __SBR_HUFF_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 |
39 | void sbr_envelope(bitfile *ld, sbr_info *sbr, uint8_t ch);
40 | void sbr_noise(bitfile *ld, sbr_info *sbr, uint8_t ch);
41 |
42 | #ifdef __cplusplus
43 | }
44 | #endif
45 | #endif
46 |
47 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/sbr_qmf.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: sbr_qmf.h,v 1.25 2007/11/01 12:33:36 menno Exp $
29 | **/
30 |
31 | #ifndef __SBR_QMF_H__
32 | #define __SBR_QMF_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | qmfa_info *qmfa_init(uint8_t channels);
39 | void qmfa_end(qmfa_info *qmfa);
40 | qmfs_info *qmfs_init(uint8_t channels);
41 | void qmfs_end(qmfs_info *qmfs);
42 |
43 | void sbr_qmf_analysis_32(sbr_info *sbr, qmfa_info *qmfa, const real_t *input,
44 | qmf_t X[MAX_NTSRHFG][64], uint8_t offset, uint8_t kx);
45 | void sbr_qmf_synthesis_32(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
46 | real_t *output);
47 | void sbr_qmf_synthesis_64(sbr_info *sbr, qmfs_info *qmfs, qmf_t X[MAX_NTSRHFG][64],
48 | real_t *output);
49 |
50 |
51 | #ifdef __cplusplus
52 | }
53 | #endif
54 | #endif
55 |
56 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/sbr_syntax.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: sbr_syntax.h,v 1.23 2007/11/01 12:33:36 menno Exp $
29 | **/
30 |
31 | #ifndef __SBR_SYNTAX_H__
32 | #define __SBR_SYNTAX_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | #include "bits.h"
39 |
40 | #define T_HFGEN 8
41 | #define T_HFADJ 2
42 |
43 | #define EXT_SBR_DATA 13
44 | #define EXT_SBR_DATA_CRC 14
45 |
46 | #define FIXFIX 0
47 | #define FIXVAR 1
48 | #define VARFIX 2
49 | #define VARVAR 3
50 |
51 | #define LO_RES 0
52 | #define HI_RES 1
53 |
54 | #define NO_TIME_SLOTS_960 15
55 | #define NO_TIME_SLOTS 16
56 | #define RATE 2
57 |
58 | #define NOISE_FLOOR_OFFSET 6
59 |
60 |
61 | uint8_t sbr_extension_data(bitfile *ld, sbr_info *sbr, uint16_t cnt,
62 | uint8_t resetFlag);
63 |
64 | #ifdef __cplusplus
65 | }
66 | #endif
67 | #endif /* __SBR_SYNTAX_H__ */
68 |
69 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/sbr_tf_grid.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: sbr_tf_grid.h,v 1.17 2007/11/01 12:33:36 menno Exp $
29 | **/
30 |
31 | #ifndef __SBR_TF_GRID_H__
32 | #define __SBR_TF_GRID_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 |
39 | uint8_t envelope_time_border_vector(sbr_info *sbr, uint8_t ch);
40 | void noise_floor_time_border_vector(sbr_info *sbr, uint8_t ch);
41 |
42 |
43 | #ifdef __cplusplus
44 | }
45 | #endif
46 | #endif
47 |
48 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/specrec.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: specrec.h,v 1.33 2009/01/26 23:51:15 menno Exp $
29 | **/
30 |
31 | #ifndef __SPECREC_H__
32 | #define __SPECREC_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | #include "syntax.h"
39 |
40 | uint8_t window_grouping_info(NeAACDecStruct *hDecoder, ic_stream *ics);
41 | uint8_t reconstruct_channel_pair(NeAACDecStruct *hDecoder, ic_stream *ics1, ic_stream *ics2,
42 | element *cpe, int16_t *spec_data1, int16_t *spec_data2);
43 | uint8_t reconstruct_single_channel(NeAACDecStruct *hDecoder, ic_stream *ics, element *sce,
44 | int16_t *spec_data);
45 |
46 | #ifdef __cplusplus
47 | }
48 | #endif
49 | #endif
50 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/ssr.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: ssr.h,v 1.19 2007/11/01 12:33:36 menno Exp $
29 | **/
30 |
31 | #ifndef __SSR_H__
32 | #define __SSR_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | #define SSR_BANDS 4
39 | #define PQFTAPS 96
40 |
41 | void ssr_decode(ssr_info *ssr, fb_info *fb, uint8_t window_sequence,
42 | uint8_t window_shape, uint8_t window_shape_prev,
43 | real_t *freq_in, real_t *time_out, real_t *overlap,
44 | real_t ipqf_buffer[SSR_BANDS][96/4],
45 | real_t *prev_fmd, uint16_t frame_len);
46 |
47 |
48 | static void ssr_gain_control(ssr_info *ssr, real_t *data, real_t *output,
49 | real_t *overlap, real_t *prev_fmd, uint8_t band,
50 | uint8_t window_sequence, uint16_t frame_len);
51 | static void ssr_gc_function(ssr_info *ssr, real_t *prev_fmd,
52 | real_t *gc_function, uint8_t window_sequence,
53 | uint16_t frame_len);
54 |
55 |
56 | #ifdef __cplusplus
57 | }
58 | #endif
59 | #endif
60 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/ssr_fb.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: ssr_fb.h,v 1.16 2007/11/01 12:33:36 menno Exp $
29 | **/
30 |
31 | #ifndef __SSR_FB_H__
32 | #define __SSR_FB_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | fb_info *ssr_filter_bank_init(uint16_t frame_len);
39 | void ssr_filter_bank_end(fb_info *fb);
40 |
41 | /*non overlapping inverse filterbank */
42 | void ssr_ifilter_bank(fb_info *fb,
43 | uint8_t window_sequence,
44 | uint8_t window_shape,
45 | uint8_t window_shape_prev,
46 | real_t *freq_in,
47 | real_t *time_out,
48 | uint16_t frame_len);
49 |
50 | #ifdef __cplusplus
51 | }
52 | #endif
53 | #endif
54 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/ssr_ipqf.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: ssr_ipqf.h,v 1.17 2007/11/01 12:33:39 menno Exp $
29 | **/
30 |
31 | #ifndef __SSR_IPQF_H__
32 | #define __SSR_IPQF_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | void ssr_ipqf(ssr_info *ssr, real_t *in_data, real_t *out_data,
39 | real_t buffer[SSR_BANDS][96/4],
40 | uint16_t frame_len, uint8_t bands);
41 |
42 |
43 | #ifdef __cplusplus
44 | }
45 | #endif
46 | #endif
47 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/syntax.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vbartacek/aacplayer-android/9cfb86b581a52bd17e4dea2330c4e911fe79d64a/jni/faad2/libfaad/syntax.c
--------------------------------------------------------------------------------
/jni/faad2/libfaad/syntax.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: syntax.h,v 1.60 2009/01/26 23:51:17 menno Exp $
29 | **/
30 |
31 | #ifndef __SYNTAX_H__
32 | #define __SYNTAX_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 | #include "bits.h"
39 |
40 | #define MAIN 1
41 | #define LC 2
42 | #define SSR 3
43 | #define LTP 4
44 | #define HE_AAC 5
45 | #define LD 23
46 | #define ER_LC 17
47 | #define ER_LTP 19
48 | #define DRM_ER_LC 27 /* special object type for DRM */
49 |
50 | /* header types */
51 | #define RAW 0
52 | #define ADIF 1
53 | #define ADTS 2
54 | #define LATM 3
55 |
56 | /* SBR signalling */
57 | #define NO_SBR 0
58 | #define SBR_UPSAMPLED 1
59 | #define SBR_DOWNSAMPLED 2
60 | #define NO_SBR_UPSAMPLED 3
61 |
62 | /* DRM channel definitions */
63 | #define DRMCH_MONO 1
64 | #define DRMCH_STEREO 2
65 | #define DRMCH_SBR_MONO 3
66 | #define DRMCH_SBR_STEREO 4
67 | #define DRMCH_SBR_PS_STEREO 5
68 |
69 |
70 | /* First object type that has ER */
71 | #define ER_OBJECT_START 17
72 |
73 |
74 | /* Bitstream */
75 | #define LEN_SE_ID 3
76 | #define LEN_TAG 4
77 | #define LEN_BYTE 8
78 |
79 | #define EXT_FIL 0
80 | #define EXT_FILL_DATA 1
81 | #define EXT_DATA_ELEMENT 2
82 | #define EXT_DYNAMIC_RANGE 11
83 | #define ANC_DATA 0
84 |
85 | /* Syntax elements */
86 | #define ID_SCE 0x0
87 | #define ID_CPE 0x1
88 | #define ID_CCE 0x2
89 | #define ID_LFE 0x3
90 | #define ID_DSE 0x4
91 | #define ID_PCE 0x5
92 | #define ID_FIL 0x6
93 | #define ID_END 0x7
94 |
95 | #define ONLY_LONG_SEQUENCE 0x0
96 | #define LONG_START_SEQUENCE 0x1
97 | #define EIGHT_SHORT_SEQUENCE 0x2
98 | #define LONG_STOP_SEQUENCE 0x3
99 |
100 | #define ZERO_HCB 0
101 | #define FIRST_PAIR_HCB 5
102 | #define ESC_HCB 11
103 | #define QUAD_LEN 4
104 | #define PAIR_LEN 2
105 | #define NOISE_HCB 13
106 | #define INTENSITY_HCB2 14
107 | #define INTENSITY_HCB 15
108 |
109 | #define INVALID_SBR_ELEMENT 255
110 |
111 | int8_t GASpecificConfig(bitfile *ld, mp4AudioSpecificConfig *mp4ASC,
112 | program_config *pce);
113 |
114 | uint8_t adts_frame(adts_header *adts, bitfile *ld);
115 | void get_adif_header(adif_header *adif, bitfile *ld);
116 | void raw_data_block(NeAACDecStruct *hDecoder, NeAACDecFrameInfo *hInfo,
117 | bitfile *ld, program_config *pce, drc_info *drc);
118 | uint8_t reordered_spectral_data(NeAACDecStruct *hDecoder, ic_stream *ics, bitfile *ld,
119 | int16_t *spectral_data);
120 | #ifdef DRM
121 | void DRM_aac_scalable_main_element(NeAACDecStruct *hDecoder, NeAACDecFrameInfo *hInfo,
122 | bitfile *ld, program_config *pce, drc_info *drc);
123 | #endif
124 | uint32_t faad_latm_frame(latm_header *latm, bitfile *ld);
125 |
126 | #ifdef __cplusplus
127 | }
128 | #endif
129 | #endif
130 |
--------------------------------------------------------------------------------
/jni/faad2/libfaad/tns.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
3 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 2 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program; if not, write to the Free Software
17 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 | **
19 | ** Any non-GPL usage of this software or parts of this software is strictly
20 | ** forbidden.
21 | **
22 | ** The "appropriate copyright message" mentioned in section 2c of the GPLv2
23 | ** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
24 | **
25 | ** Commercial non-GPL licensing of this software is possible.
26 | ** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
27 | **
28 | ** $Id: tns.h,v 1.23 2007/11/01 12:33:41 menno Exp $
29 | **/
30 |
31 | #ifndef __TNS_H__
32 | #define __TNS_H__
33 |
34 | #ifdef __cplusplus
35 | extern "C" {
36 | #endif
37 |
38 |
39 | #define TNS_MAX_ORDER 20
40 |
41 |
42 | void tns_decode_frame(ic_stream *ics, tns_info *tns, uint8_t sr_index,
43 | uint8_t object_type, real_t *spec, uint16_t frame_len);
44 | void tns_encode_frame(ic_stream *ics, tns_info *tns, uint8_t sr_index,
45 | uint8_t object_type, real_t *spec, uint16_t frame_len);
46 |
47 |
48 | #ifdef __cplusplus
49 | }
50 | #endif
51 | #endif
52 |
--------------------------------------------------------------------------------
/jni/ffmpeg/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_MODULE := ffmpeg
6 | LOCAL_SRC_FILES := libavcodec/aacdec.c libavcodec/aactab.c libavutil/log.c libavutil/mem.c \
7 | libavcodec/aacsbr.c libavcodec/mdct.c libavcodec/mpeg4audio.c libavcodec/utils.c \
8 | libavcodec/bitstream.c libavcodec/dsputil.c libavutil/mathematics.c \
9 | libavcodec/aac_parser.c libavcodec/aacps.c libavcodec/fft.c libavcodec/avpacket.c \
10 | libavcodec/faanidct.c libavcodec/jrevdct.c libavcodec/simple_idct.c \
11 | libavcodec/arm/fft_init_arm.c \
12 | libavutil/avstring.c \
13 | libavcodec/audioconvert.c \
14 | libavcodec/aac_ac3_parser.c \
15 | libavcodec/parser.c \
16 | libavutil/error.c
17 |
18 | ifeq ($(MMS_WMA),yes)
19 | LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \
20 | libavcodec/wma.c libavcodec/wmadec.c \
21 | libavcodec/options.c libavcodec/opt.c libavcodec/eval.c \
22 | libavformat/asf.c libavformat/asfdec.c libavformat/asfcrypt.c libavformat/riff.c \
23 | libavformat/utils.c libavformat/avio.c libavformat/aviobuf.c libavformat/options.c \
24 | libavformat/cutils.c libavformat/metadata.c libavformat/metadata_compat.c \
25 | libavformat/avlanguage.c \
26 | libavutil/rational.c libavutil/crc.c libavutil/rc4.c libavutil/des.c
27 | endif
28 |
29 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/libavutil $(LOCAL_PATH)/libavcodec
30 |
31 | # -DCONFIG_NETWORK : due to a bug in libavformat/utils.c we must provide it directly
32 | LOCAL_CFLAGS := -DHAVE_CONFIG_H -DCONFIG_NETWORK
33 |
34 | include $(BUILD_STATIC_LIBRARY)
35 |
--------------------------------------------------------------------------------
/jni/libmms/Android.mk:
--------------------------------------------------------------------------------
1 | #
2 | # Compile libmms
3 | #
4 | LOCAL_PATH := $(call my-dir)
5 |
6 | include $(CLEAR_VARS)
7 |
8 | LOCAL_MODULE := mms
9 | LOCAL_SRC_FILES := src/mms.c src/mmsh.c src/mmsx.c src/uri.c mms-inputstream.c
10 | LOCAL_CFLAGS := -DHAVE_CONFIG_H $(cflags_loglevels)
11 | LOCAL_C_INCLUDES := $(LOCAL_PATH)
12 | LOCAL_LDLIBS := -llog
13 |
14 | include $(BUILD_SHARED_LIBRARY)
15 |
16 |
--------------------------------------------------------------------------------
/jni/libmms/android-log.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** AACPlayer - Freeware Advanced Audio (AAC) Player for Android
3 | ** Copyright (C) 2011 Spolecne s.r.o., http://www.spoledge.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 3 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program. If not, see .
17 | **/
18 |
19 | #ifndef ANDROID_LOG_H
20 | #define ANDROID_LOG_H
21 |
22 | #include
23 |
24 | #ifndef ANDROID_LOG_MODULE
25 | #error "Please specify ANDROID_LOG_MODULE at the top of your file."
26 | #endif
27 |
28 |
29 | #ifdef AACD_LOGLEVEL_TRACE
30 | #define ALOG_TRACE(...) \
31 | __android_log_print(ANDROID_LOG_VERBOSE, ANDROID_LOG_MODULE, __VA_ARGS__)
32 | #else
33 | #define ALOG_TRACE(...) //
34 | #endif
35 |
36 | #ifdef AACD_LOGLEVEL_DEBUG
37 | #define ALOG_DEBUG(...) \
38 | __android_log_print(ANDROID_LOG_DEBUG, ANDROID_LOG_MODULE, __VA_ARGS__)
39 | #else
40 | #define ALOG_DEBUG(...) //
41 | #endif
42 |
43 | #ifdef AACD_LOGLEVEL_INFO
44 | #define AACD_INFO(...) \
45 | __android_log_print(ANDROID_LOG_INFO, ANDROID_LOG_MODULE, __VA_ARGS__)
46 | #else
47 | #define ALOG_INFO(...) //
48 | #endif
49 |
50 | #ifdef ALOG_LOGLEVEL_WARN
51 | #define ALOG_WARN(...) \
52 | __android_log_print(ANDROID_LOG_WARN, ANDROID_LOG_MODULE, __VA_ARGS__)
53 | #else
54 | #define ALOG_WARN(...) //
55 | #endif
56 |
57 | #ifdef AACD_LOGLEVEL_ERROR
58 | #define ALOG_ERROR(...) \
59 | __android_log_print(ANDROID_LOG_ERROR, ANDROID_LOG_MODULE, __VA_ARGS__)
60 | #else
61 | #error "AACD_LOGLEVEL_ERROR is not defined"
62 | #define ALOG_ERROR(...) //
63 | #endif
64 |
65 | #endif
66 |
67 |
--------------------------------------------------------------------------------
/jni/libmms/config.h:
--------------------------------------------------------------------------------
1 | /* config.h. Generated from config.h.in by configure. */
2 | /* config.h.in. Generated from configure.in by autoheader. */
3 |
4 | /* Define if compiling on BeOS system. */
5 | /* #undef BEOS */
6 |
7 | /* Define to 1 if you have the header file. */
8 | #define HAVE_DLFCN_H 1
9 |
10 | /* Define to 1 if you have the header file. */
11 | #define HAVE_INTTYPES_H 1
12 |
13 | /* Define to 1 if you have the header file. */
14 | #define HAVE_MEMORY_H 1
15 |
16 | /* Define to 1 if you have the header file. */
17 | #define HAVE_NETDB_H 1
18 |
19 | /* Define to 1 if you have the header file. */
20 | #define HAVE_NETINET_IN_H 1
21 |
22 | /* Define to 1 if you have the header file. */
23 | #define HAVE_STDINT_H 1
24 |
25 | /* Define to 1 if you have the header file. */
26 | #define HAVE_STDLIB_H 1
27 |
28 | /* Define to 1 if you have the header file. */
29 | #define HAVE_STRINGS_H 1
30 |
31 | /* Define to 1 if you have the header file. */
32 | #define HAVE_STRING_H 1
33 |
34 | /* Define to 1 if you have the header file. */
35 | #define HAVE_SYS_SOCKET_H 1
36 |
37 | /* Define to 1 if you have the header file. */
38 | #define HAVE_SYS_STAT_H 1
39 |
40 | /* Define to 1 if you have the header file. */
41 | #define HAVE_SYS_TYPES_H 1
42 |
43 | /* Define to 1 if you have the header file. */
44 | #define HAVE_UNISTD_H 1
45 |
46 | /* Define to 1 if you have the header file. */
47 | /* #undef HAVE_WINDOWS_H */
48 |
49 | /* Define to 1 if you have the header file. */
50 | /* #undef HAVE_WINSOCK2_H */
51 |
52 | /* Define to the sub-directory in which libtool stores uninstalled libraries.
53 | */
54 | #define LT_OBJDIR ".libs/"
55 |
56 | /* Name of package */
57 | #define PACKAGE "libmms"
58 |
59 | /* Define to the address where bug reports for this package should be sent. */
60 | #define PACKAGE_BUGREPORT ""
61 |
62 | /* Define to the full name of this package. */
63 | #define PACKAGE_NAME "libmms"
64 |
65 | /* Define to the full name and version of this package. */
66 | #define PACKAGE_STRING "libmms 0.6.2"
67 |
68 | /* Define to the one symbol short name of this package. */
69 | #define PACKAGE_TARNAME "libmms"
70 |
71 | /* Define to the home page for this package. */
72 | #define PACKAGE_URL ""
73 |
74 | /* Define to the version of this package. */
75 | #define PACKAGE_VERSION "0.6.2"
76 |
77 | /* Define to 1 if you have the ANSI C header files. */
78 | #define STDC_HEADERS 1
79 |
80 | /* Version number of package */
81 | #define VERSION "0.6.2"
82 |
83 |
84 | /* Define to 1 if you have the header file. */
85 | /* #undef HAVE_GLIB_H */
86 |
87 | /* Define to 1 if you porting to Android. */
88 | #define OS_ANDROID 1
89 |
90 |
--------------------------------------------------------------------------------
/jni/libmms/mms-inputstream.c:
--------------------------------------------------------------------------------
1 | /*
2 | ** AACPlayer - Freeware Advanced Audio (AAC) Player for Android
3 | ** Copyright (C) 2011 Spolecne s.r.o., http://www.spoledge.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 3 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program. If not, see .
17 | **/
18 |
19 | #define ANDROID_LOG_MODULE "MMSInputStream[native]"
20 |
21 | #include "config.h"
22 | #include "mms-inputstream.h"
23 | #include "android-log.h"
24 | #include "src/mmsx.h"
25 |
26 | #include
27 |
28 | typedef struct MMSInfo {
29 | unsigned char* buffer;
30 | unsigned long bbsize;
31 | mmsx_t *mms;
32 | } MMSInfo;
33 |
34 |
35 | /*
36 | * Class: com_spoledge_aacplayer_MMSInputStream
37 | * Method: nativeConnect
38 | * Signature: (Ljava/lang/String;)I
39 | */
40 | JNIEXPORT jint JNICALL Java_com_spoledge_aacplayer_MMSInputStream_nativeConnect
41 | (JNIEnv *env, jobject thiz, jstring jurl)
42 | {
43 | ALOG_TRACE( "nativeConnect() start" );
44 |
45 | jsize url_clen = (*env)->GetStringLength( env, jurl );
46 | jsize url_blen = (*env)->GetStringUTFLength( env, jurl );
47 |
48 | char *url = calloc( 1, url_blen + 1 );
49 |
50 | (*env)->GetStringUTFRegion( env, jurl, 0, url_clen, url );
51 |
52 | ALOG_DEBUG( "nativeConnect() url='%s'", url );
53 |
54 | // now create mms_io for passing JNIEnv to it:
55 | mms_io_t *mms_io = calloc( 1, sizeof( mms_io_t ));
56 | mms_io->android_jni = env;
57 |
58 | mmsx_t *mms = mmsx_connect( NULL, NULL, url, 128000 );
59 |
60 | free( mms_io );
61 | free( url );
62 |
63 | if (!mms)
64 | {
65 | ALOG_DEBUG( "nativeConnect() return 0" );
66 | return 0;
67 | }
68 |
69 | MMSInfo *minfo = (MMSInfo*) calloc( 1, sizeof(struct MMSInfo));
70 | minfo->mms = mms;
71 |
72 | ALOG_DEBUG( "nativeConnect() info=%p", minfo );
73 | ALOG_TRACE( "nativeConnect() end" );
74 |
75 | return (jint) minfo;
76 | }
77 |
78 |
79 | /*
80 | * Class: com_spoledge_aacplayer_MMSInputStream
81 | * Method: nativeRead
82 | * Signature: (I[BII)I
83 | */
84 | JNIEXPORT jint JNICALL Java_com_spoledge_aacplayer_MMSInputStream_nativeRead
85 | (JNIEnv *env, jobject thiz, jint jminfo, jbyteArray jbuf, jint off, jint len)
86 | {
87 | ALOG_TRACE( "nativeRead() start" );
88 |
89 | MMSInfo *minfo = (MMSInfo*) jminfo;
90 |
91 | ALOG_DEBUG( "nativeRead() info=%p", minfo );
92 |
93 | if (len > minfo->bbsize)
94 | {
95 | ALOG_TRACE( "nativeRead() extending buffer %d -> %d bytes", minfo->bbsize, len );
96 | if (minfo->buffer) free( minfo->buffer );
97 |
98 | minfo->buffer = malloc( len );
99 | minfo->bbsize = len;
100 | }
101 |
102 | ALOG_TRACE( "nativeRead() calling mmsx_read len=%d", len );
103 |
104 | int n = mmsx_read( NULL, minfo->mms, minfo->buffer, len );
105 |
106 | ALOG_TRACE( "nativeRead() got %d bytes from mmsx_read", n );
107 |
108 | (*env)->SetByteArrayRegion( env, jbuf, off, n, minfo->buffer );
109 |
110 | ALOG_TRACE( "nativeRead() end" );
111 |
112 | return n;
113 | }
114 |
115 |
116 | /*
117 | * Class: com_spoledge_aacplayer_MMSInputStream
118 | * Method: nativeClose
119 | * Signature: (I)I
120 | */
121 | JNIEXPORT void JNICALL Java_com_spoledge_aacplayer_MMSInputStream_nativeClose
122 | (JNIEnv *env, jobject thiz, jint jminfo)
123 | {
124 | ALOG_TRACE( "nativeClose() start" );
125 |
126 | MMSInfo *minfo = (MMSInfo*) jminfo;
127 |
128 | if (!minfo) return;
129 |
130 | mmsx_close( minfo->mms );
131 |
132 | if (minfo->buffer) free( minfo->buffer );
133 | free( minfo );
134 |
135 | ALOG_TRACE( "nativeClose() end" );
136 | }
137 |
138 |
139 | int android_string_utf16(void *android_jni, char *dest, char *src, int dest_len)
140 | {
141 | ALOG_TRACE( "android_string_utf16() start" );
142 |
143 | JNIEnv *env = (JNIEnv*) android_jni;
144 | int iblen = strlen(src);
145 | int oblen = dest_len - 2; /* reserve 2 bytes for 0 termination */
146 |
147 | jstring jsrc = (*env)->NewStringUTF( env, src );
148 | int clen = (*env)->GetStringLength( env, jsrc );
149 |
150 | int ret = oblen - clen * 2;
151 | if (ret < 0)
152 | {
153 | clen = oblen / 2;
154 | ret = 0;
155 | }
156 |
157 | (*env)->GetStringRegion( env, jsrc, 0, clen, (jchar*) dest);
158 |
159 | jchar *oc = (jchar*)(dest + clen*2);
160 | *oc = 0;
161 |
162 | ALOG_TRACE( "android_string_utf16() end" );
163 |
164 | return ret;
165 | }
166 |
167 |
--------------------------------------------------------------------------------
/jni/libmms/mms-inputstream.h:
--------------------------------------------------------------------------------
1 | /*
2 | ** AACPlayer - Freeware Advanced Audio (AAC) Player for Android
3 | ** Copyright (C) 2011 Spolecne s.r.o., http://www.spoledge.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 3 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program. If not, see .
17 | **/
18 |
19 | /* Header for class com_spoledge_aacplayer_MMSInputStream */
20 |
21 | #ifndef _Included_com_spoledge_aacplayer_MMSInputStream
22 | #define _Included_com_spoledge_aacplayer_MMSInputStream
23 |
24 | #include
25 |
26 | #ifdef __cplusplus
27 | extern "C" {
28 | #endif
29 |
30 | /*
31 | * Class: com_spoledge_aacplayer_MMSInputStream
32 | * Method: nativeConnect
33 | * Signature: (Ljava/lang/String;)I
34 | */
35 | JNIEXPORT jint JNICALL Java_com_spoledge_aacplayer_MMSInputStream_nativeConnect
36 | (JNIEnv *, jobject, jstring);
37 |
38 | /*
39 | * Class: com_spoledge_aacplayer_MMSInputStream
40 | * Method: nativeRead
41 | * Signature: (I[BII)I
42 | */
43 | JNIEXPORT jint JNICALL Java_com_spoledge_aacplayer_MMSInputStream_nativeRead
44 | (JNIEnv *, jobject, jint, jbyteArray, jint, jint);
45 |
46 | /*
47 | * Class: com_spoledge_aacplayer_MMSInputStream
48 | * Method: nativeClose
49 | * Signature: (I)I
50 | */
51 | JNIEXPORT void JNICALL Java_com_spoledge_aacplayer_MMSInputStream_nativeClose
52 | (JNIEnv *, jobject, jint);
53 |
54 | #ifdef __cplusplus
55 | }
56 | #endif
57 | #endif
58 |
--------------------------------------------------------------------------------
/jni/libmms/src/bswap.h:
--------------------------------------------------------------------------------
1 | #ifndef BSWAP_H_INCLUDED
2 | #define BSWAP_H_INCLUDED
3 |
4 | /*
5 | * Copyright (C) 2004 Maciej Katafiasz
6 | *
7 | *
8 | * This program is free software; you can redistribute it and/or modify
9 | * it under the terms of the GNU Library General Public License as published by
10 | * the Free Software Foundation; either version 2 of the License, or
11 | * (at your option) any later version.
12 | *
13 | * This program is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | * GNU General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU General Public License
19 | * along with this program; if not, write to the Free Software
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 | */
22 |
23 |
24 | #include
25 |
26 | #define SWAP_ENDIAN_16(val) \
27 | (val[1] | (val[0] << 8))
28 | #define SWAP_ENDIAN_32(val) \
29 | (val[3] | (val[2] << 8) | (val[1] << 16) | (val[0] << 24))
30 | #define SWAP_ENDIAN_64(val) \
31 | (val[7] | (val[6] << 8) | (val[5] << 16) | (val[4] << 24) | \
32 | ((uint64_t)val[3] << 32) | ((uint64_t)val[2] << 40) | \
33 | ((uint64_t)val[1] << 48) | ((uint64_t)val[0] << 56))
34 |
35 | #define SAME_ENDIAN_16(val) \
36 | (val[0] | (val[1] << 8))
37 | #define SAME_ENDIAN_32(val) \
38 | (val[0] | (val[1] << 8) | (val[2] << 16) | (val[3] << 24))
39 | #define SAME_ENDIAN_64(val) \
40 | (val[0] | (val[1] << 8) | (val[2] << 16) | (val[3] << 24) | \
41 | ((uint64_t)val[4] << 32) | ((uint64_t)val[5] << 40) | \
42 | ((uint64_t)val[6] << 48) | ((uint64_t)val[7] << 56))
43 |
44 | #ifndef WORDS_BIGENDIAN
45 |
46 | /* Little endian */
47 |
48 | #define LE_16(val) SAME_ENDIAN_16(((uint8_t *)(val)))
49 | #define LE_32(val) SAME_ENDIAN_32(((uint8_t *)(val)))
50 | #define LE_64(val) SAME_ENDIAN_64(((uint8_t *)(val)))
51 | #define BE_16(val) SWAP_ENDIAN_16(((uint8_t *)(val)))
52 | #define BE_32(val) SWAP_ENDIAN_32(((uint8_t *)(val)))
53 | #define BE_64(val) SWAP_ENDIAN_64(((uint8_t *)(val)))
54 |
55 | #elif WORDS_BIGENDIAN == 1
56 |
57 | /* Big endian */
58 |
59 | #define LE_16(val) SWAP_ENDIAN_16(((uint8_t *)(val)))
60 | #define LE_32(val) SWAP_ENDIAN_32(((uint8_t *)(val)))
61 | #define LE_64(val) SWAP_ENDIAN_64(((uint8_t *)(val)))
62 | #define BE_16(val) SAME_ENDIAN_16(((uint8_t *)(val)))
63 | #define BE_32(val) SAME_ENDIAN_32(((uint8_t *)(val)))
64 | #define BE_64(val) SAME_ENDIAN_64(((uint8_t *)(val)))
65 |
66 | #else
67 | #error Unknown endianness!
68 | #endif
69 |
70 | #endif /* BSWAP_H_INCLUDED */
71 |
--------------------------------------------------------------------------------
/jni/libmms/src/mms-common.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010 Hans de Goede
3 | *
4 | * This file is part of libmms a free mms protocol library
5 | *
6 | * libmms is free software; you can redistribute it and/or modify
7 | * it under the terms of the GNU Library 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 | * libmss 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 Library General Public License
17 | * along with this program; if not, write to the Free Software
18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 | */
20 |
21 | /*
22 | * Modified by Vaclav Bartacek 06/2011
23 | * Ported to Android
24 | */
25 |
26 | /* This file contains code which is shared between the mms and mmsh protocol
27 | handling code. */
28 |
29 | #ifndef __MMS_COMMON_H
30 | #define __MMS_COMMON_H
31 |
32 | #define BUF_SIZE 102400 /* max packet size */
33 | #define ASF_HEADER_SIZE (8192 * 2) /* max header size */
34 |
35 | #define io_read(io, args...) ((io && io->read) ? (io)->read(io->read_data , ## args) : mms_default_io.read(NULL , ## args))
36 | #define io_write(io, args...) ((io && io->write) ? (io)->write(io->write_data , ## args) : mms_default_io.write(NULL , ## args))
37 | #define io_select(io, args...) ((io && io->select) ? (io)->select(io->select_data , ## args) : mms_default_io.select(NULL , ## args))
38 | #define io_connect(io, args...) ((io && io->connect) ? (io)->connect(io->connect_data , ## args) : mms_default_io.connect(NULL , ## args))
39 |
40 | #ifdef _WIN32
41 | #define set_errno(_err) WSASetLastError(_err)
42 | #define get_errno() WSAGetLastError()
43 | #ifndef EINPROGRESS
44 | #define EINPROGRESS WSAEINPROGRESS
45 | #endif
46 | #ifndef AI_ADDRCONFIG
47 | #define AI_ADDRCONFIG 0
48 | #endif
49 | #ifndef AI_NUMERICSERV
50 | #define AI_NUMERICSERV 0
51 | #endif
52 | #else
53 | #define set_errno(_err) errno = (_err)
54 | #define get_errno() errno
55 | #define closesocket(_s) close(_s)
56 | #endif
57 |
58 | typedef struct mms_stream_s mms_stream_t;
59 | struct mms_stream_s {
60 | int stream_id;
61 | int stream_type;
62 | int bitrate;
63 | int bitrate_pos;
64 | };
65 |
66 | extern mms_io_t mms_default_io;
67 |
68 | int mms_internal_winsock_load(void);
69 |
70 | #endif
71 |
--------------------------------------------------------------------------------
/jni/libmms/src/mms.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2002-2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 | *
20 | * $Id: mms.h,v 1.15 2007/12/11 20:24:48 jwrdegoede Exp $
21 | *
22 | * libmms public header
23 | */
24 |
25 | #ifndef HAVE_MMS_H
26 | #define HAVE_MMS_H
27 |
28 | #include
29 | #include
30 |
31 | #include "mmsio.h"
32 |
33 | #ifdef __cplusplus
34 | extern "C" {
35 | #endif /* __cplusplus */
36 |
37 | typedef struct mms_s mms_t;
38 |
39 | mms_t* mms_connect (mms_io_t *io, void *data, const char *url, int bandwidth);
40 |
41 | int mms_read (mms_io_t *io, mms_t *instance, char *data, int len);
42 | int mms_request_time_seek (mms_io_t *io, mms_t *instance, double time_sec);
43 | int mms_time_seek (mms_io_t *io, mms_t *instance, double time_sec);
44 | int mms_request_packet_seek (mms_io_t *io, mms_t *instance,
45 | unsigned long packet_seq);
46 | /*
47 | * mms_seek() will try to seek using mms_request_packet_seek(), if the server
48 | * ignore the packet seek command, it will return unchanged current_pos, rather
49 | * than trying to mms_read() until the destination pos is reached. This is to
50 | * let the caller, by itself, to decide to choose the alternate method, such
51 | * as, mms_time_seek() and/or mms_read() until the destination pos is reached.
52 | * One can do binary search using time offset (mms_time_seek()) as a search
53 | * index, to approach the desired byte offset. It is to systematically guess
54 | * the time offset to reach for the byte offset.
55 | */
56 | mms_off_t mms_seek (mms_io_t *io, mms_t *instance, mms_off_t offset, int origin);
57 | /* return total playback time in seconds */
58 | double mms_get_time_length (mms_t *instance);
59 | /* return raw total playback time in 100 nanosecs (10^-7) */
60 | uint64_t mms_get_raw_time_length (mms_t *instance);
61 | uint64_t mms_get_file_time (mms_t *instance);
62 | uint32_t mms_get_length (mms_t *instance);
63 | void mms_close (mms_t *instance);
64 |
65 | int mms_peek_header (mms_t *instance, char *data, int maxsize);
66 |
67 | mms_off_t mms_get_current_pos (mms_t *instance);
68 |
69 | uint32_t mms_get_asf_header_len (mms_t *instance);
70 |
71 | uint64_t mms_get_asf_packet_len (mms_t *instance);
72 |
73 | int mms_get_seekable (mms_t *instance);
74 |
75 | #ifdef __cplusplus
76 | }
77 | #endif /* __cplusplus */
78 |
79 | #endif
80 |
81 |
--------------------------------------------------------------------------------
/jni/libmms/src/mms_config.h:
--------------------------------------------------------------------------------
1 | /* src/mms_config.h. Generated from mms_config.h.in by configure. */
2 | /* libmms public autoconf settings header file */
3 |
4 | /* Define to 1 if libmms is compiled with 64 bit file offsets */
5 | #define LIBMMS_HAVE_64BIT_OFF_T 1
6 |
--------------------------------------------------------------------------------
/jni/libmms/src/mmsh.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2002-2003 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 | *
20 | * $Id: mmsh.h,v 1.8 2007/12/11 20:24:48 jwrdegoede Exp $
21 | *
22 | * libmmsh public header
23 | */
24 |
25 | #ifndef HAVE_MMSH_H
26 | #define HAVE_MMSH_H
27 |
28 | #include
29 | #include
30 | #include "mmsio.h"
31 |
32 | #ifdef __cplusplus
33 | extern "C" {
34 | #endif /* __cplusplus */
35 |
36 | typedef struct mmsh_s mmsh_t;
37 |
38 | char* mmsh_connect_common(int *s ,int *port, char *url, char **host, char **path, char **file);
39 | mmsh_t* mmsh_connect (mms_io_t *io, void *data, const char *url_, int bandwidth);
40 |
41 | int mmsh_read (mms_io_t *io, mmsh_t *instance, char *data, int len);
42 | int mmsh_time_seek (mms_io_t *io, mmsh_t *instance, double time_sec);
43 | mms_off_t mmsh_seek (mms_io_t *io, mmsh_t *instance, mms_off_t offset, int origin);
44 | uint32_t mmsh_get_length (mmsh_t *instance);
45 | double mmsh_get_time_length (mmsh_t *instance);
46 | uint64_t mmsh_get_raw_time_length (mmsh_t *instance);
47 | uint64_t mmsh_get_file_time (mmsh_t *instance);
48 | mms_off_t mmsh_get_current_pos (mmsh_t *instance);
49 | void mmsh_close (mmsh_t *instance);
50 |
51 | int mmsh_peek_header (mmsh_t *instance, char *data, int maxsize);
52 |
53 | uint32_t mmsh_get_asf_header_len (mmsh_t *instance);
54 |
55 | uint32_t mmsh_get_asf_packet_len (mmsh_t *instance);
56 |
57 | int mmsh_get_seekable (mmsh_t *instance);
58 |
59 | #ifdef __cplusplus
60 | }
61 | #endif /* __cplusplus */
62 |
63 | #endif
64 |
--------------------------------------------------------------------------------
/jni/libmms/src/mmsio.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Modified by Vaclav Bartacek 06/2011
4 | * Ported to Android
5 | */
6 |
7 | #ifndef __MMS_IO_H__
8 | #define __MMS_IO_H__
9 |
10 | #include
11 |
12 | #include "config.h"
13 | #include "mms_config.h"
14 |
15 | /* On 64 bit file offset capable systems, libmms' configure script adds
16 | -D_FILE_OFFSET_BITS=64 to the CFLAGS. This causes off_t to be 64 bit,
17 | When an app which includes this header file gets compiled without
18 | -D_FILE_OFFSET_BITS=64, it should still expect / pass 64 bit ints for
19 | off_t, this acomplishes this: */
20 | #if defined LIBMMS_HAVE_64BIT_OFF_T && !defined __MMS_C__
21 | #define mms_off_t int64_t
22 | #else
23 | #define mms_off_t off_t
24 | #endif
25 |
26 | #ifdef __cplusplus
27 | extern "C" {
28 | #endif /* __cplusplus */
29 |
30 | typedef mms_off_t (*mms_io_write_func)(void *data, int socket, char *buf, mms_off_t num);
31 | typedef mms_off_t (*mms_io_read_func)(void *data, int socket, char *buf, mms_off_t num);
32 |
33 | /* select states */
34 | #define MMS_IO_READ_READY 1
35 | #define MMS_IO_WRITE_READY 2
36 |
37 | enum
38 | {
39 | MMS_IO_STATUS_READY, /* IO can be safely performed */
40 | MMS_IO_STATUS_ERROR, /* There was IO error */
41 | MMS_IO_STATUS_ABORTED, /* IO command was (somehow)
42 | aborted. This is not error, but invalidates IO for further operations*/
43 | MMS_IO_STATUS_TIMEOUT /* Timeout was exceeded */
44 | };
45 |
46 | /*
47 | * Waits for a file descriptor/socket to change status.
48 | *
49 | * users can use this handler to provide their own implementations,
50 | * for example abortable ones
51 | *
52 | * params :
53 | * data whatever parameter may be needed by implementation
54 | * fd file/socket descriptor
55 | * state MMS_IO_READ_READY, MMS_IO_WRITE_READY
56 | * timeout_sec timeout in seconds
57 | *
58 | *
59 | * return value :
60 | * MMS_IO_READY the file descriptor is ready for cmd
61 | * MMS_IO_ERROR an i/o error occured
62 | * MMS_IO_ABORTED command aborted
63 | * MMS_IO_TIMEOUT the file descriptor is not ready after timeout_msec milliseconds
64 | * every other return value is interpreted same as MMS_IO_ABORTED
65 | */
66 | typedef int (*mms_io_select_func)(void *data, int fd, int state, int timeout_msec);
67 |
68 | /*
69 | * open a tcp connection
70 | *
71 | * params :
72 | * stream needed for reporting errors but may be NULL
73 | * host address of target
74 | * port port on target
75 | *
76 | * returns a socket descriptor or -1 if an error occured
77 | */
78 | typedef int (*mms_io_tcp_connect_func)(void *data, const char *host, int port);
79 |
80 | typedef struct
81 | {
82 | mms_io_select_func select;
83 | void *select_data;
84 | mms_io_read_func read;
85 | void *read_data;
86 | mms_io_write_func write;
87 | void *write_data;
88 | mms_io_tcp_connect_func connect;
89 | void *connect_data;
90 | #ifdef OS_ANDROID
91 | void *android_jni;
92 | #endif
93 | } mms_io_t;
94 |
95 | /* set default IO implementation, it will be used in absence of specific IO
96 | parameter. Structure is referenced, not copied, must remain valid for entire
97 | usage period. Passing NULL reverts to default, POSIX based implementation */
98 | void mms_set_default_io_impl(const mms_io_t *io);
99 | const mms_io_t* mms_get_default_io_impl();
100 |
101 | #ifdef __cplusplus
102 | }
103 | #endif /* __cplusplus */
104 |
105 | #endif /* __MMS_IO_H__ */
106 |
--------------------------------------------------------------------------------
/jni/libmms/src/mmsx.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2007 Hans de Goede
3 | *
4 | * This file is part of libmms a free mms protocol library
5 | *
6 | * libmms is free software; you can redistribute it and/or modify
7 | * it under the terms of the GNU Library 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 | * libmss 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 Library General Public License
17 | * along with this program; if not, write to the Free Software
18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 | */
20 |
21 | /*
22 | * Modified by Vaclav Bartacek 06/2011
23 | * Ported to Android
24 | */
25 |
26 | /*
27 | * mmsx is a small wrapper around the mms and mmsh protocol implementations
28 | * in libmms. The mmsx functions provide transparent access to both protocols
29 | * so that programs who wish to support both can do so with a single code path
30 | * if desired.
31 | */
32 |
33 | #include
34 | #include "mmsx.h"
35 | #include "mms.h"
36 | #include "mmsh.h"
37 |
38 | struct mmsx_s {
39 | mms_t *connection;
40 | mmsh_t *connection_h;
41 | };
42 |
43 | mmsx_t *mmsx_connect(mms_io_t *io, void *data, const char *url, int bandwidth)
44 | {
45 | mmsx_t *mmsx = calloc(1, sizeof(mmsx_t));
46 | #ifdef OS_ANDROID
47 | char *try_mms_first = NULL;
48 | #else
49 | char *try_mms_first = getenv("LIBMMS_TRY_MMS_FIRST");
50 | #endif
51 |
52 | if (!mmsx)
53 | return mmsx;
54 |
55 | /* Normally we try mmsh first, as mms: is a rollover protocol identifier
56 | according to microsoft and recent mediaplayer versions will try
57 | mmsh before mms for mms:// uris. Note that in case of a mmst:// or a
58 | mmsh:// url the mms[h]_connect function will directly exit if it cannot
59 | handle it. The LIBMMS_TRY_MMS_FIRST environment variable is there for
60 | testing the mms code against servers which accept both mmsh and mms. */
61 | if (try_mms_first) {
62 | mmsx->connection = mms_connect(io, data, url, bandwidth);
63 | if (mmsx->connection)
64 | return mmsx;
65 | }
66 |
67 | mmsx->connection_h = mmsh_connect(io, data, url, bandwidth);
68 | if (mmsx->connection_h)
69 | return mmsx;
70 |
71 | if (!try_mms_first) {
72 | mmsx->connection = mms_connect(io, data, url, bandwidth);
73 | if (mmsx->connection)
74 | return mmsx;
75 | }
76 |
77 | free(mmsx);
78 | return NULL;
79 | }
80 |
81 | int mmsx_read (mms_io_t *io, mmsx_t *mmsx, char *data, int len)
82 | {
83 | if(mmsx->connection)
84 | return mms_read(io, mmsx->connection, data, len);
85 | else
86 | return mmsh_read(io, mmsx->connection_h, data, len);
87 | }
88 |
89 | int mmsx_time_seek (mms_io_t *io, mmsx_t *mmsx, double time_sec)
90 | {
91 | if(mmsx->connection)
92 | return mms_time_seek(io, mmsx->connection, time_sec);
93 | else
94 | return mmsh_time_seek(io, mmsx->connection_h, time_sec);
95 | }
96 |
97 | mms_off_t mmsx_seek (mms_io_t *io, mmsx_t *mmsx, mms_off_t offset, int origin)
98 | {
99 | if(mmsx->connection)
100 | return mms_seek(io, mmsx->connection, offset, origin);
101 | else
102 | return mmsh_seek(io, mmsx->connection_h, offset, origin);
103 | }
104 |
105 | double mmsx_get_time_length (mmsx_t *mmsx)
106 | {
107 | if(mmsx->connection)
108 | return mms_get_time_length(mmsx->connection);
109 | else
110 | return mmsh_get_time_length(mmsx->connection_h);
111 | }
112 |
113 | uint64_t mmsx_get_raw_time_length (mmsx_t *mmsx)
114 | {
115 | if(mmsx->connection)
116 | return mms_get_raw_time_length(mmsx->connection);
117 | else
118 | return mmsh_get_raw_time_length(mmsx->connection_h);
119 | }
120 |
121 | uint64_t mmsx_get_file_time (mmsx_t *mmsx) {
122 | if(mmsx->connection)
123 | return mms_get_file_time(mmsx->connection);
124 | else
125 | return mmsh_get_file_time(mmsx->connection_h);
126 | }
127 |
128 | uint32_t mmsx_get_length (mmsx_t *mmsx)
129 | {
130 | if(mmsx->connection)
131 | return mms_get_length(mmsx->connection);
132 | else
133 | return mmsh_get_length(mmsx->connection_h);
134 | }
135 |
136 | void mmsx_close (mmsx_t *mmsx)
137 | {
138 | if(mmsx->connection)
139 | mms_close(mmsx->connection);
140 | else
141 | mmsh_close(mmsx->connection_h);
142 |
143 | free(mmsx);
144 | }
145 |
146 | int mmsx_peek_header (mmsx_t *mmsx, char *data, int maxsize)
147 | {
148 | if(mmsx->connection)
149 | return mms_peek_header(mmsx->connection, data, maxsize);
150 | else
151 | return mmsh_peek_header(mmsx->connection_h, data, maxsize);
152 | }
153 |
154 | mms_off_t mmsx_get_current_pos (mmsx_t *mmsx)
155 | {
156 | if(mmsx->connection)
157 | return mms_get_current_pos(mmsx->connection);
158 | else
159 | return mmsh_get_current_pos(mmsx->connection_h);
160 | }
161 |
162 | uint32_t mmsx_get_asf_header_len(mmsx_t *mmsx)
163 | {
164 | if(mmsx->connection)
165 | return mms_get_asf_header_len(mmsx->connection);
166 | else
167 | return mmsh_get_asf_header_len(mmsx->connection_h);
168 | }
169 |
170 | uint64_t mmsx_get_asf_packet_len (mmsx_t *mmsx)
171 | {
172 | if(mmsx->connection)
173 | return mms_get_asf_packet_len(mmsx->connection);
174 | else
175 | return mmsh_get_asf_packet_len(mmsx->connection_h);
176 | }
177 |
178 | int mmsx_get_seekable (mmsx_t *mmsx)
179 | {
180 | if(mmsx->connection)
181 | return mms_get_seekable(mmsx->connection);
182 | else
183 | return mmsh_get_seekable(mmsx->connection_h);
184 | }
185 |
--------------------------------------------------------------------------------
/jni/libmms/src/mmsx.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2007 Hans de Goede
3 | *
4 | * This file is part of libmms a free mms protocol library
5 | *
6 | * libmms is free software; you can redistribute it and/or modify
7 | * it under the terms of the GNU Library 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 | * libmss 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 Library General Public License
17 | * along with this program; if not, write to the Free Software
18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19 | *
20 | * libmms public header
21 | */
22 |
23 | /*
24 | * mmsx is a small wrapper around the mms and mmsh protocol implementations
25 | * in libmms. The mmsx functions provide transparent access to both protocols
26 | * so that programs who wish to support both can do so with a single code path
27 | * if desired.
28 | */
29 |
30 | #ifndef HAVE_MMSX_H
31 | #define HAVE_MMSX_H
32 |
33 | #include
34 | #include "mmsio.h"
35 |
36 | #ifdef __cplusplus
37 | extern "C" {
38 | #endif /* __cplusplus */
39 |
40 | typedef struct mmsx_s mmsx_t;
41 |
42 | mmsx_t* mmsx_connect (mms_io_t *io, void *data, const char *url, int bandwidth);
43 |
44 | int mmsx_read (mms_io_t *io, mmsx_t *instance, char *data, int len);
45 | int mmsx_time_seek (mms_io_t *io, mmsx_t *instance, double time_sec);
46 | mms_off_t mmsx_seek (mms_io_t *io, mmsx_t *instance, mms_off_t offset, int origin);
47 | /* return total playback time in seconds */
48 | double mmsx_get_time_length (mmsx_t *instance);
49 | /* return raw total playback time in 100 nanosecs (10^-7) */
50 | uint64_t mmsx_get_raw_time_length (mmsx_t *instance);
51 | uint32_t mmsx_get_length (mmsx_t *instance);
52 | uint64_t mmsx_get_file_time (mmsx_t *instance);
53 | void mmsx_close (mmsx_t *instance);
54 |
55 | int mmsx_peek_header (mmsx_t *instance, char *data, int maxsize);
56 |
57 | mms_off_t mmsx_get_current_pos (mmsx_t *instance);
58 |
59 | uint32_t mmsx_get_asf_header_len (mmsx_t *instance);
60 |
61 | uint64_t mmsx_get_asf_packet_len (mmsx_t *instance);
62 |
63 | int mmsx_get_seekable (mmsx_t *instance);
64 |
65 | #ifdef __cplusplus
66 | }
67 | #endif /* __cplusplus */
68 |
69 | #endif
70 |
71 |
--------------------------------------------------------------------------------
/jni/libmms/src/uri.h:
--------------------------------------------------------------------------------
1 | /* GNet - Networking library
2 | * Copyright (C) 2000-2001 David Helder, David Bolcsfoldi
3 | *
4 | * This library is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Library General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2 of the License, or (at your option) any later version.
8 | *
9 | * This library is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Library General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Library General Public
15 | * License along with this library; if not, write to the
16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 | * Boston, MA 02111-1307, USA.
18 | */
19 |
20 | /*
21 | * Modified by Vaclav Bartacek 06/2011
22 | * Ported to Android
23 | */
24 |
25 | #ifndef _GNET_URI_H
26 | #define _GNET_URI_H
27 |
28 | #ifndef OS_ANDROID
29 | #include
30 | #else
31 |
32 | typedef int gint;
33 | typedef gint gboolean;
34 | typedef unsigned int guint;
35 | typedef const void *gconstpointer;
36 |
37 | #ifndef FALSE
38 | #define FALSE (0)
39 | #endif
40 |
41 | #ifndef TRUE
42 | #define TRUE (!FALSE)
43 | #endif
44 |
45 | #define g_new0(struct_type, n_structs) \
46 | ((struct_type *) calloc( n_structs, sizeof (struct_type)))
47 |
48 | #define g_malloc(s) \
49 | (malloc(s))
50 |
51 | #define g_free(s) \
52 | (free(s))
53 |
54 | #define g_strdup(s) \
55 | (strdup(s))
56 |
57 | #define g_strndup(s,n) \
58 | (strndup(s,n))
59 |
60 | #define g_return_if_fail(e)
61 | #define g_return_val_if_fail(a,b)
62 |
63 | #endif
64 |
65 | #ifdef __cplusplus
66 | extern "C" {
67 | #endif /* __cplusplus */
68 |
69 |
70 | /**
71 | * GURI:
72 | * @scheme: Scheme (or protocol)
73 | * @userinfo: User info
74 | * @hostname: Host name
75 | * @port: Port number
76 | * @path: Path
77 | * @query: Query
78 | * @fragment: Fragment
79 | *
80 | * The #GURI structure represents a URI. All fields in this
81 | * structure are publicly readable.
82 | *
83 | **/
84 | typedef struct _GURI GURI;
85 |
86 | struct _GURI
87 | {
88 | char* scheme;
89 | char* user;
90 | char* passwd;
91 | char* hostname;
92 | gint port;
93 | char* path;
94 | char* query;
95 | char* fragment;
96 | };
97 |
98 |
99 |
100 | GURI* gnet_uri_new (const char* uri);
101 | GURI* gnet_uri_new_fields (const char* scheme, const char* hostname,
102 | const gint port, const char* path);
103 | GURI*
104 | gnet_uri_new_fields_all (const char* scheme, const char* user,
105 | const char* passwd, const char* hostname,
106 | const gint port, const char* path,
107 | const char* query, const char* fragment);
108 | GURI* gnet_uri_clone (const GURI* uri);
109 | void gnet_uri_delete (GURI* uri);
110 |
111 | gboolean gnet_uri_equal (gconstpointer p1, gconstpointer p2);
112 | guint gnet_uri_hash (gconstpointer p);
113 |
114 | void gnet_uri_escape (GURI* uri);
115 | void gnet_uri_unescape (GURI* uri);
116 |
117 | char* gnet_uri_get_string (const GURI* uri);
118 |
119 | void gnet_uri_set_scheme (GURI* uri, const char* scheme);
120 | void gnet_uri_set_userinfo (GURI* uri, const char* user, const char* passwd);
121 | void gnet_uri_set_hostname (GURI* uri, const char* hostname);
122 | void gnet_uri_set_port (GURI* uri, gint port);
123 | void gnet_uri_set_path (GURI* uri, const char* path);
124 | void gnet_uri_set_query (GURI* uri, const char* query);
125 | void gnet_uri_set_fragment (GURI* uri, const char* fragment);
126 |
127 | char* gnet_mms_helper(const GURI* uri, int make_absolute);
128 |
129 | #ifdef __cplusplus
130 | }
131 | #endif /* __cplusplus */
132 |
133 | #endif /* _GNET_URI_H */
134 |
--------------------------------------------------------------------------------
/jni/opencore-aacdec.patch:
--------------------------------------------------------------------------------
1 | diff -aur opencore-aacdec/src/get_adif_header.c aacplayer-android/jni/opencore-aacdec/src/get_adif_header.c
2 | --- opencore-aacdec/src/get_adif_header.c 2009-07-28 12:19:38.000000000 +0200
3 | +++ aacplayer-android/jni/opencore-aacdec/src/get_adif_header.c 2011-03-28 10:56:20.000000000 +0200
4 | @@ -19,6 +19,11 @@
5 |
6 | Filename: get_adif_header.cpp
7 |
8 | + Changes by Vaclav Bartacek:
9 | + 2011-03-25: renamed get_adiff_header to opencore_get_adif_header
10 | + (due to linking problems - duplicit symbol
11 | + - same symbol used by FAAD2 and OpenCORE)
12 | +
13 | ------------------------------------------------------------------------------
14 | INPUT AND OUTPUT DEFINITIONS
15 |
16 | @@ -242,7 +247,7 @@
17 | ; Declare variables used in this module but defined elsewhere
18 | ----------------------------------------------------------------------------*/
19 |
20 | -Int get_adif_header(
21 | +Int opencore_get_adif_header(
22 | tDec_Int_File *pVars,
23 | ProgConfig *pScratchPCE)
24 | {
25 | diff -aur opencore-aacdec/src/get_adif_header.h aacplayer-android/jni/opencore-aacdec/src/get_adif_header.h
26 | --- opencore-aacdec/src/get_adif_header.h 2009-07-27 17:51:56.000000000 +0200
27 | +++ aacplayer-android/jni/opencore-aacdec/src/get_adif_header.h 2011-03-28 10:56:26.000000000 +0200
28 | @@ -19,6 +19,11 @@
29 |
30 | Filename: get_adif_header.h
31 |
32 | + Changes by Vaclav Bartacek:
33 | + 2011-03-25: renamed get_adiff_header to opencore_get_adif_header
34 | + (due to linking problems - duplicit symbol
35 | + - same symbol used by FAAD2 and OpenCORE)
36 | +
37 | ------------------------------------------------------------------------------
38 | INCLUDE DESCRIPTION
39 |
40 | @@ -74,7 +79,7 @@
41 | ; Function Prototype declaration
42 | ----------------------------------------------------------------------------*/
43 |
44 | -Int get_adif_header(
45 | +Int opencore_get_adif_header(
46 | tDec_Int_File *pVars,
47 | ProgConfig *pScratchPCE);
48 |
49 | diff -aur opencore-aacdec/src/pvmp4audiodecoderframe.c aacplayer-android/jni/opencore-aacdec/src/pvmp4audiodecoderframe.c
50 | --- opencore-aacdec/src/pvmp4audiodecoderframe.c 2009-07-28 12:19:38.000000000 +0200
51 | +++ aacplayer-android/jni/opencore-aacdec/src/pvmp4audiodecoderframe.c 2011-03-28 10:56:33.000000000 +0200
52 | @@ -19,6 +19,11 @@
53 |
54 | Filename: pvmp4audiodecoderframe.cpp
55 |
56 | + Changes by Vaclav Bartacek:
57 | + 2011-03-25: renamed get_adiff_header to opencore_get_adif_header
58 | + (due to linking problems - duplicit symbol
59 | + - same symbol used by FAAD2 and OpenCORE)
60 | +
61 | ------------------------------------------------------------------------------
62 | INPUT AND OUTPUT DEFINITIONS
63 |
64 | @@ -414,7 +419,7 @@
65 | * (actually usedBits).
66 | */
67 | status =
68 | - get_adif_header(
69 | + opencore_get_adif_header(
70 | pVars,
71 | &(pVars->scratch.scratch_prog_config));
72 |
73 |
--------------------------------------------------------------------------------
/jni/opencore-aacdec/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 |
3 | include $(CLEAR_VARS)
4 |
5 | LOCAL_MODULE := opencore-aacdec
6 | LOCAL_SRC_FILES := src/sbr_create_limiter_bands.c src/get_ga_specific_config.c src/idct32.c \
7 | src/tns_decode_coef.c src/digit_reversal_tables.c src/sbr_decode_huff_cw.c \
8 | src/sbr_inv_filt_levelemphasis.c src/pvmp4audiodecoderinitlibrary.c src/intensity_right.c \
9 | src/ps_all_pass_fract_delay_filter.c src/fwd_short_complex_rot.c src/pns_intensity_right.c \
10 | src/mix_radix_fft.c src/tns_ar_filter.c src/get_dse.c \
11 | src/inv_long_complex_rot.c src/q_normalize.c src/dct64.c \
12 | src/decode_noise_floorlevels.c src/hcbtables_binary.c src/extractframeinfo.c \
13 | src/check_crc.c src/esc_iquant_scaling.c src/getmask.c \
14 | src/sbr_get_additional_data.c src/get_adif_header.c src/pv_div.c \
15 | src/pvmp4setaudioconfig.c src/sbr_crc_check.c src/qmf_filterbank_coeff.c \
16 | src/getfill.c src/sbr_get_dir_control_data.c src/getactualaacconfig.c \
17 | src/sbr_extract_extended_data.c src/getics.c src/apply_ms_synt.c \
18 | src/pulse_nc.c src/sbr_requantize_envelope_data.c src/sbr_open.c \
19 | src/decode_huff_cw_binary.c src/gen_rand_vector.c src/calc_sbr_envelope.c \
20 | src/fft_rx4_short.c src/iquant_table.c src/long_term_synthesis.c \
21 | src/buf_getbits.c src/ps_decode_bs_utils.c src/deinterleave.c \
22 | src/sbr_get_envelope.c src/dst32.c src/get_pulse_data.c \
23 | src/sbr_get_cpe.c src/calc_sbr_synfilterbank.c src/fft_rx4_long.c \
24 | src/pv_sine.c src/pns_left.c src/ps_hybrid_filter_bank_allocation.c \
25 | src/window_tables_fxp.c src/get_tns.c src/dst16.c \
26 | src/sbr_downsample_lo_res.c src/synthesis_sub_band.c src/calc_auto_corr.c \
27 | src/long_term_prediction.c src/ms_synt.c src/inv_short_complex_rot.c \
28 | src/hufffac.c src/sbr_code_book_envlevel.c src/get_sbr_bitstream.c \
29 | src/get_adts_header.c src/sfb.c src/sbr_update_freq_scale.c \
30 | src/sbr_generate_high_freq.c src/sbr_get_sce.c src/huffdecode.c \
31 | src/pv_sqrt.c src/tns_inv_filter.c src/ps_hybrid_analysis.c \
32 | src/sbr_dec.c src/sbr_envelope_calc_tbl.c src/analysis_sub_band.c \
33 | src/ps_decorrelate.c src/pv_normalize.c src/dst8.c \
34 | src/find_adts_syncword.c src/ps_read_data.c src/pvmp4audiodecodergetmemrequirements.c \
35 | src/sbr_decode_envelope.c src/ps_init_stereo_mixing.c src/pv_pow2.c \
36 | src/fwd_long_complex_rot.c src/sbr_find_start_andstop_band.c src/lt_decode.c \
37 | src/get_ele_list.c src/unpack_idx.c src/get_sbr_startfreq.c \
38 | src/ps_hybrid_synthesis.c src/sbr_read_data.c src/ps_channel_filtering.c \
39 | src/mdct_fxp.c src/sbr_aliasing_reduction.c src/imdct_fxp.c \
40 | src/get_ics_info.c src/mdct_tables_fxp.c src/ps_stereo_processing.c \
41 | src/get_prog_config.c src/fft_rx4_tables_fxp.c src/trans4m_freq_2_time_fxp.c \
42 | src/apply_tns.c src/getgroup.c src/set_mc_info.c \
43 | src/sbr_reset_dec.c src/pvmp4audiodecoderresetbuffer.c src/ps_allocate_decoder.c \
44 | src/pvmp4audiodecoderframe.c src/pv_log2.c src/init_sbr_dec.c \
45 | src/infoinit.c src/mdst.c src/ps_pwr_transient_detection.c \
46 | src/sbr_get_header_data.c src/pns_corr.c src/huffcb.c \
47 | src/calc_sbr_anafilterbank.c src/dct16.c src/trans4m_time_2_freq_fxp.c \
48 | src/sbr_envelope_unmapping.c src/ps_bstr_decoding.c src/idct8.c \
49 | src/calc_gsfb_table.c src/get_audio_specific_config.c src/huffspec_fxp.c \
50 | src/ps_fft_rx8.c src/get_sbr_stopfreq.c src/sbr_applied.c \
51 | src/pvmp4audiodecoderconfig.c src/ps_applied.c src/ps_all_pass_filter_coeff.c \
52 | src/byte_align.c src/idct16.c src/sbr_get_noise_floor_data.c \
53 | src/shellsort.c
54 |
55 | LOCAL_C_INCLUDES := $(LOCAL_PATH)/include $(LOCAL_PATH)/src $(LOCAL_PATH)/oscl
56 | LOCAL_ARM_MODE := arm
57 |
58 | include $(BUILD_STATIC_LIBRARY)
59 |
--------------------------------------------------------------------------------
/jni/opencore-aacdec/config.h:
--------------------------------------------------------------------------------
1 | /* config.h. Generated from config.h.in by configure. */
2 | /* config.h.in. Generated from configure.ac by autoheader. */
3 |
4 | /* SBR decoding */
5 | #define AAC_PLUS 1
6 |
7 | /* Define to 1 if you have the header file. */
8 | #define HAVE_CURL_CURL_H 1
9 |
10 | /* Define to 1 if you have the header file. */
11 | #define HAVE_DLFCN_H 1
12 |
13 | /* Define to 1 if you have the header file. */
14 | #define HAVE_INTTYPES_H 1
15 |
16 | /* Define to 1 if you have the header file. */
17 | #define HAVE_MEMORY_H 1
18 |
19 | /* Define to 1 if you have the header file. */
20 | #define HAVE_PTHREAD_H 1
21 |
22 | /* Define to 1 if you have the header file. */
23 | #define HAVE_STDINT_H 1
24 |
25 | /* Define to 1 if you have the header file. */
26 | #define HAVE_STDLIB_H 1
27 |
28 | /* Define to 1 if you have the header file. */
29 | #define HAVE_STRINGS_H 1
30 |
31 | /* Define to 1 if you have the header file. */
32 | #define HAVE_STRING_H 1
33 |
34 | /* Define to 1 if you have the header file. */
35 | #define HAVE_SYS_STAT_H 1
36 |
37 | /* Define to 1 if you have the header file. */
38 | #define HAVE_SYS_TYPES_H 1
39 |
40 | /* Define to 1 if you have the header file. */
41 | #define HAVE_UNISTD_H 1
42 |
43 | /* High-Quality SBR */
44 | #define HQ_SBR 1
45 |
46 | /* Define to 1 if your C compiler doesn't accept -c and -o together. */
47 | /* #undef NO_MINUS_C_MINUS_O */
48 |
49 | /* Name of package */
50 | #define PACKAGE "libaacdec"
51 |
52 | /* Define to the address where bug reports for this package should be sent. */
53 | #define PACKAGE_BUGREPORT "tipok@tipok.org.ua"
54 |
55 | /* Define to the full name of this package. */
56 | #define PACKAGE_NAME "libaacdec"
57 |
58 | /* Define to the full name and version of this package. */
59 | #define PACKAGE_STRING "libaacdec 1.0.0"
60 |
61 | /* Define to the one symbol short name of this package. */
62 | #define PACKAGE_TARNAME "libaacdec"
63 |
64 | /* Define to the version of this package. */
65 | #define PACKAGE_VERSION "1.0.0"
66 |
67 | /* Parametric-Stereo decoding */
68 | #define PARAMETRICSTEREO 1
69 |
70 | /* GCC ARM v4 */
71 | /* #undef PV_ARM_GCC_V4 */
72 |
73 | /* GCC ARM v5 */
74 | /* #undef PV_ARM_GCC_V5 */
75 | #define PV_ARM_GCC_V5
76 |
77 | /* MSC EVC ARM v4 */
78 | /* #undef PV_ARM_MSC_EVC_V4 */
79 |
80 | /* MSC EVC ARM v5 */
81 | /* #undef PV_ARM_MSC_EVC_V5 */
82 |
83 | /* ARM v4 */
84 | /* #undef PV_ARM_V4 */
85 |
86 | /* ARM v5 */
87 | /* #undef PV_ARM_V5 */
88 |
89 | /* Define to 1 if you have the ANSI C header files. */
90 | #define STDC_HEADERS 1
91 |
92 | /* Version number of package */
93 | #define VERSION "1.0.0"
94 |
95 | /* Define to `__inline__' or `__inline' if that's what the C compiler
96 | calls it, or to nothing if 'inline' is not supported under any name. */
97 | #ifndef __cplusplus
98 | /* #undef inline */
99 | #endif
100 |
--------------------------------------------------------------------------------
/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
23 |
24 |
30 |
31 |
37 |
38 |
44 |
45 |
51 |
52 |
58 |
59 |
66 |
67 |
72 |
73 |
80 |
81 |
88 |
89 |
96 |
97 |
98 |
99 |
104 |
105 |
113 |
114 |
122 |
123 |
124 |
125 |
132 |
133 |
139 |
140 |
146 |
147 |
153 |
154 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
--------------------------------------------------------------------------------
/res/values-cs/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | AAC Přehrávač
4 | Zavřít
5 | Přehrávač I (FAAD2)
6 | Přehrávač II (FFmpeg)
7 | Přehrávač III (OpenCORE)
8 | Přehrávač IV (MMS/WMA)
9 | Přehrávač V (file chunks)
10 | Načítám...
11 | Vyr.paměť (ms)
12 | Audio
13 | Dekodér
14 | Chyba
15 | Používám FAAD2 ...
16 | Používám FFmpeg ...
17 | Používám MMS/WMA ...
18 | Používám file chunks ...
19 | Přehrávám...
20 | Zastaveno
21 |
22 |
--------------------------------------------------------------------------------
/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #ff1f293e
4 | #ff324f85
5 |
6 |
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | AAC Player
4 | 0.8
5 | Close
6 | Player I (FAAD2)
7 | Player II (FFmpeg)
8 | Player III (OpenCORE)
9 | Player IV (MMS/WMA)
10 | Player V (file chunks)
11 | STOP
12 | Error
13 | Buffering...
14 | Buffers (ms)
15 | Audio
16 | Decode
17 | Using FAAD2 ...
18 | Using FFmpeg ...
19 | Using OpenCORE ...
20 | Using MMS/WMA ...
21 | Using file chunks ...
22 | $Revision$
23 | Playing...
24 | Stopped
25 |
26 |
--------------------------------------------------------------------------------
/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/sample.ant.properties:
--------------------------------------------------------------------------------
1 | #
2 | # The Android NDK home directory:
3 | #
4 | ndk.home=/usr/local/google/android-ndk-r4
5 |
6 |
7 | #
8 | # The list of native AAC decoders.
9 | # Allowed decoders are: faad2, ffmpeg, opencore-aacdec.
10 | #
11 | # NOTE: if you change this property then it is recommended to clean the project
12 | # (ant mrproper)
13 | #
14 | # Examples:
15 | # aac.decoders=opencore-aacdec
16 | # aac.decoders=faad2 ffmpeg opencore-aacdec
17 | #
18 | aac.decoders=faad2 ffmpeg opencore-aacdec
19 |
20 |
21 | #
22 | # Enable 4-th decoder - MMS/ASF/WMA
23 | # mms=yes
24 | #
25 | mms=yes
26 |
27 |
28 | #
29 | # The debug level of the JNI/C code.
30 | # Allowed values are: trace, debug, info, warn, error
31 | #
32 | jni.loglevel=info
33 |
34 |
35 | #
36 | # Options passed to the Makefile, e.g:
37 | # -d = debug all
38 | # --debug=v = set debug level (a, b, v, i, j, m)
39 | # -qp = print the database of rules (nothing remade)
40 | #
41 | # Or targets:
42 | # dump = dumps all targets
43 | #
44 | make.options=
45 |
--------------------------------------------------------------------------------
/sample.local.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must *NOT* be checked in Version Control Systems,
5 | # as it contains information specific to your local configuration.
6 |
7 | # location of the SDK. This is only used by Ant
8 | # For customization when using a Version Control System, please read the
9 | # header note.
10 | sdk.dir=/usr/local/google/android
11 |
--------------------------------------------------------------------------------
/src/com/spoledge/aacplayer/ArrayDecoder.java:
--------------------------------------------------------------------------------
1 | /*
2 | ** AACPlayer - Freeware Advanced Audio (AAC) Player for Android
3 | ** Copyright (C) 2011 Spolecne s.r.o., http://www.spoledge.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 3 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program. If not, see .
17 | **/
18 | package com.spoledge.aacplayer;
19 |
20 |
21 | /**
22 | * Parent class for all array decoders.
23 | */
24 | public class ArrayDecoder extends Decoder {
25 |
26 | private static enum State { IDLE, RUNNING };
27 |
28 | private static boolean libLoaded = false;
29 |
30 |
31 | ////////////////////////////////////////////////////////////////////////////
32 | // Attributes
33 | ////////////////////////////////////////////////////////////////////////////
34 |
35 | private int decoder;
36 | private int aacdw;
37 | private State state = State.IDLE;
38 |
39 |
40 | ////////////////////////////////////////////////////////////////////////////
41 | // Constructors
42 | ////////////////////////////////////////////////////////////////////////////
43 |
44 | private ArrayDecoder( int decoder ) {
45 | this.decoder = decoder;
46 | }
47 |
48 |
49 | ////////////////////////////////////////////////////////////////////////////
50 | // Public
51 | ////////////////////////////////////////////////////////////////////////////
52 |
53 | /**
54 | * Returns supported decoders.
55 | * @return the supported decoders (bit array)
56 | * @see DECODER_FAAD2
57 | * @see DECODER_FFMPEG
58 | * @see DECODER_OPENCORE
59 | */
60 | public static int getFeatures() {
61 | loadLibrary();
62 |
63 | return nativeGetFeatures();
64 | }
65 |
66 |
67 | /**
68 | * Creates a new decoder.
69 | * @param decoder the decoder to be used
70 | * @see DECODER_FAAD2
71 | * @see DECODER_FFMPEG
72 | * @see DECODER_OPENCORE
73 | */
74 | public static synchronized ArrayDecoder create( int decoder ) {
75 | loadLibrary();
76 |
77 | return new ArrayDecoder( decoder );
78 | }
79 |
80 |
81 | /**
82 | * Returns the decoder.
83 | * @see DECODER_FAAD2
84 | * @see DECODER_FFMPEG
85 | * @see DECODER_OPENCORE
86 | */
87 | public int getDecoder() {
88 | return decoder;
89 | }
90 |
91 |
92 | /**
93 | * Starts decoding AAC stream.
94 | */
95 | public Info start( ArrayBufferReader reader ) {
96 | if (state != State.IDLE) throw new IllegalStateException();
97 |
98 | info = new Info();
99 |
100 | aacdw = nativeStart( decoder, reader, info );
101 |
102 | if (aacdw == 0) throw new RuntimeException("Cannot start native decoder");
103 |
104 | state = State.RUNNING;
105 |
106 | return info;
107 | }
108 |
109 |
110 | /**
111 | * Decodes AAC stream.
112 | * @return the number of samples produced (totally all channels = the length of the filled array)
113 | */
114 | public Info decode( short[] samples, int outLen ) {
115 | if (state != State.RUNNING) throw new IllegalStateException();
116 |
117 | nativeDecode( aacdw, samples, outLen );
118 |
119 | return info;
120 | }
121 |
122 |
123 | /**
124 | * Stops the decoder and releases all resources.
125 | */
126 | public void stop() {
127 | if (aacdw != 0) {
128 | nativeStop( aacdw );
129 | aacdw = 0;
130 | }
131 |
132 | state = State.IDLE;
133 | }
134 |
135 |
136 | ////////////////////////////////////////////////////////////////////////////
137 | // Protected
138 | ////////////////////////////////////////////////////////////////////////////
139 |
140 | @Override
141 | protected void finalize() {
142 | try {
143 | stop();
144 | }
145 | catch (Throwable t) {
146 | t.printStackTrace();
147 | }
148 | }
149 |
150 |
151 | ////////////////////////////////////////////////////////////////////////////
152 | // Private
153 | ////////////////////////////////////////////////////////////////////////////
154 |
155 | private static synchronized void loadLibrary() {
156 | if (!libLoaded) {
157 | System.loadLibrary( "aacarray" );
158 |
159 | libLoaded = true;
160 | }
161 | }
162 |
163 |
164 | private static native int nativeGetFeatures();
165 |
166 | private native int nativeStart( int decoder, ArrayBufferReader reader, Info info );
167 |
168 | private native int nativeDecode( int aacdw, short[] samples, int outLen );
169 |
170 | private native void nativeStop( int aacdw );
171 | }
172 |
173 |
174 |
--------------------------------------------------------------------------------
/src/com/spoledge/aacplayer/ArrayPCMFeed.java:
--------------------------------------------------------------------------------
1 | /*
2 | ** AACPlayer - Freeware Advanced Audio (AAC) Player for Android
3 | ** Copyright (C) 2011 Spolecne s.r.o., http://www.spoledge.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 3 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program. If not, see .
17 | **/
18 | package com.spoledge.aacplayer;
19 |
20 |
21 | /**
22 | * This is the PCM Feeder which uses arrays (short[]).
23 | *
24 | *
25 | * // 44100 Hz, stereo, bufferng of 1.5 seconds:
26 | * ArrayPCMFeed pcmfeed = new ArrayPCMFeed( 44100, 2, ArrayPCMFeed.msToBytes( 1500 ));
27 | *
28 | * // start the exectuin thread:
29 | * new Thread( pcmfeed ).start();
30 | *
31 | * while (...) {
32 | * // obtain the PCM data:
33 | * short[] samples = ...
34 | *
35 | * // feed the audio buffer; on error break the loop:
36 | * if (!pcmfeed.feed( samples, samples.length )) break;
37 | * }
38 | *
39 | */
40 | public class ArrayPCMFeed extends PCMFeed {
41 |
42 | ////////////////////////////////////////////////////////////////////////////
43 | // Attributes
44 | ////////////////////////////////////////////////////////////////////////////
45 |
46 | private short[] samples;
47 | private int n;
48 |
49 |
50 | ////////////////////////////////////////////////////////////////////////////
51 | // Constructors
52 | ////////////////////////////////////////////////////////////////////////////
53 |
54 | /**
55 | * Creates a new PCMFeed object.
56 | * @param sampleRate the sampling rate in Hz (e.g. 44100)
57 | * @param channels the number of channels - only allowed values are 1 (mono) and 2 (stereo).
58 | * @param bufferSizeInBytes the size of the audio buffer in bytes
59 | */
60 | public ArrayPCMFeed( int sampleRate, int channels, int bufferSizeInBytes ) {
61 | this( sampleRate, channels, bufferSizeInBytes, null );
62 | }
63 |
64 |
65 | /**
66 | * Creates a new PCMFeed object.
67 | * @param sampleRate the sampling rate in Hz (e.g. 44100)
68 | * @param channels the number of channels - only allowed values are 1 (mono) and 2 (stereo).
69 | * @param bufferSizeInBytes the size of the audio buffer in bytes
70 | * @param playerCallback the callback - may be null
71 | */
72 | public ArrayPCMFeed( int sampleRate, int channels, int bufferSizeInBytes, PlayerCallback playerCallback ) {
73 | super( sampleRate, channels, bufferSizeInBytes, playerCallback );
74 | }
75 |
76 |
77 | ////////////////////////////////////////////////////////////////////////////
78 | // Public
79 | ////////////////////////////////////////////////////////////////////////////
80 |
81 | /**
82 | * This is called by main thread when a new data are available.
83 | *
84 | * @param samples the array containing the PCM data
85 | * @param n the length of the PCM data
86 | * @return true if ok, false if the execution thread is not responding
87 | */
88 | public synchronized boolean feed( short[] samples, int n ) {
89 | while (this.samples != null && !stopped) {
90 | try { wait(); } catch (InterruptedException e) {}
91 | }
92 |
93 | this.samples = samples;
94 | this.n = n;
95 |
96 | notify();
97 |
98 | return !stopped;
99 | }
100 |
101 |
102 | ////////////////////////////////////////////////////////////////////////////
103 | // Protected
104 | ////////////////////////////////////////////////////////////////////////////
105 |
106 | /**
107 | * Acquires samples into variable lsamples.
108 | * @return the actual size (in shorts) of the lsamples
109 | */
110 | protected synchronized int acquireSamples() {
111 | while (n == 0 && !stopped) {
112 | try { wait(); } catch (InterruptedException e) {}
113 | }
114 |
115 | lsamples = samples;
116 | int ln = n;
117 |
118 | samples = null;
119 | n = 0;
120 | notify();
121 |
122 | return ln;
123 | }
124 |
125 |
126 | /**
127 | * Releases the lsamples variable.
128 | * This method is called always after processing the acquired lsamples.
129 | */
130 | protected void releaseSamples() {
131 | // nothing to be done
132 | }
133 |
134 | }
135 |
136 |
--------------------------------------------------------------------------------
/src/com/spoledge/aacplayer/Decoder.java:
--------------------------------------------------------------------------------
1 | /*
2 | ** AACPlayer - Freeware Advanced Audio (AAC) Player for Android
3 | ** Copyright (C) 2011 Spolecne s.r.o., http://www.spoledge.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 3 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program. If not, see .
17 | **/
18 | package com.spoledge.aacplayer;
19 |
20 |
21 | /**
22 | * Parent class for all decoders.
23 | */
24 | public abstract class Decoder {
25 |
26 | /**
27 | * Info about the stream.
28 | */
29 | public static final class Info {
30 | private int sampleRate;
31 | private int channels;
32 |
33 | private int frameMaxBytesConsumed;
34 | private int frameSamples;
35 |
36 | private int roundFrames;
37 | private int roundBytesConsumed;
38 | private int roundSamples;
39 |
40 |
41 | ////////////////////////////////////////////////////////////////////////////
42 | // Public
43 | ////////////////////////////////////////////////////////////////////////////
44 |
45 | /**
46 | * Returns the sampling rate in Hz.
47 | * @return the sampling rate - always set
48 | */
49 | public int getSampleRate() {
50 | return sampleRate;
51 | }
52 |
53 |
54 | /**
55 | * Returns the number of channels (0=unknown yet, 1=mono, 2=stereo).
56 | * @return the channels - always set
57 | */
58 | public int getChannels() {
59 | return channels;
60 | }
61 |
62 |
63 | /**
64 | * Returns the maximum bytes consumed per ADTS frame.
65 | * @return the value - after each decode() round
66 | */
67 | public int getFrameMaxBytesConsumed() {
68 | return frameMaxBytesConsumed;
69 | }
70 |
71 |
72 | /**
73 | * Returns the samples produced per ADTS frame.
74 | * @return the value - after each decode() round (but should be always the same)
75 | */
76 | public int getFrameSamples() {
77 | return frameSamples;
78 | }
79 |
80 |
81 | /**
82 | * Returns the number of ADTS frames decoded.
83 | * @return the value - after each decode() round
84 | */
85 | public int getRoundFrames() {
86 | return roundFrames;
87 | }
88 |
89 |
90 | /**
91 | * Returns the number of bytes consumed.
92 | * @return the value - after each decode() round
93 | */
94 | public int getRoundBytesConsumed() {
95 | return roundBytesConsumed;
96 | }
97 |
98 |
99 | /**
100 | * Returns the number of samples decoded.
101 | * @return the value - after each decode() round
102 | */
103 | public int getRoundSamples() {
104 | return roundSamples;
105 | }
106 | }
107 |
108 |
109 | /**
110 | * Decoder supported bit: FAAD2.
111 | */
112 | public static final int DECODER_FAAD2 = 0x01;
113 |
114 | /**
115 | * Decoder supported bit: FFMPEG.
116 | */
117 | public static final int DECODER_FFMPEG = 0x02;
118 |
119 | /**
120 | * Decoder supported bit: OpenCORE.
121 | */
122 | public static final int DECODER_OPENCORE = 0x04;
123 |
124 | /**
125 | * Decoder supported bit: FFMPEG_WMA.
126 | */
127 | public static final int DECODER_FFMPEG_WMA = 0x08;
128 |
129 |
130 | private static boolean libLoaded = false;
131 |
132 |
133 | ////////////////////////////////////////////////////////////////////////////
134 | // Attributes
135 | ////////////////////////////////////////////////////////////////////////////
136 |
137 | /**
138 | * The information passed between JNI and Java.
139 | */
140 | protected Info info;
141 |
142 | }
143 |
144 |
--------------------------------------------------------------------------------
/src/com/spoledge/aacplayer/History.java:
--------------------------------------------------------------------------------
1 | /*
2 | ** AACPlayer - Freeware Advanced Audio (AAC) Player for Android
3 | ** Copyright (C) 2011 Spolecne s.r.o., http://www.spoledge.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 3 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program. If not, see .
17 | **/
18 | package com.spoledge.aacplayer;
19 |
20 | import android.content.Context;
21 | import android.widget.ArrayAdapter;
22 |
23 | import java.io.DataInputStream;
24 | import java.io.DataOutputStream;
25 | import java.io.IOException;
26 |
27 | import java.util.ArrayList;
28 |
29 |
30 | public class History {
31 | private static final int VERSION = 1;
32 | private static final String FILENAME = "history.dat";
33 |
34 | private Context ctx;
35 | private ArrayList list;
36 |
37 |
38 | public History( Context ctx ) {
39 | this.ctx = ctx;
40 | }
41 |
42 |
43 | public ArrayAdapter getArrayAdapter() {
44 | return new ArrayAdapter( ctx, android.R.layout.simple_dropdown_item_1line, list );
45 | }
46 |
47 |
48 | public void addUrl( String url ) {
49 | if (!list.contains( url )) list.add( url );
50 | }
51 |
52 |
53 | public int size() {
54 | return list.size();
55 | }
56 |
57 |
58 | public void read() {
59 | list = new ArrayList();
60 |
61 | try {
62 | DataInputStream dis = new DataInputStream( ctx.openFileInput( FILENAME ));
63 |
64 | dis.readInt(); // VERSION
65 | int n = dis.readInt();
66 |
67 | while (n-- > 0) list.add( dis.readUTF());
68 | }
69 | catch (IOException e) {}
70 | }
71 |
72 |
73 | public void write() {
74 | try {
75 | DataOutputStream dos = new DataOutputStream( ctx.openFileOutput( FILENAME, 0 ));
76 |
77 | dos.writeInt( VERSION );
78 | dos.writeInt( list.size());
79 |
80 | for (String url : list) dos.writeUTF( url );
81 | }
82 | catch (IOException e) {}
83 | }
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/src/com/spoledge/aacplayer/MMSInputStream.java:
--------------------------------------------------------------------------------
1 | /*
2 | ** AACPlayer - Freeware Advanced Audio (AAC) Player for Android
3 | ** Copyright (C) 2011 Spolecne s.r.o., http://www.spoledge.com
4 | **
5 | ** This program is free software; you can redistribute it and/or modify
6 | ** it under the terms of the GNU General Public License as published by
7 | ** the Free Software Foundation; either version 3 of the License, or
8 | ** (at your option) any later version.
9 | **
10 | ** This program is distributed in the hope that it will be useful,
11 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | ** GNU General Public License for more details.
14 | **
15 | ** You should have received a copy of the GNU General Public License
16 | ** along with this program. If not, see .
17 | **/
18 | package com.spoledge.aacplayer;
19 |
20 | import android.util.Log;
21 |
22 | import java.io.InputStream;
23 | import java.io.IOException;
24 |
25 |
26 | /**
27 | * This is a MMS input stream - reads data from a MMS stream.
28 | *