├── .DS_Store
├── .classpath
├── .project
├── .settings
└── org.eclipse.jdt.core.prefs
├── AndroidManifest.xml
├── bin
├── AndroidManifest.xml
├── AudioPlayer.apk
├── classes.dex
├── classes
│ └── com
│ │ └── phuket
│ │ └── tour
│ │ └── audioplayer
│ │ ├── BuildConfig.class
│ │ ├── MainActivity$1.class
│ │ ├── MainActivity$2.class
│ │ ├── MainActivity$3.class
│ │ ├── MainActivity$4.class
│ │ ├── MainActivity$5.class
│ │ ├── MainActivity.class
│ │ ├── R$attr.class
│ │ ├── R$dimen.class
│ │ ├── R$drawable.class
│ │ ├── R$id.class
│ │ ├── R$layout.class
│ │ ├── R$menu.class
│ │ ├── R$string.class
│ │ ├── R$style.class
│ │ ├── R.class
│ │ ├── audiotrack
│ │ ├── Mp3Decoder.class
│ │ ├── MusicDecoder.class
│ │ ├── NativeMp3Player$PlayerThread.class
│ │ ├── NativeMp3Player.class
│ │ ├── NativeMp3PlayerController$MusicTimerTask.class
│ │ └── NativeMp3PlayerController.class
│ │ └── opensles
│ │ ├── SoundTrackController$OnCompletionListener.class
│ │ └── SoundTrackController.class
├── dexedLibs
│ └── android-support-v4-426f71c833f770ec2943c32f7c1d6c59.jar
├── jarlist.cache
├── res
│ └── crunch
│ │ ├── drawable-hdpi
│ │ └── ic_launcher.png
│ │ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ │ ├── drawable-xhdpi
│ │ └── ic_launcher.png
│ │ └── drawable-xxhdpi
│ │ └── ic_launcher.png
└── resources.ap_
├── gen
└── com
│ └── phuket
│ └── tour
│ └── audioplayer
│ ├── BuildConfig.java
│ └── R.java
├── ic_launcher-web.png
├── jni
├── .DS_Store
├── Android.mk
├── Application.mk
└── songstudio
│ ├── .DS_Store
│ ├── 3rdparty
│ ├── ffmpeg
│ │ └── include
│ │ │ ├── libavcodec
│ │ │ ├── avcodec.h
│ │ │ ├── avfft.h
│ │ │ ├── dxva2.h
│ │ │ ├── old_codec_ids.h
│ │ │ ├── vaapi.h
│ │ │ ├── vda.h
│ │ │ ├── vdpau.h
│ │ │ ├── version.h
│ │ │ └── xvmc.h
│ │ │ ├── libavdevice
│ │ │ ├── avdevice.h
│ │ │ └── version.h
│ │ │ ├── libavfilter
│ │ │ ├── asrc_abuffer.h
│ │ │ ├── avcodec.h
│ │ │ ├── avfilter.h
│ │ │ ├── avfiltergraph.h
│ │ │ ├── buffersink.h
│ │ │ ├── buffersrc.h
│ │ │ └── version.h
│ │ │ ├── libavformat
│ │ │ ├── avformat.h
│ │ │ ├── avio.h
│ │ │ └── version.h
│ │ │ ├── libavutil
│ │ │ ├── adler32.h
│ │ │ ├── aes.h
│ │ │ ├── attributes.h
│ │ │ ├── audio_fifo.h
│ │ │ ├── audioconvert.h
│ │ │ ├── avassert.h
│ │ │ ├── avconfig.h
│ │ │ ├── avstring.h
│ │ │ ├── avutil.h
│ │ │ ├── base64.h
│ │ │ ├── blowfish.h
│ │ │ ├── bprint.h
│ │ │ ├── bswap.h
│ │ │ ├── buffer.h
│ │ │ ├── channel_layout.h
│ │ │ ├── common.h
│ │ │ ├── cpu.h
│ │ │ ├── crc.h
│ │ │ ├── dict.h
│ │ │ ├── error.h
│ │ │ ├── eval.h
│ │ │ ├── fifo.h
│ │ │ ├── file.h
│ │ │ ├── frame.h
│ │ │ ├── hmac.h
│ │ │ ├── imgutils.h
│ │ │ ├── intfloat.h
│ │ │ ├── intfloat_readwrite.h
│ │ │ ├── intreadwrite.h
│ │ │ ├── lfg.h
│ │ │ ├── log.h
│ │ │ ├── lzo.h
│ │ │ ├── mathematics.h
│ │ │ ├── md5.h
│ │ │ ├── mem.h
│ │ │ ├── murmur3.h
│ │ │ ├── old_pix_fmts.h
│ │ │ ├── opt.h
│ │ │ ├── parseutils.h
│ │ │ ├── pixdesc.h
│ │ │ ├── pixfmt.h
│ │ │ ├── random_seed.h
│ │ │ ├── rational.h
│ │ │ ├── ripemd.h
│ │ │ ├── samplefmt.h
│ │ │ ├── sha.h
│ │ │ ├── sha512.h
│ │ │ ├── time.h
│ │ │ ├── timecode.h
│ │ │ ├── timestamp.h
│ │ │ ├── version.h
│ │ │ └── xtea.h
│ │ │ ├── libpostproc
│ │ │ ├── postprocess.h
│ │ │ └── version.h
│ │ │ ├── libswresample
│ │ │ ├── swresample.h
│ │ │ └── version.h
│ │ │ └── libswscale
│ │ │ ├── swscale.h
│ │ │ └── version.h
│ └── prebuilt
│ │ └── armv7-a
│ │ ├── libavcodec.a
│ │ ├── libavfilter.a
│ │ ├── libavformat.a
│ │ ├── libavutil.a
│ │ ├── libfdk-aac.a
│ │ ├── libpostproc.a
│ │ ├── libswresample.a
│ │ ├── libswscale.a
│ │ ├── libvo-aacenc.a
│ │ └── libx264.a
│ ├── Android.mk
│ ├── MusicDecoder.cpp
│ ├── SoundTrackController.cpp
│ ├── com_phuket_tour_audioplayer_audiotrack_MusicDecoder.h
│ ├── com_phuket_tour_audioplayer_opensles_SoundTrackController.h
│ ├── libcommon
│ ├── Android.mk
│ ├── CommonTools.h
│ ├── packet_pool.cpp
│ ├── packet_pool.h
│ ├── packet_queue.cpp
│ └── packet_queue.h
│ ├── libmedia
│ ├── Android.mk
│ ├── opensl_es_context.cpp
│ ├── opensl_es_context.h
│ ├── opensl_es_util.h
│ ├── sound_service.cpp
│ └── sound_service.h
│ └── libmusicdecoder
│ ├── Android.mk
│ ├── accompany_decoder.cpp
│ ├── accompany_decoder.h
│ ├── accompany_decoder_controller.cpp
│ └── accompany_decoder_controller.h
├── libs
├── android-support-v4.jar
└── armeabi-v7a
│ └── libsongstudio.so
├── obj
└── local
│ └── armeabi-v7a
│ ├── libcommontool.a
│ ├── libmedia.a
│ ├── libmusicdecoder.a
│ ├── libsongstudio.so
│ └── objs
│ ├── commontool
│ ├── packet_pool.o
│ ├── packet_pool.o.d
│ ├── packet_queue.o
│ └── packet_queue.o.d
│ ├── media
│ ├── opensl_es_context.o
│ ├── opensl_es_context.o.d
│ ├── sound_service.o
│ └── sound_service.o.d
│ ├── musicdecoder
│ ├── accompany_decoder.o
│ ├── accompany_decoder.o.d
│ ├── accompany_decoder_controller.o
│ └── accompany_decoder_controller.o.d
│ └── songstudio
│ ├── MusicDecoder.o
│ ├── MusicDecoder.o.d
│ ├── SoundTrackController.o
│ └── SoundTrackController.o.d
├── proguard-project.txt
├── project.properties
├── res
├── drawable-hdpi
│ └── ic_launcher.png
├── drawable-mdpi
│ └── ic_launcher.png
├── drawable-xhdpi
│ └── ic_launcher.png
├── drawable-xxhdpi
│ └── ic_launcher.png
├── layout
│ └── activity_main.xml
├── menu
│ └── main.xml
├── values-v11
│ └── styles.xml
├── values-v14
│ └── styles.xml
├── values-w820dp
│ └── dimens.xml
└── values
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── resource
└── 131.mp3
└── src
├── .DS_Store
└── com
├── .DS_Store
└── phuket
├── .DS_Store
└── tour
├── .DS_Store
└── audioplayer
├── MainActivity.java
├── audiotrack
├── Mp3Decoder.java
├── MusicDecoder.java
├── NativeMp3Player.java
└── NativeMp3PlayerController.java
└── opensles
└── SoundTrackController.java
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/.DS_Store
--------------------------------------------------------------------------------
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | AudioPlayer
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
3 | org.eclipse.jdt.core.compiler.compliance=1.6
4 | org.eclipse.jdt.core.compiler.source=1.6
5 |
--------------------------------------------------------------------------------
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
12 |
13 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/bin/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
11 |
12 |
13 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/bin/AudioPlayer.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/AudioPlayer.apk
--------------------------------------------------------------------------------
/bin/classes.dex:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes.dex
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/BuildConfig.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/BuildConfig.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/MainActivity$1.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/MainActivity$1.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/MainActivity$2.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/MainActivity$2.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/MainActivity$3.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/MainActivity$3.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/MainActivity$4.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/MainActivity$4.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/MainActivity$5.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/MainActivity$5.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/MainActivity.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/MainActivity.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/R$attr.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/R$attr.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/R$dimen.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/R$dimen.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/R$drawable.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/R$drawable.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/R$id.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/R$id.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/R$layout.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/R$layout.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/R$menu.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/R$menu.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/R$string.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/R$string.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/R$style.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/R$style.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/R.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/R.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/audiotrack/Mp3Decoder.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/audiotrack/Mp3Decoder.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/audiotrack/MusicDecoder.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/audiotrack/MusicDecoder.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/audiotrack/NativeMp3Player$PlayerThread.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/audiotrack/NativeMp3Player$PlayerThread.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/audiotrack/NativeMp3Player.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/audiotrack/NativeMp3Player.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/audiotrack/NativeMp3PlayerController$MusicTimerTask.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/audiotrack/NativeMp3PlayerController$MusicTimerTask.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/audiotrack/NativeMp3PlayerController.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/audiotrack/NativeMp3PlayerController.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/opensles/SoundTrackController$OnCompletionListener.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/opensles/SoundTrackController$OnCompletionListener.class
--------------------------------------------------------------------------------
/bin/classes/com/phuket/tour/audioplayer/opensles/SoundTrackController.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/classes/com/phuket/tour/audioplayer/opensles/SoundTrackController.class
--------------------------------------------------------------------------------
/bin/dexedLibs/android-support-v4-426f71c833f770ec2943c32f7c1d6c59.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/dexedLibs/android-support-v4-426f71c833f770ec2943c32f7c1d6c59.jar
--------------------------------------------------------------------------------
/bin/jarlist.cache:
--------------------------------------------------------------------------------
1 | # cache for current jar dependency. DO NOT EDIT.
2 | # format is
3 | # Encoding is UTF-8
4 |
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/res/crunch/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/res/crunch/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/res/crunch/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/res/crunch/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/res/crunch/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bin/resources.ap_:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/bin/resources.ap_
--------------------------------------------------------------------------------
/gen/com/phuket/tour/audioplayer/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /** Automatically generated file. DO NOT MODIFY */
2 | package com.phuket.tour.audioplayer;
3 |
4 | public final class BuildConfig {
5 | public final static boolean DEBUG = true;
6 | }
--------------------------------------------------------------------------------
/gen/com/phuket/tour/audioplayer/R.java:
--------------------------------------------------------------------------------
1 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
2 | *
3 | * This class was automatically generated by the
4 | * aapt tool from the resource data it found. It
5 | * should not be modified by hand.
6 | */
7 |
8 | package com.phuket.tour.audioplayer;
9 |
10 | public final class R {
11 | public static final class attr {
12 | }
13 | public static final class dimen {
14 | /** Default screen margins, per the Android Design guidelines.
15 |
16 | Example customization of dimensions originally defined in res/values/dimens.xml
17 | (such as screen margins) for screens with more than 820dp of available width. This
18 | would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively).
19 |
20 | */
21 | public static final int activity_horizontal_margin=0x7f040000;
22 | public static final int activity_vertical_margin=0x7f040001;
23 | }
24 | public static final class drawable {
25 | public static final int ic_launcher=0x7f020000;
26 | }
27 | public static final class id {
28 | public static final int action_settings=0x7f080008;
29 | public static final int audio_track_impl_layout=0x7f080000;
30 | public static final int opensl_es_impl_layout=0x7f080004;
31 | public static final int play_audiotrack_btn=0x7f080002;
32 | public static final int play_opensl_es_btn=0x7f080006;
33 | public static final int stop_audiotrack_btn=0x7f080003;
34 | public static final int stop_opensl_es_btn=0x7f080007;
35 | public static final int title_audiotrack=0x7f080001;
36 | public static final int title_opensl_es=0x7f080005;
37 | }
38 | public static final class layout {
39 | public static final int activity_main=0x7f030000;
40 | }
41 | public static final class menu {
42 | public static final int main=0x7f070000;
43 | }
44 | public static final class string {
45 | public static final int action_settings=0x7f050006;
46 | public static final int app_name=0x7f050000;
47 | public static final int audio_player_audiotrack=0x7f050002;
48 | public static final int hello_world=0x7f050001;
49 | public static final int opensl_es_audiotrack=0x7f050003;
50 | public static final int play=0x7f050004;
51 | public static final int stop=0x7f050005;
52 | }
53 | public static final class style {
54 | /**
55 | Base application theme, dependent on API level. This theme is replaced
56 | by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
57 |
58 |
59 | Theme customizations available in newer API levels can go in
60 | res/values-vXX/styles.xml, while customizations related to
61 | backward-compatibility can go here.
62 |
63 |
64 | Base application theme for API 11+. This theme completely replaces
65 | AppBaseTheme from res/values/styles.xml on API 11+ devices.
66 |
67 | API 11 theme customizations can go here.
68 |
69 | Base application theme for API 14+. This theme completely replaces
70 | AppBaseTheme from BOTH res/values/styles.xml and
71 | res/values-v11/styles.xml on API 14+ devices.
72 |
73 | API 14 theme customizations can go here.
74 | */
75 | public static final int AppBaseTheme=0x7f060000;
76 | /** Application theme.
77 | All customizations that are NOT specific to a particular API-level can go here.
78 | */
79 | public static final int AppTheme=0x7f060001;
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/ic_launcher-web.png
--------------------------------------------------------------------------------
/jni/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/jni/.DS_Store
--------------------------------------------------------------------------------
/jni/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 | include $(call all-subdir-makefiles)
3 | include $(CLEAR_VARS)
--------------------------------------------------------------------------------
/jni/Application.mk:
--------------------------------------------------------------------------------
1 | APP_ABI := armeabi-v7a
2 | APP_STL := gnustl_static
3 | APP_CPPFLAGS := -std=gnu++11 -fexceptions -D__STDC_LIMIT_MACROS
4 | NDK_TOOLCHAIN_VERSION = 4.8
5 | APP_PLATFORM := android-9
6 |
--------------------------------------------------------------------------------
/jni/songstudio/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/jni/songstudio/.DS_Store
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavcodec/avfft.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg 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 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVCODEC_AVFFT_H
20 | #define AVCODEC_AVFFT_H
21 |
22 | /**
23 | * @file
24 | * @ingroup lavc_fft
25 | * FFT functions
26 | */
27 |
28 | /**
29 | * @defgroup lavc_fft FFT functions
30 | * @ingroup lavc_misc
31 | *
32 | * @{
33 | */
34 |
35 | typedef float FFTSample;
36 |
37 | typedef struct FFTComplex {
38 | FFTSample re, im;
39 | } FFTComplex;
40 |
41 | typedef struct FFTContext FFTContext;
42 |
43 | /**
44 | * Set up a complex FFT.
45 | * @param nbits log2 of the length of the input array
46 | * @param inverse if 0 perform the forward transform, if 1 perform the inverse
47 | */
48 | FFTContext *av_fft_init(int nbits, int inverse);
49 |
50 | /**
51 | * Do the permutation needed BEFORE calling ff_fft_calc().
52 | */
53 | void av_fft_permute(FFTContext *s, FFTComplex *z);
54 |
55 | /**
56 | * Do a complex FFT with the parameters defined in av_fft_init(). The
57 | * input data must be permuted before. No 1.0/sqrt(n) normalization is done.
58 | */
59 | void av_fft_calc(FFTContext *s, FFTComplex *z);
60 |
61 | void av_fft_end(FFTContext *s);
62 |
63 | FFTContext *av_mdct_init(int nbits, int inverse, double scale);
64 | void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
65 | void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input);
66 | void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
67 | void av_mdct_end(FFTContext *s);
68 |
69 | /* Real Discrete Fourier Transform */
70 |
71 | enum RDFTransformType {
72 | DFT_R2C,
73 | IDFT_C2R,
74 | IDFT_R2C,
75 | DFT_C2R,
76 | };
77 |
78 | typedef struct RDFTContext RDFTContext;
79 |
80 | /**
81 | * Set up a real FFT.
82 | * @param nbits log2 of the length of the input array
83 | * @param trans the type of transform
84 | */
85 | RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);
86 | void av_rdft_calc(RDFTContext *s, FFTSample *data);
87 | void av_rdft_end(RDFTContext *s);
88 |
89 | /* Discrete Cosine Transform */
90 |
91 | typedef struct DCTContext DCTContext;
92 |
93 | enum DCTTransformType {
94 | DCT_II = 0,
95 | DCT_III,
96 | DCT_I,
97 | DST_I,
98 | };
99 |
100 | /**
101 | * Set up DCT.
102 | * @param nbits size of the input array:
103 | * (1 << nbits) for DCT-II, DCT-III and DST-I
104 | * (1 << nbits) + 1 for DCT-I
105 | *
106 | * @note the first element of the input of DST-I is ignored
107 | */
108 | DCTContext *av_dct_init(int nbits, enum DCTTransformType type);
109 | void av_dct_calc(DCTContext *s, FFTSample *data);
110 | void av_dct_end (DCTContext *s);
111 |
112 | /**
113 | * @}
114 | */
115 |
116 | #endif /* AVCODEC_AVFFT_H */
117 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavcodec/dxva2.h:
--------------------------------------------------------------------------------
1 | /*
2 | * DXVA2 HW acceleration
3 | *
4 | * copyright (c) 2009 Laurent Aimar
5 | *
6 | * This file is part of FFmpeg.
7 | *
8 | * FFmpeg is free software; you can redistribute it and/or
9 | * modify it under the terms of the GNU Lesser General Public
10 | * License as published by the Free Software Foundation; either
11 | * version 2.1 of the License, or (at your option) any later version.
12 | *
13 | * FFmpeg 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 GNU
16 | * Lesser General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Lesser General Public
19 | * License along with FFmpeg; if not, write to the Free Software
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | */
22 |
23 | #ifndef AVCODEC_DXVA_H
24 | #define AVCODEC_DXVA_H
25 |
26 | /**
27 | * @file
28 | * @ingroup lavc_codec_hwaccel_dxva2
29 | * Public libavcodec DXVA2 header.
30 | */
31 |
32 | #if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0600
33 | #undef _WIN32_WINNT
34 | #endif
35 |
36 | #if !defined(_WIN32_WINNT)
37 | #define _WIN32_WINNT 0x0600
38 | #endif
39 |
40 | #include
41 | #include
42 | #include
43 |
44 | /**
45 | * @defgroup lavc_codec_hwaccel_dxva2 DXVA2
46 | * @ingroup lavc_codec_hwaccel
47 | *
48 | * @{
49 | */
50 |
51 | #define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards
52 |
53 | /**
54 | * This structure is used to provides the necessary configurations and data
55 | * to the DXVA2 FFmpeg HWAccel implementation.
56 | *
57 | * The application must make it available as AVCodecContext.hwaccel_context.
58 | */
59 | struct dxva_context {
60 | /**
61 | * DXVA2 decoder object
62 | */
63 | IDirectXVideoDecoder *decoder;
64 |
65 | /**
66 | * DXVA2 configuration used to create the decoder
67 | */
68 | const DXVA2_ConfigPictureDecode *cfg;
69 |
70 | /**
71 | * The number of surface in the surface array
72 | */
73 | unsigned surface_count;
74 |
75 | /**
76 | * The array of Direct3D surfaces used to create the decoder
77 | */
78 | LPDIRECT3DSURFACE9 *surface;
79 |
80 | /**
81 | * A bit field configuring the workarounds needed for using the decoder
82 | */
83 | uint64_t workaround;
84 |
85 | /**
86 | * Private to the FFmpeg AVHWAccel implementation
87 | */
88 | unsigned report_id;
89 | };
90 |
91 | /**
92 | * @}
93 | */
94 |
95 | #endif /* AVCODEC_DXVA_H */
96 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavcodec/vaapi.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Video Acceleration API (shared data between FFmpeg and the video player)
3 | * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1
4 | *
5 | * Copyright (C) 2008-2009 Splitted-Desktop Systems
6 | *
7 | * This file is part of FFmpeg.
8 | *
9 | * FFmpeg is free software; you can redistribute it and/or
10 | * modify it under the terms of the GNU Lesser General Public
11 | * License as published by the Free Software Foundation; either
12 | * version 2.1 of the License, or (at your option) any later version.
13 | *
14 | * FFmpeg is distributed in the hope that it will be useful,
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 | * Lesser General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU Lesser General Public
20 | * License along with FFmpeg; if not, write to the Free Software
21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 | */
23 |
24 | #ifndef AVCODEC_VAAPI_H
25 | #define AVCODEC_VAAPI_H
26 |
27 | /**
28 | * @file
29 | * @ingroup lavc_codec_hwaccel_vaapi
30 | * Public libavcodec VA API header.
31 | */
32 |
33 | #include
34 |
35 | /**
36 | * @defgroup lavc_codec_hwaccel_vaapi VA API Decoding
37 | * @ingroup lavc_codec_hwaccel
38 | * @{
39 | */
40 |
41 | /**
42 | * This structure is used to share data between the FFmpeg library and
43 | * the client video application.
44 | * This shall be zero-allocated and available as
45 | * AVCodecContext.hwaccel_context. All user members can be set once
46 | * during initialization or through each AVCodecContext.get_buffer()
47 | * function call. In any case, they must be valid prior to calling
48 | * decoding functions.
49 | */
50 | struct vaapi_context {
51 | /**
52 | * Window system dependent data
53 | *
54 | * - encoding: unused
55 | * - decoding: Set by user
56 | */
57 | void *display;
58 |
59 | /**
60 | * Configuration ID
61 | *
62 | * - encoding: unused
63 | * - decoding: Set by user
64 | */
65 | uint32_t config_id;
66 |
67 | /**
68 | * Context ID (video decode pipeline)
69 | *
70 | * - encoding: unused
71 | * - decoding: Set by user
72 | */
73 | uint32_t context_id;
74 |
75 | /**
76 | * VAPictureParameterBuffer ID
77 | *
78 | * - encoding: unused
79 | * - decoding: Set by libavcodec
80 | */
81 | uint32_t pic_param_buf_id;
82 |
83 | /**
84 | * VAIQMatrixBuffer ID
85 | *
86 | * - encoding: unused
87 | * - decoding: Set by libavcodec
88 | */
89 | uint32_t iq_matrix_buf_id;
90 |
91 | /**
92 | * VABitPlaneBuffer ID (for VC-1 decoding)
93 | *
94 | * - encoding: unused
95 | * - decoding: Set by libavcodec
96 | */
97 | uint32_t bitplane_buf_id;
98 |
99 | /**
100 | * Slice parameter/data buffer IDs
101 | *
102 | * - encoding: unused
103 | * - decoding: Set by libavcodec
104 | */
105 | uint32_t *slice_buf_ids;
106 |
107 | /**
108 | * Number of effective slice buffer IDs to send to the HW
109 | *
110 | * - encoding: unused
111 | * - decoding: Set by libavcodec
112 | */
113 | unsigned int n_slice_buf_ids;
114 |
115 | /**
116 | * Size of pre-allocated slice_buf_ids
117 | *
118 | * - encoding: unused
119 | * - decoding: Set by libavcodec
120 | */
121 | unsigned int slice_buf_ids_alloc;
122 |
123 | /**
124 | * Pointer to VASliceParameterBuffers
125 | *
126 | * - encoding: unused
127 | * - decoding: Set by libavcodec
128 | */
129 | void *slice_params;
130 |
131 | /**
132 | * Size of a VASliceParameterBuffer element
133 | *
134 | * - encoding: unused
135 | * - decoding: Set by libavcodec
136 | */
137 | unsigned int slice_param_size;
138 |
139 | /**
140 | * Size of pre-allocated slice_params
141 | *
142 | * - encoding: unused
143 | * - decoding: Set by libavcodec
144 | */
145 | unsigned int slice_params_alloc;
146 |
147 | /**
148 | * Number of slices currently filled in
149 | *
150 | * - encoding: unused
151 | * - decoding: Set by libavcodec
152 | */
153 | unsigned int slice_count;
154 |
155 | /**
156 | * Pointer to slice data buffer base
157 | * - encoding: unused
158 | * - decoding: Set by libavcodec
159 | */
160 | const uint8_t *slice_data;
161 |
162 | /**
163 | * Current size of slice data
164 | *
165 | * - encoding: unused
166 | * - decoding: Set by libavcodec
167 | */
168 | uint32_t slice_data_size;
169 | };
170 |
171 | /* @} */
172 |
173 | #endif /* AVCODEC_VAAPI_H */
174 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavcodec/vda.h:
--------------------------------------------------------------------------------
1 | /*
2 | * VDA HW acceleration
3 | *
4 | * copyright (c) 2011 Sebastien Zwickert
5 | *
6 | * This file is part of FFmpeg.
7 | *
8 | * FFmpeg is free software; you can redistribute it and/or
9 | * modify it under the terms of the GNU Lesser General Public
10 | * License as published by the Free Software Foundation; either
11 | * version 2.1 of the License, or (at your option) any later version.
12 | *
13 | * FFmpeg 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 GNU
16 | * Lesser General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Lesser General Public
19 | * License along with FFmpeg; if not, write to the Free Software
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | */
22 |
23 | #ifndef AVCODEC_VDA_H
24 | #define AVCODEC_VDA_H
25 |
26 | /**
27 | * @file
28 | * @ingroup lavc_codec_hwaccel_vda
29 | * Public libavcodec VDA header.
30 | */
31 |
32 | #include
33 |
34 | // emmintrin.h is unable to compile with -std=c99 -Werror=missing-prototypes
35 | // http://openradar.appspot.com/8026390
36 | #undef __GNUC_STDC_INLINE__
37 |
38 | #define Picture QuickdrawPicture
39 | #include
40 | #undef Picture
41 |
42 | #include "libavcodec/version.h"
43 |
44 | /**
45 | * @defgroup lavc_codec_hwaccel_vda VDA
46 | * @ingroup lavc_codec_hwaccel
47 | *
48 | * @{
49 | */
50 |
51 | /**
52 | * This structure is used to provide the necessary configurations and data
53 | * to the VDA FFmpeg HWAccel implementation.
54 | *
55 | * The application must make it available as AVCodecContext.hwaccel_context.
56 | */
57 | struct vda_context {
58 | /**
59 | * VDA decoder object.
60 | *
61 | * - encoding: unused
62 | * - decoding: Set/Unset by libavcodec.
63 | */
64 | VDADecoder decoder;
65 |
66 | /**
67 | * The Core Video pixel buffer that contains the current image data.
68 | *
69 | * encoding: unused
70 | * decoding: Set by libavcodec. Unset by user.
71 | */
72 | CVPixelBufferRef cv_buffer;
73 |
74 | /**
75 | * Use the hardware decoder in synchronous mode.
76 | *
77 | * encoding: unused
78 | * decoding: Set by user.
79 | */
80 | int use_sync_decoding;
81 |
82 | /**
83 | * The frame width.
84 | *
85 | * - encoding: unused
86 | * - decoding: Set/Unset by user.
87 | */
88 | int width;
89 |
90 | /**
91 | * The frame height.
92 | *
93 | * - encoding: unused
94 | * - decoding: Set/Unset by user.
95 | */
96 | int height;
97 |
98 | /**
99 | * The frame format.
100 | *
101 | * - encoding: unused
102 | * - decoding: Set/Unset by user.
103 | */
104 | int format;
105 |
106 | /**
107 | * The pixel format for output image buffers.
108 | *
109 | * - encoding: unused
110 | * - decoding: Set/Unset by user.
111 | */
112 | OSType cv_pix_fmt_type;
113 |
114 | /**
115 | * The current bitstream buffer.
116 | *
117 | * - encoding: unused
118 | * - decoding: Set/Unset by libavcodec.
119 | */
120 | uint8_t *priv_bitstream;
121 |
122 | /**
123 | * The current size of the bitstream.
124 | *
125 | * - encoding: unused
126 | * - decoding: Set/Unset by libavcodec.
127 | */
128 | int priv_bitstream_size;
129 |
130 | /**
131 | * The reference size used for fast reallocation.
132 | *
133 | * - encoding: unused
134 | * - decoding: Set/Unset by libavcodec.
135 | */
136 | int priv_allocated_size;
137 |
138 | /**
139 | * Use av_buffer to manage buffer.
140 | * When the flag is set, the CVPixelBuffers returned by the decoder will
141 | * be released automatically, so you have to retain them if necessary.
142 | * Not setting this flag may cause memory leak.
143 | *
144 | * encoding: unused
145 | * decoding: Set by user.
146 | */
147 | int use_ref_buffer;
148 | };
149 |
150 | /** Create the video decoder. */
151 | int ff_vda_create_decoder(struct vda_context *vda_ctx,
152 | uint8_t *extradata,
153 | int extradata_size);
154 |
155 | /** Destroy the video decoder. */
156 | int ff_vda_destroy_decoder(struct vda_context *vda_ctx);
157 |
158 | /**
159 | * @}
160 | */
161 |
162 | #endif /* AVCODEC_VDA_H */
163 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavcodec/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This file is part of FFmpeg.
4 | *
5 | * FFmpeg is free software; you can redistribute it and/or
6 | * modify it under the terms of the GNU Lesser General Public
7 | * License as published by the Free Software Foundation; either
8 | * version 2.1 of the License, or (at your option) any later version.
9 | *
10 | * FFmpeg 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 GNU
13 | * Lesser General Public License for more details.
14 | *
15 | * You should have received a copy of the GNU Lesser General Public
16 | * License along with FFmpeg; if not, write to the Free Software
17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 | */
19 |
20 | #ifndef AVCODEC_VERSION_H
21 | #define AVCODEC_VERSION_H
22 |
23 | /**
24 | * @file
25 | * @ingroup libavc
26 | * Libavcodec version macros.
27 | */
28 |
29 | #include "libavutil/avutil.h"
30 |
31 | #define LIBAVCODEC_VERSION_MAJOR 55
32 | #define LIBAVCODEC_VERSION_MINOR 39
33 | #define LIBAVCODEC_VERSION_MICRO 101
34 |
35 | #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
36 | LIBAVCODEC_VERSION_MINOR, \
37 | LIBAVCODEC_VERSION_MICRO)
38 | #define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \
39 | LIBAVCODEC_VERSION_MINOR, \
40 | LIBAVCODEC_VERSION_MICRO)
41 | #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT
42 |
43 | #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
44 |
45 | /**
46 | * FF_API_* defines may be placed below to indicate public API that will be
47 | * dropped at a future version bump. The defines themselves are not part of
48 | * the public API and may change, break or disappear at any time.
49 | */
50 |
51 | #ifndef FF_API_REQUEST_CHANNELS
52 | #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 56)
53 | #endif
54 | #ifndef FF_API_ALLOC_CONTEXT
55 | #define FF_API_ALLOC_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 55)
56 | #endif
57 | #ifndef FF_API_AVCODEC_OPEN
58 | #define FF_API_AVCODEC_OPEN (LIBAVCODEC_VERSION_MAJOR < 55)
59 | #endif
60 | #ifndef FF_API_OLD_DECODE_AUDIO
61 | #define FF_API_OLD_DECODE_AUDIO (LIBAVCODEC_VERSION_MAJOR < 56)
62 | #endif
63 | #ifndef FF_API_OLD_TIMECODE
64 | #define FF_API_OLD_TIMECODE (LIBAVCODEC_VERSION_MAJOR < 55)
65 | #endif
66 |
67 | #ifndef FF_API_OLD_ENCODE_AUDIO
68 | #define FF_API_OLD_ENCODE_AUDIO (LIBAVCODEC_VERSION_MAJOR < 56)
69 | #endif
70 | #ifndef FF_API_OLD_ENCODE_VIDEO
71 | #define FF_API_OLD_ENCODE_VIDEO (LIBAVCODEC_VERSION_MAJOR < 56)
72 | #endif
73 | #ifndef FF_API_CODEC_ID
74 | #define FF_API_CODEC_ID (LIBAVCODEC_VERSION_MAJOR < 56)
75 | #endif
76 | #ifndef FF_API_AVCODEC_RESAMPLE
77 | #define FF_API_AVCODEC_RESAMPLE (LIBAVCODEC_VERSION_MAJOR < 56)
78 | #endif
79 | #ifndef FF_API_DEINTERLACE
80 | #define FF_API_DEINTERLACE (LIBAVCODEC_VERSION_MAJOR < 56)
81 | #endif
82 | #ifndef FF_API_DESTRUCT_PACKET
83 | #define FF_API_DESTRUCT_PACKET (LIBAVCODEC_VERSION_MAJOR < 56)
84 | #endif
85 | #ifndef FF_API_GET_BUFFER
86 | #define FF_API_GET_BUFFER (LIBAVCODEC_VERSION_MAJOR < 56)
87 | #endif
88 | #ifndef FF_API_MISSING_SAMPLE
89 | #define FF_API_MISSING_SAMPLE (LIBAVCODEC_VERSION_MAJOR < 56)
90 | #endif
91 | #ifndef FF_API_LOWRES
92 | #define FF_API_LOWRES (LIBAVCODEC_VERSION_MAJOR < 56)
93 | #endif
94 | #ifndef FF_API_CAP_VDPAU
95 | #define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 56)
96 | #endif
97 | #ifndef FF_API_BUFS_VDPAU
98 | #define FF_API_BUFS_VDPAU (LIBAVCODEC_VERSION_MAJOR < 56)
99 | #endif
100 | #ifndef FF_API_VOXWARE
101 | #define FF_API_VOXWARE (LIBAVCODEC_VERSION_MAJOR < 56)
102 | #endif
103 |
104 | #endif /* AVCODEC_VERSION_H */
105 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavdevice/avdevice.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg 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 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVDEVICE_AVDEVICE_H
20 | #define AVDEVICE_AVDEVICE_H
21 |
22 | #include "version.h"
23 |
24 | /**
25 | * @file
26 | * @ingroup lavd
27 | * Main libavdevice API header
28 | */
29 |
30 | /**
31 | * @defgroup lavd Special devices muxing/demuxing library
32 | * @{
33 | * Libavdevice is a complementary library to @ref libavf "libavformat". It
34 | * provides various "special" platform-specific muxers and demuxers, e.g. for
35 | * grabbing devices, audio capture and playback etc. As a consequence, the
36 | * (de)muxers in libavdevice are of the AVFMT_NOFILE type (they use their own
37 | * I/O functions). The filename passed to avformat_open_input() often does not
38 | * refer to an actually existing file, but has some special device-specific
39 | * meaning - e.g. for x11grab it is the display name.
40 | *
41 | * To use libavdevice, simply call avdevice_register_all() to register all
42 | * compiled muxers and demuxers. They all use standard libavformat API.
43 | * @}
44 | */
45 |
46 | #include "libavformat/avformat.h"
47 |
48 | /**
49 | * Return the LIBAVDEVICE_VERSION_INT constant.
50 | */
51 | unsigned avdevice_version(void);
52 |
53 | /**
54 | * Return the libavdevice build-time configuration.
55 | */
56 | const char *avdevice_configuration(void);
57 |
58 | /**
59 | * Return the libavdevice license.
60 | */
61 | const char *avdevice_license(void);
62 |
63 | /**
64 | * Initialize libavdevice and register all the input and output devices.
65 | * @warning This function is not thread safe.
66 | */
67 | void avdevice_register_all(void);
68 |
69 | #endif /* AVDEVICE_AVDEVICE_H */
70 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavdevice/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg 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 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVDEVICE_VERSION_H
20 | #define AVDEVICE_VERSION_H
21 |
22 | /**
23 | * @file
24 | * @ingroup lavd
25 | * Libavdevice version macros
26 | */
27 |
28 | #include "libavutil/avutil.h"
29 |
30 | #define LIBAVDEVICE_VERSION_MAJOR 55
31 | #define LIBAVDEVICE_VERSION_MINOR 5
32 | #define LIBAVDEVICE_VERSION_MICRO 100
33 |
34 | #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
35 | LIBAVDEVICE_VERSION_MINOR, \
36 | LIBAVDEVICE_VERSION_MICRO)
37 | #define LIBAVDEVICE_VERSION AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, \
38 | LIBAVDEVICE_VERSION_MINOR, \
39 | LIBAVDEVICE_VERSION_MICRO)
40 | #define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT
41 |
42 | #define LIBAVDEVICE_IDENT "Lavd" AV_STRINGIFY(LIBAVDEVICE_VERSION)
43 |
44 | /**
45 | * FF_API_* defines may be placed below to indicate public API that will be
46 | * dropped at a future version bump. The defines themselves are not part of
47 | * the public API and may change, break or disappear at any time.
48 | */
49 |
50 | #endif /* AVDEVICE_VERSION_H */
51 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavfilter/asrc_abuffer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg 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 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVFILTER_ASRC_ABUFFER_H
20 | #define AVFILTER_ASRC_ABUFFER_H
21 |
22 | #include "avfilter.h"
23 |
24 | /**
25 | * @file
26 | * memory buffer source for audio
27 | *
28 | * @deprecated use buffersrc.h instead.
29 | */
30 |
31 | /**
32 | * Queue an audio buffer to the audio buffer source.
33 | *
34 | * @param abuffersrc audio source buffer context
35 | * @param data pointers to the samples planes
36 | * @param linesize linesizes of each audio buffer plane
37 | * @param nb_samples number of samples per channel
38 | * @param sample_fmt sample format of the audio data
39 | * @param ch_layout channel layout of the audio data
40 | * @param planar flag to indicate if audio data is planar or packed
41 | * @param pts presentation timestamp of the audio buffer
42 | * @param flags unused
43 | *
44 | * @deprecated use av_buffersrc_add_ref() instead.
45 | */
46 | attribute_deprecated
47 | int av_asrc_buffer_add_samples(AVFilterContext *abuffersrc,
48 | uint8_t *data[8], int linesize[8],
49 | int nb_samples, int sample_rate,
50 | int sample_fmt, int64_t ch_layout, int planar,
51 | int64_t pts, int av_unused flags);
52 |
53 | /**
54 | * Queue an audio buffer to the audio buffer source.
55 | *
56 | * This is similar to av_asrc_buffer_add_samples(), but the samples
57 | * are stored in a buffer with known size.
58 | *
59 | * @param abuffersrc audio source buffer context
60 | * @param buf pointer to the samples data, packed is assumed
61 | * @param size the size in bytes of the buffer, it must contain an
62 | * integer number of samples
63 | * @param sample_fmt sample format of the audio data
64 | * @param ch_layout channel layout of the audio data
65 | * @param pts presentation timestamp of the audio buffer
66 | * @param flags unused
67 | *
68 | * @deprecated use av_buffersrc_add_ref() instead.
69 | */
70 | attribute_deprecated
71 | int av_asrc_buffer_add_buffer(AVFilterContext *abuffersrc,
72 | uint8_t *buf, int buf_size,
73 | int sample_rate,
74 | int sample_fmt, int64_t ch_layout, int planar,
75 | int64_t pts, int av_unused flags);
76 |
77 | /**
78 | * Queue an audio buffer to the audio buffer source.
79 | *
80 | * @param abuffersrc audio source buffer context
81 | * @param samplesref buffer ref to queue
82 | * @param flags unused
83 | *
84 | * @deprecated use av_buffersrc_add_ref() instead.
85 | */
86 | attribute_deprecated
87 | int av_asrc_buffer_add_audio_buffer_ref(AVFilterContext *abuffersrc,
88 | AVFilterBufferRef *samplesref,
89 | int av_unused flags);
90 |
91 | #endif /* AVFILTER_ASRC_ABUFFER_H */
92 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavfilter/avcodec.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg 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 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVFILTER_AVCODEC_H
20 | #define AVFILTER_AVCODEC_H
21 |
22 | /**
23 | * @file
24 | * libavcodec/libavfilter gluing utilities
25 | *
26 | * This should be included in an application ONLY if the installed
27 | * libavfilter has been compiled with libavcodec support, otherwise
28 | * symbols defined below will not be available.
29 | */
30 |
31 | #include "avfilter.h"
32 |
33 | #if FF_API_AVFILTERBUFFER
34 | /**
35 | * Create and return a picref reference from the data and properties
36 | * contained in frame.
37 | *
38 | * @param perms permissions to assign to the new buffer reference
39 | * @deprecated avfilter APIs work natively with AVFrame instead.
40 | */
41 | attribute_deprecated
42 | AVFilterBufferRef *avfilter_get_video_buffer_ref_from_frame(const AVFrame *frame, int perms);
43 |
44 |
45 | /**
46 | * Create and return a picref reference from the data and properties
47 | * contained in frame.
48 | *
49 | * @param perms permissions to assign to the new buffer reference
50 | * @deprecated avfilter APIs work natively with AVFrame instead.
51 | */
52 | attribute_deprecated
53 | AVFilterBufferRef *avfilter_get_audio_buffer_ref_from_frame(const AVFrame *frame,
54 | int perms);
55 |
56 | /**
57 | * Create and return a buffer reference from the data and properties
58 | * contained in frame.
59 | *
60 | * @param perms permissions to assign to the new buffer reference
61 | * @deprecated avfilter APIs work natively with AVFrame instead.
62 | */
63 | attribute_deprecated
64 | AVFilterBufferRef *avfilter_get_buffer_ref_from_frame(enum AVMediaType type,
65 | const AVFrame *frame,
66 | int perms);
67 | #endif
68 |
69 | #if FF_API_FILL_FRAME
70 | /**
71 | * Fill an AVFrame with the information stored in samplesref.
72 | *
73 | * @param frame an already allocated AVFrame
74 | * @param samplesref an audio buffer reference
75 | * @return >= 0 in case of success, a negative AVERROR code in case of
76 | * failure
77 | * @deprecated Use avfilter_copy_buf_props() instead.
78 | */
79 | attribute_deprecated
80 | int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame,
81 | const AVFilterBufferRef *samplesref);
82 |
83 | /**
84 | * Fill an AVFrame with the information stored in picref.
85 | *
86 | * @param frame an already allocated AVFrame
87 | * @param picref a video buffer reference
88 | * @return >= 0 in case of success, a negative AVERROR code in case of
89 | * failure
90 | * @deprecated Use avfilter_copy_buf_props() instead.
91 | */
92 | attribute_deprecated
93 | int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame,
94 | const AVFilterBufferRef *picref);
95 |
96 | /**
97 | * Fill an AVFrame with information stored in ref.
98 | *
99 | * @param frame an already allocated AVFrame
100 | * @param ref a video or audio buffer reference
101 | * @return >= 0 in case of success, a negative AVERROR code in case of
102 | * failure
103 | * @deprecated Use avfilter_copy_buf_props() instead.
104 | */
105 | attribute_deprecated
106 | int avfilter_fill_frame_from_buffer_ref(AVFrame *frame,
107 | const AVFilterBufferRef *ref);
108 | #endif
109 |
110 | #endif /* AVFILTER_AVCODEC_H */
111 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavfilter/avfiltergraph.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Filter graphs
3 | * copyright (c) 2007 Bobby Bingham
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVFILTER_AVFILTERGRAPH_H
23 | #define AVFILTER_AVFILTERGRAPH_H
24 |
25 | #include "avfilter.h"
26 | #include "libavutil/log.h"
27 |
28 | #endif /* AVFILTER_AVFILTERGRAPH_H */
29 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavfilter/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Version macros.
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVFILTER_VERSION_H
22 | #define AVFILTER_VERSION_H
23 |
24 | /**
25 | * @file
26 | * @ingroup lavfi
27 | * Libavfilter version macros
28 | */
29 |
30 | #include "libavutil/avutil.h"
31 |
32 | #define LIBAVFILTER_VERSION_MAJOR 3
33 | #define LIBAVFILTER_VERSION_MINOR 90
34 | #define LIBAVFILTER_VERSION_MICRO 100
35 |
36 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
37 | LIBAVFILTER_VERSION_MINOR, \
38 | LIBAVFILTER_VERSION_MICRO)
39 | #define LIBAVFILTER_VERSION AV_VERSION(LIBAVFILTER_VERSION_MAJOR, \
40 | LIBAVFILTER_VERSION_MINOR, \
41 | LIBAVFILTER_VERSION_MICRO)
42 | #define LIBAVFILTER_BUILD LIBAVFILTER_VERSION_INT
43 |
44 | #define LIBAVFILTER_IDENT "Lavfi" AV_STRINGIFY(LIBAVFILTER_VERSION)
45 |
46 | /**
47 | * FF_API_* defines may be placed below to indicate public API that will be
48 | * dropped at a future version bump. The defines themselves are not part of
49 | * the public API and may change, break or disappear at any time.
50 | */
51 |
52 | #ifndef FF_API_AVFILTERPAD_PUBLIC
53 | #define FF_API_AVFILTERPAD_PUBLIC (LIBAVFILTER_VERSION_MAJOR < 4)
54 | #endif
55 | #ifndef FF_API_FOO_COUNT
56 | #define FF_API_FOO_COUNT (LIBAVFILTER_VERSION_MAJOR < 4)
57 | #endif
58 | #ifndef FF_API_FILL_FRAME
59 | #define FF_API_FILL_FRAME (LIBAVFILTER_VERSION_MAJOR < 4)
60 | #endif
61 | #ifndef FF_API_BUFFERSRC_BUFFER
62 | #define FF_API_BUFFERSRC_BUFFER (LIBAVFILTER_VERSION_MAJOR < 4)
63 | #endif
64 | #ifndef FF_API_AVFILTERBUFFER
65 | #define FF_API_AVFILTERBUFFER (LIBAVFILTER_VERSION_MAJOR < 4)
66 | #endif
67 | #ifndef FF_API_OLD_FILTER_OPTS
68 | #define FF_API_OLD_FILTER_OPTS (LIBAVFILTER_VERSION_MAJOR < 4)
69 | #endif
70 | #ifndef FF_API_ACONVERT_FILTER
71 | #define FF_API_ACONVERT_FILTER (LIBAVFILTER_VERSION_MAJOR < 4)
72 | #endif
73 | #ifndef FF_API_AVFILTER_OPEN
74 | #define FF_API_AVFILTER_OPEN (LIBAVFILTER_VERSION_MAJOR < 4)
75 | #endif
76 | #ifndef FF_API_AVFILTER_INIT_FILTER
77 | #define FF_API_AVFILTER_INIT_FILTER (LIBAVFILTER_VERSION_MAJOR < 4)
78 | #endif
79 | #ifndef FF_API_OLD_FILTER_REGISTER
80 | #define FF_API_OLD_FILTER_REGISTER (LIBAVFILTER_VERSION_MAJOR < 4)
81 | #endif
82 | #ifndef FF_API_OLD_GRAPH_PARSE
83 | #define FF_API_OLD_GRAPH_PARSE (LIBAVFILTER_VERSION_MAJOR < 4)
84 | #endif
85 | #ifndef FF_API_DRAWTEXT_OLD_TIMELINE
86 | #define FF_API_DRAWTEXT_OLD_TIMELINE (LIBAVFILTER_VERSION_MAJOR < 4)
87 | #endif
88 |
89 | #endif /* AVFILTER_VERSION_H */
90 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavformat/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Version macros.
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVFORMAT_VERSION_H
22 | #define AVFORMAT_VERSION_H
23 |
24 | /**
25 | * @file
26 | * @ingroup libavf
27 | * Libavformat version macros
28 | */
29 |
30 | #include "libavutil/avutil.h"
31 |
32 | #define LIBAVFORMAT_VERSION_MAJOR 55
33 | #define LIBAVFORMAT_VERSION_MINOR 19
34 | #define LIBAVFORMAT_VERSION_MICRO 104
35 |
36 | #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
37 | LIBAVFORMAT_VERSION_MINOR, \
38 | LIBAVFORMAT_VERSION_MICRO)
39 | #define LIBAVFORMAT_VERSION AV_VERSION(LIBAVFORMAT_VERSION_MAJOR, \
40 | LIBAVFORMAT_VERSION_MINOR, \
41 | LIBAVFORMAT_VERSION_MICRO)
42 | #define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT
43 |
44 | #define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
45 |
46 | /**
47 | * FF_API_* defines may be placed below to indicate public API that will be
48 | * dropped at a future version bump. The defines themselves are not part of
49 | * the public API and may change, break or disappear at any time.
50 | */
51 |
52 | #ifndef FF_API_ALLOC_OUTPUT_CONTEXT
53 | #define FF_API_ALLOC_OUTPUT_CONTEXT (LIBAVFORMAT_VERSION_MAJOR < 56)
54 | #endif
55 | #ifndef FF_API_FORMAT_PARAMETERS
56 | #define FF_API_FORMAT_PARAMETERS (LIBAVFORMAT_VERSION_MAJOR < 56)
57 | #endif
58 | #ifndef FF_API_NEW_STREAM
59 | #define FF_API_NEW_STREAM (LIBAVFORMAT_VERSION_MAJOR < 56)
60 | #endif
61 | #ifndef FF_API_SET_PTS_INFO
62 | #define FF_API_SET_PTS_INFO (LIBAVFORMAT_VERSION_MAJOR < 56)
63 | #endif
64 | #ifndef FF_API_CLOSE_INPUT_FILE
65 | #define FF_API_CLOSE_INPUT_FILE (LIBAVFORMAT_VERSION_MAJOR < 56)
66 | #endif
67 | #ifndef FF_API_READ_PACKET
68 | #define FF_API_READ_PACKET (LIBAVFORMAT_VERSION_MAJOR < 56)
69 | #endif
70 | #ifndef FF_API_ASS_SSA
71 | #define FF_API_ASS_SSA (LIBAVFORMAT_VERSION_MAJOR < 56)
72 | #endif
73 | #ifndef FF_API_R_FRAME_RATE
74 | #define FF_API_R_FRAME_RATE 1
75 | #endif
76 | #endif /* AVFORMAT_VERSION_H */
77 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/adler32.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2006 Mans Rullgard
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_ADLER32_H
22 | #define AVUTIL_ADLER32_H
23 |
24 | #include
25 | #include "attributes.h"
26 |
27 | /**
28 | * @defgroup lavu_adler32 Adler32
29 | * @ingroup lavu_crypto
30 | * @{
31 | */
32 |
33 | /**
34 | * Calculate the Adler32 checksum of a buffer.
35 | *
36 | * Passing the return value to a subsequent av_adler32_update() call
37 | * allows the checksum of multiple buffers to be calculated as though
38 | * they were concatenated.
39 | *
40 | * @param adler initial checksum value
41 | * @param buf pointer to input buffer
42 | * @param len size of input buffer
43 | * @return updated checksum
44 | */
45 | unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf,
46 | unsigned int len) av_pure;
47 |
48 | /**
49 | * @}
50 | */
51 |
52 | #endif /* AVUTIL_ADLER32_H */
53 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/aes.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2007 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_AES_H
22 | #define AVUTIL_AES_H
23 |
24 | #include
25 |
26 | #include "attributes.h"
27 | #include "version.h"
28 |
29 | /**
30 | * @defgroup lavu_aes AES
31 | * @ingroup lavu_crypto
32 | * @{
33 | */
34 |
35 | extern const int av_aes_size;
36 |
37 | struct AVAES;
38 |
39 | /**
40 | * Allocate an AVAES context.
41 | */
42 | struct AVAES *av_aes_alloc(void);
43 |
44 | /**
45 | * Initialize an AVAES context.
46 | * @param key_bits 128, 192 or 256
47 | * @param decrypt 0 for encryption, 1 for decryption
48 | */
49 | int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt);
50 |
51 | /**
52 | * Encrypt or decrypt a buffer using a previously initialized context.
53 | * @param count number of 16 byte blocks
54 | * @param dst destination array, can be equal to src
55 | * @param src source array, can be equal to dst
56 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used
57 | * @param decrypt 0 for encryption, 1 for decryption
58 | */
59 | void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
60 |
61 | /**
62 | * @}
63 | */
64 |
65 | #endif /* AVUTIL_AES_H */
66 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/attributes.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2006 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | /**
22 | * @file
23 | * Macro definitions for various function/variable attributes
24 | */
25 |
26 | #ifndef AVUTIL_ATTRIBUTES_H
27 | #define AVUTIL_ATTRIBUTES_H
28 |
29 | #ifdef __GNUC__
30 | # define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y)
31 | #else
32 | # define AV_GCC_VERSION_AT_LEAST(x,y) 0
33 | #endif
34 |
35 | #ifndef av_always_inline
36 | #if AV_GCC_VERSION_AT_LEAST(3,1)
37 | # define av_always_inline __attribute__((always_inline)) inline
38 | #elif defined(_MSC_VER)
39 | # define av_always_inline __forceinline
40 | #else
41 | # define av_always_inline inline
42 | #endif
43 | #endif
44 |
45 | #ifndef av_extern_inline
46 | #if defined(__ICL) && __ICL >= 1210 || defined(__GNUC_STDC_INLINE__)
47 | # define av_extern_inline extern inline
48 | #else
49 | # define av_extern_inline inline
50 | #endif
51 | #endif
52 |
53 | #if AV_GCC_VERSION_AT_LEAST(3,1)
54 | # define av_noinline __attribute__((noinline))
55 | #elif defined(_MSC_VER)
56 | # define av_noinline __declspec(noinline)
57 | #else
58 | # define av_noinline
59 | #endif
60 |
61 | #if AV_GCC_VERSION_AT_LEAST(3,1)
62 | # define av_pure __attribute__((pure))
63 | #else
64 | # define av_pure
65 | #endif
66 |
67 | #if AV_GCC_VERSION_AT_LEAST(2,6)
68 | # define av_const __attribute__((const))
69 | #else
70 | # define av_const
71 | #endif
72 |
73 | #if AV_GCC_VERSION_AT_LEAST(4,3)
74 | # define av_cold __attribute__((cold))
75 | #else
76 | # define av_cold
77 | #endif
78 |
79 | #if AV_GCC_VERSION_AT_LEAST(4,1)
80 | # define av_flatten __attribute__((flatten))
81 | #else
82 | # define av_flatten
83 | #endif
84 |
85 | #if AV_GCC_VERSION_AT_LEAST(3,1)
86 | # define attribute_deprecated __attribute__((deprecated))
87 | #elif defined(_MSC_VER)
88 | # define attribute_deprecated __declspec(deprecated)
89 | #else
90 | # define attribute_deprecated
91 | #endif
92 |
93 | /**
94 | * Disable warnings about deprecated features
95 | * This is useful for sections of code kept for backward compatibility and
96 | * scheduled for removal.
97 | */
98 | #ifndef AV_NOWARN_DEPRECATED
99 | #if AV_GCC_VERSION_AT_LEAST(4,6)
100 | # define AV_NOWARN_DEPRECATED(code) \
101 | _Pragma("GCC diagnostic push") \
102 | _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \
103 | code \
104 | _Pragma("GCC diagnostic pop")
105 | #elif defined(_MSC_VER)
106 | # define AV_NOWARN_DEPRECATED(code) \
107 | __pragma(warning(push)) \
108 | __pragma(warning(disable : 4996)) \
109 | code; \
110 | __pragma(warning(pop))
111 | #else
112 | # define AV_NOWARN_DEPRECATED(code) code
113 | #endif
114 | #endif
115 |
116 |
117 | #if defined(__GNUC__)
118 | # define av_unused __attribute__((unused))
119 | #else
120 | # define av_unused
121 | #endif
122 |
123 | /**
124 | * Mark a variable as used and prevent the compiler from optimizing it
125 | * away. This is useful for variables accessed only from inline
126 | * assembler without the compiler being aware.
127 | */
128 | #if AV_GCC_VERSION_AT_LEAST(3,1)
129 | # define av_used __attribute__((used))
130 | #else
131 | # define av_used
132 | #endif
133 |
134 | #if AV_GCC_VERSION_AT_LEAST(3,3)
135 | # define av_alias __attribute__((may_alias))
136 | #else
137 | # define av_alias
138 | #endif
139 |
140 | #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
141 | # define av_uninit(x) x=x
142 | #else
143 | # define av_uninit(x) x
144 | #endif
145 |
146 | #ifdef __GNUC__
147 | # define av_builtin_constant_p __builtin_constant_p
148 | # define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos)))
149 | #else
150 | # define av_builtin_constant_p(x) 0
151 | # define av_printf_format(fmtpos, attrpos)
152 | #endif
153 |
154 | #if AV_GCC_VERSION_AT_LEAST(2,5)
155 | # define av_noreturn __attribute__((noreturn))
156 | #else
157 | # define av_noreturn
158 | #endif
159 |
160 | #endif /* AVUTIL_ATTRIBUTES_H */
161 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/audio_fifo.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Audio FIFO
3 | * Copyright (c) 2012 Justin Ruggles
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | /**
23 | * @file
24 | * Audio FIFO Buffer
25 | */
26 |
27 | #ifndef AVUTIL_AUDIO_FIFO_H
28 | #define AVUTIL_AUDIO_FIFO_H
29 |
30 | #include "avutil.h"
31 | #include "fifo.h"
32 | #include "samplefmt.h"
33 |
34 | /**
35 | * @addtogroup lavu_audio
36 | * @{
37 | */
38 |
39 | /**
40 | * Context for an Audio FIFO Buffer.
41 | *
42 | * - Operates at the sample level rather than the byte level.
43 | * - Supports multiple channels with either planar or packed sample format.
44 | * - Automatic reallocation when writing to a full buffer.
45 | */
46 | typedef struct AVAudioFifo AVAudioFifo;
47 |
48 | /**
49 | * Free an AVAudioFifo.
50 | *
51 | * @param af AVAudioFifo to free
52 | */
53 | void av_audio_fifo_free(AVAudioFifo *af);
54 |
55 | /**
56 | * Allocate an AVAudioFifo.
57 | *
58 | * @param sample_fmt sample format
59 | * @param channels number of channels
60 | * @param nb_samples initial allocation size, in samples
61 | * @return newly allocated AVAudioFifo, or NULL on error
62 | */
63 | AVAudioFifo *av_audio_fifo_alloc(enum AVSampleFormat sample_fmt, int channels,
64 | int nb_samples);
65 |
66 | /**
67 | * Reallocate an AVAudioFifo.
68 | *
69 | * @param af AVAudioFifo to reallocate
70 | * @param nb_samples new allocation size, in samples
71 | * @return 0 if OK, or negative AVERROR code on failure
72 | */
73 | int av_audio_fifo_realloc(AVAudioFifo *af, int nb_samples);
74 |
75 | /**
76 | * Write data to an AVAudioFifo.
77 | *
78 | * The AVAudioFifo will be reallocated automatically if the available space
79 | * is less than nb_samples.
80 | *
81 | * @see enum AVSampleFormat
82 | * The documentation for AVSampleFormat describes the data layout.
83 | *
84 | * @param af AVAudioFifo to write to
85 | * @param data audio data plane pointers
86 | * @param nb_samples number of samples to write
87 | * @return number of samples actually written, or negative AVERROR
88 | * code on failure. If successful, the number of samples
89 | * actually written will always be nb_samples.
90 | */
91 | int av_audio_fifo_write(AVAudioFifo *af, void **data, int nb_samples);
92 |
93 | /**
94 | * Read data from an AVAudioFifo.
95 | *
96 | * @see enum AVSampleFormat
97 | * The documentation for AVSampleFormat describes the data layout.
98 | *
99 | * @param af AVAudioFifo to read from
100 | * @param data audio data plane pointers
101 | * @param nb_samples number of samples to read
102 | * @return number of samples actually read, or negative AVERROR code
103 | * on failure. The number of samples actually read will not
104 | * be greater than nb_samples, and will only be less than
105 | * nb_samples if av_audio_fifo_size is less than nb_samples.
106 | */
107 | int av_audio_fifo_read(AVAudioFifo *af, void **data, int nb_samples);
108 |
109 | /**
110 | * Drain data from an AVAudioFifo.
111 | *
112 | * Removes the data without reading it.
113 | *
114 | * @param af AVAudioFifo to drain
115 | * @param nb_samples number of samples to drain
116 | * @return 0 if OK, or negative AVERROR code on failure
117 | */
118 | int av_audio_fifo_drain(AVAudioFifo *af, int nb_samples);
119 |
120 | /**
121 | * Reset the AVAudioFifo buffer.
122 | *
123 | * This empties all data in the buffer.
124 | *
125 | * @param af AVAudioFifo to reset
126 | */
127 | void av_audio_fifo_reset(AVAudioFifo *af);
128 |
129 | /**
130 | * Get the current number of samples in the AVAudioFifo available for reading.
131 | *
132 | * @param af the AVAudioFifo to query
133 | * @return number of samples available for reading
134 | */
135 | int av_audio_fifo_size(AVAudioFifo *af);
136 |
137 | /**
138 | * Get the current number of samples in the AVAudioFifo available for writing.
139 | *
140 | * @param af the AVAudioFifo to query
141 | * @return number of samples available for writing
142 | */
143 | int av_audio_fifo_space(AVAudioFifo *af);
144 |
145 | /**
146 | * @}
147 | */
148 |
149 | #endif /* AVUTIL_AUDIO_FIFO_H */
150 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/audioconvert.h:
--------------------------------------------------------------------------------
1 |
2 | #include "version.h"
3 |
4 | #if FF_API_AUDIOCONVERT
5 | #include "channel_layout.h"
6 | #endif
7 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/avassert.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2010 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | /**
22 | * @file
23 | * simple assert() macros that are a bit more flexible than ISO C assert().
24 | * @author Michael Niedermayer
25 | */
26 |
27 | #ifndef AVUTIL_AVASSERT_H
28 | #define AVUTIL_AVASSERT_H
29 |
30 | #include
31 | #include "avutil.h"
32 | #include "log.h"
33 |
34 | /**
35 | * assert() equivalent, that is always enabled.
36 | */
37 | #define av_assert0(cond) do { \
38 | if (!(cond)) { \
39 | av_log(NULL, AV_LOG_PANIC, "Assertion %s failed at %s:%d\n", \
40 | AV_STRINGIFY(cond), __FILE__, __LINE__); \
41 | abort(); \
42 | } \
43 | } while (0)
44 |
45 |
46 | /**
47 | * assert() equivalent, that does not lie in speed critical code.
48 | * These asserts() thus can be enabled without fearing speedloss.
49 | */
50 | #if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 0
51 | #define av_assert1(cond) av_assert0(cond)
52 | #else
53 | #define av_assert1(cond) ((void)0)
54 | #endif
55 |
56 |
57 | /**
58 | * assert() equivalent, that does lie in speed critical code.
59 | */
60 | #if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
61 | #define av_assert2(cond) av_assert0(cond)
62 | #else
63 | #define av_assert2(cond) ((void)0)
64 | #endif
65 |
66 | #endif /* AVUTIL_AVASSERT_H */
67 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/avconfig.h:
--------------------------------------------------------------------------------
1 | /* Generated by ffconf */
2 | #ifndef AVUTIL_AVCONFIG_H
3 | #define AVUTIL_AVCONFIG_H
4 | #define AV_HAVE_BIGENDIAN 0
5 | #define AV_HAVE_FAST_UNALIGNED 0
6 | #define AV_HAVE_INCOMPATIBLE_LIBAV_ABI 0
7 | #define AV_HAVE_INCOMPATIBLE_FORK_ABI 0
8 | #endif /* AVUTIL_AVCONFIG_H */
9 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/base64.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2006 Ryan Martell. (rdm4@martellventures.com)
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_BASE64_H
22 | #define AVUTIL_BASE64_H
23 |
24 | #include
25 |
26 | /**
27 | * @defgroup lavu_base64 Base64
28 | * @ingroup lavu_crypto
29 | * @{
30 | */
31 |
32 |
33 | /**
34 | * Decode a base64-encoded string.
35 | *
36 | * @param out buffer for decoded data
37 | * @param in null-terminated input string
38 | * @param out_size size in bytes of the out buffer, must be at
39 | * least 3/4 of the length of in
40 | * @return number of bytes written, or a negative value in case of
41 | * invalid input
42 | */
43 | int av_base64_decode(uint8_t *out, const char *in, int out_size);
44 |
45 | /**
46 | * Encode data to base64 and null-terminate.
47 | *
48 | * @param out buffer for encoded data
49 | * @param out_size size in bytes of the out buffer (including the
50 | * null terminator), must be at least AV_BASE64_SIZE(in_size)
51 | * @param in input buffer containing the data to encode
52 | * @param in_size size in bytes of the in buffer
53 | * @return out or NULL in case of error
54 | */
55 | char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
56 |
57 | /**
58 | * Calculate the output size needed to base64-encode x bytes to a
59 | * null-terminated string.
60 | */
61 | #define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1)
62 |
63 | /**
64 | * @}
65 | */
66 |
67 | #endif /* AVUTIL_BASE64_H */
68 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/blowfish.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Blowfish algorithm
3 | * Copyright (c) 2012 Samuel Pitoiset
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_BLOWFISH_H
23 | #define AVUTIL_BLOWFISH_H
24 |
25 | #include
26 |
27 | /**
28 | * @defgroup lavu_blowfish Blowfish
29 | * @ingroup lavu_crypto
30 | * @{
31 | */
32 |
33 | #define AV_BF_ROUNDS 16
34 |
35 | typedef struct AVBlowfish {
36 | uint32_t p[AV_BF_ROUNDS + 2];
37 | uint32_t s[4][256];
38 | } AVBlowfish;
39 |
40 | /**
41 | * Initialize an AVBlowfish context.
42 | *
43 | * @param ctx an AVBlowfish context
44 | * @param key a key
45 | * @param key_len length of the key
46 | */
47 | void av_blowfish_init(struct AVBlowfish *ctx, const uint8_t *key, int key_len);
48 |
49 | /**
50 | * Encrypt or decrypt a buffer using a previously initialized context.
51 | *
52 | * @param ctx an AVBlowfish context
53 | * @param xl left four bytes halves of input to be encrypted
54 | * @param xr right four bytes halves of input to be encrypted
55 | * @param decrypt 0 for encryption, 1 for decryption
56 | */
57 | void av_blowfish_crypt_ecb(struct AVBlowfish *ctx, uint32_t *xl, uint32_t *xr,
58 | int decrypt);
59 |
60 | /**
61 | * Encrypt or decrypt a buffer using a previously initialized context.
62 | *
63 | * @param ctx an AVBlowfish context
64 | * @param dst destination array, can be equal to src
65 | * @param src source array, can be equal to dst
66 | * @param count number of 8 byte blocks
67 | * @param iv initialization vector for CBC mode, if NULL ECB will be used
68 | * @param decrypt 0 for encryption, 1 for decryption
69 | */
70 | void av_blowfish_crypt(struct AVBlowfish *ctx, uint8_t *dst, const uint8_t *src,
71 | int count, uint8_t *iv, int decrypt);
72 |
73 | /**
74 | * @}
75 | */
76 |
77 | #endif /* AVUTIL_BLOWFISH_H */
78 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/bswap.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2006 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | /**
22 | * @file
23 | * byte swapping routines
24 | */
25 |
26 | #ifndef AVUTIL_BSWAP_H
27 | #define AVUTIL_BSWAP_H
28 |
29 | #include
30 | #include "libavutil/avconfig.h"
31 | #include "attributes.h"
32 |
33 | #ifdef HAVE_AV_CONFIG_H
34 |
35 | #include "config.h"
36 |
37 | #if ARCH_ARM
38 | # include "arm/bswap.h"
39 | #elif ARCH_AVR32
40 | # include "avr32/bswap.h"
41 | #elif ARCH_BFIN
42 | # include "bfin/bswap.h"
43 | #elif ARCH_SH4
44 | # include "sh4/bswap.h"
45 | #elif ARCH_X86
46 | # include "x86/bswap.h"
47 | #endif
48 |
49 | #endif /* HAVE_AV_CONFIG_H */
50 |
51 | #define AV_BSWAP16C(x) (((x) << 8 & 0xff00) | ((x) >> 8 & 0x00ff))
52 | #define AV_BSWAP32C(x) (AV_BSWAP16C(x) << 16 | AV_BSWAP16C((x) >> 16))
53 | #define AV_BSWAP64C(x) (AV_BSWAP32C(x) << 32 | AV_BSWAP32C((x) >> 32))
54 |
55 | #define AV_BSWAPC(s, x) AV_BSWAP##s##C(x)
56 |
57 | #ifndef av_bswap16
58 | static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
59 | {
60 | x= (x>>8) | (x<<8);
61 | return x;
62 | }
63 | #endif
64 |
65 | #ifndef av_bswap32
66 | static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
67 | {
68 | return AV_BSWAP32C(x);
69 | }
70 | #endif
71 |
72 | #ifndef av_bswap64
73 | static inline uint64_t av_const av_bswap64(uint64_t x)
74 | {
75 | return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32);
76 | }
77 | #endif
78 |
79 | // be2ne ... big-endian to native-endian
80 | // le2ne ... little-endian to native-endian
81 |
82 | #if AV_HAVE_BIGENDIAN
83 | #define av_be2ne16(x) (x)
84 | #define av_be2ne32(x) (x)
85 | #define av_be2ne64(x) (x)
86 | #define av_le2ne16(x) av_bswap16(x)
87 | #define av_le2ne32(x) av_bswap32(x)
88 | #define av_le2ne64(x) av_bswap64(x)
89 | #define AV_BE2NEC(s, x) (x)
90 | #define AV_LE2NEC(s, x) AV_BSWAPC(s, x)
91 | #else
92 | #define av_be2ne16(x) av_bswap16(x)
93 | #define av_be2ne32(x) av_bswap32(x)
94 | #define av_be2ne64(x) av_bswap64(x)
95 | #define av_le2ne16(x) (x)
96 | #define av_le2ne32(x) (x)
97 | #define av_le2ne64(x) (x)
98 | #define AV_BE2NEC(s, x) AV_BSWAPC(s, x)
99 | #define AV_LE2NEC(s, x) (x)
100 | #endif
101 |
102 | #define AV_BE2NE16C(x) AV_BE2NEC(16, x)
103 | #define AV_BE2NE32C(x) AV_BE2NEC(32, x)
104 | #define AV_BE2NE64C(x) AV_BE2NEC(64, x)
105 | #define AV_LE2NE16C(x) AV_LE2NEC(16, x)
106 | #define AV_LE2NE32C(x) AV_LE2NEC(32, x)
107 | #define AV_LE2NE64C(x) AV_LE2NEC(64, x)
108 |
109 | #endif /* AVUTIL_BSWAP_H */
110 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/cpu.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_CPU_H
22 | #define AVUTIL_CPU_H
23 |
24 | #include "attributes.h"
25 |
26 | #define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */
27 |
28 | /* lower 16 bits - CPU features */
29 | #define AV_CPU_FLAG_MMX 0x0001 ///< standard MMX
30 | #define AV_CPU_FLAG_MMXEXT 0x0002 ///< SSE integer functions or AMD MMX ext
31 | #define AV_CPU_FLAG_MMX2 0x0002 ///< SSE integer functions or AMD MMX ext
32 | #define AV_CPU_FLAG_3DNOW 0x0004 ///< AMD 3DNOW
33 | #define AV_CPU_FLAG_SSE 0x0008 ///< SSE functions
34 | #define AV_CPU_FLAG_SSE2 0x0010 ///< PIV SSE2 functions
35 | #define AV_CPU_FLAG_SSE2SLOW 0x40000000 ///< SSE2 supported, but usually not faster
36 | ///< than regular MMX/SSE (e.g. Core1)
37 | #define AV_CPU_FLAG_3DNOWEXT 0x0020 ///< AMD 3DNowExt
38 | #define AV_CPU_FLAG_SSE3 0x0040 ///< Prescott SSE3 functions
39 | #define AV_CPU_FLAG_SSE3SLOW 0x20000000 ///< SSE3 supported, but usually not faster
40 | ///< than regular MMX/SSE (e.g. Core1)
41 | #define AV_CPU_FLAG_SSSE3 0x0080 ///< Conroe SSSE3 functions
42 | #define AV_CPU_FLAG_ATOM 0x10000000 ///< Atom processor, some SSSE3 instructions are slower
43 | #define AV_CPU_FLAG_SSE4 0x0100 ///< Penryn SSE4.1 functions
44 | #define AV_CPU_FLAG_SSE42 0x0200 ///< Nehalem SSE4.2 functions
45 | #define AV_CPU_FLAG_AVX 0x4000 ///< AVX functions: requires OS support even if YMM registers aren't used
46 | #define AV_CPU_FLAG_XOP 0x0400 ///< Bulldozer XOP functions
47 | #define AV_CPU_FLAG_FMA4 0x0800 ///< Bulldozer FMA4 functions
48 | // #if LIBAVUTIL_VERSION_MAJOR <52
49 | #define AV_CPU_FLAG_CMOV 0x1001000 ///< supports cmov instruction
50 | // #else
51 | // #define AV_CPU_FLAG_CMOV 0x1000 ///< supports cmov instruction
52 | // #endif
53 | #define AV_CPU_FLAG_AVX2 0x8000 ///< AVX2 functions: requires OS support even if YMM registers aren't used
54 |
55 | #define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard
56 |
57 | #define AV_CPU_FLAG_ARMV5TE (1 << 0)
58 | #define AV_CPU_FLAG_ARMV6 (1 << 1)
59 | #define AV_CPU_FLAG_ARMV6T2 (1 << 2)
60 | #define AV_CPU_FLAG_VFP (1 << 3)
61 | #define AV_CPU_FLAG_VFPV3 (1 << 4)
62 | #define AV_CPU_FLAG_NEON (1 << 5)
63 |
64 | /**
65 | * Return the flags which specify extensions supported by the CPU.
66 | * The returned value is affected by av_force_cpu_flags() if that was used
67 | * before. So av_get_cpu_flags() can easily be used in a application to
68 | * detect the enabled cpu flags.
69 | */
70 | int av_get_cpu_flags(void);
71 |
72 | /**
73 | * Disables cpu detection and forces the specified flags.
74 | * -1 is a special case that disables forcing of specific flags.
75 | */
76 | void av_force_cpu_flags(int flags);
77 |
78 | /**
79 | * Set a mask on flags returned by av_get_cpu_flags().
80 | * This function is mainly useful for testing.
81 | * Please use av_force_cpu_flags() and av_get_cpu_flags() instead which are more flexible
82 | *
83 | * @warning this function is not thread safe.
84 | */
85 | attribute_deprecated void av_set_cpu_flags_mask(int mask);
86 |
87 | /**
88 | * Parse CPU flags from a string.
89 | *
90 | * The returned flags contain the specified flags as well as related unspecified flags.
91 | *
92 | * This function exists only for compatibility with libav.
93 | * Please use av_parse_cpu_caps() when possible.
94 | * @return a combination of AV_CPU_* flags, negative on error.
95 | */
96 | attribute_deprecated
97 | int av_parse_cpu_flags(const char *s);
98 |
99 | /**
100 | * Parse CPU caps from a string and update the given AV_CPU_* flags based on that.
101 | *
102 | * @return negative on error.
103 | */
104 | int av_parse_cpu_caps(unsigned *flags, const char *s);
105 |
106 | /**
107 | * @return the number of logical CPU cores present.
108 | */
109 | int av_cpu_count(void);
110 |
111 | #endif /* AVUTIL_CPU_H */
112 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/crc.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2006 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_CRC_H
22 | #define AVUTIL_CRC_H
23 |
24 | #include
25 | #include
26 | #include "attributes.h"
27 |
28 | /**
29 | * @defgroup lavu_crc32 CRC32
30 | * @ingroup lavu_crypto
31 | * @{
32 | */
33 |
34 | typedef uint32_t AVCRC;
35 |
36 | typedef enum {
37 | AV_CRC_8_ATM,
38 | AV_CRC_16_ANSI,
39 | AV_CRC_16_CCITT,
40 | AV_CRC_32_IEEE,
41 | AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */
42 | AV_CRC_24_IEEE = 12,
43 | AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */
44 | }AVCRCId;
45 |
46 | /**
47 | * Initialize a CRC table.
48 | * @param ctx must be an array of size sizeof(AVCRC)*257 or sizeof(AVCRC)*1024
49 | * @param le If 1, the lowest bit represents the coefficient for the highest
50 | * exponent of the corresponding polynomial (both for poly and
51 | * actual CRC).
52 | * If 0, you must swap the CRC parameter and the result of av_crc
53 | * if you need the standard representation (can be simplified in
54 | * most cases to e.g. bswap16):
55 | * av_bswap32(crc << (32-bits))
56 | * @param bits number of bits for the CRC
57 | * @param poly generator polynomial without the x**bits coefficient, in the
58 | * representation as specified by le
59 | * @param ctx_size size of ctx in bytes
60 | * @return <0 on failure
61 | */
62 | int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);
63 |
64 | /**
65 | * Get an initialized standard CRC table.
66 | * @param crc_id ID of a standard CRC
67 | * @return a pointer to the CRC table or NULL on failure
68 | */
69 | const AVCRC *av_crc_get_table(AVCRCId crc_id);
70 |
71 | /**
72 | * Calculate the CRC of a block.
73 | * @param crc CRC of previous blocks if any or initial value for CRC
74 | * @return CRC updated with the data from the given block
75 | *
76 | * @see av_crc_init() "le" parameter
77 | */
78 | uint32_t av_crc(const AVCRC *ctx, uint32_t crc,
79 | const uint8_t *buffer, size_t length) av_pure;
80 |
81 | /**
82 | * @}
83 | */
84 |
85 | #endif /* AVUTIL_CRC_H */
86 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/error.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg 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 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | /**
20 | * @file
21 | * error code definitions
22 | */
23 |
24 | #ifndef AVUTIL_ERROR_H
25 | #define AVUTIL_ERROR_H
26 |
27 | #include
28 | #include
29 |
30 | /**
31 | * @addtogroup lavu_error
32 | *
33 | * @{
34 | */
35 |
36 |
37 | /* error handling */
38 | #if EDOM > 0
39 | #define AVERROR(e) (-(e)) ///< Returns a negative error code from a POSIX error code, to return from library functions.
40 | #define AVUNERROR(e) (-(e)) ///< Returns a POSIX error code from a library function error return value.
41 | #else
42 | /* Some platforms have E* and errno already negated. */
43 | #define AVERROR(e) (e)
44 | #define AVUNERROR(e) (e)
45 | #endif
46 |
47 | #define FFERRTAG(a, b, c, d) (-(int)MKTAG(a, b, c, d))
48 |
49 | #define AVERROR_BSF_NOT_FOUND FFERRTAG(0xF8,'B','S','F') ///< Bitstream filter not found
50 | #define AVERROR_BUG FFERRTAG( 'B','U','G','!') ///< Internal bug, also see AVERROR_BUG2
51 | #define AVERROR_BUFFER_TOO_SMALL FFERRTAG( 'B','U','F','S') ///< Buffer too small
52 | #define AVERROR_DECODER_NOT_FOUND FFERRTAG(0xF8,'D','E','C') ///< Decoder not found
53 | #define AVERROR_DEMUXER_NOT_FOUND FFERRTAG(0xF8,'D','E','M') ///< Demuxer not found
54 | #define AVERROR_ENCODER_NOT_FOUND FFERRTAG(0xF8,'E','N','C') ///< Encoder not found
55 | #define AVERROR_EOF FFERRTAG( 'E','O','F',' ') ///< End of file
56 | #define AVERROR_EXIT FFERRTAG( 'E','X','I','T') ///< Immediate exit was requested; the called function should not be restarted
57 | #define AVERROR_EXTERNAL FFERRTAG( 'E','X','T',' ') ///< Generic error in an external library
58 | #define AVERROR_FILTER_NOT_FOUND FFERRTAG(0xF8,'F','I','L') ///< Filter not found
59 | #define AVERROR_INVALIDDATA FFERRTAG( 'I','N','D','A') ///< Invalid data found when processing input
60 | #define AVERROR_MUXER_NOT_FOUND FFERRTAG(0xF8,'M','U','X') ///< Muxer not found
61 | #define AVERROR_OPTION_NOT_FOUND FFERRTAG(0xF8,'O','P','T') ///< Option not found
62 | #define AVERROR_PATCHWELCOME FFERRTAG( 'P','A','W','E') ///< Not yet implemented in FFmpeg, patches welcome
63 | #define AVERROR_PROTOCOL_NOT_FOUND FFERRTAG(0xF8,'P','R','O') ///< Protocol not found
64 |
65 | #define AVERROR_STREAM_NOT_FOUND FFERRTAG(0xF8,'S','T','R') ///< Stream not found
66 | /**
67 | * This is semantically identical to AVERROR_BUG
68 | * it has been introduced in Libav after our AVERROR_BUG and with a modified value.
69 | */
70 | #define AVERROR_BUG2 FFERRTAG( 'B','U','G',' ')
71 | #define AVERROR_UNKNOWN FFERRTAG( 'U','N','K','N') ///< Unknown error, typically from an external library
72 | #define AVERROR_EXPERIMENTAL (-0x2bb2afa8) ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it.
73 |
74 | #define AV_ERROR_MAX_STRING_SIZE 64
75 |
76 | /**
77 | * Put a description of the AVERROR code errnum in errbuf.
78 | * In case of failure the global variable errno is set to indicate the
79 | * error. Even in case of failure av_strerror() will print a generic
80 | * error message indicating the errnum provided to errbuf.
81 | *
82 | * @param errnum error code to describe
83 | * @param errbuf buffer to which description is written
84 | * @param errbuf_size the size in bytes of errbuf
85 | * @return 0 on success, a negative value if a description for errnum
86 | * cannot be found
87 | */
88 | int av_strerror(int errnum, char *errbuf, size_t errbuf_size);
89 |
90 | /**
91 | * Fill the provided buffer with a string containing an error string
92 | * corresponding to the AVERROR code errnum.
93 | *
94 | * @param errbuf a buffer
95 | * @param errbuf_size size in bytes of errbuf
96 | * @param errnum error code to describe
97 | * @return the buffer in input, filled with the error description
98 | * @see av_strerror()
99 | */
100 | static inline char *av_make_error_string(char *errbuf, size_t errbuf_size, int errnum)
101 | {
102 | av_strerror(errnum, errbuf, errbuf_size);
103 | return errbuf;
104 | }
105 |
106 | /**
107 | * Convenience macro, the return value should be used only directly in
108 | * function arguments but never stand-alone.
109 | */
110 | #define av_err2str(errnum) \
111 | av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, AV_ERROR_MAX_STRING_SIZE, errnum)
112 |
113 | /**
114 | * @}
115 | */
116 |
117 | #endif /* AVUTIL_ERROR_H */
118 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/file.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg 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 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVUTIL_FILE_H
20 | #define AVUTIL_FILE_H
21 |
22 | #include
23 |
24 | #include "avutil.h"
25 |
26 | /**
27 | * @file
28 | * Misc file utilities.
29 | */
30 |
31 | /**
32 | * Read the file with name filename, and put its content in a newly
33 | * allocated buffer or map it with mmap() when available.
34 | * In case of success set *bufptr to the read or mmapped buffer, and
35 | * *size to the size in bytes of the buffer in *bufptr.
36 | * The returned buffer must be released with av_file_unmap().
37 | *
38 | * @param log_offset loglevel offset used for logging
39 | * @param log_ctx context used for logging
40 | * @return a non negative number in case of success, a negative value
41 | * corresponding to an AVERROR error code in case of failure
42 | */
43 | int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
44 | int log_offset, void *log_ctx);
45 |
46 | /**
47 | * Unmap or free the buffer bufptr created by av_file_map().
48 | *
49 | * @param size size in bytes of bufptr, must be the same as returned
50 | * by av_file_map()
51 | */
52 | void av_file_unmap(uint8_t *bufptr, size_t size);
53 |
54 | /**
55 | * Wrapper to work around the lack of mkstemp() on mingw.
56 | * Also, tries to create file in /tmp first, if possible.
57 | * *prefix can be a character constant; *filename will be allocated internally.
58 | * @return file descriptor of opened file (or -1 on error)
59 | * and opened file name in **filename.
60 | * @note On very old libcs it is necessary to set a secure umask before
61 | * calling this, av_tempfile() can't call umask itself as it is used in
62 | * libraries and could interfere with the calling application.
63 | */
64 | int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx);
65 |
66 | #endif /* AVUTIL_FILE_H */
67 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/hmac.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2012 Martin Storsjo
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_HMAC_H
22 | #define AVUTIL_HMAC_H
23 |
24 | #include
25 |
26 | /**
27 | * @defgroup lavu_hmac HMAC
28 | * @ingroup lavu_crypto
29 | * @{
30 | */
31 |
32 | enum AVHMACType {
33 | AV_HMAC_MD5,
34 | AV_HMAC_SHA1,
35 | AV_HMAC_SHA224 = 10,
36 | AV_HMAC_SHA256,
37 | AV_HMAC_SHA384,
38 | AV_HMAC_SHA512,
39 | };
40 |
41 | typedef struct AVHMAC AVHMAC;
42 |
43 | /**
44 | * Allocate an AVHMAC context.
45 | * @param type The hash function used for the HMAC.
46 | */
47 | AVHMAC *av_hmac_alloc(enum AVHMACType type);
48 |
49 | /**
50 | * Free an AVHMAC context.
51 | * @param ctx The context to free, may be NULL
52 | */
53 | void av_hmac_free(AVHMAC *ctx);
54 |
55 | /**
56 | * Initialize an AVHMAC context with an authentication key.
57 | * @param ctx The HMAC context
58 | * @param key The authentication key
59 | * @param keylen The length of the key, in bytes
60 | */
61 | void av_hmac_init(AVHMAC *ctx, const uint8_t *key, unsigned int keylen);
62 |
63 | /**
64 | * Hash data with the HMAC.
65 | * @param ctx The HMAC context
66 | * @param data The data to hash
67 | * @param len The length of the data, in bytes
68 | */
69 | void av_hmac_update(AVHMAC *ctx, const uint8_t *data, unsigned int len);
70 |
71 | /**
72 | * Finish hashing and output the HMAC digest.
73 | * @param ctx The HMAC context
74 | * @param out The output buffer to write the digest into
75 | * @param outlen The length of the out buffer, in bytes
76 | * @return The number of bytes written to out, or a negative error code.
77 | */
78 | int av_hmac_final(AVHMAC *ctx, uint8_t *out, unsigned int outlen);
79 |
80 | /**
81 | * Hash an array of data with a key.
82 | * @param ctx The HMAC context
83 | * @param data The data to hash
84 | * @param len The length of the data, in bytes
85 | * @param key The authentication key
86 | * @param keylen The length of the key, in bytes
87 | * @param out The output buffer to write the digest into
88 | * @param outlen The length of the out buffer, in bytes
89 | * @return The number of bytes written to out, or a negative error code.
90 | */
91 | int av_hmac_calc(AVHMAC *ctx, const uint8_t *data, unsigned int len,
92 | const uint8_t *key, unsigned int keylen,
93 | uint8_t *out, unsigned int outlen);
94 |
95 | /**
96 | * @}
97 | */
98 |
99 | #endif /* AVUTIL_HMAC_H */
100 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/intfloat.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011 Mans Rullgard
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_INTFLOAT_H
22 | #define AVUTIL_INTFLOAT_H
23 |
24 | #include
25 | #include "attributes.h"
26 |
27 | union av_intfloat32 {
28 | uint32_t i;
29 | float f;
30 | };
31 |
32 | union av_intfloat64 {
33 | uint64_t i;
34 | double f;
35 | };
36 |
37 | /**
38 | * Reinterpret a 32-bit integer as a float.
39 | */
40 | static av_always_inline float av_int2float(uint32_t i)
41 | {
42 | union av_intfloat32 v;
43 | v.i = i;
44 | return v.f;
45 | }
46 |
47 | /**
48 | * Reinterpret a float as a 32-bit integer.
49 | */
50 | static av_always_inline uint32_t av_float2int(float f)
51 | {
52 | union av_intfloat32 v;
53 | v.f = f;
54 | return v.i;
55 | }
56 |
57 | /**
58 | * Reinterpret a 64-bit integer as a double.
59 | */
60 | static av_always_inline double av_int2double(uint64_t i)
61 | {
62 | union av_intfloat64 v;
63 | v.i = i;
64 | return v.f;
65 | }
66 |
67 | /**
68 | * Reinterpret a double as a 64-bit integer.
69 | */
70 | static av_always_inline uint64_t av_double2int(double f)
71 | {
72 | union av_intfloat64 v;
73 | v.f = f;
74 | return v.i;
75 | }
76 |
77 | #endif /* AVUTIL_INTFLOAT_H */
78 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/intfloat_readwrite.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2005 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_INTFLOAT_READWRITE_H
22 | #define AVUTIL_INTFLOAT_READWRITE_H
23 |
24 | #include
25 | #include "attributes.h"
26 |
27 | /* IEEE 80 bits extended float */
28 | typedef struct AVExtFloat {
29 | uint8_t exponent[2];
30 | uint8_t mantissa[8];
31 | } AVExtFloat;
32 |
33 | attribute_deprecated double av_int2dbl(int64_t v) av_const;
34 | attribute_deprecated float av_int2flt(int32_t v) av_const;
35 | attribute_deprecated double av_ext2dbl(const AVExtFloat ext) av_const;
36 | attribute_deprecated int64_t av_dbl2int(double d) av_const;
37 | attribute_deprecated int32_t av_flt2int(float d) av_const;
38 | attribute_deprecated AVExtFloat av_dbl2ext(double d) av_const;
39 |
40 | #endif /* AVUTIL_INTFLOAT_READWRITE_H */
41 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/lfg.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Lagged Fibonacci PRNG
3 | * Copyright (c) 2008 Michael Niedermayer
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_LFG_H
23 | #define AVUTIL_LFG_H
24 |
25 | typedef struct AVLFG {
26 | unsigned int state[64];
27 | int index;
28 | } AVLFG;
29 |
30 | void av_lfg_init(AVLFG *c, unsigned int seed);
31 |
32 | /**
33 | * Get the next random unsigned 32-bit number using an ALFG.
34 | *
35 | * Please also consider a simple LCG like state= state*1664525+1013904223,
36 | * it may be good enough and faster for your specific use case.
37 | */
38 | static inline unsigned int av_lfg_get(AVLFG *c){
39 | c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63];
40 | return c->state[c->index++ & 63];
41 | }
42 |
43 | /**
44 | * Get the next random unsigned 32-bit number using a MLFG.
45 | *
46 | * Please also consider av_lfg_get() above, it is faster.
47 | */
48 | static inline unsigned int av_mlfg_get(AVLFG *c){
49 | unsigned int a= c->state[(c->index-55) & 63];
50 | unsigned int b= c->state[(c->index-24) & 63];
51 | return c->state[c->index++ & 63] = 2*a*b+a+b;
52 | }
53 |
54 | /**
55 | * Get the next two numbers generated by a Box-Muller Gaussian
56 | * generator using the random numbers issued by lfg.
57 | *
58 | * @param out array where the two generated numbers are placed
59 | */
60 | void av_bmg_get(AVLFG *lfg, double out[2]);
61 |
62 | #endif /* AVUTIL_LFG_H */
63 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/lzo.h:
--------------------------------------------------------------------------------
1 | /*
2 | * LZO 1x decompression
3 | * copyright (c) 2006 Reimar Doeffinger
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_LZO_H
23 | #define AVUTIL_LZO_H
24 |
25 | /**
26 | * @defgroup lavu_lzo LZO
27 | * @ingroup lavu_crypto
28 | *
29 | * @{
30 | */
31 |
32 | #include
33 |
34 | /** @name Error flags returned by av_lzo1x_decode
35 | * @{ */
36 | /// end of the input buffer reached before decoding finished
37 | #define AV_LZO_INPUT_DEPLETED 1
38 | /// decoded data did not fit into output buffer
39 | #define AV_LZO_OUTPUT_FULL 2
40 | /// a reference to previously decoded data was wrong
41 | #define AV_LZO_INVALID_BACKPTR 4
42 | /// a non-specific error in the compressed bitstream
43 | #define AV_LZO_ERROR 8
44 | /** @} */
45 |
46 | #define AV_LZO_INPUT_PADDING 8
47 | #define AV_LZO_OUTPUT_PADDING 12
48 |
49 | /**
50 | * @brief Decodes LZO 1x compressed data.
51 | * @param out output buffer
52 | * @param outlen size of output buffer, number of bytes left are returned here
53 | * @param in input buffer
54 | * @param inlen size of input buffer, number of bytes left are returned here
55 | * @return 0 on success, otherwise a combination of the error flags above
56 | *
57 | * Make sure all buffers are appropriately padded, in must provide
58 | * AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes.
59 | */
60 | int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
61 |
62 | /**
63 | * @}
64 | */
65 |
66 | #endif /* AVUTIL_LZO_H */
67 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/md5.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2006 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_MD5_H
22 | #define AVUTIL_MD5_H
23 |
24 | #include
25 |
26 | #include "attributes.h"
27 | #include "version.h"
28 |
29 | /**
30 | * @defgroup lavu_md5 MD5
31 | * @ingroup lavu_crypto
32 | * @{
33 | */
34 |
35 | extern const int av_md5_size;
36 |
37 | struct AVMD5;
38 |
39 | /**
40 | * Allocate an AVMD5 context.
41 | */
42 | struct AVMD5 *av_md5_alloc(void);
43 |
44 | /**
45 | * Initialize MD5 hashing.
46 | *
47 | * @param ctx pointer to the function context (of size av_md5_size)
48 | */
49 | void av_md5_init(struct AVMD5 *ctx);
50 |
51 | /**
52 | * Update hash value.
53 | *
54 | * @param ctx hash function context
55 | * @param src input data to update hash with
56 | * @param len input data length
57 | */
58 | void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, int len);
59 |
60 | /**
61 | * Finish hashing and output digest value.
62 | *
63 | * @param ctx hash function context
64 | * @param dst buffer where output digest value is stored
65 | */
66 | void av_md5_final(struct AVMD5 *ctx, uint8_t *dst);
67 |
68 | /**
69 | * Hash an array of data.
70 | *
71 | * @param dst The output buffer to write the digest into
72 | * @param src The data to hash
73 | * @param len The length of the data, in bytes
74 | */
75 | void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len);
76 |
77 | /**
78 | * @}
79 | */
80 |
81 | #endif /* AVUTIL_MD5_H */
82 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/murmur3.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 Reimar Döffinger
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_MURMUR3_H
22 | #define AVUTIL_MURMUR3_H
23 |
24 | #include
25 |
26 | struct AVMurMur3 *av_murmur3_alloc(void);
27 | void av_murmur3_init_seeded(struct AVMurMur3 *c, uint64_t seed);
28 | void av_murmur3_init(struct AVMurMur3 *c);
29 | void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, int len);
30 | void av_murmur3_final(struct AVMurMur3 *c, uint8_t dst[16]);
31 |
32 | #endif /* AVUTIL_MURMUR3_H */
33 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/random_seed.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009 Baptiste Coudurier
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_RANDOM_SEED_H
22 | #define AVUTIL_RANDOM_SEED_H
23 |
24 | #include
25 | /**
26 | * @addtogroup lavu_crypto
27 | * @{
28 | */
29 |
30 | /**
31 | * Get a seed to use in conjunction with random functions.
32 | * This function tries to provide a good seed at a best effort bases.
33 | * Its possible to call this function multiple times if more bits are needed.
34 | * It can be quite slow, which is why it should only be used as seed for a faster
35 | * PRNG. The quality of the seed depends on the platform.
36 | */
37 | uint32_t av_get_random_seed(void);
38 |
39 | /**
40 | * @}
41 | */
42 |
43 | #endif /* AVUTIL_RANDOM_SEED_H */
44 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/rational.h:
--------------------------------------------------------------------------------
1 | /*
2 | * rational numbers
3 | * Copyright (c) 2003 Michael Niedermayer
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | /**
23 | * @file
24 | * rational numbers
25 | * @author Michael Niedermayer
26 | */
27 |
28 | #ifndef AVUTIL_RATIONAL_H
29 | #define AVUTIL_RATIONAL_H
30 |
31 | #include
32 | #include
33 | #include "attributes.h"
34 |
35 | /**
36 | * @addtogroup lavu_math
37 | * @{
38 | */
39 |
40 | /**
41 | * rational number numerator/denominator
42 | */
43 | typedef struct AVRational{
44 | int num; ///< numerator
45 | int den; ///< denominator
46 | } AVRational;
47 |
48 | /**
49 | * Compare two rationals.
50 | * @param a first rational
51 | * @param b second rational
52 | * @return 0 if a==b, 1 if a>b, -1 if a>63)|1;
59 | else if(b.den && a.den) return 0;
60 | else if(a.num && b.num) return (a.num>>31) - (b.num>>31);
61 | else return INT_MIN;
62 | }
63 |
64 | /**
65 | * Convert rational to double.
66 | * @param a rational to convert
67 | * @return (double) a
68 | */
69 | static inline double av_q2d(AVRational a){
70 | return a.num / (double) a.den;
71 | }
72 |
73 | /**
74 | * Reduce a fraction.
75 | * This is useful for framerate calculations.
76 | * @param dst_num destination numerator
77 | * @param dst_den destination denominator
78 | * @param num source numerator
79 | * @param den source denominator
80 | * @param max the maximum allowed for dst_num & dst_den
81 | * @return 1 if exact, 0 otherwise
82 | */
83 | int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max);
84 |
85 | /**
86 | * Multiply two rationals.
87 | * @param b first rational
88 | * @param c second rational
89 | * @return b*c
90 | */
91 | AVRational av_mul_q(AVRational b, AVRational c) av_const;
92 |
93 | /**
94 | * Divide one rational by another.
95 | * @param b first rational
96 | * @param c second rational
97 | * @return b/c
98 | */
99 | AVRational av_div_q(AVRational b, AVRational c) av_const;
100 |
101 | /**
102 | * Add two rationals.
103 | * @param b first rational
104 | * @param c second rational
105 | * @return b+c
106 | */
107 | AVRational av_add_q(AVRational b, AVRational c) av_const;
108 |
109 | /**
110 | * Subtract one rational from another.
111 | * @param b first rational
112 | * @param c second rational
113 | * @return b-c
114 | */
115 | AVRational av_sub_q(AVRational b, AVRational c) av_const;
116 |
117 | /**
118 | * Invert a rational.
119 | * @param q value
120 | * @return 1 / q
121 | */
122 | static av_always_inline AVRational av_inv_q(AVRational q)
123 | {
124 | AVRational r = { q.den, q.num };
125 | return r;
126 | }
127 |
128 | /**
129 | * Convert a double precision floating point number to a rational.
130 | * inf is expressed as {1,0} or {-1,0} depending on the sign.
131 | *
132 | * @param d double to convert
133 | * @param max the maximum allowed numerator and denominator
134 | * @return (AVRational) d
135 | */
136 | AVRational av_d2q(double d, int max) av_const;
137 |
138 | /**
139 | * @return 1 if q1 is nearer to q than q2, -1 if q2 is nearer
140 | * than q1, 0 if they have the same distance.
141 | */
142 | int av_nearer_q(AVRational q, AVRational q1, AVRational q2);
143 |
144 | /**
145 | * Find the nearest value in q_list to q.
146 | * @param q_list an array of rationals terminated by {0, 0}
147 | * @return the index of the nearest value found in the array
148 | */
149 | int av_find_nearest_q_idx(AVRational q, const AVRational* q_list);
150 |
151 | /**
152 | * @}
153 | */
154 |
155 | #endif /* AVUTIL_RATIONAL_H */
156 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/ripemd.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2007 Michael Niedermayer
3 | * Copyright (C) 2013 James Almer
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_RIPEMD_H
23 | #define AVUTIL_RIPEMD_H
24 |
25 | #include
26 |
27 | #include "attributes.h"
28 | #include "version.h"
29 |
30 | /**
31 | * @defgroup lavu_ripemd RIPEMD
32 | * @ingroup lavu_crypto
33 | * @{
34 | */
35 |
36 | extern const int av_ripemd_size;
37 |
38 | struct AVRIPEMD;
39 |
40 | /**
41 | * Allocate an AVRIPEMD context.
42 | */
43 | struct AVRIPEMD *av_ripemd_alloc(void);
44 |
45 | /**
46 | * Initialize RIPEMD hashing.
47 | *
48 | * @param context pointer to the function context (of size av_ripemd_size)
49 | * @param bits number of bits in digest (128, 160, 256 or 320 bits)
50 | * @return zero if initialization succeeded, -1 otherwise
51 | */
52 | int av_ripemd_init(struct AVRIPEMD* context, int bits);
53 |
54 | /**
55 | * Update hash value.
56 | *
57 | * @param context hash function context
58 | * @param data input data to update hash with
59 | * @param len input data length
60 | */
61 | void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, unsigned int len);
62 |
63 | /**
64 | * Finish hashing and output digest value.
65 | *
66 | * @param context hash function context
67 | * @param digest buffer where output digest value is stored
68 | */
69 | void av_ripemd_final(struct AVRIPEMD* context, uint8_t *digest);
70 |
71 | /**
72 | * @}
73 | */
74 |
75 | #endif /* AVUTIL_RIPEMD_H */
76 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/sha.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2007 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_SHA_H
22 | #define AVUTIL_SHA_H
23 |
24 | #include
25 |
26 | #include "attributes.h"
27 | #include "version.h"
28 |
29 | /**
30 | * @defgroup lavu_sha SHA
31 | * @ingroup lavu_crypto
32 | * @{
33 | */
34 |
35 | extern const int av_sha_size;
36 |
37 | struct AVSHA;
38 |
39 | /**
40 | * Allocate an AVSHA context.
41 | */
42 | struct AVSHA *av_sha_alloc(void);
43 |
44 | /**
45 | * Initialize SHA-1 or SHA-2 hashing.
46 | *
47 | * @param context pointer to the function context (of size av_sha_size)
48 | * @param bits number of bits in digest (SHA-1 - 160 bits, SHA-2 224 or 256 bits)
49 | * @return zero if initialization succeeded, -1 otherwise
50 | */
51 | int av_sha_init(struct AVSHA* context, int bits);
52 |
53 | /**
54 | * Update hash value.
55 | *
56 | * @param context hash function context
57 | * @param data input data to update hash with
58 | * @param len input data length
59 | */
60 | void av_sha_update(struct AVSHA* context, const uint8_t* data, unsigned int len);
61 |
62 | /**
63 | * Finish hashing and output digest value.
64 | *
65 | * @param context hash function context
66 | * @param digest buffer where output digest value is stored
67 | */
68 | void av_sha_final(struct AVSHA* context, uint8_t *digest);
69 |
70 | /**
71 | * @}
72 | */
73 |
74 | #endif /* AVUTIL_SHA_H */
75 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/sha512.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2007 Michael Niedermayer
3 | * Copyright (C) 2013 James Almer
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_SHA512_H
23 | #define AVUTIL_SHA512_H
24 |
25 | #include
26 |
27 | #include "attributes.h"
28 | #include "version.h"
29 |
30 | /**
31 | * @defgroup lavu_sha512 SHA512
32 | * @ingroup lavu_crypto
33 | * @{
34 | */
35 |
36 | extern const int av_sha512_size;
37 |
38 | struct AVSHA512;
39 |
40 | /**
41 | * Allocate an AVSHA512 context.
42 | */
43 | struct AVSHA512 *av_sha512_alloc(void);
44 |
45 | /**
46 | * Initialize SHA-2 512 hashing.
47 | *
48 | * @param context pointer to the function context (of size av_sha512_size)
49 | * @param bits number of bits in digest (224, 256, 384 or 512 bits)
50 | * @return zero if initialization succeeded, -1 otherwise
51 | */
52 | int av_sha512_init(struct AVSHA512* context, int bits);
53 |
54 | /**
55 | * Update hash value.
56 | *
57 | * @param context hash function context
58 | * @param data input data to update hash with
59 | * @param len input data length
60 | */
61 | void av_sha512_update(struct AVSHA512* context, const uint8_t* data, unsigned int len);
62 |
63 | /**
64 | * Finish hashing and output digest value.
65 | *
66 | * @param context hash function context
67 | * @param digest buffer where output digest value is stored
68 | */
69 | void av_sha512_final(struct AVSHA512* context, uint8_t *digest);
70 |
71 | /**
72 | * @}
73 | */
74 |
75 | #endif /* AVUTIL_SHA512_H */
76 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/time.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2000-2003 Fabrice Bellard
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_TIME_H
22 | #define AVUTIL_TIME_H
23 |
24 | #include
25 |
26 | /**
27 | * Get the current time in microseconds.
28 | */
29 | int64_t av_gettime(void);
30 |
31 | /**
32 | * Sleep for a period of time. Although the duration is expressed in
33 | * microseconds, the actual delay may be rounded to the precision of the
34 | * system timer.
35 | *
36 | * @param usec Number of microseconds to sleep.
37 | * @return zero on success or (negative) error code.
38 | */
39 | int av_usleep(unsigned usec);
40 |
41 | #endif /* AVUTIL_TIME_H */
42 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/timestamp.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg 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 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | /**
20 | * @file
21 | * timestamp utils, mostly useful for debugging/logging purposes
22 | */
23 |
24 | #ifndef AVUTIL_TIMESTAMP_H
25 | #define AVUTIL_TIMESTAMP_H
26 |
27 | #include "common.h"
28 |
29 | #define AV_TS_MAX_STRING_SIZE 32
30 |
31 | /**
32 | * Fill the provided buffer with a string containing a timestamp
33 | * representation.
34 | *
35 | * @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE
36 | * @param ts the timestamp to represent
37 | * @return the buffer in input
38 | */
39 | static inline char *av_ts_make_string(char *buf, int64_t ts)
40 | {
41 | if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
42 | else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%0x", ts);
43 | return buf;
44 | }
45 |
46 | /**
47 | * Convenience macro, the return value should be used only directly in
48 | * function arguments but never stand-alone.
49 | */
50 | #define av_ts2str(ts) av_ts_make_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts)
51 |
52 | /**
53 | * Fill the provided buffer with a string containing a timestamp time
54 | * representation.
55 | *
56 | * @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE
57 | * @param ts the timestamp to represent
58 | * @param tb the timebase of the timestamp
59 | * @return the buffer in input
60 | */
61 | static inline char *av_ts_make_time_string(char *buf, int64_t ts, AVRational *tb)
62 | {
63 | if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
64 | else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts);
65 | return buf;
66 | }
67 |
68 | /**
69 | * Convenience macro, the return value should be used only directly in
70 | * function arguments but never stand-alone.
71 | */
72 | #define av_ts2timestr(ts, tb) av_ts_make_time_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts, tb)
73 |
74 | #endif /* AVUTIL_TIMESTAMP_H */
75 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2003 Fabrice Bellard
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_VERSION_H
22 | #define AVUTIL_VERSION_H
23 |
24 | /**
25 | * @defgroup preproc_misc Preprocessor String Macros
26 | *
27 | * String manipulation macros
28 | *
29 | * @{
30 | */
31 |
32 | #define AV_STRINGIFY(s) AV_TOSTRING(s)
33 | #define AV_TOSTRING(s) #s
34 |
35 | #define AV_GLUE(a, b) a ## b
36 | #define AV_JOIN(a, b) AV_GLUE(a, b)
37 |
38 | #define AV_PRAGMA(s) _Pragma(#s)
39 |
40 | /**
41 | * @}
42 | */
43 |
44 | /**
45 | * @defgroup version_utils Library Version Macros
46 | *
47 | * Useful to check and match library version in order to maintain
48 | * backward compatibility.
49 | *
50 | * @{
51 | */
52 |
53 | #define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
54 | #define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
55 | #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
56 |
57 | /**
58 | * @}
59 | */
60 |
61 |
62 | /**
63 | * @file
64 | * @ingroup lavu
65 | * Libavutil version macros
66 | */
67 |
68 | /**
69 | * @defgroup lavu_ver Version and Build diagnostics
70 | *
71 | * Macros and function useful to check at compiletime and at runtime
72 | * which version of libavutil is in use.
73 | *
74 | * @{
75 | */
76 |
77 | #define LIBAVUTIL_VERSION_MAJOR 52
78 | #define LIBAVUTIL_VERSION_MINOR 48
79 | #define LIBAVUTIL_VERSION_MICRO 101
80 |
81 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
82 | LIBAVUTIL_VERSION_MINOR, \
83 | LIBAVUTIL_VERSION_MICRO)
84 | #define LIBAVUTIL_VERSION AV_VERSION(LIBAVUTIL_VERSION_MAJOR, \
85 | LIBAVUTIL_VERSION_MINOR, \
86 | LIBAVUTIL_VERSION_MICRO)
87 | #define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT
88 |
89 | #define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
90 |
91 | /**
92 | * @}
93 | *
94 | * @defgroup depr_guards Deprecation guards
95 | * FF_API_* defines may be placed below to indicate public API that will be
96 | * dropped at a future version bump. The defines themselves are not part of
97 | * the public API and may change, break or disappear at any time.
98 | *
99 | * @{
100 | */
101 |
102 | #ifndef FF_API_GET_BITS_PER_SAMPLE_FMT
103 | #define FF_API_GET_BITS_PER_SAMPLE_FMT (LIBAVUTIL_VERSION_MAJOR < 53)
104 | #endif
105 | #ifndef FF_API_FIND_OPT
106 | #define FF_API_FIND_OPT (LIBAVUTIL_VERSION_MAJOR < 53)
107 | #endif
108 | #ifndef FF_API_OLD_AVOPTIONS
109 | #define FF_API_OLD_AVOPTIONS (LIBAVUTIL_VERSION_MAJOR < 53)
110 | #endif
111 | #ifndef FF_API_PIX_FMT
112 | #define FF_API_PIX_FMT (LIBAVUTIL_VERSION_MAJOR < 53)
113 | #endif
114 | #ifndef FF_API_CONTEXT_SIZE
115 | #define FF_API_CONTEXT_SIZE (LIBAVUTIL_VERSION_MAJOR < 53)
116 | #endif
117 | #ifndef FF_API_PIX_FMT_DESC
118 | #define FF_API_PIX_FMT_DESC (LIBAVUTIL_VERSION_MAJOR < 53)
119 | #endif
120 | #ifndef FF_API_AV_REVERSE
121 | #define FF_API_AV_REVERSE (LIBAVUTIL_VERSION_MAJOR < 53)
122 | #endif
123 | #ifndef FF_API_AUDIOCONVERT
124 | #define FF_API_AUDIOCONVERT (LIBAVUTIL_VERSION_MAJOR < 53)
125 | #endif
126 | #ifndef FF_API_CPU_FLAG_MMX2
127 | #define FF_API_CPU_FLAG_MMX2 (LIBAVUTIL_VERSION_MAJOR < 53)
128 | #endif
129 | #ifndef FF_API_SAMPLES_UTILS_RETURN_ZERO
130 | #define FF_API_SAMPLES_UTILS_RETURN_ZERO (LIBAVUTIL_VERSION_MAJOR < 53)
131 | #endif
132 | #ifndef FF_API_LLS_PRIVATE
133 | #define FF_API_LLS_PRIVATE (LIBAVUTIL_VERSION_MAJOR < 53)
134 | #endif
135 | #ifndef FF_API_LLS1
136 | #define FF_API_LLS1 (LIBAVUTIL_VERSION_MAJOR < 53)
137 | #endif
138 | #ifndef FF_API_AVFRAME_LAVC
139 | #define FF_API_AVFRAME_LAVC (LIBAVUTIL_VERSION_MAJOR < 53)
140 | #endif
141 | #ifndef FF_API_VDPAU
142 | #define FF_API_VDPAU (LIBAVUTIL_VERSION_MAJOR < 53)
143 | #endif
144 | #ifndef FF_API_GET_CHANNEL_LAYOUT_COMPAT
145 | #define FF_API_GET_CHANNEL_LAYOUT_COMPAT (LIBAVUTIL_VERSION_MAJOR < 53)
146 | #endif
147 |
148 | /**
149 | * @}
150 | */
151 |
152 | #endif /* AVUTIL_VERSION_H */
153 |
154 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libavutil/xtea.h:
--------------------------------------------------------------------------------
1 | /*
2 | * A 32-bit implementation of the XTEA algorithm
3 | * Copyright (c) 2012 Samuel Pitoiset
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_XTEA_H
23 | #define AVUTIL_XTEA_H
24 |
25 | #include
26 |
27 | /**
28 | * @defgroup lavu_xtea XTEA
29 | * @ingroup lavu_crypto
30 | * @{
31 | */
32 |
33 | typedef struct AVXTEA {
34 | uint32_t key[16];
35 | } AVXTEA;
36 |
37 | /**
38 | * Initialize an AVXTEA context.
39 | *
40 | * @param ctx an AVXTEA context
41 | * @param key a key of 16 bytes used for encryption/decryption
42 | */
43 | void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]);
44 |
45 | /**
46 | * Encrypt or decrypt a buffer using a previously initialized context.
47 | *
48 | * @param ctx an AVXTEA context
49 | * @param dst destination array, can be equal to src
50 | * @param src source array, can be equal to dst
51 | * @param count number of 8 byte blocks
52 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used
53 | * @param decrypt 0 for encryption, 1 for decryption
54 | */
55 | void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src,
56 | int count, uint8_t *iv, int decrypt);
57 |
58 | /**
59 | * @}
60 | */
61 |
62 | #endif /* AVUTIL_XTEA_H */
63 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libpostproc/postprocess.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2001-2003 Michael Niedermayer (michaelni@gmx.at)
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg 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 | * FFmpeg 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 FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef POSTPROC_POSTPROCESS_H
22 | #define POSTPROC_POSTPROCESS_H
23 |
24 | /**
25 | * @file
26 | * @ingroup lpp
27 | * external API header
28 | */
29 |
30 | /**
31 | * @defgroup lpp Libpostproc
32 | * @{
33 | */
34 |
35 | #include "libpostproc/version.h"
36 |
37 | /**
38 | * Return the LIBPOSTPROC_VERSION_INT constant.
39 | */
40 | unsigned postproc_version(void);
41 |
42 | /**
43 | * Return the libpostproc build-time configuration.
44 | */
45 | const char *postproc_configuration(void);
46 |
47 | /**
48 | * Return the libpostproc license.
49 | */
50 | const char *postproc_license(void);
51 |
52 | #define PP_QUALITY_MAX 6
53 |
54 | #define QP_STORE_T int8_t
55 |
56 | #include
57 |
58 | typedef void pp_context;
59 | typedef void pp_mode;
60 |
61 | #if LIBPOSTPROC_VERSION_INT < (52<<16)
62 | typedef pp_context pp_context_t;
63 | typedef pp_mode pp_mode_t;
64 | extern const char *const pp_help; ///< a simple help text
65 | #else
66 | extern const char pp_help[]; ///< a simple help text
67 | #endif
68 |
69 | void pp_postprocess(const uint8_t * src[3], const int srcStride[3],
70 | uint8_t * dst[3], const int dstStride[3],
71 | int horizontalSize, int verticalSize,
72 | const QP_STORE_T *QP_store, int QP_stride,
73 | pp_mode *mode, pp_context *ppContext, int pict_type);
74 |
75 |
76 | /**
77 | * Return a pp_mode or NULL if an error occurred.
78 | *
79 | * @param name the string after "-pp" on the command line
80 | * @param quality a number from 0 to PP_QUALITY_MAX
81 | */
82 | pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality);
83 | void pp_free_mode(pp_mode *mode);
84 |
85 | pp_context *pp_get_context(int width, int height, int flags);
86 | void pp_free_context(pp_context *ppContext);
87 |
88 | #define PP_CPU_CAPS_MMX 0x80000000
89 | #define PP_CPU_CAPS_MMX2 0x20000000
90 | #define PP_CPU_CAPS_3DNOW 0x40000000
91 | #define PP_CPU_CAPS_ALTIVEC 0x10000000
92 | #define PP_CPU_CAPS_AUTO 0x00080000
93 |
94 | #define PP_FORMAT 0x00000008
95 | #define PP_FORMAT_420 (0x00000011|PP_FORMAT)
96 | #define PP_FORMAT_422 (0x00000001|PP_FORMAT)
97 | #define PP_FORMAT_411 (0x00000002|PP_FORMAT)
98 | #define PP_FORMAT_444 (0x00000000|PP_FORMAT)
99 |
100 | #define PP_PICT_TYPE_QP2 0x00000010 ///< MPEG2 style QScale
101 |
102 | /**
103 | * @}
104 | */
105 |
106 | #endif /* POSTPROC_POSTPROCESS_H */
107 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libpostproc/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Version macros.
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef POSTPROC_POSTPROCESS_VERSION_H
22 | #define POSTPROC_POSTPROCESS_VERSION_H
23 |
24 | /**
25 | * @file
26 | * Libpostproc version macros
27 | */
28 |
29 | #include "libavutil/avutil.h"
30 |
31 | #define LIBPOSTPROC_VERSION_MAJOR 52
32 | #define LIBPOSTPROC_VERSION_MINOR 3
33 | #define LIBPOSTPROC_VERSION_MICRO 100
34 |
35 | #define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \
36 | LIBPOSTPROC_VERSION_MINOR, \
37 | LIBPOSTPROC_VERSION_MICRO)
38 | #define LIBPOSTPROC_VERSION AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, \
39 | LIBPOSTPROC_VERSION_MINOR, \
40 | LIBPOSTPROC_VERSION_MICRO)
41 | #define LIBPOSTPROC_BUILD LIBPOSTPROC_VERSION_INT
42 |
43 | #define LIBPOSTPROC_IDENT "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION)
44 |
45 | #endif /* POSTPROC_POSTPROCESS_VERSION_H */
46 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libswresample/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Version macros.
3 | *
4 | * This file is part of libswresample
5 | *
6 | * libswresample is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * libswresample 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 GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with libswresample; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef SWR_VERSION_H
22 | #define SWR_VERSION_H
23 |
24 | /**
25 | * @file
26 | * Libswresample version macros
27 | */
28 |
29 | #include "../libavutil/avutil.h"
30 |
31 | #define LIBSWRESAMPLE_VERSION_MAJOR 0
32 | #define LIBSWRESAMPLE_VERSION_MINOR 17
33 | #define LIBSWRESAMPLE_VERSION_MICRO 104
34 |
35 | #define LIBSWRESAMPLE_VERSION_INT AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
36 | LIBSWRESAMPLE_VERSION_MINOR, \
37 | LIBSWRESAMPLE_VERSION_MICRO)
38 | #define LIBSWRESAMPLE_VERSION AV_VERSION(LIBSWRESAMPLE_VERSION_MAJOR, \
39 | LIBSWRESAMPLE_VERSION_MINOR, \
40 | LIBSWRESAMPLE_VERSION_MICRO)
41 | #define LIBSWRESAMPLE_BUILD LIBSWRESAMPLE_VERSION_INT
42 |
43 | #define LIBSWRESAMPLE_IDENT "SwR" AV_STRINGIFY(LIBSWRESAMPLE_VERSION)
44 |
45 | #endif /* SWR_VERSION_H */
46 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/ffmpeg/include/libswscale/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg 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 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef SWSCALE_VERSION_H
20 | #define SWSCALE_VERSION_H
21 |
22 | /**
23 | * @file
24 | * swscale version macros
25 | */
26 |
27 | #include "libavutil/avutil.h"
28 |
29 | #define LIBSWSCALE_VERSION_MAJOR 2
30 | #define LIBSWSCALE_VERSION_MINOR 5
31 | #define LIBSWSCALE_VERSION_MICRO 101
32 |
33 | #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
34 | LIBSWSCALE_VERSION_MINOR, \
35 | LIBSWSCALE_VERSION_MICRO)
36 | #define LIBSWSCALE_VERSION AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \
37 | LIBSWSCALE_VERSION_MINOR, \
38 | LIBSWSCALE_VERSION_MICRO)
39 | #define LIBSWSCALE_BUILD LIBSWSCALE_VERSION_INT
40 |
41 | #define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION)
42 |
43 | /**
44 | * FF_API_* defines may be placed below to indicate public API that will be
45 | * dropped at a future version bump. The defines themselves are not part of
46 | * the public API and may change, break or disappear at any time.
47 | */
48 |
49 | #ifndef FF_API_SWS_GETCONTEXT
50 | #define FF_API_SWS_GETCONTEXT (LIBSWSCALE_VERSION_MAJOR < 3)
51 | #endif
52 | #ifndef FF_API_SWS_CPU_CAPS
53 | #define FF_API_SWS_CPU_CAPS (LIBSWSCALE_VERSION_MAJOR < 3)
54 | #endif
55 | #ifndef FF_API_SWS_FORMAT_NAME
56 | #define FF_API_SWS_FORMAT_NAME (LIBSWSCALE_VERSION_MAJOR < 3)
57 | #endif
58 |
59 | #endif /* SWSCALE_VERSION_H */
60 |
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/prebuilt/armv7-a/libavcodec.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/jni/songstudio/3rdparty/prebuilt/armv7-a/libavcodec.a
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/prebuilt/armv7-a/libavfilter.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/jni/songstudio/3rdparty/prebuilt/armv7-a/libavfilter.a
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/prebuilt/armv7-a/libavformat.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/jni/songstudio/3rdparty/prebuilt/armv7-a/libavformat.a
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/prebuilt/armv7-a/libavutil.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/jni/songstudio/3rdparty/prebuilt/armv7-a/libavutil.a
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/prebuilt/armv7-a/libfdk-aac.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/jni/songstudio/3rdparty/prebuilt/armv7-a/libfdk-aac.a
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/prebuilt/armv7-a/libpostproc.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/jni/songstudio/3rdparty/prebuilt/armv7-a/libpostproc.a
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/prebuilt/armv7-a/libswresample.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/jni/songstudio/3rdparty/prebuilt/armv7-a/libswresample.a
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/prebuilt/armv7-a/libswscale.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/jni/songstudio/3rdparty/prebuilt/armv7-a/libswscale.a
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/prebuilt/armv7-a/libvo-aacenc.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/jni/songstudio/3rdparty/prebuilt/armv7-a/libvo-aacenc.a
--------------------------------------------------------------------------------
/jni/songstudio/3rdparty/prebuilt/armv7-a/libx264.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/jni/songstudio/3rdparty/prebuilt/armv7-a/libx264.a
--------------------------------------------------------------------------------
/jni/songstudio/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 | include $(CLEAR_VARS)
3 |
4 | LOCAL_CFLAGS += -D__STDC_CONSTANT_MACROS
5 | LOCAL_C_INCLUDES := \
6 | $(LOCAL_PATH)/libcommon \
7 | $(LOCAL_PATH)/3rdparty/ffmpeg/include
8 |
9 | LOCAL_SRC_FILES = \
10 | SoundTrackController.cpp \
11 | MusicDecoder.cpp
12 |
13 | LOCAL_STATIC_LIBRARIES := libcommontool libmusicdecoder libmedia
14 |
15 | LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog
16 | # Link with OpenSL ES
17 | LOCAL_LDLIBS += -lOpenSLES
18 | LOCAL_LDLIBS += -lz
19 | LOCAL_LDLIBS += -landroid
20 |
21 | LOCAL_LDFLAGS += $(LOCAL_PATH)/3rdparty/prebuilt/armv7-a/libfdk-aac.a
22 | LOCAL_LDFLAGS += $(LOCAL_PATH)/3rdparty/prebuilt/armv7-a/libavfilter.a
23 | LOCAL_LDFLAGS += $(LOCAL_PATH)/3rdparty/prebuilt/armv7-a/libvo-aacenc.a
24 | LOCAL_LDFLAGS += $(LOCAL_PATH)/3rdparty/prebuilt/armv7-a/libavformat.a
25 | LOCAL_LDFLAGS += $(LOCAL_PATH)/3rdparty/prebuilt/armv7-a/libavcodec.a
26 | LOCAL_LDFLAGS += $(LOCAL_PATH)/3rdparty/prebuilt/armv7-a/libavutil.a
27 | LOCAL_LDFLAGS += $(LOCAL_PATH)/3rdparty/prebuilt/armv7-a/libswscale.a
28 | LOCAL_LDFLAGS += $(LOCAL_PATH)/3rdparty/prebuilt/armv7-a/libswresample.a
29 | LOCAL_LDFLAGS += $(LOCAL_PATH)/3rdparty/prebuilt/armv7-a/libpostproc.a
30 | LOCAL_LDFLAGS += $(LOCAL_PATH)/3rdparty/prebuilt/armv7-a/libx264.a
31 |
32 | LOCAL_LDLIBS += -L$(LOCAL_PATH)/3rdparty/prebuilt/armv7-a -lfdk-aac -lvo-aacenc
33 |
34 | LOCAL_MODULE := libsongstudio
35 | include $(BUILD_SHARED_LIBRARY)
36 | include $(call all-makefiles-under,$(LOCAL_PATH))
--------------------------------------------------------------------------------
/jni/songstudio/MusicDecoder.cpp:
--------------------------------------------------------------------------------
1 | #include "com_phuket_tour_audioplayer_audiotrack_MusicDecoder.h"
2 | #include "libmusicdecoder/accompany_decoder_controller.h"
3 |
4 | #define LOG_TAG "MusicDecoder"
5 |
6 | AccompanyDecoderController* decoderController = NULL;
7 |
8 | JNIEXPORT jint JNICALL Java_com_phuket_tour_audioplayer_audiotrack_MusicDecoder_getMusicMeta
9 | (JNIEnv * env, jobject obj, jstring accompanyFilePathParam, jintArray meta) {
10 | const char* accompanyFilePath = env->GetStringUTFChars(accompanyFilePathParam, NULL);
11 | LOGI("musicPath is %s", accompanyFilePath);
12 | jint* metaData = env->GetIntArrayElements(meta, 0);
13 | decoderController = new AccompanyDecoderController();
14 | decoderController->getMusicMeta(accompanyFilePath, metaData);
15 | LOGI("sampleRate is %d", metaData[0]);
16 | LOGI("bitrate is %d", metaData[1]);
17 | env->ReleaseIntArrayElements(meta, metaData, 0);
18 | env->ReleaseStringUTFChars(accompanyFilePathParam, accompanyFilePath);
19 | return 0;
20 | }
21 |
22 | JNIEXPORT jint JNICALL Java_com_phuket_tour_audioplayer_audiotrack_MusicDecoder_openFile
23 | (JNIEnv * env, jobject obj, jstring accompanyFilePathParam, jfloat packetBufferTimePercent) {
24 | if(NULL != decoderController) {
25 | const char* accompanyFilePath = env->GetStringUTFChars(accompanyFilePathParam, NULL);
26 | decoderController->init(accompanyFilePath, packetBufferTimePercent);
27 | env->ReleaseStringUTFChars(accompanyFilePathParam, accompanyFilePath);
28 | }
29 | return 0;
30 | }
31 |
32 | JNIEXPORT jint JNICALL Java_com_phuket_tour_audioplayer_audiotrack_MusicDecoder_readSamples
33 | (JNIEnv * env, jobject obj, jshortArray array, jint size, jintArray extraSlientSampleSize) {
34 | if(NULL != decoderController) {
35 | jshort* target = env->GetShortArrayElements(array, 0);
36 | jint* slientSizeArr = env->GetIntArrayElements(extraSlientSampleSize, 0);
37 | int result = decoderController->readSamples(target, size, slientSizeArr);
38 | env->ReleaseIntArrayElements(extraSlientSampleSize, slientSizeArr, 0);
39 | env->ReleaseShortArrayElements(array, target, 0);
40 | return result;
41 | }
42 | return -1;
43 | }
44 |
45 | JNIEXPORT void JNICALL Java_com_phuket_tour_audioplayer_audiotrack_MusicDecoder_closeFile
46 | (JNIEnv * env, jobject obj) {
47 | if(NULL != decoderController) {
48 | decoderController->destroy();
49 | delete decoderController;
50 | decoderController = NULL;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/jni/songstudio/SoundTrackController.cpp:
--------------------------------------------------------------------------------
1 | #include "com_phuket_tour_audioplayer_opensles_SoundTrackController.h"
2 |
3 | #include "libmedia/sound_service.h"
4 |
5 | #define LOG_TAG "Sound_Track_Controller"
6 |
7 | static const char* JAVA_LANG_IOEXCEPTION = "java/lang/IOException";
8 | static const char* JAVA_LANG_OUTOFMEMORYERROR = "java/lang/OutOfMemoryError";
9 | static void ThrowException(JNIEnv* env, const char* className, const char* message) {
10 | // Get the exception class
11 | jclass clazz = env->FindClass(className);
12 |
13 | // If exception class is found
14 | if (0 != clazz) {
15 | // Throw exception
16 | env->ThrowNew(clazz, message);
17 |
18 | // Release local class reference
19 | env->DeleteLocalRef(clazz);
20 | }
21 | }
22 |
23 | static bool CheckError(JNIEnv* env, SLresult result) {
24 | bool isError = false;
25 |
26 | // If an error occurred
27 | if (SL_RESULT_SUCCESS != result) {
28 | // Throw IOException
29 | const char* msg = ResultToString(result);
30 | LOGI("msg is %s", msg);
31 | ThrowException(env, JAVA_LANG_IOEXCEPTION, msg);
32 |
33 | isError = true;
34 | }
35 |
36 | return isError;
37 | }
38 |
39 | SoundService* soundService = NULL;
40 | JNIEXPORT jboolean JNICALL Java_com_phuket_tour_audioplayer_opensles_SoundTrackController_setAudioDataSource(JNIEnv * env, jobject obj, jstring accompany, jfloat percent) {
41 | const char* accompanyPath = env->GetStringUTFChars(accompany, NULL);
42 | soundService = SoundService::GetInstance();
43 | //设置播放完成的回调
44 | JavaVM *g_jvm = NULL;
45 | env->GetJavaVM(&g_jvm);
46 | jobject g_obj = env->NewGlobalRef(obj);
47 | soundService->setOnCompletionCallback(g_jvm, g_obj);
48 | //设置播放文件路径以及解码buffer的1秒钟的百分比
49 | soundService->initSongDecoder(accompanyPath, percent);
50 | SLresult result = soundService->initSoundTrack();
51 | env->ReleaseStringUTFChars(accompany, accompanyPath);
52 | bool isError = CheckError(env, result);
53 | return isError;
54 | }
55 |
56 | JNIEXPORT jint JNICALL Java_com_phuket_tour_audioplayer_opensles_SoundTrackController_getAccompanySampleRate(JNIEnv * env, jobject obj) {
57 | if (NULL != soundService) {
58 | return soundService->getAccompanySampleRate();
59 | }
60 | return -1;
61 | }
62 |
63 | JNIEXPORT void JNICALL Java_com_phuket_tour_audioplayer_opensles_SoundTrackController_play
64 | (JNIEnv * env, jobject obj) {
65 | if(NULL != soundService) {
66 | soundService->play();
67 | }
68 | }
69 |
70 | JNIEXPORT jint JNICALL Java_com_phuket_tour_audioplayer_opensles_SoundTrackController_getCurrentTimeMills(JNIEnv * env, jobject obj) {
71 | if (NULL != soundService) {
72 | return soundService->getCurrentTimeMills();
73 | }
74 | return 0;
75 | }
76 |
77 | JNIEXPORT void JNICALL Java_com_phuket_tour_audioplayer_opensles_SoundTrackController_stop
78 | (JNIEnv * env, jobject obj) {
79 | if (NULL != soundService) {
80 | soundService->stop();
81 | soundService = NULL;
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/jni/songstudio/com_phuket_tour_audioplayer_audiotrack_MusicDecoder.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class com_phuket_tour_audioplayer_audiotrack_MusicDecoder */
4 |
5 | #ifndef _Included_com_phuket_tour_audioplayer_audiotrack_MusicDecoder
6 | #define _Included_com_phuket_tour_audioplayer_audiotrack_MusicDecoder
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | /*
11 | * Class: com_phuket_tour_audioplayer_audiotrack_MusicDecoder
12 | * Method: getMusicMeta
13 | * Signature: (Ljava/lang/String;[I)I
14 | */
15 | JNIEXPORT jint JNICALL Java_com_phuket_tour_audioplayer_audiotrack_MusicDecoder_getMusicMeta
16 | (JNIEnv *, jobject, jstring, jintArray);
17 |
18 | /*
19 | * Class: com_phuket_tour_audioplayer_audiotrack_MusicDecoder
20 | * Method: openFile
21 | * Signature: (Ljava/lang/String;F)I
22 | */
23 | JNIEXPORT jint JNICALL Java_com_phuket_tour_audioplayer_audiotrack_MusicDecoder_openFile
24 | (JNIEnv *, jobject, jstring, jfloat);
25 |
26 | /*
27 | * Class: com_phuket_tour_audioplayer_audiotrack_MusicDecoder
28 | * Method: readSamples
29 | * Signature: ([SI[I)I
30 | */
31 | JNIEXPORT jint JNICALL Java_com_phuket_tour_audioplayer_audiotrack_MusicDecoder_readSamples
32 | (JNIEnv *, jobject, jshortArray, jint, jintArray);
33 |
34 | /*
35 | * Class: com_phuket_tour_audioplayer_audiotrack_MusicDecoder
36 | * Method: closeFile
37 | * Signature: ()V
38 | */
39 | JNIEXPORT void JNICALL Java_com_phuket_tour_audioplayer_audiotrack_MusicDecoder_closeFile
40 | (JNIEnv *, jobject);
41 |
42 | #ifdef __cplusplus
43 | }
44 | #endif
45 | #endif
46 |
--------------------------------------------------------------------------------
/jni/songstudio/com_phuket_tour_audioplayer_opensles_SoundTrackController.h:
--------------------------------------------------------------------------------
1 | /* DO NOT EDIT THIS FILE - it is machine generated */
2 | #include
3 | /* Header for class com_phuket_tour_audioplayer_opensles_SoundTrackController */
4 |
5 | #ifndef _Included_com_phuket_tour_audioplayer_opensles_SoundTrackController
6 | #define _Included_com_phuket_tour_audioplayer_opensles_SoundTrackController
7 | #ifdef __cplusplus
8 | extern "C" {
9 | #endif
10 | /*
11 | * Class: com_phuket_tour_audioplayer_opensles_SoundTrackController
12 | * Method: setAudioDataSource
13 | * Signature: (Ljava/lang/String;F)Z
14 | */
15 | JNIEXPORT jboolean JNICALL Java_com_phuket_tour_audioplayer_opensles_SoundTrackController_setAudioDataSource
16 | (JNIEnv *, jobject, jstring, jfloat);
17 |
18 | /*
19 | * Class: com_phuket_tour_audioplayer_opensles_SoundTrackController
20 | * Method: getAccompanySampleRate
21 | * Signature: ()I
22 | */
23 | JNIEXPORT jint JNICALL Java_com_phuket_tour_audioplayer_opensles_SoundTrackController_getAccompanySampleRate
24 | (JNIEnv *, jobject);
25 |
26 | /*
27 | * Class: com_phuket_tour_audioplayer_opensles_SoundTrackController
28 | * Method: play
29 | * Signature: ()V
30 | */
31 | JNIEXPORT void JNICALL Java_com_phuket_tour_audioplayer_opensles_SoundTrackController_play
32 | (JNIEnv *, jobject);
33 |
34 | /*
35 | * Class: com_phuket_tour_audioplayer_opensles_SoundTrackController
36 | * Method: getCurrentTimeMills
37 | * Signature: ()I
38 | */
39 | JNIEXPORT jint JNICALL Java_com_phuket_tour_audioplayer_opensles_SoundTrackController_getCurrentTimeMills
40 | (JNIEnv *, jobject);
41 |
42 | /*
43 | * Class: com_phuket_tour_audioplayer_opensles_SoundTrackController
44 | * Method: stop
45 | * Signature: ()V
46 | */
47 | JNIEXPORT void JNICALL Java_com_phuket_tour_audioplayer_opensles_SoundTrackController_stop
48 | (JNIEnv *, jobject);
49 |
50 | #ifdef __cplusplus
51 | }
52 | #endif
53 | #endif
54 |
--------------------------------------------------------------------------------
/jni/songstudio/libcommon/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 | include $(CLEAR_VARS)
3 |
4 | LOCAL_SRC_FILES := \
5 | ./packet_queue.cpp \
6 | ./packet_pool.cpp
7 |
8 | LOCAL_MODULE := libcommontool
9 | include $(BUILD_STATIC_LIBRARY)
--------------------------------------------------------------------------------
/jni/songstudio/libcommon/packet_pool.h:
--------------------------------------------------------------------------------
1 | #ifndef SONGSTUDIO_PACKET_POOL_H
2 | #define SONGSTUDIO_PACKET_POOL_H
3 | #include "packet_queue.h"
4 | #include "./../libcommon/CommonTools.h"
5 |
6 | class PacketPool {
7 | private:
8 | PacketPool(); //注意:构造方法私有
9 | static PacketPool* instance; //惟一实例
10 | /** 边录边合---伴奏的packet queue **/
11 | PacketQueue* accompanyPacketQueue;
12 | /** 边录边合---人声的packet queue **/
13 | PacketQueue* audioPacketQueue;
14 | /** 直播---发送的packet queue **/
15 | PacketQueue* livePacketQueue;
16 | /** 直播---接收的packet queue **/
17 | PacketQueue* liveSubscriberPacketQueue;
18 | /** 试音---的packet queue **/
19 | PacketQueue* tuningPacketQueue;
20 | /** 解码线程---解码出来的伴奏的queue **/
21 | PacketQueue* decoderAccompanyPacketQueue;
22 | /** 解码线程---解码出来的原唱的queue **/
23 | PacketQueue* decoderOriginalSongPacketQueue;
24 |
25 | public:
26 | static PacketPool* GetInstance(); //工厂方法(用来获得实例)
27 | virtual ~PacketPool();
28 |
29 | /** 解码出来的伴奏的queue的所有操作 **/
30 | virtual void initDecoderAccompanyPacketQueue();
31 | virtual void abortDecoderAccompanyPacketQueue();
32 | virtual void destoryDecoderAccompanyPacketQueue();
33 | virtual int getDecoderAccompanyPacket(AudioPacket **audioPacket, bool block);
34 | virtual void pushDecoderAccompanyPacketToQueue(AudioPacket* audioPacket);
35 | virtual void clearDecoderAccompanyPacketToQueue();
36 | virtual int geDecoderAccompanyPacketQueueSize();
37 |
38 | /** 解码出来的原唱的queue的所有操作 **/
39 | virtual void initDecoderOriginalSongPacketQueue();
40 | virtual void abortDecoderOriginalSongPacketQueue();
41 | virtual void destoryDecoderOriginalSongPacketQueue();
42 | virtual int getDecoderOriginalSongPacket(AudioPacket **audioPacket, bool block);
43 | virtual void pushDecoderOriginalSongPacketToQueue(AudioPacket* audioPacket);
44 | virtual void clearDecoderOriginalSongPacketToQueue();
45 | virtual int getDecoderOriginalSongPacketQueueSize();
46 |
47 | /** 人声的packet queue的所有操作 **/
48 | virtual void initAudioPacketQueue();
49 | virtual void abortAudioPacketQueue();
50 | virtual void destoryAudioPacketQueue();
51 | virtual int getAudioPacket(AudioPacket **audioPacket, bool block);
52 | virtual void pushAudioPacketToQueue(AudioPacket* audioPacket);
53 | virtual void clearAudioPacketToQueue();
54 | virtual int getAudioPacketQueueSize();
55 |
56 | /** 伴奏的packet queue的所有操作 **/
57 | virtual void initAccompanyPacketQueue();
58 | virtual void abortAccompanyPacketQueue();
59 | virtual void destoryAccompanyPacketQueue();
60 | virtual int getAccompanyPacket(AudioPacket **accompanyPacket, bool block);
61 | virtual void pushAccompanyPacketToQueue(AudioPacket* accompanyPacket);
62 | virtual int getAccompanyPacketQueueSize();
63 | virtual void clearAccompanyPacketQueue();
64 |
65 | /** 直播发送的packet queue的所有操作 **/
66 | virtual void initLivePacketQueue();
67 | virtual void abortLivePacketQueue();
68 | virtual void destoryLivePacketQueue();
69 | virtual int getLivePacket(AudioPacket **livePacket, bool block);
70 | virtual void pushLivePacketToQueue(AudioPacket* livePacket);
71 | virtual int getLivePacketQueueSize();
72 |
73 | /** 直播接收的packet queue的所有操作 **/
74 | virtual void initLiveSubscriberPacketQueue();
75 | virtual void abortLiveSubscriberPacketQueue();
76 | virtual void destoryLiveSubscriberPacketQueue();
77 | virtual int getLiveSubscriberPacket(AudioPacket **livePacket, bool block);
78 | virtual void pushLiveSubscriberPacketToQueue(AudioPacket* livePacket);
79 | virtual int getLiveSubscriberPacketQueueSize();
80 |
81 | /** 试音的packet queue的所有操作 **/
82 | virtual void initTuningPacketQueue();
83 | virtual void abortTuningPacketQueue();
84 | virtual void destoryTuningPacketQueue();
85 | virtual int getTuningPacket(AudioPacket **livePacket, bool block);
86 | virtual void pushTuningPacketToQueue(AudioPacket* livePacket);
87 | virtual int getTuningPacketQueueSize();
88 | };
89 |
90 | #endif //SONGSTUDIO_PACKET_POOL_H
91 |
--------------------------------------------------------------------------------
/jni/songstudio/libcommon/packet_queue.cpp:
--------------------------------------------------------------------------------
1 | #include "packet_queue.h"
2 | #define LOG_TAG "SongStudioPacketQueue"
3 |
4 |
5 | PacketQueue::PacketQueue() {
6 | init();
7 | }
8 |
9 | PacketQueue::PacketQueue(const char* queueNameParam) {
10 | init();
11 | queueName = queueNameParam;
12 | // LOGI("queueName is %s ....", queueName);
13 | }
14 |
15 | void PacketQueue::init() {
16 | int initLockCode = pthread_mutex_init(&mLock, NULL);
17 | // LOGI("initLockCode is %d", initLockCode);
18 | int initConditionCode = pthread_cond_init(&mCondition, NULL);
19 | // LOGI("initConditionCode is %d", initConditionCode);
20 | mNbPackets = 0;
21 | mFirst = NULL;
22 | mLast = NULL;
23 | mAbortRequest = false;
24 | }
25 |
26 | PacketQueue::~PacketQueue() {
27 | LOGI("%s ~PacketQueue ....", queueName);
28 | flush();
29 | pthread_mutex_destroy(&mLock);
30 | pthread_cond_destroy(&mCondition);
31 | }
32 |
33 | int PacketQueue::size() {
34 | // LOGI("%s size ....", queueName);
35 | pthread_mutex_lock(&mLock);
36 | int size = mNbPackets;
37 | pthread_mutex_unlock(&mLock);
38 | return size;
39 | }
40 |
41 | void PacketQueue::flush() {
42 | LOGI("%s flush .... and this time the queue size is %d", queueName, size());
43 | AudioPacketList *pkt, *pkt1;
44 |
45 | AudioPacket *audioPacket;
46 | pthread_mutex_lock(&mLock);
47 |
48 | for (pkt = mFirst; pkt != NULL; pkt = pkt1) {
49 | pkt1 = pkt->next;
50 | audioPacket = pkt->pkt;
51 | if(NULL != audioPacket){
52 | // LOGI("pkt->pkt is not null will delete....");
53 | delete audioPacket;
54 | // LOGI("delete success....");
55 | }
56 | // LOGI("delete pkt ....");
57 | delete pkt;
58 | pkt = NULL;
59 | // LOGI("delete success....");
60 | }
61 | mLast = NULL;
62 | mFirst = NULL;
63 | mNbPackets = 0;
64 |
65 | pthread_mutex_unlock(&mLock);
66 | }
67 |
68 | int PacketQueue::put(AudioPacket* pkt) {
69 | if (mAbortRequest) {
70 | delete pkt;
71 | return -1;
72 | }
73 | // LOGI("%s put data ....", queueName);
74 | AudioPacketList *pkt1 = new AudioPacketList();
75 | if (!pkt1)
76 | return -1;
77 | pkt1->pkt = pkt;
78 | pkt1->next = NULL;
79 |
80 | // LOGI("%s get pthread_mutex_lock in put method....", queueName);
81 | int getLockCode = pthread_mutex_lock(&mLock);
82 | // LOGI("%s get pthread_mutex_lock result in put method: %d", queueName, getLockCode);
83 | if (mLast == NULL) {
84 | mFirst = pkt1;
85 | } else {
86 | mLast->next = pkt1;
87 | }
88 |
89 | mLast = pkt1;
90 | mNbPackets++;
91 | // LOGI("%s queue's mNbPackets : %d", queueName, mNbPackets);
92 |
93 | pthread_cond_signal(&mCondition);
94 | // LOGI("put realease pthread_mutex_unlock ...");
95 | pthread_mutex_unlock(&mLock);
96 | // LOGI("put realease pthread_mutex_unlock success");
97 |
98 | return 0;
99 |
100 | }
101 |
102 | /* return < 0 if aborted, 0 if no packet and > 0 if packet. */
103 | int PacketQueue::get(AudioPacket **pkt, bool block) {
104 | AudioPacketList *pkt1;
105 | int ret;
106 |
107 | // LOGI("%s get pthread_mutex_lock in get method....", queueName);
108 | int getLockCode = pthread_mutex_lock(&mLock);
109 | // LOGI("%s get pthread_mutex_lock result in get method: %d", queueName, getLockCode);
110 | for (;;) {
111 | if (mAbortRequest) {
112 | // LOGI("mAbortRequest ....");
113 | ret = -1;
114 | break;
115 | }
116 |
117 | pkt1 = mFirst;
118 | // LOGI("queue's mNbPackets : %d", mNbPackets);
119 | if (pkt1) {
120 | // LOGI("have data ....");
121 | mFirst = pkt1->next;
122 | if (!mFirst)
123 | mLast = NULL;
124 | mNbPackets--;
125 | // LOGI("name is %s queue's mNbPackets : %d", queueName, mNbPackets);
126 | *pkt = pkt1->pkt;
127 | delete pkt1;
128 | pkt1 = NULL;
129 | ret = 1;
130 | break;
131 | } else if (!block) {
132 | // LOGI("block ....");
133 | ret = 0;
134 | break;
135 | } else {
136 | // LOGI("%s pthread_cond_wait ....", queueName);
137 | pthread_cond_wait(&mCondition, &mLock);
138 | }
139 | }
140 |
141 | // LOGI("get realease pthread_mutex_unlock ...");
142 | pthread_mutex_unlock(&mLock);
143 | // LOGI("get realease pthread_mutex_unlock success");
144 | return ret;
145 |
146 | }
147 |
148 | void PacketQueue::abort() {
149 | // LOGI("%s abort ....", queueName);
150 | pthread_mutex_lock(&mLock);
151 | mAbortRequest = true;
152 | pthread_cond_signal(&mCondition);
153 | pthread_mutex_unlock(&mLock);
154 | // LOGI("queue abort success");
155 | }
156 |
--------------------------------------------------------------------------------
/jni/songstudio/libcommon/packet_queue.h:
--------------------------------------------------------------------------------
1 | #ifndef SONG_STDIO_PACKETQUEUE_H
2 | #define SONG_STDIO_PACKETQUEUE_H
3 |
4 | #include
5 | #include "./../libcommon/CommonTools.h"
6 |
7 | typedef struct AudioPacket {
8 |
9 | static const int AUDIO_PACKET_ACTION_PLAY = 0;
10 | static const int AUDIO_PACKET_ACTION_PAUSE = 100;
11 | static const int AUDIO_PACKET_ACTION_SEEK = 101;
12 |
13 | short * buffer;
14 | int size;
15 | float position;
16 | int action;
17 |
18 | float extra_param1;
19 | float extra_param2;
20 |
21 | AudioPacket() {
22 | buffer = NULL;
23 | size = 0;
24 | position = -1;
25 | action = 0;
26 | extra_param1 = 0;
27 | extra_param2 = 0;
28 | }
29 | ~AudioPacket() {
30 | // __android_log_print(ANDROID_LOG_ERROR, "~AudioPacket", "delete AudioPacket");
31 | if (NULL != buffer) {
32 | // __android_log_print(ANDROID_LOG_ERROR, "~AudioPacket", "buffer's addr is %x", buffer);
33 | // __android_log_print(ANDROID_LOG_ERROR, "~AudioPacket", "delete buffer ...");
34 | delete[] buffer;
35 | buffer = NULL;
36 | // __android_log_print(ANDROID_LOG_ERROR, "~AudioPacket", "delete buffer success");
37 | }
38 | // __android_log_print(ANDROID_LOG_ERROR, "~AudioPacket", "delete AudioPacket success");
39 | }
40 | } AudioPacket;
41 |
42 | typedef struct AudioPacketList {
43 | AudioPacket *pkt;
44 | struct AudioPacketList *next;
45 | AudioPacketList(){
46 | pkt = NULL;
47 | next = NULL;
48 | }
49 | } AudioPacketList;
50 | inline void buildPacketFromBuffer(AudioPacket * audioPacket, short* samples, int sampleSize) {
51 | short* packetBuffer = new short[sampleSize];
52 | if (NULL != packetBuffer) {
53 | memcpy(packetBuffer, samples, sampleSize * 2);
54 | audioPacket->buffer = packetBuffer;
55 | audioPacket->size = sampleSize;
56 | } else {
57 | audioPacket->size = -1;
58 | }
59 | }
60 | class PacketQueue {
61 | public:
62 | PacketQueue();
63 | PacketQueue(const char* queueNameParam);
64 | ~PacketQueue();
65 |
66 | void init();
67 | void flush();
68 | int put(AudioPacket* audioPacket);
69 |
70 | /* return < 0 if aborted, 0 if no packet and > 0 if packet. */
71 | int get(AudioPacket **audioPacket, bool block);
72 |
73 | int size();
74 |
75 | void abort();
76 |
77 | private:
78 | AudioPacketList* mFirst;
79 | AudioPacketList* mLast;
80 | int mNbPackets;
81 | bool mAbortRequest;
82 | pthread_mutex_t mLock;
83 | pthread_cond_t mCondition;
84 | const char* queueName;
85 | };
86 |
87 | #endif // SONG_STDIO_PACKETQUEUE_H
88 |
--------------------------------------------------------------------------------
/jni/songstudio/libmedia/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 | include $(CLEAR_VARS)
3 |
4 | LOCAL_STATIC_LIBRARIES := libmusicdecoder
5 |
6 | LOCAL_ARM_MODE := arm
7 | LOCAL_CFLAGS := -DHAVE_CONFIG_H -DFPM_ARM -ffast-math -O3
8 | LOCAL_C_INCLUDES += \
9 | $(LOCAL_PATH)/../3rdparty/ffmpeg/include
10 |
11 | LOCAL_SRC_FILES += \
12 | sound_service.cpp \
13 | opensl_es_context.cpp
14 |
15 | # Link with OpenSL ES
16 | LOCAL_LDLIBS += -lOpenSLES
17 |
18 | LOCAL_MODULE := libmedia
19 | include $(BUILD_STATIC_LIBRARY)
--------------------------------------------------------------------------------
/jni/songstudio/libmedia/opensl_es_context.cpp:
--------------------------------------------------------------------------------
1 | #include "opensl_es_context.h"
2 |
3 | #define LOG_TAG "OpenSLESContext"
4 |
5 | OpenSLESContext* OpenSLESContext::instance = new OpenSLESContext();
6 |
7 | void OpenSLESContext::init() {
8 | LOGI("createEngine");
9 | SLresult result = createEngine();
10 | LOGI("createEngine result is s%", ResultToString(result));
11 | if (SL_RESULT_SUCCESS == result) {
12 | LOGI("Realize the engine object");
13 | // Realize the engine object
14 | result = RealizeObject(engineObject);
15 | if (SL_RESULT_SUCCESS == result) {
16 | LOGI("Get the engine interface");
17 | // Get the engine interface
18 | result = GetEngineInterface();
19 | }
20 | }
21 | }
22 |
23 | OpenSLESContext::OpenSLESContext() {
24 | isInited = false;
25 | }
26 | OpenSLESContext::~OpenSLESContext() {
27 | }
28 |
29 | OpenSLESContext* OpenSLESContext::GetInstance() {
30 | if (!instance->isInited) {
31 | instance->init();
32 | instance->isInited = true;
33 | }
34 | return instance;
35 | }
36 |
--------------------------------------------------------------------------------
/jni/songstudio/libmedia/opensl_es_context.h:
--------------------------------------------------------------------------------
1 | #ifndef _MEDIA_OPENSL_ES_CONTEXT_H_
2 | #define _MEDIA_OPENSL_ES_CONTEXT_H_
3 |
4 | #include "opensl_es_util.h"
5 | #include "../libcommon/CommonTools.h"
6 |
7 | class OpenSLESContext {
8 | private:
9 | SLObjectItf engineObject;
10 | SLEngineItf engineEngine;
11 | bool isInited;
12 | /**
13 | * Creates an OpenSL ES engine.
14 | */
15 | SLresult createEngine() {
16 | // OpenSL ES for Android is designed to be thread-safe,
17 | // so this option request will be ignored, but it will
18 | // make the source code portable to other platforms.
19 | SLEngineOption engineOptions[] = { { (SLuint32) SL_ENGINEOPTION_THREADSAFE, (SLuint32) SL_BOOLEAN_TRUE } };
20 |
21 | // Create the OpenSL ES engine object
22 | return slCreateEngine(&engineObject, ARRAY_LEN(engineOptions), engineOptions, 0, // no interfaces
23 | 0, // no interfaces
24 | 0); // no required
25 | };
26 | /**
27 | * Realize the given object. Objects needs to be
28 | * realized before using them.
29 | * @param object object instance.
30 | */
31 | SLresult RealizeObject(SLObjectItf object) {
32 | // Realize the engine object
33 | return (*object)->Realize(object, SL_BOOLEAN_FALSE); // No async, blocking call
34 | };
35 | /**
36 | * Gets the engine interface from the given engine object
37 | * in order to create other objects from the engine.
38 | */
39 | SLresult GetEngineInterface() {
40 | // Get the engine interface
41 | return (*engineObject)->GetInterface(engineObject, SL_IID_ENGINE, &engineEngine);
42 | };
43 |
44 | OpenSLESContext();
45 | void init();
46 | static OpenSLESContext* instance;
47 | public:
48 | static OpenSLESContext* GetInstance(); //工厂方法(用来获得实例)
49 | virtual ~OpenSLESContext();
50 | SLEngineItf getEngine() {
51 | return engineEngine;
52 | };
53 | };
54 | #endif //_MEDIA_OPENSL_ES_CONTEXT_H_
55 |
--------------------------------------------------------------------------------
/jni/songstudio/libmedia/opensl_es_util.h:
--------------------------------------------------------------------------------
1 | #ifndef OPENSL_ES_UTILS_H
2 | #define OPENSL_ES_UTILS_H
3 | #include
4 | #include
5 |
6 | /**
7 | * Convert OpenSL ES result to string.
8 | *
9 | * @param result result code.
10 | * @return result string.
11 | */
12 | static const char* ResultToString(SLresult result) {
13 | const char* str = 0;
14 |
15 | switch (result) {
16 | case SL_RESULT_SUCCESS:
17 | str = "Success";
18 | break;
19 |
20 | case SL_RESULT_PRECONDITIONS_VIOLATED:
21 | str = "Preconditions violated";
22 | break;
23 |
24 | case SL_RESULT_PARAMETER_INVALID:
25 | str = "Parameter invalid";
26 | break;
27 |
28 | case SL_RESULT_MEMORY_FAILURE:
29 | str = "Memory failure";
30 | break;
31 |
32 | case SL_RESULT_RESOURCE_ERROR:
33 | str = "Resource error";
34 | break;
35 |
36 | case SL_RESULT_RESOURCE_LOST:
37 | str = "Resource lost";
38 | break;
39 |
40 | case SL_RESULT_IO_ERROR:
41 | str = "IO error";
42 | break;
43 |
44 | case SL_RESULT_BUFFER_INSUFFICIENT:
45 | str = "Buffer insufficient";
46 | break;
47 |
48 | case SL_RESULT_CONTENT_CORRUPTED:
49 | str = "Success";
50 | break;
51 |
52 | case SL_RESULT_CONTENT_UNSUPPORTED:
53 | str = "Content unsupported";
54 | break;
55 |
56 | case SL_RESULT_CONTENT_NOT_FOUND:
57 | str = "Content not found";
58 | break;
59 |
60 | case SL_RESULT_PERMISSION_DENIED:
61 | str = "Permission denied";
62 | break;
63 |
64 | case SL_RESULT_FEATURE_UNSUPPORTED:
65 | str = "Feature unsupported";
66 | break;
67 |
68 | case SL_RESULT_INTERNAL_ERROR:
69 | str = "Internal error";
70 | break;
71 |
72 | case SL_RESULT_UNKNOWN_ERROR:
73 | str = "Unknown error";
74 | break;
75 |
76 | case SL_RESULT_OPERATION_ABORTED:
77 | str = "Operation aborted";
78 | break;
79 |
80 | case SL_RESULT_CONTROL_LOST:
81 | str = "Control lost";
82 | break;
83 |
84 | default:
85 | str = "Unknown code";
86 | }
87 |
88 | return str;
89 | }
90 |
91 | static int getChannelMask(int channels) {
92 | int channelMask = SL_SPEAKER_FRONT_CENTER;
93 | switch (channels) {
94 | case 1:
95 | channelMask = SL_SPEAKER_FRONT_CENTER;
96 | break;
97 | case 2:
98 | channelMask = SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT;
99 | break;
100 | };
101 | return channelMask;
102 | }
103 |
104 | static int opensl_get_sample_rate(int sampleRate) {
105 | int samplesPerSec = SL_SAMPLINGRATE_44_1;
106 | switch (sampleRate) {
107 | case 8000:
108 | samplesPerSec = SL_SAMPLINGRATE_8;
109 | break;
110 | case 11025:
111 | samplesPerSec = SL_SAMPLINGRATE_11_025;
112 | break;
113 | case 12000:
114 | samplesPerSec = SL_SAMPLINGRATE_12;
115 | break;
116 | case 16000:
117 | samplesPerSec = SL_SAMPLINGRATE_16;
118 | break;
119 | case 22050:
120 | samplesPerSec = SL_SAMPLINGRATE_22_05;
121 | break;
122 | case 24000:
123 | samplesPerSec = SL_SAMPLINGRATE_24;
124 | break;
125 | case 32000:
126 | samplesPerSec = SL_SAMPLINGRATE_32;
127 | break;
128 | case 44100:
129 | samplesPerSec = SL_SAMPLINGRATE_44_1;
130 | break;
131 | case 48000:
132 | samplesPerSec = SL_SAMPLINGRATE_48;
133 | break;
134 | case 64000:
135 | samplesPerSec = SL_SAMPLINGRATE_64;
136 | break;
137 | case 88200:
138 | samplesPerSec = SL_SAMPLINGRATE_88_2;
139 | break;
140 | case 96000:
141 | samplesPerSec = SL_SAMPLINGRATE_96;
142 | break;
143 | case 192000:
144 | samplesPerSec = SL_SAMPLINGRATE_192;
145 | break;
146 | default:
147 | samplesPerSec = SL_SAMPLINGRATE_44_1;
148 | }
149 | return samplesPerSec;
150 | }
151 |
152 | static const char * opensl_get_error_string(SLresult result) {
153 | switch (result) {
154 | case SL_RESULT_PRECONDITIONS_VIOLATED:
155 | return "Preconditions violated";
156 | case SL_RESULT_PARAMETER_INVALID:
157 | return "Invalid parameter";
158 | case SL_RESULT_MEMORY_FAILURE:
159 | return "Memory failure";
160 | case SL_RESULT_RESOURCE_ERROR:
161 | return "Resource error";
162 | case SL_RESULT_RESOURCE_LOST:
163 | return "Resource lost";
164 | case SL_RESULT_IO_ERROR:
165 | return "IO error";
166 | case SL_RESULT_BUFFER_INSUFFICIENT:
167 | return "Insufficient buffer";
168 | case SL_RESULT_CONTENT_CORRUPTED:
169 | return "Content corrupted";
170 | case SL_RESULT_CONTENT_UNSUPPORTED:
171 | return "Content unsupported";
172 | case SL_RESULT_CONTENT_NOT_FOUND:
173 | return "Content not found";
174 | case SL_RESULT_PERMISSION_DENIED:
175 | return "Permission denied";
176 | case SL_RESULT_FEATURE_UNSUPPORTED:
177 | return "Feature unsupported";
178 | case SL_RESULT_INTERNAL_ERROR:
179 | return "Internal error";
180 | case SL_RESULT_UNKNOWN_ERROR:
181 | return "Unknown error";
182 | case SL_RESULT_OPERATION_ABORTED:
183 | return "Operation aborted";
184 | case SL_RESULT_CONTROL_LOST:
185 | return "Control lost";
186 | }
187 | return "Unknown OpenSL error";
188 | }
189 |
190 | #endif //OPENSL_ES_UTILS_H
191 |
--------------------------------------------------------------------------------
/jni/songstudio/libmusicdecoder/Android.mk:
--------------------------------------------------------------------------------
1 | LOCAL_PATH := $(call my-dir)
2 | include $(CLEAR_VARS)
3 | LOCAL_ARM_MODE := arm
4 |
5 | LOCAL_CFLAGS := -DHAVE_CONFIG_H -DFPM_ARM -ffast-math -O3
6 |
7 | LOCAL_STATIC_LIBRARIES := libcommontool
8 |
9 | LOCAL_C_INCLUDES += \
10 | $(LOCAL_PATH)/../libcommon \
11 | $(LOCAL_PATH)/../3rdparty/ffmpeg/include
12 |
13 | LOCAL_SRC_FILES := \
14 | ./accompany_decoder_controller.cpp \
15 | ./accompany_decoder.cpp
16 |
17 | LOCAL_MODULE := libmusicdecoder
18 | include $(BUILD_STATIC_LIBRARY)
--------------------------------------------------------------------------------
/jni/songstudio/libmusicdecoder/accompany_decoder.h:
--------------------------------------------------------------------------------
1 | #ifndef ACCOMPANY_DECODER_H
2 | #define ACCOMPANY_DECODER_H
3 | #include
4 | #include
5 | #include
6 | #include "../libcommon/packet_pool.h"
7 | #ifndef UINT64_C
8 | #define UINT64_C(value)__CONCAT(value,ULL)
9 | #endif
10 |
11 | #ifndef INT64_MIN
12 | #define INT64_MIN (-9223372036854775807LL - 1)
13 | #endif
14 |
15 | #ifndef INT64_MAX
16 | #define INT64_MAX 9223372036854775807LL
17 | #endif
18 |
19 | #include "./../libcommon/CommonTools.h"
20 |
21 | extern "C" {
22 | #include "libavcodec/avcodec.h"
23 | #include "libavformat/avformat.h"
24 | #include "libavutil/avutil.h"
25 | #include "libavutil/samplefmt.h"
26 | #include "libavutil/common.h"
27 | #include "libavutil/channel_layout.h"
28 | #include "libavutil/opt.h"
29 | #include "libavutil/imgutils.h"
30 | #include "libavutil/mathematics.h"
31 | #include "libswscale/swscale.h"
32 | #include "libswresample/swresample.h"
33 | };
34 |
35 | #define OUT_PUT_CHANNELS 2
36 |
37 | class AccompanyDecoder {
38 | private:
39 | /** 如果使用了快进或者快退命令,则先设置以下参数 **/
40 | bool seek_req;
41 | bool seek_resp;
42 | float seek_seconds;
43 |
44 | float actualSeekPosition;
45 |
46 | AVFormatContext* avFormatContext;
47 | AVCodecContext * avCodecContext;
48 | int stream_index;
49 | float timeBase;
50 | AVFrame *pAudioFrame;
51 | AVPacket packet;
52 |
53 | char* accompanyFilePath;
54 |
55 | bool seek_success_read_frame_success;
56 | int packetBufferSize;
57 |
58 | /** 每次解码出来的audioBuffer以及这个audioBuffer的时间戳以及当前类对于这个audioBuffer的操作情况 **/
59 | short* audioBuffer;
60 | float position;
61 | int audioBufferCursor;
62 | int audioBufferSize;
63 | float duration;
64 | bool isNeedFirstFrameCorrectFlag;
65 | float firstFrameCorrectionInSecs;
66 |
67 | SwrContext *swrContext;
68 | void *swrBuffer;
69 | int swrBufferSize;
70 |
71 | int init(const char* fileString);
72 | int readSamples(short* samples, int size);
73 | int readFrame();
74 | bool audioCodecIsSupported();
75 |
76 | public:
77 | AccompanyDecoder();
78 | virtual ~AccompanyDecoder();
79 |
80 | //获取采样率以及比特率
81 | virtual int getMusicMeta(const char* fileString, int * metaData);
82 | //初始化这个decoder,即打开指定的mp3文件
83 | virtual void init(const char* fileString, int packetBufferSizeParam);
84 | virtual AudioPacket* decodePacket();
85 | //销毁这个decoder
86 | virtual void destroy();
87 | void setSeekReq(bool seekReqParam){
88 | seek_req = seekReqParam;
89 | if(seek_req){
90 | seek_resp = false;
91 | }
92 | };
93 | bool hasSeekReq() {
94 | return seek_req;
95 | };
96 | bool hasSeekResp() {
97 | return seek_resp;
98 | };
99 | /** 设置到播放到什么位置,单位是秒,但是后边3位小数,其实是精确到毫秒 **/
100 | void setPosition(float seconds) {
101 | actualSeekPosition = -1;
102 | this->seek_seconds = seconds;
103 | this->seek_req = true;
104 | this->seek_resp = false;
105 | };
106 |
107 | float getActualSeekPosition(){
108 | float ret = actualSeekPosition;
109 | if(ret != -1){
110 | actualSeekPosition = -1;
111 | }
112 | return ret;
113 | };
114 | virtual void seek_frame();
115 | };
116 | #endif //ACCOMPANY_DECODER_H
117 |
--------------------------------------------------------------------------------
/jni/songstudio/libmusicdecoder/accompany_decoder_controller.cpp:
--------------------------------------------------------------------------------
1 | #include "accompany_decoder_controller.h"
2 |
3 | #define LOG_TAG "AccompanyDecoderController"
4 | AccompanyDecoderController::AccompanyDecoderController() {
5 | accompanyDecoder = NULL;
6 | playPosition = 0.0f;
7 | }
8 |
9 | AccompanyDecoderController::~AccompanyDecoderController() {
10 | }
11 |
12 | int AccompanyDecoderController::getMusicMeta(const char* accompanyPath,
13 | int * accompanyMetaData) {
14 | //获取伴奏的meta
15 | AccompanyDecoder* accompanyDecoder = new AccompanyDecoder();
16 | accompanyDecoder->getMusicMeta(accompanyPath, accompanyMetaData);
17 | delete accompanyDecoder;
18 | //初始化伴奏的采样率
19 | accompanySampleRate = accompanyMetaData[0];
20 | // LOGI("accompanySampleRate is %d", accompanySampleRate);
21 | return 0;
22 | }
23 |
24 | float AccompanyDecoderController::getPlayPosition() {
25 | return playPosition;
26 | }
27 |
28 | void* AccompanyDecoderController::startDecoderThread(void* ptr) {
29 | LOGI("enter AccompanyDecoderController::startDecoderThread");
30 | AccompanyDecoderController* decoderController =
31 | (AccompanyDecoderController *) ptr;
32 | int getLockCode = pthread_mutex_lock(&decoderController->mLock);
33 | while (decoderController->isRunning) {
34 | decoderController->decodeSongPacket();
35 | if (decoderController->packetPool->geDecoderAccompanyPacketQueueSize() > QUEUE_SIZE_MAX_THRESHOLD) {
36 | pthread_cond_wait(&decoderController->mCondition,
37 | &decoderController->mLock);
38 | }
39 | }
40 | pthread_mutex_unlock(&decoderController->mLock);
41 | }
42 |
43 | void AccompanyDecoderController::initAccompanyDecoder(
44 | const char* accompanyPath) {
45 | //初始化两个decoder
46 | accompanyDecoder = new AccompanyDecoder();
47 | accompanyDecoder->init(accompanyPath, accompanyPacketBufferSize);
48 | }
49 |
50 | void AccompanyDecoderController::init(const char* accompanyPath,
51 | float packetBufferTimePercent) {
52 | //初始化两个全局变量
53 | volume = 1.0f;
54 | accompanyMax = 1.0f;
55 |
56 | //计算计算出伴奏和原唱的bufferSize
57 | int accompanyByteCountPerSec = accompanySampleRate * CHANNEL_PER_FRAME
58 | * BITS_PER_CHANNEL / BITS_PER_BYTE;
59 | accompanyPacketBufferSize = (int) ((accompanyByteCountPerSec / 2)
60 | * packetBufferTimePercent);
61 | //初始化两个decoder
62 | initAccompanyDecoder(accompanyPath);
63 | //初始化队列以及开启线程
64 | packetPool = PacketPool::GetInstance();
65 | packetPool->initDecoderAccompanyPacketQueue();
66 | initDecoderThread();
67 | }
68 |
69 | void AccompanyDecoderController::initDecoderThread() {
70 | isRunning = true;
71 | pthread_mutex_init(&mLock, NULL);
72 | pthread_cond_init(&mCondition, NULL);
73 | pthread_create(&songDecoderThread, NULL, startDecoderThread, this);
74 | }
75 |
76 | //需要子类完成自己的操作
77 | void AccompanyDecoderController::decodeSongPacket() {
78 | AudioPacket* accompanyPacket = accompanyDecoder->decodePacket();
79 | accompanyPacket->action = AudioPacket::AUDIO_PACKET_ACTION_PLAY;
80 | packetPool->pushDecoderAccompanyPacketToQueue(accompanyPacket);
81 | }
82 |
83 | void AccompanyDecoderController::destroyDecoderThread() {
84 | isRunning = false;
85 | void* status;
86 | int getLockCode = pthread_mutex_lock(&mLock);
87 | pthread_cond_signal(&mCondition);
88 | pthread_mutex_unlock(&mLock);
89 | pthread_join(songDecoderThread, &status);
90 | pthread_mutex_destroy(&mLock);
91 | pthread_cond_destroy(&mCondition);
92 | }
93 |
94 | int AccompanyDecoderController::readSamples(short* samples, int size,
95 | int* slientSizeArr) {
96 | int result = -1;
97 | AudioPacket* accompanyPacket = NULL;
98 | packetPool->getDecoderAccompanyPacket(&accompanyPacket, true);
99 | if (NULL != accompanyPacket) {
100 | int samplePacketSize = accompanyPacket->size;
101 | if (samplePacketSize != -1 && samplePacketSize <= size) {
102 | //copy the raw data to samples
103 | memcpy(samples, accompanyPacket->buffer, samplePacketSize * 2);
104 | adjustSamplesVolume(samples, samplePacketSize,
105 | volume / accompanyMax);
106 | delete accompanyPacket;
107 | result = samplePacketSize;
108 | }
109 | } else {
110 | result = -2;
111 | }
112 | if (packetPool->geDecoderAccompanyPacketQueueSize() < QUEUE_SIZE_MIN_THRESHOLD) {
113 | int getLockCode = pthread_mutex_lock(&mLock);
114 | if (result != -1) {
115 | pthread_cond_signal(&mCondition);
116 | }
117 | pthread_mutex_unlock (&mLock);
118 | }
119 | return result;
120 | }
121 |
122 | void AccompanyDecoderController::destroy() {
123 | destroyDecoderThread();
124 | packetPool->abortDecoderAccompanyPacketQueue();
125 | packetPool->destoryDecoderAccompanyPacketQueue();
126 | if (NULL != accompanyDecoder) {
127 | accompanyDecoder->destroy();
128 | delete accompanyDecoder;
129 | accompanyDecoder = NULL;
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/jni/songstudio/libmusicdecoder/accompany_decoder_controller.h:
--------------------------------------------------------------------------------
1 | #ifndef ACCOMPANY_DECODER_CONTROLLER_H
2 | #define ACCOMPANY_DECODER_CONTROLLER_H
3 |
4 | #include
5 | #include "accompany_decoder.h"
6 | #include
7 |
8 | #define CHANNEL_PER_FRAME 2
9 | #define BITS_PER_CHANNEL 16
10 | #define BITS_PER_BYTE 8
11 | /** decode data to queue and queue size **/
12 | #define QUEUE_SIZE_MAX_THRESHOLD 25
13 | #define QUEUE_SIZE_MIN_THRESHOLD 20
14 |
15 | /**
16 | * 这是伴奏单独的控制类,原唱的控制类继承自这个类
17 | */
18 | class AccompanyDecoderController {
19 | protected:
20 | /** 本身这个类也是一个生产者,每次客户端读出一个packet去我们就会把伴奏的packet给放入队列中,把原唱的packet销毁掉 **/
21 | PacketPool* packetPool;
22 |
23 | /** 伴奏的解码器 **/
24 | AccompanyDecoder* accompanyDecoder;
25 |
26 | /** 伴奏和原唱的采样频率与解码伴奏和原唱的每个packet的大小 **/
27 | int accompanySampleRate;
28 | int accompanyPacketBufferSize;
29 |
30 | /** 由于可能要进行音量的变化,这个是控制音量的值 **/
31 | float volume;
32 | /** 7.0新增**/
33 | float accompanyMax;
34 |
35 | /** 解码线程,主要是调用原唱和伴唱的解码器 解码出对应的packet数据来 **/
36 | pthread_t songDecoderThread;
37 | static void* startDecoderThread(void* ptr);
38 | /** 开启解码线程 **/
39 | virtual void initDecoderThread();
40 | virtual void decodeSongPacket();
41 | /** 销毁解码线程 **/
42 | virtual void destroyDecoderThread();
43 | public:
44 |
45 | /** 由于在解码线程中要用到以下几个值,所以访问控制符是public的 **/
46 | bool isRunning;
47 | pthread_mutex_t mLock;
48 | pthread_cond_t mCondition;
49 |
50 | AccompanyDecoderController();
51 | ~AccompanyDecoderController();
52 |
53 | /** 根据伴奏文件与原唱文件得到采样率以及比特率赋值给全局变量,并且将伴奏文件的采样率与比特率放入metaData返回 **/
54 | virtual int getMusicMeta(const char* accompanyPath, const char* originalSongPath, int * accompanyMetaData){};
55 |
56 | /** 初始两个decoder,并且根据上一步算出的采样率,计算出伴奏和原唱的bufferSize **/
57 | virtual void init(const char* accompanyPath, const char* originalSongPath, float packetBufferTimePercent){};
58 |
59 | /** 根据伴奏文件与原唱文件得到采样率以及比特率赋值给全局变量,并且将伴奏文件的采样率与比特率放入metaData返回 **/
60 | virtual int getMusicMeta(const char* accompanyPath, int * accompanyMetaData);
61 |
62 | /** 初始两个decoder,并且根据上一步算出的采样率,计算出伴奏和原唱的bufferSize **/
63 | virtual void init(const char* accompanyPath, float packetBufferTimePercent);
64 |
65 | /** 读取samples,返回实际读取的sample的个数 并且将accompanyPacket放入到accompanyQueue中,如果有originalSongPacket销毁 **/
66 | virtual int readSamples(short* samples, int size, int* slientSizeArr);
67 |
68 | /** 设置伴奏或者原唱的音量 **/
69 | void setVolume(float volumeParam, float accompanyMaxParam) {
70 | volume = volumeParam;
71 | accompanyMax = accompanyMaxParam;
72 | }
73 |
74 | virtual float getPlayPosition();
75 | /** 销毁这个controller **/
76 | virtual void destroy();
77 |
78 | protected:
79 | float playPosition;
80 |
81 | virtual void initAccompanyDecoder(const char* accompanyPath);
82 | };
83 | #endif //ACCOMPANY_DECODER_CONTROLLER_H
84 |
--------------------------------------------------------------------------------
/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/libs/armeabi-v7a/libsongstudio.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/libs/armeabi-v7a/libsongstudio.so
--------------------------------------------------------------------------------
/obj/local/armeabi-v7a/libcommontool.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/obj/local/armeabi-v7a/libcommontool.a
--------------------------------------------------------------------------------
/obj/local/armeabi-v7a/libmedia.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/obj/local/armeabi-v7a/libmedia.a
--------------------------------------------------------------------------------
/obj/local/armeabi-v7a/libmusicdecoder.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/obj/local/armeabi-v7a/libmusicdecoder.a
--------------------------------------------------------------------------------
/obj/local/armeabi-v7a/libsongstudio.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/obj/local/armeabi-v7a/libsongstudio.so
--------------------------------------------------------------------------------
/obj/local/armeabi-v7a/objs/commontool/packet_pool.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/obj/local/armeabi-v7a/objs/commontool/packet_pool.o
--------------------------------------------------------------------------------
/obj/local/armeabi-v7a/objs/commontool/packet_queue.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/obj/local/armeabi-v7a/objs/commontool/packet_queue.o
--------------------------------------------------------------------------------
/obj/local/armeabi-v7a/objs/media/opensl_es_context.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/obj/local/armeabi-v7a/objs/media/opensl_es_context.o
--------------------------------------------------------------------------------
/obj/local/armeabi-v7a/objs/media/sound_service.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/obj/local/armeabi-v7a/objs/media/sound_service.o
--------------------------------------------------------------------------------
/obj/local/armeabi-v7a/objs/musicdecoder/accompany_decoder.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/obj/local/armeabi-v7a/objs/musicdecoder/accompany_decoder.o
--------------------------------------------------------------------------------
/obj/local/armeabi-v7a/objs/musicdecoder/accompany_decoder_controller.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/obj/local/armeabi-v7a/objs/musicdecoder/accompany_decoder_controller.o
--------------------------------------------------------------------------------
/obj/local/armeabi-v7a/objs/songstudio/MusicDecoder.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/obj/local/armeabi-v7a/objs/songstudio/MusicDecoder.o
--------------------------------------------------------------------------------
/obj/local/armeabi-v7a/objs/songstudio/SoundTrackController.o:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/obj/local/armeabi-v7a/objs/songstudio/SoundTrackController.o
--------------------------------------------------------------------------------
/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/project.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 edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-23
15 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
15 |
16 |
24 |
25 |
32 |
33 |
40 |
41 |
42 |
48 |
49 |
57 |
58 |
65 |
66 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 | 64dp
9 |
10 |
11 |
--------------------------------------------------------------------------------
/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 | 16dp
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | AudioPlayer
5 | Hello world!
6 | AudioPlayer AudioTrack Impl
7 | AudioPlayer OpenSL ES Impl
8 | Play
9 | Stop
10 | Settings
11 |
12 |
13 |
--------------------------------------------------------------------------------
/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/resource/131.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/resource/131.mp3
--------------------------------------------------------------------------------
/src/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/src/.DS_Store
--------------------------------------------------------------------------------
/src/com/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/src/com/.DS_Store
--------------------------------------------------------------------------------
/src/com/phuket/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/src/com/phuket/.DS_Store
--------------------------------------------------------------------------------
/src/com/phuket/tour/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhanxiaokai/Android-AudioPlayer/bd8eed0d70a200d0c1bfc9be873ec58ea3dc5b3f/src/com/phuket/tour/.DS_Store
--------------------------------------------------------------------------------
/src/com/phuket/tour/audioplayer/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.phuket.tour.audioplayer;
2 |
3 |
4 | import com.phuket.tour.audioplayer.audiotrack.NativeMp3PlayerController;
5 | import com.phuket.tour.audioplayer.opensles.SoundTrackController;
6 |
7 | import android.app.Activity;
8 | import android.os.Bundle;
9 | import android.os.Handler;
10 | import android.os.Message;
11 | import android.util.Log;
12 | import android.view.View;
13 | import android.view.View.OnClickListener;
14 | import android.widget.Button;
15 |
16 | public class MainActivity extends Activity {
17 |
18 | static {
19 | System.loadLibrary("songstudio");
20 | }
21 | private static String TAG = "MainActivity";
22 |
23 | private Button audioTrackPlayBtn;
24 | private Button audioTrackStopBtn;
25 | private Button openSLESPlayBtn;
26 | private Button openSLESStopBtn;
27 | /** 要播放的文件路径 **/
28 | private static String playFilePath = "/mnt/sdcard/131.mp3";
29 |
30 | @Override
31 | protected void onCreate(Bundle savedInstanceState) {
32 | super.onCreate(savedInstanceState);
33 | setContentView(R.layout.activity_main);
34 | findView();
35 | bindListener();
36 | }
37 |
38 | private void findView() {
39 | audioTrackPlayBtn = (Button) findViewById(R.id.play_audiotrack_btn);
40 | audioTrackStopBtn = (Button) findViewById(R.id.stop_audiotrack_btn);
41 | openSLESPlayBtn = (Button) findViewById(R.id.play_opensl_es_btn);
42 | openSLESStopBtn = (Button) findViewById(R.id.stop_opensl_es_btn);
43 | }
44 |
45 | private void bindListener() {
46 | audioTrackPlayBtn.setOnClickListener(audioTrackPlayBtnListener);
47 | audioTrackStopBtn.setOnClickListener(audioTrackStopBtnListener);
48 | openSLESPlayBtn.setOnClickListener(openSLESPlayBtnListener);
49 | openSLESStopBtn.setOnClickListener(openSLESStopBtnListener);
50 | }
51 |
52 | private NativeMp3PlayerController audioTrackPlayerController;
53 | OnClickListener audioTrackPlayBtnListener = new OnClickListener() {
54 |
55 | @Override
56 | public void onClick(View v) {
57 | Log.i(TAG, "Click AudioTrack Play Btn");
58 | audioTrackPlayerController = new NativeMp3PlayerController();
59 | audioTrackPlayerController.setHandler(handler);
60 | audioTrackPlayerController.setAudioDataSource(playFilePath);
61 | audioTrackPlayerController.start();
62 | }
63 | };
64 |
65 | OnClickListener audioTrackStopBtnListener = new OnClickListener() {
66 |
67 | @Override
68 | public void onClick(View v) {
69 | Log.i(TAG, "Click AudioTrack Stop Btn");
70 | // 普通AudioTrack的停止播放
71 | if (null != audioTrackPlayerController) {
72 | audioTrackPlayerController.stop();
73 | audioTrackPlayerController = null;
74 | }
75 | }
76 | };
77 |
78 | private SoundTrackController openSLPlayerController;
79 | OnClickListener openSLESPlayBtnListener = new OnClickListener() {
80 |
81 | @Override
82 | public void onClick(View v) {
83 | Log.i(TAG, "Click OpenSL ES Play Btn");
84 | // OpenSL EL初始化播放器
85 | openSLPlayerController = new SoundTrackController();
86 | openSLPlayerController.setAudioDataSource(playFilePath, 0.2f);
87 | // OpenSL EL进行播放
88 | openSLPlayerController.play();
89 | }
90 | };
91 |
92 | OnClickListener openSLESStopBtnListener = new OnClickListener() {
93 |
94 | @Override
95 | public void onClick(View v) {
96 | Log.i(TAG, "Click OpenSL ES Stop Btn");
97 | if (null != openSLPlayerController) {
98 | openSLPlayerController.stop();
99 | openSLPlayerController = null;
100 | }
101 | }
102 | };
103 |
104 | private Handler handler = new Handler() {
105 | @Override
106 | public void handleMessage(Message msg) {
107 | // 计算当前时间
108 | int _time = Math.max(msg.arg1, 0) / 1000;
109 | int total_time = Math.max(msg.arg2, 0) / 1000;
110 | float ratio = (float) _time / (float) total_time;
111 | Log.i(TAG, "Play Progress : " + ratio);
112 | }
113 | };
114 | }
115 |
--------------------------------------------------------------------------------
/src/com/phuket/tour/audioplayer/audiotrack/Mp3Decoder.java:
--------------------------------------------------------------------------------
1 | package com.phuket.tour.audioplayer.audiotrack;
2 |
3 | public interface Mp3Decoder {
4 |
5 | public void init(String accompanyPath, float packetBufferTimePercent);
6 |
7 | public void destory();
8 |
9 | public int readSamples(short[] samples, int[] slientSizeArr);
10 |
11 | public int getMusicMetaByPath(String musicPath, int[] metaArray);
12 | }
13 |
--------------------------------------------------------------------------------
/src/com/phuket/tour/audioplayer/audiotrack/MusicDecoder.java:
--------------------------------------------------------------------------------
1 | package com.phuket.tour.audioplayer.audiotrack;
2 |
3 | public class MusicDecoder implements Mp3Decoder {
4 |
5 | @Override
6 | public void init(String accompanyPath, float packetBufferTimePercent) {
7 | openFile(accompanyPath, packetBufferTimePercent);
8 | }
9 |
10 | @Override
11 | public void destory() {
12 | closeFile();
13 | }
14 |
15 | @Override
16 | public int readSamples(short[] samples, int[] slientSizeArr) {
17 | return readSamples(samples, samples.length, slientSizeArr);
18 | }
19 |
20 | @Override
21 | public int getMusicMetaByPath(String accompanyPath, int[] metaArray) {
22 | return getMusicMeta(accompanyPath, metaArray);
23 | }
24 |
25 | /** 第一步进行获取伴奏文件的meta信息,一个是采样率一个是比特率 **/
26 | private native int getMusicMeta(String musicPath, int[] metaArray);
27 | /** 最开始init的时候进行打开伴奏文件 **/
28 | private native int openFile(String accompanyPath, float packetBufferTimePercent);
29 | /** 打开文件之后进行读取samples处理 **/
30 | private native int readSamples(short[] samples, int size, int[] slientSizeArr);
31 | /** 最终当歌曲结束的时候 关闭文件 **/
32 | private native void closeFile();
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/src/com/phuket/tour/audioplayer/audiotrack/NativeMp3PlayerController.java:
--------------------------------------------------------------------------------
1 | package com.phuket.tour.audioplayer.audiotrack;
2 |
3 | import java.util.Timer;
4 | import java.util.TimerTask;
5 |
6 | import android.media.AudioManager;
7 | import android.os.Handler;
8 |
9 | public class NativeMp3PlayerController {
10 |
11 | public static final int UPDATE_PLAY_VOICE_PROGRESS = 730;
12 |
13 | public NativeMp3Player mediaPlayer;
14 |
15 | private boolean isPlaying = false;
16 |
17 | private Timer mTimer;
18 | private TimerTask myTimerTask = null;
19 | private Handler mHander;
20 |
21 | public int getCurrentTimeMills() {
22 | return mediaPlayer.getCurrentTimeMills();
23 | }
24 |
25 | public NativeMp3PlayerController() {
26 | try {
27 | if (mediaPlayer == null) {
28 | mediaPlayer = new NativeMp3Player();
29 | mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
30 | }
31 | } catch (Exception e) {
32 | }
33 | }
34 |
35 | public int getPlayerCurrentTime() {
36 | try {
37 | return mediaPlayer.getCurrentTimeMills();
38 | } catch (Exception e) {
39 | e.printStackTrace();
40 | }
41 | return 0;
42 | }
43 |
44 | public int getPlayerDuration() {
45 | try {
46 | if (null != mediaPlayer) {
47 | return mediaPlayer.getDuration();
48 | }
49 | } catch (Exception e) {
50 | e.printStackTrace();
51 | }
52 | return 0;
53 | }
54 |
55 | // *****************************************************
56 |
57 | public boolean setAudioDataSource(String path) {
58 | boolean result = mediaPlayer.setDataSource(path);
59 | if (result) {
60 | mediaPlayer.prepare();
61 | }
62 | return result;
63 | }
64 |
65 | public void start() {
66 | timerStop();
67 | isPlaying = true;
68 | // timelabelProgress.sendEmptyMessage(0);
69 | timerStart();
70 | try {
71 | if (mediaPlayer != null) {
72 | mediaPlayer.start();
73 | }
74 | } catch (IllegalStateException e) {
75 | e.printStackTrace();
76 | }
77 | }
78 |
79 | public void stop() {
80 | timerStop();
81 | try {
82 | if (mediaPlayer != null) {
83 | mediaPlayer.stop();
84 | }
85 | } catch (IllegalStateException e) {
86 | e.printStackTrace();
87 | }
88 | isPlaying = false;
89 | }
90 |
91 | private void timerStop() {
92 | if (mTimer != null) {
93 | mTimer.cancel();
94 | mTimer = null;
95 | }
96 | if (myTimerTask != null) {
97 | myTimerTask.cancel();
98 | myTimerTask = null;
99 | }
100 | }
101 |
102 | private void timerStart() {
103 | if (mTimer == null) {
104 | mTimer = new Timer();
105 | myTimerTask = new MusicTimerTask();
106 | mTimer.schedule(myTimerTask, 0, 50);
107 | }
108 | }
109 |
110 | class MusicTimerTask extends TimerTask {
111 | @Override
112 | public void run() {
113 | int time = getPlayerCurrentTime();
114 | if (time != 0) {
115 | mHander.sendMessage(mHander.obtainMessage(
116 | UPDATE_PLAY_VOICE_PROGRESS, time, isPlaying ? 1 : 0));
117 | }
118 | }
119 | }
120 |
121 | public NativeMp3Player getMediaPlayer() {
122 | return mediaPlayer;
123 | }
124 |
125 | public void setHandler(Handler mTimeHandler) {
126 | this.mHander = mTimeHandler;
127 | }
128 |
129 | public int getAccompanySampleRate() {
130 | try {
131 | if (mediaPlayer != null) {
132 | return mediaPlayer.getAccompanySampleRate();
133 | }
134 | } catch (IllegalStateException e) {
135 | e.printStackTrace();
136 | }
137 | return -1;
138 | }
139 |
140 | }
--------------------------------------------------------------------------------
/src/com/phuket/tour/audioplayer/opensles/SoundTrackController.java:
--------------------------------------------------------------------------------
1 | package com.phuket.tour.audioplayer.opensles;
2 |
3 | public class SoundTrackController {
4 | public interface OnCompletionListener{
5 | public void onCompletion();
6 | };
7 | private OnCompletionListener onCompletionListener;
8 | public void setOnCompletionListener(OnCompletionListener onCompletionListener){
9 | this.onCompletionListener = onCompletionListener;
10 | }
11 | /**
12 | * 设置播放文件地址,有可能是伴唱原唱都要进行设置
13 | */
14 | public native boolean setAudioDataSource(String accompanyPath, float percent);
15 | /**
16 | * 获得伴奏的采样频率
17 | */
18 | public native int getAccompanySampleRate();
19 | /**
20 | * 播放伴奏
21 | */
22 | public native void play();
23 | /**
24 | * 获得播放伴奏的当前时间
25 | */
26 | public native int getCurrentTimeMills();
27 | /**
28 | * 停止伴奏
29 | */
30 | public native void stop();
31 | public void onCompletion(){
32 | onCompletionListener.onCompletion();
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------