11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # CharacterDance
2 | It's some interesting projects I thought of in the process of learning Android.
3 | Use it, text will become your designated video. The words are alive!!!!
4 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.4.1)
2 |
3 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
4 |
5 | # 添加头文件路径
6 | include_directories(
7 | ./src/main/cpp
8 | ./src/main/cpp/ffmpeg
9 | ./src/main/cpp/include
10 | )
11 |
12 | # 定义源码所在目录
13 | aux_source_directory(./src/main/cpp SRC)
14 | aux_source_directory(./src/main/cpp/ffmpeg SRC_FFMPEG)
15 |
16 | # 将 SRC_FFMPEG 添加到 SRC 中
17 | list(APPEND SRC ${SRC_FFMPEG})
18 |
19 | # 设置ffmpeg库所在路径的目录
20 | set(distribution_DIR ${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI})
21 |
22 | # 编译一个ffmpeg-cmd库
23 | add_library( ffmpeg-cmd # 库名称
24 | SHARED # 库类型
25 | ${SRC}) # 编译进库的源码
26 |
27 | # 添加libffmpeg.so库
28 | add_library( ffmpeg
29 | SHARED
30 | IMPORTED )
31 | # 指定libffmpeg.so库的位置
32 | set_target_properties( ffmpeg
33 | PROPERTIES IMPORTED_LOCATION
34 | ${distribution_DIR}/libffmpeg.so )
35 |
36 | # 查找日志库
37 | find_library(
38 | log-lib
39 | log )
40 |
41 | # 将其他库链接到目标库ffmpeg-cmd
42 | target_link_libraries( ffmpeg-cmd
43 | ffmpeg
44 | -landroid # native_window
45 | -ljnigraphics # bitmap
46 | -lOpenSLES # openSLES
47 | ${log-lib} )
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'com.jakewharton.butterknife'
3 |
4 | android {
5 | compileSdkVersion 28
6 | configurations.all {
7 | resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.2'
8 | }
9 | defaultConfig {
10 | applicationId "com.liu.kinton.CharacterDance"
11 | minSdkVersion 24
12 | targetSdkVersion 28
13 | versionCode 1
14 | versionName "1.0"
15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
16 | externalNativeBuild {
17 | cmake {
18 | cppFlags ""
19 | }
20 | }
21 | }
22 | buildTypes {
23 | release {
24 | minifyEnabled false
25 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
26 | }
27 | }
28 | externalNativeBuild {
29 | cmake {
30 | }
31 | }
32 | }
33 |
34 | dependencies {
35 | implementation fileTree(include: ['*.jar'], dir: 'libs')
36 | testImplementation 'junit:junit:4.12'
37 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
38 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
39 | implementation 'com.github.tbruyelle:rxpermissions:0.10.2'
40 | implementation 'com.jakewharton:butterknife:9.0.0-rc1'
41 | annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc1'
42 | implementation 'com.android.support:appcompat-v7:28.0.0'
43 | implementation 'org.jcodec:jcodec:0.2.3'
44 | implementation 'org.jcodec:jcodec-android:0.2.3'
45 | implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
46 | implementation 'io.reactivex.rxjava2:rxjava:2.x.x'
47 | implementation 'com.android.support.constraint:constraint-layout:2.0.0-alpha3'
48 | implementation 'com.android.support:recyclerview-v7:28.0.0'
49 | }
50 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/liu/kinton/CharacterDance/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.liu.kinton.CharacterDance;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.liu.kinton.ffmpegdemo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/cpp/android_log.h:
--------------------------------------------------------------------------------
1 | //#include
2 | //#define LOGE(format, ...) __android_log_print(ANDROID_LOG_ERROR, "ffmpeg_vdtest", format, ##__VA_ARGS__)
3 | //#define LOGI(format, ...) __android_log_print(ANDROID_LOG_INFO, "ffmpeg_vdtest", format, ##__VA_ARGS__)
4 | #include
5 | static int use_log_report = 0;
6 |
7 |
8 | #define FF_LOG_TAG "FFmpeg_EpMedia"
9 |
10 |
11 | #define FF_LOG_UNKNOWN ANDROID_LOG_UNKNOWN
12 | #define FF_LOG_DEFAULT ANDROID_LOG_DEFAULT
13 |
14 |
15 | #define FF_LOG_VERBOSE ANDROID_LOG_VERBOSE
16 | #define FF_LOG_DEBUG ANDROID_LOG_DEBUG
17 | #define FF_LOG_INFO ANDROID_LOG_INFO
18 | #define FF_LOG_WARN ANDROID_LOG_WARN
19 | #define FF_LOG_ERROR ANDROID_LOG_ERROR
20 | #define FF_LOG_FATAL ANDROID_LOG_FATAL
21 | #define FF_LOG_SILENT ANDROID_LOG_SILENT
22 |
23 |
24 | #define VLOG(level, TAG, ...) ((void)__android_log_vprint(level, TAG, __VA_ARGS__))
25 | #define VLOGV(...) VLOG(FF_LOG_VERBOSE, FF_LOG_TAG, __VA_ARGS__)
26 | #define VLOGD(...) VLOG(FF_LOG_DEBUG, FF_LOG_TAG, __VA_ARGS__)
27 | #define VLOGI(...) VLOG(FF_LOG_INFO, FF_LOG_TAG, __VA_ARGS__)
28 | #define VLOGW(...) VLOG(FF_LOG_WARN, FF_LOG_TAG, __VA_ARGS__)
29 | #define VLOGE(...) VLOG(FF_LOG_ERROR, FF_LOG_TAG, __VA_ARGS__)
30 |
31 |
32 | #define ALOG(level, TAG, ...) ((void)__android_log_print(level, TAG, __VA_ARGS__))
33 | #define ALOGV(...) ALOG(FF_LOG_VERBOSE, FF_LOG_TAG, __VA_ARGS__)
34 | #define ALOGD(...) ALOG(FF_LOG_DEBUG, FF_LOG_TAG, __VA_ARGS__)
35 | #define ALOGI(...) ALOG(FF_LOG_INFO, FF_LOG_TAG, __VA_ARGS__)
36 | #define ALOGW(...) ALOG(FF_LOG_WARN, FF_LOG_TAG, __VA_ARGS__)
37 | #define ALOGE(...) ALOG(FF_LOG_ERROR, FF_LOG_TAG, __VA_ARGS__)
38 |
39 | #define LOGE(format, ...) __android_log_print(ANDROID_LOG_ERROR, FF_LOG_TAG, format, ##__VA_ARGS__)
40 | #define LOGI(format, ...) __android_log_print(ANDROID_LOG_INFO, FF_LOG_TAG, format, ##__VA_ARGS__)
41 |
42 |
43 | /*belown printf info*/
44 | static void ffp_log_callback_brief(void *ptr, int level, const char *fmt, va_list vl)
45 | {
46 | int ffplv = FF_LOG_VERBOSE;
47 | if (level <= AV_LOG_ERROR)
48 | ffplv = FF_LOG_ERROR;
49 | else if (level <= AV_LOG_WARNING)
50 | ffplv = FF_LOG_WARN;
51 | else if (level <= AV_LOG_INFO)
52 | ffplv = FF_LOG_INFO;
53 | else if (level <= AV_LOG_VERBOSE)
54 | ffplv = FF_LOG_VERBOSE;
55 | else
56 | ffplv = FF_LOG_DEBUG;
57 |
58 |
59 | if (level <= AV_LOG_INFO)
60 | VLOG(ffplv, FF_LOG_TAG, fmt, vl);
61 | }
62 |
63 |
64 | static void ffp_log_callback_report(void *ptr, int level, const char *fmt, va_list vl)
65 | {
66 | int ffplv = FF_LOG_VERBOSE;
67 | if (level <= AV_LOG_ERROR)
68 | ffplv = FF_LOG_ERROR;
69 | else if (level <= AV_LOG_WARNING)
70 | ffplv = FF_LOG_WARN;
71 | else if (level <= AV_LOG_INFO)
72 | ffplv = FF_LOG_INFO;
73 | else if (level <= AV_LOG_VERBOSE)
74 | ffplv = FF_LOG_VERBOSE;
75 | else
76 | ffplv = FF_LOG_DEBUG;
77 |
78 |
79 | va_list vl2;
80 | char line[1024];
81 | static int print_prefix = 1;
82 |
83 |
84 | va_copy(vl2, vl);
85 | // av_log_default_callback(ptr, level, fmt, vl);
86 | av_log_format_line(ptr, level, fmt, vl2, line, sizeof(line), &print_prefix);
87 | va_end(vl2);
88 |
89 |
90 | ALOG(ffplv, FF_LOG_TAG, "%s", line);
91 | }
92 |
93 |
--------------------------------------------------------------------------------
/app/src/main/cpp/ffmpeg/cmdutils_common_opts.h:
--------------------------------------------------------------------------------
1 | { "L" , OPT_EXIT, {.func_arg = show_license}, "show license" },
2 | { "h" , OPT_EXIT, {.func_arg = show_help}, "show help", "topic" },
3 | { "?" , OPT_EXIT, {.func_arg = show_help}, "show help", "topic" },
4 | { "help" , OPT_EXIT, {.func_arg = show_help}, "show help", "topic" },
5 | { "-help" , OPT_EXIT, {.func_arg = show_help}, "show help", "topic" },
6 | { "version" , OPT_EXIT, {.func_arg = show_version}, "show version" },
7 | { "buildconf" , OPT_EXIT, {.func_arg = show_buildconf}, "show build configuration" },
8 | { "formats" , OPT_EXIT, {.func_arg = show_formats }, "show available formats" },
9 | { "devices" , OPT_EXIT, {.func_arg = show_devices }, "show available devices" },
10 | { "codecs" , OPT_EXIT, {.func_arg = show_codecs }, "show available codecs" },
11 | { "decoders" , OPT_EXIT, {.func_arg = show_decoders }, "show available decoders" },
12 | { "encoders" , OPT_EXIT, {.func_arg = show_encoders }, "show available encoders" },
13 | { "bsfs" , OPT_EXIT, {.func_arg = show_bsfs }, "show available bit stream filters" },
14 | { "protocols" , OPT_EXIT, {.func_arg = show_protocols}, "show available protocols" },
15 | { "filters" , OPT_EXIT, {.func_arg = show_filters }, "show available filters" },
16 | { "pix_fmts" , OPT_EXIT, {.func_arg = show_pix_fmts }, "show available pixel formats" },
17 | { "layouts" , OPT_EXIT, {.func_arg = show_layouts }, "show standard channel layouts" },
18 | { "sample_fmts", OPT_EXIT, {.func_arg = show_sample_fmts }, "show available audio sample formats" },
19 | { "colors" , OPT_EXIT, {.func_arg = show_colors }, "show available color names" },
20 | { "loglevel" , HAS_ARG, {.func_arg = opt_loglevel}, "set logging level", "loglevel" },
21 | { "v", HAS_ARG, {.func_arg = opt_loglevel}, "set logging level", "loglevel" },
22 | { "report" , 0, {(void*)opt_report}, "generate a report" },
23 | { "max_alloc" , HAS_ARG, {.func_arg = opt_max_alloc}, "set maximum size of a single allocated block", "bytes" },
24 | { "cpuflags" , HAS_ARG | OPT_EXPERT, { .func_arg = opt_cpuflags }, "force specific cpu flags", "flags" },
25 | { "hide_banner", OPT_BOOL | OPT_EXPERT, {&hide_banner}, "do not show program banner", "hide_banner" },
26 | #if CONFIG_OPENCL
27 | { "opencl_bench", OPT_EXIT, {.func_arg = opt_opencl_bench}, "run benchmark on all OpenCL devices and show results" },
28 | { "opencl_options", HAS_ARG, {.func_arg = opt_opencl}, "set OpenCL environment options" },
29 | #endif
30 | #if CONFIG_AVDEVICE
31 | { "sources" , OPT_EXIT | HAS_ARG, { .func_arg = show_sources },
32 | "list sources of the input device", "device" },
33 | { "sinks" , OPT_EXIT | HAS_ARG, { .func_arg = show_sinks },
34 | "list sinks of the output device", "device" },
35 | #endif
36 |
--------------------------------------------------------------------------------
/app/src/main/cpp/ffmpeg_cmd.c:
--------------------------------------------------------------------------------
1 | #include "ffmpeg_cmd.h"
2 |
3 | #include
4 | #include
5 | #include "ffmpeg_thread.h"
6 | #include "android_log.h"
7 | #include "cmdutils.h"
8 |
9 | static JavaVM *jvm = NULL;
10 | //java虚拟机
11 | static jclass m_clazz = NULL;//当前类(面向java)
12 |
13 | /**
14 | * 回调执行Java方法
15 | * 参看 Jni反射+Java反射
16 | */
17 | void callJavaMethod(JNIEnv *env, jclass clazz,int ret) {
18 | if (clazz == NULL) {
19 | LOGE("---------------clazz isNULL---------------");
20 | return;
21 | }
22 | //获取方法ID (I)V指的是方法签名 通过javap -s -public FFmpegCmd 命令生成
23 | jmethodID methodID = (*env)->GetStaticMethodID(env, clazz, "onExecuted", "(I)V");
24 | if (methodID == NULL) {
25 | LOGE("---------------methodID isNULL---------------");
26 | return;
27 | }
28 | //调用该java方法
29 | (*env)->CallStaticVoidMethod(env, clazz, methodID,ret);
30 | }
31 | void callJavaMethodProgress(JNIEnv *env, jclass clazz,float ret) {
32 | if (clazz == NULL) {
33 | LOGE("---------------clazz isNULL---------------");
34 | return;
35 | }
36 | //获取方法ID (I)V指的是方法签名 通过javap -s -public FFmpegCmd 命令生成
37 | jmethodID methodID = (*env)->GetStaticMethodID(env, clazz, "onProgress", "(F)V");
38 | if (methodID == NULL) {
39 | LOGE("---------------methodID isNULL---------------");
40 | return;
41 | }
42 | //调用该java方法
43 | (*env)->CallStaticVoidMethod(env, clazz, methodID,ret);
44 | }
45 |
46 | /**
47 | * c语言-线程回调
48 | */
49 | static void ffmpeg_callback(int ret) {
50 | JNIEnv *env;
51 | //附加到当前线程从JVM中取出JNIEnv, C/C++从子线程中直接回到Java里的方法时 必须经过这个步骤
52 | (*jvm)->AttachCurrentThread(jvm, (void **) &env, NULL);
53 | callJavaMethod(env, m_clazz,ret);
54 |
55 | //完毕-脱离当前线程
56 | (*jvm)->DetachCurrentThread(jvm);
57 | }
58 |
59 | void ffmpeg_progress(float progress) {
60 | JNIEnv *env;
61 | (*jvm)->AttachCurrentThread(jvm, (void **) &env, NULL);
62 | callJavaMethodProgress(env, m_clazz,progress);
63 | (*jvm)->DetachCurrentThread(jvm);
64 | }
65 |
66 | JNIEXPORT jint JNICALL
67 | Java_com_github_xch168_ffmpeg_1cmd_FFmpegCmd_exec(JNIEnv *env, jclass clazz, jint cmdnum, jobjectArray cmdline) {
68 | (*env)->GetJavaVM(env, &jvm);
69 | m_clazz = (*env)->NewGlobalRef(env, clazz);
70 | //---------------------------------C语言 反射Java 相关----------------------------------------
71 | //---------------------------------java 数组转C语言数组----------------------------------------
72 | int i = 0;//满足NDK所需的C99标准
73 | char **argv = NULL;//命令集 二维指针
74 | jstring *strr = NULL;
75 |
76 | if (cmdline != NULL) {
77 | argv = (char **) malloc(sizeof(char *) * cmdnum);
78 | strr = (jstring *) malloc(sizeof(jstring) * cmdnum);
79 |
80 | for (i = 0; i < cmdnum; ++i) {//转换
81 | strr[i] = (jstring)(*env)->GetObjectArrayElement(env, cmdline, i);
82 | argv[i] = (char *) (*env)->GetStringUTFChars(env, strr[i], 0);
83 | }
84 |
85 | }
86 | //---------------------------------java 数组转C语言数组----------------------------------------
87 | //---------------------------------执行FFmpeg命令相关----------------------------------------
88 | //新建线程 执行ffmpeg 命令
89 | ffmpeg_thread_run_cmd(cmdnum, argv);
90 | //注册ffmpeg命令执行完毕时的回调
91 | ffmpeg_thread_callback(ffmpeg_callback);
92 |
93 | free(strr);
94 | return 0;
95 | }
96 |
97 | JNIEXPORT void JNICALL
98 | Java_com_github_xch168_ffmpeg_1cmd_FFmpegCmd_exit(JNIEnv *env, jclass type) {
99 | (*env)->GetJavaVM(env, &jvm);
100 | m_clazz = (*env)->NewGlobalRef(env, type);
101 | ffmpeg_thread_cancel();
102 |
103 | }
--------------------------------------------------------------------------------
/app/src/main/cpp/ffmpeg_cmd.h:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | #ifndef _Included_FFmpeg_Cmd
4 | #define _Included_FFmpeg_Cmd
5 | #ifdef __cplusplus
6 | extern "C" {
7 | #endif
8 |
9 | JNIEXPORT jint JNICALL Java_com_github_xch168_ffmpeg_1cmd_FFmpegCmd_exec(JNIEnv *, jclass, jint, jobjectArray);
10 |
11 | JNIEXPORT void JNICALL Java_com_github_xch168_ffmpeg_1cmd_FFmpegCmd_exit(JNIEnv *, jclass);
12 |
13 | #ifdef __cplusplus
14 | }
15 | #endif
16 | #endif
17 |
18 | void ffmpeg_progress(float progress);
--------------------------------------------------------------------------------
/app/src/main/cpp/ffmpeg_thread.c:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Kinton on 2019/6/18.
3 | //
4 |
5 | #include "libavcodec/avcodec.h"
6 | #include "ffmpeg_thread.h"
7 | #include "android_log.h"
8 |
9 | pthread_t ntid;
10 | char **argvs = NULL;
11 | int num=0;
12 |
13 | void *thread(void *arg) { //执行
14 | int result = ffmpeg_exec(num, argvs);
15 | ffmpeg_thread_exit(result);
16 | return ((void *)0);
17 | }
18 | /**
19 | * 新建子线程执行ffmpeg命令
20 | */
21 | int ffmpeg_thread_run_cmd(int cmdnum,char **argv) {
22 | num=cmdnum;
23 | argvs=argv;
24 |
25 | int temp =pthread_create(&ntid,NULL,thread,NULL);
26 | if(temp!=0) {
27 | LOGE("can't create thread: %s ",strerror(temp));
28 | return 1;
29 | }
30 | LOGI("create thread succes: %s ",strerror(temp));
31 | return 0;
32 | }
33 |
34 | static void (*ffmpeg_callback)(int ret);
35 |
36 | /**
37 | * 注册线程回调
38 | */
39 | void ffmpeg_thread_callback(void (*cb)(int ret)) {
40 | ffmpeg_callback = cb;
41 | }
42 |
43 | /**
44 | * 退出线程
45 | */
46 | void ffmpeg_thread_exit(int ret) {
47 | if (ffmpeg_callback) {
48 | ffmpeg_callback(ret);
49 | }
50 | pthread_exit("ffmpeg_thread_exit");
51 | }
52 |
53 | /**
54 | * 取消线程
55 | */
56 | void ffmpeg_thread_cancel() {
57 | void *ret=NULL;
58 | pthread_join(ntid, &ret);
59 | }
60 |
61 |
--------------------------------------------------------------------------------
/app/src/main/cpp/ffmpeg_thread.h:
--------------------------------------------------------------------------------
1 | #include "libavcodec/avcodec.h"
2 | #include "libavformat/avformat.h"
3 | #include "libswscale/swscale.h"
4 | #include "ffmpeg.h"
5 | #include
6 | #include
7 |
8 | int ffmpeg_thread_run_cmd(int cmdnum,char **argv);
9 |
10 | void ffmpeg_thread_exit(int ret);
11 |
12 | void ffmpeg_thread_callback(void (*cb)(int ret));
13 |
14 | void ffmpeg_thread_cancel();
--------------------------------------------------------------------------------
/app/src/main/cpp/include/compat/va_copy.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MSVC Compatible va_copy macro
3 | * Copyright (c) 2012 Derek Buitenhuis
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 COMPAT_VA_COPY_H
23 | #define COMPAT_VA_COPY_H
24 |
25 | #include
26 |
27 | #if !defined(va_copy) && defined(_MSC_VER)
28 | #define va_copy(dst, src) ((dst) = (src))
29 | #endif
30 | #if !defined(va_copy) && defined(__GNUC__) && __GNUC__ < 3
31 | #define va_copy(dst, src) __va_copy(dst, src)
32 | #endif
33 |
34 | #endif /* COMPAT_VA_COPY_H */
35 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavcodec/arm/mathops.h:
--------------------------------------------------------------------------------
1 | /*
2 | * simple math operations
3 | * Copyright (c) 2006 Michael Niedermayer et al
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 AVCODEC_ARM_MATHOPS_H
23 | #define AVCODEC_ARM_MATHOPS_H
24 |
25 | #include
26 | #include "ffmpeg/config.h"
27 | #include "libavutil/common.h"
28 |
29 | #if HAVE_INLINE_ASM
30 |
31 | #if HAVE_ARMV6_INLINE
32 | #define MULH MULH
33 | static inline av_const int MULH(int a, int b)
34 | {
35 | int r;
36 | __asm__ ("smmul %0, %1, %2" : "=r"(r) : "r"(a), "r"(b));
37 | return r;
38 | }
39 |
40 | #define FASTDIV FASTDIV
41 | static av_always_inline av_const int FASTDIV(int a, int b)
42 | {
43 | int r;
44 | __asm__ ("cmp %2, #2 \n\t"
45 | "ldr %0, [%3, %2, lsl #2] \n\t"
46 | "ite le \n\t"
47 | "lsrle %0, %1, #1 \n\t"
48 | "smmulgt %0, %0, %1 \n\t"
49 | : "=&r"(r) : "r"(a), "r"(b), "r"(ff_inverse) : "cc");
50 | return r;
51 | }
52 |
53 | #else /* HAVE_ARMV6_INLINE */
54 |
55 | #define FASTDIV FASTDIV
56 | static av_always_inline av_const int FASTDIV(int a, int b)
57 | {
58 | int r, t;
59 | __asm__ ("umull %1, %0, %2, %3"
60 | : "=&r"(r), "=&r"(t) : "r"(a), "r"(ff_inverse[b]));
61 | return r;
62 | }
63 | #endif
64 |
65 | #define MLS64(d, a, b) MAC64(d, -(a), b)
66 |
67 | #if HAVE_ARMV5TE_INLINE
68 |
69 | /* signed 16x16 -> 32 multiply add accumulate */
70 | # define MAC16(rt, ra, rb) \
71 | __asm__ ("smlabb %0, %1, %2, %0" : "+r"(rt) : "r"(ra), "r"(rb));
72 |
73 | /* signed 16x16 -> 32 multiply */
74 | # define MUL16 MUL16
75 | static inline av_const int MUL16(int ra, int rb)
76 | {
77 | int rt;
78 | __asm__ ("smulbb %0, %1, %2" : "=r"(rt) : "r"(ra), "r"(rb));
79 | return rt;
80 | }
81 |
82 | #endif
83 |
84 | #define mid_pred mid_pred
85 | static inline av_const int mid_pred(int a, int b, int c)
86 | {
87 | int m;
88 | __asm__ (
89 | "mov %0, %2 \n\t"
90 | "cmp %1, %2 \n\t"
91 | "itt gt \n\t"
92 | "movgt %0, %1 \n\t"
93 | "movgt %1, %2 \n\t"
94 | "cmp %1, %3 \n\t"
95 | "it le \n\t"
96 | "movle %1, %3 \n\t"
97 | "cmp %0, %1 \n\t"
98 | "it gt \n\t"
99 | "movgt %0, %1 \n\t"
100 | : "=&r"(m), "+r"(a)
101 | : "r"(b), "r"(c)
102 | : "cc");
103 | return m;
104 | }
105 |
106 | #endif /* HAVE_INLINE_ASM */
107 |
108 | #endif /* AVCODEC_ARM_MATHOPS_H */
109 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavcodec/avdct.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_AVDCT_H
20 | #define AVCODEC_AVDCT_H
21 |
22 | #include "libavutil/opt.h"
23 |
24 | /**
25 | * AVDCT context.
26 | * @note function pointers can be NULL if the specific features have been
27 | * disabled at build time.
28 | */
29 | typedef struct AVDCT {
30 | const AVClass *av_class;
31 |
32 | void (*idct)(int16_t *block /* align 16 */);
33 |
34 | /**
35 | * IDCT input permutation.
36 | * Several optimized IDCTs need a permutated input (relative to the
37 | * normal order of the reference IDCT).
38 | * This permutation must be performed before the idct_put/add.
39 | * Note, normally this can be merged with the zigzag/alternate scan
40 | * An example to avoid confusion:
41 | * - (->decode coeffs -> zigzag reorder -> dequant -> reference IDCT -> ...)
42 | * - (x -> reference DCT -> reference IDCT -> x)
43 | * - (x -> reference DCT -> simple_mmx_perm = idct_permutation
44 | * -> simple_idct_mmx -> x)
45 | * - (-> decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant
46 | * -> simple_idct_mmx -> ...)
47 | */
48 | uint8_t idct_permutation[64];
49 |
50 | void (*fdct)(int16_t *block /* align 16 */);
51 |
52 |
53 | /**
54 | * DCT algorithm.
55 | * must use AVOptions to set this field.
56 | */
57 | int dct_algo;
58 |
59 | /**
60 | * IDCT algorithm.
61 | * must use AVOptions to set this field.
62 | */
63 | int idct_algo;
64 |
65 | void (*get_pixels)(int16_t *block /* align 16 */,
66 | const uint8_t *pixels /* align 8 */,
67 | ptrdiff_t line_size);
68 |
69 | int bits_per_sample;
70 | } AVDCT;
71 |
72 | /**
73 | * Allocates a AVDCT context.
74 | * This needs to be initialized with avcodec_dct_init() after optionally
75 | * configuring it with AVOptions.
76 | *
77 | * To free it use av_free()
78 | */
79 | AVDCT *avcodec_dct_alloc(void);
80 | int avcodec_dct_init(AVDCT *);
81 |
82 | const AVClass *avcodec_dct_get_class(void);
83 |
84 | #endif /* AVCODEC_AVDCT_H */
85 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 | *
103 | * @param nbits size of the input array:
104 | * (1 << nbits) for DCT-II, DCT-III and DST-I
105 | * (1 << nbits) + 1 for DCT-I
106 | * @param type the type of transform
107 | *
108 | * @note the first element of the input of DST-I is ignored
109 | */
110 | DCTContext *av_dct_init(int nbits, enum DCTTransformType type);
111 | void av_dct_calc(DCTContext *s, FFTSample *data);
112 | void av_dct_end (DCTContext *s);
113 |
114 | /**
115 | * @}
116 | */
117 |
118 | #endif /* AVCODEC_AVFFT_H */
119 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavcodec/d3d11va.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Direct3D11 HW acceleration
3 | *
4 | * copyright (c) 2009 Laurent Aimar
5 | * copyright (c) 2015 Steve Lhomme
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_D3D11VA_H
25 | #define AVCODEC_D3D11VA_H
26 |
27 | /**
28 | * @file
29 | * @ingroup lavc_codec_hwaccel_d3d11va
30 | * Public libavcodec D3D11VA header.
31 | */
32 |
33 | #if !defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0602
34 | #undef _WIN32_WINNT
35 | #define _WIN32_WINNT 0x0602
36 | #endif
37 |
38 | #include
39 | #include
40 |
41 | /**
42 | * @defgroup lavc_codec_hwaccel_d3d11va Direct3D11
43 | * @ingroup lavc_codec_hwaccel
44 | *
45 | * @{
46 | */
47 |
48 | #define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for Direct3D11 and old UVD/UVD+ ATI video cards
49 | #define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 ///< Work around for Direct3D11 and old Intel GPUs with ClearVideo interface
50 |
51 | /**
52 | * This structure is used to provides the necessary configurations and data
53 | * to the Direct3D11 FFmpeg HWAccel implementation.
54 | *
55 | * The application must make it available as AVCodecContext.hwaccel_context.
56 | *
57 | * Use av_d3d11va_alloc_context() exclusively to allocate an AVD3D11VAContext.
58 | */
59 | typedef struct AVD3D11VAContext {
60 | /**
61 | * D3D11 decoder object
62 | */
63 | ID3D11VideoDecoder *decoder;
64 |
65 | /**
66 | * D3D11 VideoContext
67 | */
68 | ID3D11VideoContext *video_context;
69 |
70 | /**
71 | * D3D11 configuration used to create the decoder
72 | */
73 | D3D11_VIDEO_DECODER_CONFIG *cfg;
74 |
75 | /**
76 | * The number of surface in the surface array
77 | */
78 | unsigned surface_count;
79 |
80 | /**
81 | * The array of Direct3D surfaces used to create the decoder
82 | */
83 | ID3D11VideoDecoderOutputView **surface;
84 |
85 | /**
86 | * A bit field configuring the workarounds needed for using the decoder
87 | */
88 | uint64_t workaround;
89 |
90 | /**
91 | * Private to the FFmpeg AVHWAccel implementation
92 | */
93 | unsigned report_id;
94 |
95 | /**
96 | * Mutex to access video_context
97 | */
98 | HANDLE context_mutex;
99 | } AVD3D11VAContext;
100 |
101 | /**
102 | * Allocate an AVD3D11VAContext.
103 | *
104 | * @return Newly-allocated AVD3D11VAContext or NULL on failure.
105 | */
106 | AVD3D11VAContext *av_d3d11va_alloc_context(void);
107 |
108 | /**
109 | * @}
110 | */
111 |
112 | #endif /* AVCODEC_D3D11VA_H */
113 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavcodec/dv_profile.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_DV_PROFILE_H
20 | #define AVCODEC_DV_PROFILE_H
21 |
22 | #include
23 |
24 | #include "libavutil/pixfmt.h"
25 | #include "libavutil/rational.h"
26 | #include "avcodec.h"
27 |
28 | /* minimum number of bytes to read from a DV stream in order to
29 | * determine the profile */
30 | #define DV_PROFILE_BYTES (6 * 80) /* 6 DIF blocks */
31 |
32 |
33 | /*
34 | * AVDVProfile is used to express the differences between various
35 | * DV flavors. For now it's primarily used for differentiating
36 | * 525/60 and 625/50, but the plans are to use it for various
37 | * DV specs as well (e.g. SMPTE314M vs. IEC 61834).
38 | */
39 | typedef struct AVDVProfile {
40 | int dsf; /* value of the dsf in the DV header */
41 | int video_stype; /* stype for VAUX source pack */
42 | int frame_size; /* total size of one frame in bytes */
43 | int difseg_size; /* number of DIF segments per DIF channel */
44 | int n_difchan; /* number of DIF channels per frame */
45 | AVRational time_base; /* 1/framerate */
46 | int ltc_divisor; /* FPS from the LTS standpoint */
47 | int height; /* picture height in pixels */
48 | int width; /* picture width in pixels */
49 | AVRational sar[2]; /* sample aspect ratios for 4:3 and 16:9 */
50 | enum AVPixelFormat pix_fmt; /* picture pixel format */
51 | int bpm; /* blocks per macroblock */
52 | const uint8_t *block_sizes; /* AC block sizes, in bits */
53 | int audio_stride; /* size of audio_shuffle table */
54 | int audio_min_samples[3]; /* min amount of audio samples */
55 | /* for 48kHz, 44.1kHz and 32kHz */
56 | int audio_samples_dist[5]; /* how many samples are supposed to be */
57 | /* in each frame in a 5 frames window */
58 | const uint8_t (*audio_shuffle)[9]; /* PCM shuffling table */
59 | } AVDVProfile;
60 |
61 | /**
62 | * Get a DV profile for the provided compressed frame.
63 | *
64 | * @param sys the profile used for the previous frame, may be NULL
65 | * @param frame the compressed data buffer
66 | * @param buf_size size of the buffer in bytes
67 | * @return the DV profile for the supplied data or NULL on failure
68 | */
69 | const AVDVProfile *av_dv_frame_profile(const AVDVProfile *sys,
70 | const uint8_t *frame, unsigned buf_size);
71 |
72 | /**
73 | * Get a DV profile for the provided stream parameters.
74 | */
75 | const AVDVProfile *av_dv_codec_profile(int width, int height, enum AVPixelFormat pix_fmt);
76 |
77 | /**
78 | * Get a DV profile for the provided stream parameters.
79 | * The frame rate is used as a best-effort parameter.
80 | */
81 | const AVDVProfile *av_dv_codec_profile2(int width, int height, enum AVPixelFormat pix_fmt, AVRational frame_rate);
82 |
83 | #endif /* AVCODEC_DV_PROFILE_H */
84 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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_DXVA2_H
24 | #define AVCODEC_DXVA2_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 < 0x0602
33 | #undef _WIN32_WINNT
34 | #define _WIN32_WINNT 0x0602
35 | #endif
36 |
37 | #include
38 | #include
39 | #include
40 |
41 | /**
42 | * @defgroup lavc_codec_hwaccel_dxva2 DXVA2
43 | * @ingroup lavc_codec_hwaccel
44 | *
45 | * @{
46 | */
47 |
48 | #define FF_DXVA2_WORKAROUND_SCALING_LIST_ZIGZAG 1 ///< Work around for DXVA2 and old UVD/UVD+ ATI video cards
49 | #define FF_DXVA2_WORKAROUND_INTEL_CLEARVIDEO 2 ///< Work around for DXVA2 and old Intel GPUs with ClearVideo interface
50 |
51 | /**
52 | * This structure is used to provides the necessary configurations and data
53 | * to the DXVA2 FFmpeg HWAccel implementation.
54 | *
55 | * The application must make it available as AVCodecContext.hwaccel_context.
56 | */
57 | struct dxva_context {
58 | /**
59 | * DXVA2 decoder object
60 | */
61 | IDirectXVideoDecoder *decoder;
62 |
63 | /**
64 | * DXVA2 configuration used to create the decoder
65 | */
66 | const DXVA2_ConfigPictureDecode *cfg;
67 |
68 | /**
69 | * The number of surface in the surface array
70 | */
71 | unsigned surface_count;
72 |
73 | /**
74 | * The array of Direct3D surfaces used to create the decoder
75 | */
76 | LPDIRECT3DSURFACE9 *surface;
77 |
78 | /**
79 | * A bit field configuring the workarounds needed for using the decoder
80 | */
81 | uint64_t workaround;
82 |
83 | /**
84 | * Private to the FFmpeg AVHWAccel implementation
85 | */
86 | unsigned report_id;
87 | };
88 |
89 | /**
90 | * @}
91 | */
92 |
93 | #endif /* AVCODEC_DXVA2_H */
94 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavcodec/vorbis_parser.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 | /**
21 | * @file
22 | * A public API for Vorbis parsing
23 | *
24 | * Determines the duration for each packet.
25 | */
26 |
27 | #ifndef AVCODEC_VORBIS_PARSER_H
28 | #define AVCODEC_VORBIS_PARSER_H
29 |
30 | #include
31 |
32 | typedef struct AVVorbisParseContext AVVorbisParseContext;
33 |
34 | /**
35 | * Allocate and initialize the Vorbis parser using headers in the extradata.
36 | *
37 | * @param avctx codec context
38 | * @param s Vorbis parser context
39 | */
40 | AVVorbisParseContext *av_vorbis_parse_init(const uint8_t *extradata,
41 | int extradata_size);
42 |
43 | /**
44 | * Free the parser and everything associated with it.
45 | */
46 | void av_vorbis_parse_free(AVVorbisParseContext **s);
47 |
48 | #define VORBIS_FLAG_HEADER 0x00000001
49 | #define VORBIS_FLAG_COMMENT 0x00000002
50 | #define VORBIS_FLAG_SETUP 0x00000004
51 |
52 | /**
53 | * Get the duration for a Vorbis packet.
54 | *
55 | * If @p flags is @c NULL,
56 | * special frames are considered invalid.
57 | *
58 | * @param s Vorbis parser context
59 | * @param buf buffer containing a Vorbis frame
60 | * @param buf_size size of the buffer
61 | * @param flags flags for special frames
62 | */
63 | int av_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf,
64 | int buf_size, int *flags);
65 |
66 | /**
67 | * Get the duration for a Vorbis packet.
68 | *
69 | * @param s Vorbis parser context
70 | * @param buf buffer containing a Vorbis frame
71 | * @param buf_size size of the buffer
72 | */
73 | int av_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf,
74 | int buf_size);
75 |
76 | void av_vorbis_parse_reset(AVVorbisParseContext *s);
77 |
78 | #endif /* AVCODEC_VORBIS_PARSER_H */
79 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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/version.h"
29 |
30 | #define LIBAVDEVICE_VERSION_MAJOR 57
31 | #define LIBAVDEVICE_VERSION_MINOR 0
32 | #define LIBAVDEVICE_VERSION_MICRO 101
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 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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/version.h"
31 |
32 | #define LIBAVFILTER_VERSION_MAJOR 6
33 | #define LIBAVFILTER_VERSION_MINOR 31
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_OLD_FILTER_OPTS
53 | #define FF_API_OLD_FILTER_OPTS (LIBAVFILTER_VERSION_MAJOR < 7)
54 | #endif
55 | #ifndef FF_API_OLD_FILTER_OPTS_ERROR
56 | #define FF_API_OLD_FILTER_OPTS_ERROR (LIBAVFILTER_VERSION_MAJOR < 7)
57 | #endif
58 | #ifndef FF_API_AVFILTER_OPEN
59 | #define FF_API_AVFILTER_OPEN (LIBAVFILTER_VERSION_MAJOR < 7)
60 | #endif
61 | #ifndef FF_API_AVFILTER_INIT_FILTER
62 | #define FF_API_AVFILTER_INIT_FILTER (LIBAVFILTER_VERSION_MAJOR < 7)
63 | #endif
64 | #ifndef FF_API_OLD_FILTER_REGISTER
65 | #define FF_API_OLD_FILTER_REGISTER (LIBAVFILTER_VERSION_MAJOR < 7)
66 | #endif
67 | #ifndef FF_API_NOCONST_GET_NAME
68 | #define FF_API_NOCONST_GET_NAME (LIBAVFILTER_VERSION_MAJOR < 7)
69 | #endif
70 |
71 | #endif /* AVFILTER_VERSION_H */
72 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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/version.h"
31 |
32 | #define LIBAVFORMAT_VERSION_MAJOR 57
33 | #define LIBAVFORMAT_VERSION_MINOR 25
34 | #define LIBAVFORMAT_VERSION_MICRO 100
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 | * @note, when bumping the major version it is recommended to manually
52 | * disable each FF_API_* in its own commit instead of disabling them all
53 | * at once through the bump. This improves the git bisect-ability of the change.
54 | *
55 | */
56 | #ifndef FF_API_LAVF_BITEXACT
57 | #define FF_API_LAVF_BITEXACT (LIBAVFORMAT_VERSION_MAJOR < 58)
58 | #endif
59 | #ifndef FF_API_LAVF_FRAC
60 | #define FF_API_LAVF_FRAC (LIBAVFORMAT_VERSION_MAJOR < 58)
61 | #endif
62 | #ifndef FF_API_LAVF_CODEC_TB
63 | #define FF_API_LAVF_CODEC_TB (LIBAVFORMAT_VERSION_MAJOR < 58)
64 | #endif
65 | #ifndef FF_API_URL_FEOF
66 | #define FF_API_URL_FEOF (LIBAVFORMAT_VERSION_MAJOR < 58)
67 | #endif
68 | #ifndef FF_API_LAVF_FMT_RAWPICTURE
69 | #define FF_API_LAVF_FMT_RAWPICTURE (LIBAVFORMAT_VERSION_MAJOR < 58)
70 | #endif
71 | #ifndef FF_API_COMPUTE_PKT_FIELDS2
72 | #define FF_API_COMPUTE_PKT_FIELDS2 (LIBAVFORMAT_VERSION_MAJOR < 58)
73 | #endif
74 | #ifndef FF_API_OLD_OPEN_CALLBACKS
75 | #define FF_API_OLD_OPEN_CALLBACKS (LIBAVFORMAT_VERSION_MAJOR < 58)
76 | #endif
77 |
78 | #ifndef FF_API_R_FRAME_RATE
79 | #define FF_API_R_FRAME_RATE 1
80 | #endif
81 | #endif /* AVFORMAT_VERSION_H */
82 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavresample/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 AVRESAMPLE_VERSION_H
20 | #define AVRESAMPLE_VERSION_H
21 |
22 | /**
23 | * @file
24 | * @ingroup lavr
25 | * Libavresample version macros.
26 | */
27 |
28 | #include "libavutil/version.h"
29 |
30 | #define LIBAVRESAMPLE_VERSION_MAJOR 3
31 | #define LIBAVRESAMPLE_VERSION_MINOR 1
32 | #define LIBAVRESAMPLE_VERSION_MICRO 0
33 |
34 | #define LIBAVRESAMPLE_VERSION_INT AV_VERSION_INT(LIBAVRESAMPLE_VERSION_MAJOR, \
35 | LIBAVRESAMPLE_VERSION_MINOR, \
36 | LIBAVRESAMPLE_VERSION_MICRO)
37 | #define LIBAVRESAMPLE_VERSION AV_VERSION(LIBAVRESAMPLE_VERSION_MAJOR, \
38 | LIBAVRESAMPLE_VERSION_MINOR, \
39 | LIBAVRESAMPLE_VERSION_MICRO)
40 | #define LIBAVRESAMPLE_BUILD LIBAVRESAMPLE_VERSION_INT
41 |
42 | #define LIBAVRESAMPLE_IDENT "Lavr" AV_STRINGIFY(LIBAVRESAMPLE_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 /* AVRESAMPLE_VERSION_H */
51 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 | * @file
29 | * Public header for libavutil Adler32 hasher
30 | *
31 | * @defgroup lavu_adler32 Adler32
32 | * @ingroup lavu_crypto
33 | * @{
34 | */
35 |
36 | /**
37 | * Calculate the Adler32 checksum of a buffer.
38 | *
39 | * Passing the return value to a subsequent av_adler32_update() call
40 | * allows the checksum of multiple buffers to be calculated as though
41 | * they were concatenated.
42 | *
43 | * @param adler initial checksum value
44 | * @param buf pointer to input buffer
45 | * @param len size of input buffer
46 | * @return updated checksum
47 | */
48 | unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf,
49 | unsigned int len) av_pure;
50 |
51 | /**
52 | * @}
53 | */
54 |
55 | #endif /* AVUTIL_ADLER32_H */
56 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavutil/aes_ctr.h:
--------------------------------------------------------------------------------
1 | /*
2 | * AES-CTR cipher
3 | * Copyright (c) 2015 Eran Kornblau
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_AES_CTR_H
23 | #define AVUTIL_AES_CTR_H
24 |
25 | #include
26 |
27 | #include "attributes.h"
28 | #include "version.h"
29 |
30 | #define AES_CTR_KEY_SIZE (16)
31 | #define AES_CTR_IV_SIZE (8)
32 |
33 | struct AVAESCTR;
34 |
35 | /**
36 | * Allocate an AVAESCTR context.
37 | */
38 | struct AVAESCTR *av_aes_ctr_alloc(void);
39 |
40 | /**
41 | * Initialize an AVAESCTR context.
42 | * @param key encryption key, must have a length of AES_CTR_KEY_SIZE
43 | */
44 | int av_aes_ctr_init(struct AVAESCTR *a, const uint8_t *key);
45 |
46 | /**
47 | * Release an AVAESCTR context.
48 | */
49 | void av_aes_ctr_free(struct AVAESCTR *a);
50 |
51 | /**
52 | * Process a buffer using a previously initialized context.
53 | * @param dst destination array, can be equal to src
54 | * @param src source array, can be equal to dst
55 | * @param size the size of src and dst
56 | */
57 | void av_aes_ctr_crypt(struct AVAESCTR *a, uint8_t *dst, const uint8_t *src, int size);
58 |
59 | /**
60 | * Get the current iv
61 | */
62 | const uint8_t* av_aes_ctr_get_iv(struct AVAESCTR *a);
63 |
64 | /**
65 | * Generate a random iv
66 | */
67 | void av_aes_ctr_set_random_iv(struct AVAESCTR *a);
68 |
69 | /**
70 | * Forcefully change the iv
71 | */
72 | void av_aes_ctr_set_iv(struct AVAESCTR *a, const uint8_t* iv);
73 |
74 | /**
75 | * Increment the top 64 bit of the iv (performed after each frame)
76 | */
77 | void av_aes_ctr_increment_iv(struct AVAESCTR *a);
78 |
79 | /**
80 | * @}
81 | */
82 |
83 | #endif /* AVUTIL_AES_CTR_H */
84 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavutil/arm/timer.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2009 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_ARM_TIMER_H
22 | #define AVUTIL_ARM_TIMER_H
23 |
24 | #include
25 | #include "ffmpeg/config.h"
26 |
27 | #if HAVE_INLINE_ASM && defined(__ARM_ARCH_7A__)
28 |
29 | #define AV_READ_TIME read_time
30 |
31 | static inline uint64_t read_time(void)
32 | {
33 | unsigned cc;
34 | __asm__ volatile ("mrc p15, 0, %0, c9, c13, 0" : "=r"(cc));
35 | return cc;
36 | }
37 |
38 | #endif /* HAVE_INLINE_ASM && __ARM_ARCH_7A__ */
39 |
40 | #endif /* AVUTIL_ARM_TIMER_H */
41 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 | #endif /* AVUTIL_AVCONFIG_H */
8 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 | * Allocate an AVBlowfish context.
42 | */
43 | AVBlowfish *av_blowfish_alloc(void);
44 |
45 | /**
46 | * Initialize an AVBlowfish context.
47 | *
48 | * @param ctx an AVBlowfish context
49 | * @param key a key
50 | * @param key_len length of the key
51 | */
52 | void av_blowfish_init(struct AVBlowfish *ctx, const uint8_t *key, int key_len);
53 |
54 | /**
55 | * Encrypt or decrypt a buffer using a previously initialized context.
56 | *
57 | * @param ctx an AVBlowfish context
58 | * @param xl left four bytes halves of input to be encrypted
59 | * @param xr right four bytes halves of input to be encrypted
60 | * @param decrypt 0 for encryption, 1 for decryption
61 | */
62 | void av_blowfish_crypt_ecb(struct AVBlowfish *ctx, uint32_t *xl, uint32_t *xr,
63 | int decrypt);
64 |
65 | /**
66 | * Encrypt or decrypt a buffer using a previously initialized context.
67 | *
68 | * @param ctx an AVBlowfish context
69 | * @param dst destination array, can be equal to src
70 | * @param src source array, can be equal to dst
71 | * @param count number of 8 byte blocks
72 | * @param iv initialization vector for CBC mode, if NULL ECB will be used
73 | * @param decrypt 0 for encryption, 1 for decryption
74 | */
75 | void av_blowfish_crypt(struct AVBlowfish *ctx, uint8_t *dst, const uint8_t *src,
76 | int count, uint8_t *iv, int decrypt);
77 |
78 | /**
79 | * @}
80 | */
81 |
82 | #endif /* AVUTIL_BLOWFISH_H */
83 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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_AARCH64
38 | # include "aarch64/bswap.h"
39 | #elif ARCH_ARM
40 | # include "arm/bswap.h"
41 | #elif ARCH_AVR32
42 | # include "avr32/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 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavutil/camellia.h:
--------------------------------------------------------------------------------
1 | /*
2 | * An implementation of the CAMELLIA algorithm as mentioned in RFC3713
3 | * Copyright (c) 2014 Supraja Meedinti
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_CAMELLIA_H
23 | #define AVUTIL_CAMELLIA_H
24 |
25 | #include
26 |
27 |
28 | /**
29 | * @file
30 | * @brief Public header for libavutil CAMELLIA algorithm
31 | * @defgroup lavu_camellia CAMELLIA
32 | * @ingroup lavu_crypto
33 | * @{
34 | */
35 |
36 | extern const int av_camellia_size;
37 |
38 | struct AVCAMELLIA;
39 |
40 | /**
41 | * Allocate an AVCAMELLIA context
42 | * To free the struct: av_free(ptr)
43 | */
44 | struct AVCAMELLIA *av_camellia_alloc(void);
45 |
46 | /**
47 | * Initialize an AVCAMELLIA context.
48 | *
49 | * @param ctx an AVCAMELLIA context
50 | * @param key a key of 16, 24, 32 bytes used for encryption/decryption
51 | * @param key_bits number of keybits: possible are 128, 192, 256
52 | */
53 | int av_camellia_init(struct AVCAMELLIA *ctx, const uint8_t *key, int key_bits);
54 |
55 | /**
56 | * Encrypt or decrypt a buffer using a previously initialized context
57 | *
58 | * @param ctx an AVCAMELLIA context
59 | * @param dst destination array, can be equal to src
60 | * @param src source array, can be equal to dst
61 | * @param count number of 16 byte blocks
62 | * @paran iv initialization vector for CBC mode, NULL for ECB mode
63 | * @param decrypt 0 for encryption, 1 for decryption
64 | */
65 | void av_camellia_crypt(struct AVCAMELLIA *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt);
66 |
67 | /**
68 | * @}
69 | */
70 | #endif /* AVUTIL_CAMELLIA_H */
71 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavutil/cast5.h:
--------------------------------------------------------------------------------
1 | /*
2 | * An implementation of the CAST128 algorithm as mentioned in RFC2144
3 | * Copyright (c) 2014 Supraja Meedinti
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_CAST5_H
23 | #define AVUTIL_CAST5_H
24 |
25 | #include
26 |
27 |
28 | /**
29 | * @file
30 | * @brief Public header for libavutil CAST5 algorithm
31 | * @defgroup lavu_cast5 CAST5
32 | * @ingroup lavu_crypto
33 | * @{
34 | */
35 |
36 | extern const int av_cast5_size;
37 |
38 | struct AVCAST5;
39 |
40 | /**
41 | * Allocate an AVCAST5 context
42 | * To free the struct: av_free(ptr)
43 | */
44 | struct AVCAST5 *av_cast5_alloc(void);
45 | /**
46 | * Initialize an AVCAST5 context.
47 | *
48 | * @param ctx an AVCAST5 context
49 | * @param key a key of 5,6,...16 bytes used for encryption/decryption
50 | * @param key_bits number of keybits: possible are 40,48,...,128
51 | * @return 0 on success, less than 0 on failure
52 | */
53 | int av_cast5_init(struct AVCAST5 *ctx, const uint8_t *key, int key_bits);
54 |
55 | /**
56 | * Encrypt or decrypt a buffer using a previously initialized context, ECB mode only
57 | *
58 | * @param ctx an AVCAST5 context
59 | * @param dst destination array, can be equal to src
60 | * @param src source array, can be equal to dst
61 | * @param count number of 8 byte blocks
62 | * @param decrypt 0 for encryption, 1 for decryption
63 | */
64 | void av_cast5_crypt(struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, int decrypt);
65 |
66 | /**
67 | * Encrypt or decrypt a buffer using a previously initialized context
68 | *
69 | * @param ctx an AVCAST5 context
70 | * @param dst destination array, can be equal to src
71 | * @param src source array, can be equal to dst
72 | * @param count number of 8 byte blocks
73 | * @param iv initialization vector for CBC mode, NULL for ECB mode
74 | * @param decrypt 0 for encryption, 1 for decryption
75 | */
76 | void av_cast5_crypt2(struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
77 | /**
78 | * @}
79 | */
80 | #endif /* AVUTIL_CAST5_H */
81 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 | #include "version.h"
28 |
29 | /**
30 | * @defgroup lavu_crc32 CRC32
31 | * @ingroup lavu_crypto
32 | * @{
33 | */
34 |
35 | typedef uint32_t AVCRC;
36 |
37 | typedef enum {
38 | AV_CRC_8_ATM,
39 | AV_CRC_16_ANSI,
40 | AV_CRC_16_CCITT,
41 | AV_CRC_32_IEEE,
42 | AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */
43 | AV_CRC_16_ANSI_LE, /*< reversed bitorder version of AV_CRC_16_ANSI */
44 | #if FF_API_CRC_BIG_TABLE
45 | AV_CRC_24_IEEE = 12,
46 | #else
47 | AV_CRC_24_IEEE,
48 | #endif /* FF_API_CRC_BIG_TABLE */
49 | AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */
50 | }AVCRCId;
51 |
52 | /**
53 | * Initialize a CRC table.
54 | * @param ctx must be an array of size sizeof(AVCRC)*257 or sizeof(AVCRC)*1024
55 | * @param le If 1, the lowest bit represents the coefficient for the highest
56 | * exponent of the corresponding polynomial (both for poly and
57 | * actual CRC).
58 | * If 0, you must swap the CRC parameter and the result of av_crc
59 | * if you need the standard representation (can be simplified in
60 | * most cases to e.g. bswap16):
61 | * av_bswap32(crc << (32-bits))
62 | * @param bits number of bits for the CRC
63 | * @param poly generator polynomial without the x**bits coefficient, in the
64 | * representation as specified by le
65 | * @param ctx_size size of ctx in bytes
66 | * @return <0 on failure
67 | */
68 | int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size);
69 |
70 | /**
71 | * Get an initialized standard CRC table.
72 | * @param crc_id ID of a standard CRC
73 | * @return a pointer to the CRC table or NULL on failure
74 | */
75 | const AVCRC *av_crc_get_table(AVCRCId crc_id);
76 |
77 | /**
78 | * Calculate the CRC of a block.
79 | * @param crc CRC of previous blocks if any or initial value for CRC
80 | * @return CRC updated with the data from the given block
81 | *
82 | * @see av_crc_init() "le" parameter
83 | */
84 | uint32_t av_crc(const AVCRC *ctx, uint32_t crc,
85 | const uint8_t *buffer, size_t length) av_pure;
86 |
87 | /**
88 | * @}
89 | */
90 |
91 | #endif /* AVUTIL_CRC_H */
92 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavutil/des.h:
--------------------------------------------------------------------------------
1 | /*
2 | * DES encryption/decryption
3 | * Copyright (c) 2007 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_DES_H
23 | #define AVUTIL_DES_H
24 |
25 | #include
26 |
27 | /**
28 | * @defgroup lavu_des DES
29 | * @ingroup lavu_crypto
30 | * @{
31 | */
32 |
33 | typedef struct AVDES {
34 | uint64_t round_keys[3][16];
35 | int triple_des;
36 | } AVDES;
37 |
38 | /**
39 | * Allocate an AVDES context.
40 | */
41 | AVDES *av_des_alloc(void);
42 |
43 | /**
44 | * @brief Initializes an AVDES context.
45 | *
46 | * @param key_bits must be 64 or 192
47 | * @param decrypt 0 for encryption/CBC-MAC, 1 for decryption
48 | * @return zero on success, negative value otherwise
49 | */
50 | int av_des_init(struct AVDES *d, const uint8_t *key, int key_bits, int decrypt);
51 |
52 | /**
53 | * @brief Encrypts / decrypts using the DES algorithm.
54 | *
55 | * @param count number of 8 byte blocks
56 | * @param dst destination array, can be equal to src, must be 8-byte aligned
57 | * @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL
58 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used,
59 | * must be 8-byte aligned
60 | * @param decrypt 0 for encryption, 1 for decryption
61 | */
62 | void av_des_crypt(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
63 |
64 | /**
65 | * @brief Calculates CBC-MAC using the DES algorithm.
66 | *
67 | * @param count number of 8 byte blocks
68 | * @param dst destination array, can be equal to src, must be 8-byte aligned
69 | * @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL
70 | */
71 | void av_des_mac(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count);
72 |
73 | /**
74 | * @}
75 | */
76 |
77 | #endif /* AVUTIL_DES_H */
78 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavutil/display.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2014 Vittorio Giovara
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_DISPLAY_H
22 | #define AVUTIL_DISPLAY_H
23 |
24 | #include
25 |
26 | /**
27 | * The display transformation matrix specifies an affine transformation that
28 | * should be applied to video frames for correct presentation. It is compatible
29 | * with the matrices stored in the ISO/IEC 14496-12 container format.
30 | *
31 | * The data is a 3x3 matrix represented as a 9-element array:
32 | *
33 | * | a b u |
34 | * (a, b, u, c, d, v, x, y, w) -> | c d v |
35 | * | x y w |
36 | *
37 | * All numbers are stored in native endianness, as 16.16 fixed-point values,
38 | * except for u, v and w, which are stored as 2.30 fixed-point values.
39 | *
40 | * The transformation maps a point (p, q) in the source (pre-transformation)
41 | * frame to the point (p', q') in the destination (post-transformation) frame as
42 | * follows:
43 | * | a b u |
44 | * (p, q, 1) . | c d v | = z * (p', q', 1)
45 | * | x y w |
46 | *
47 | * The transformation can also be more explicitly written in components as
48 | * follows:
49 | * p' = (a * p + c * q + x) / z;
50 | * q' = (b * p + d * q + y) / z;
51 | * z = u * p + v * q + w
52 | */
53 |
54 | /**
55 | * Extract the rotation component of the transformation matrix.
56 | *
57 | * @param matrix the transformation matrix
58 | * @return the angle (in degrees) by which the transformation rotates the frame
59 | * counterclockwise. The angle will be in range [-180.0, 180.0],
60 | * or NaN if the matrix is singular.
61 | *
62 | * @note floating point numbers are inherently inexact, so callers are
63 | * recommended to round the return value to nearest integer before use.
64 | */
65 | double av_display_rotation_get(const int32_t matrix[9]);
66 |
67 | /**
68 | * Initialize a transformation matrix describing a pure counterclockwise
69 | * rotation by the specified angle (in degrees).
70 | *
71 | * @param matrix an allocated transformation matrix (will be fully overwritten
72 | * by this function)
73 | * @param angle rotation angle in degrees.
74 | */
75 | void av_display_rotation_set(int32_t matrix[9], double angle);
76 |
77 | /**
78 | * Flip the input matrix horizontally and/or vertically.
79 | *
80 | * @param matrix an allocated transformation matrix
81 | * @param hflip whether the matrix should be flipped horizontally
82 | * @param vflip whether the matrix should be flipped vertically
83 | */
84 | void av_display_matrix_flip(int32_t matrix[9], int hflip, int vflip);
85 |
86 | #endif /* AVUTIL_DISPLAY_H */
87 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavutil/downmix_info.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2014 Tim Walker
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_DOWNMIX_INFO_H
22 | #define AVUTIL_DOWNMIX_INFO_H
23 |
24 | #include "frame.h"
25 |
26 | /**
27 | * @file
28 | * audio downmix medatata
29 | */
30 |
31 | /**
32 | * @addtogroup lavu_audio
33 | * @{
34 | */
35 |
36 | /**
37 | * @defgroup downmix_info Audio downmix metadata
38 | * @{
39 | */
40 |
41 | /**
42 | * Possible downmix types.
43 | */
44 | enum AVDownmixType {
45 | AV_DOWNMIX_TYPE_UNKNOWN, /**< Not indicated. */
46 | AV_DOWNMIX_TYPE_LORO, /**< Lo/Ro 2-channel downmix (Stereo). */
47 | AV_DOWNMIX_TYPE_LTRT, /**< Lt/Rt 2-channel downmix, Dolby Surround compatible. */
48 | AV_DOWNMIX_TYPE_DPLII, /**< Lt/Rt 2-channel downmix, Dolby Pro Logic II compatible. */
49 | AV_DOWNMIX_TYPE_NB /**< Number of downmix types. Not part of ABI. */
50 | };
51 |
52 | /**
53 | * This structure describes optional metadata relevant to a downmix procedure.
54 | *
55 | * All fields are set by the decoder to the value indicated in the audio
56 | * bitstream (if present), or to a "sane" default otherwise.
57 | */
58 | typedef struct AVDownmixInfo {
59 | /**
60 | * Type of downmix preferred by the mastering engineer.
61 | */
62 | enum AVDownmixType preferred_downmix_type;
63 |
64 | /**
65 | * Absolute scale factor representing the nominal level of the center
66 | * channel during a regular downmix.
67 | */
68 | double center_mix_level;
69 |
70 | /**
71 | * Absolute scale factor representing the nominal level of the center
72 | * channel during an Lt/Rt compatible downmix.
73 | */
74 | double center_mix_level_ltrt;
75 |
76 | /**
77 | * Absolute scale factor representing the nominal level of the surround
78 | * channels during a regular downmix.
79 | */
80 | double surround_mix_level;
81 |
82 | /**
83 | * Absolute scale factor representing the nominal level of the surround
84 | * channels during an Lt/Rt compatible downmix.
85 | */
86 | double surround_mix_level_ltrt;
87 |
88 | /**
89 | * Absolute scale factor representing the level at which the LFE data is
90 | * mixed into L/R channels during downmixing.
91 | */
92 | double lfe_mix_level;
93 | } AVDownmixInfo;
94 |
95 | /**
96 | * Get a frame's AV_FRAME_DATA_DOWNMIX_INFO side data for editing.
97 | *
98 | * If the side data is absent, it is created and added to the frame.
99 | *
100 | * @param frame the frame for which the side data is to be obtained or created
101 | *
102 | * @return the AVDownmixInfo structure to be edited by the caller, or NULL if
103 | * the structure cannot be allocated.
104 | */
105 | AVDownmixInfo *av_downmix_info_update_side_data(AVFrame *frame);
106 |
107 | /**
108 | * @}
109 | */
110 |
111 | /**
112 | * @}
113 | */
114 |
115 | #endif /* AVUTIL_DOWNMIX_INFO_H */
116 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavutil/ffversion.h:
--------------------------------------------------------------------------------
1 | /* Automatically generated by version.sh, do not manually edit! */
2 | #ifndef AVUTIL_FFVERSION_H
3 | #define AVUTIL_FFVERSION_H
4 | #define FFMPEG_VERSION "3.0.3"
5 | #endif /* AVUTIL_FFVERSION_H */
6 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 | av_warn_unused_result
44 | int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
45 | int log_offset, void *log_ctx);
46 |
47 | /**
48 | * Unmap or free the buffer bufptr created by av_file_map().
49 | *
50 | * @param size size in bytes of bufptr, must be the same as returned
51 | * by av_file_map()
52 | */
53 | void av_file_unmap(uint8_t *bufptr, size_t size);
54 |
55 | /**
56 | * Wrapper to work around the lack of mkstemp() on mingw.
57 | * Also, tries to create file in /tmp first, if possible.
58 | * *prefix can be a character constant; *filename will be allocated internally.
59 | * @return file descriptor of opened file (or negative value corresponding to an
60 | * AVERROR code on error)
61 | * and opened file name in **filename.
62 | * @note On very old libcs it is necessary to set a secure umask before
63 | * calling this, av_tempfile() can't call umask itself as it is used in
64 | * libraries and could interfere with the calling application.
65 | */
66 | int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx);
67 |
68 | #endif /* AVUTIL_FILE_H */
69 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 | #include "version.h"
27 | /**
28 | * @defgroup lavu_hmac HMAC
29 | * @ingroup lavu_crypto
30 | * @{
31 | */
32 |
33 | enum AVHMACType {
34 | AV_HMAC_MD5,
35 | AV_HMAC_SHA1,
36 | AV_HMAC_SHA224,
37 | AV_HMAC_SHA256,
38 | AV_HMAC_SHA384 = 12,
39 | AV_HMAC_SHA512,
40 | };
41 |
42 | typedef struct AVHMAC AVHMAC;
43 |
44 | /**
45 | * Allocate an AVHMAC context.
46 | * @param type The hash function used for the HMAC.
47 | */
48 | AVHMAC *av_hmac_alloc(enum AVHMACType type);
49 |
50 | /**
51 | * Free an AVHMAC context.
52 | * @param ctx The context to free, may be NULL
53 | */
54 | void av_hmac_free(AVHMAC *ctx);
55 |
56 | /**
57 | * Initialize an AVHMAC context with an authentication key.
58 | * @param ctx The HMAC context
59 | * @param key The authentication key
60 | * @param keylen The length of the key, in bytes
61 | */
62 | void av_hmac_init(AVHMAC *ctx, const uint8_t *key, unsigned int keylen);
63 |
64 | /**
65 | * Hash data with the HMAC.
66 | * @param ctx The HMAC context
67 | * @param data The data to hash
68 | * @param len The length of the data, in bytes
69 | */
70 | void av_hmac_update(AVHMAC *ctx, const uint8_t *data, unsigned int len);
71 |
72 | /**
73 | * Finish hashing and output the HMAC digest.
74 | * @param ctx The HMAC context
75 | * @param out The output buffer to write the digest into
76 | * @param outlen The length of the out buffer, in bytes
77 | * @return The number of bytes written to out, or a negative error code.
78 | */
79 | int av_hmac_final(AVHMAC *ctx, uint8_t *out, unsigned int outlen);
80 |
81 | /**
82 | * Hash an array of data with a key.
83 | * @param ctx The HMAC context
84 | * @param data The data to hash
85 | * @param len The length of the data, in bytes
86 | * @param key The authentication key
87 | * @param keylen The length of the key, in bytes
88 | * @param out The output buffer to write the digest into
89 | * @param outlen The length of the out buffer, in bytes
90 | * @return The number of bytes written to out, or a negative error code.
91 | */
92 | int av_hmac_calc(AVHMAC *ctx, const uint8_t *data, unsigned int len,
93 | const uint8_t *key, unsigned int keylen,
94 | uint8_t *out, unsigned int outlen);
95 |
96 | /**
97 | * @}
98 | */
99 |
100 | #endif /* AVUTIL_HMAC_H */
101 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavutil/macros.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 | * @ingroup lavu
22 | * Utility Preprocessor macros
23 | */
24 |
25 | #ifndef AVUTIL_MACROS_H
26 | #define AVUTIL_MACROS_H
27 |
28 | /**
29 | * @addtogroup preproc_misc Preprocessor String Macros
30 | *
31 | * String manipulation macros
32 | *
33 | * @{
34 | */
35 |
36 | #define AV_STRINGIFY(s) AV_TOSTRING(s)
37 | #define AV_TOSTRING(s) #s
38 |
39 | #define AV_GLUE(a, b) a ## b
40 | #define AV_JOIN(a, b) AV_GLUE(a, b)
41 |
42 | /**
43 | * @}
44 | */
45 |
46 | #define AV_PRAGMA(s) _Pragma(#s)
47 |
48 | #define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1))
49 |
50 | #endif /* AVUTIL_MACROS_H */
51 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavutil/mastering_display_metadata.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2016 Neil Birkbeck
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_MASTERING_DISPLAY_METADATA_H
22 | #define AVUTIL_MASTERING_DISPLAY_METADATA_H
23 |
24 | #include "frame.h"
25 | #include "rational.h"
26 |
27 |
28 | /**
29 | * Mastering display metadata capable of representing the color volume of
30 | * the display used to master the content (SMPTE 2086:2014).
31 | *
32 | * To be used as payload of a AVFrameSideData or AVPacketSideData with the
33 | * appropriate type.
34 | *
35 | * @note The struct should be allocated with av_mastering_display_metadata_alloc()
36 | * and its size is not a part of the public ABI.
37 | */
38 | typedef struct AVMasteringDisplayMetadata {
39 | /**
40 | * CIE 1931 xy chromaticity coords of color primaries (r, g, b order).
41 | */
42 | AVRational display_primaries[3][2];
43 |
44 | /**
45 | * CIE 1931 xy chromaticity coords of white point.
46 | */
47 | AVRational white_point[2];
48 |
49 | /**
50 | * Min luminance of mastering display (cd/m^2).
51 | */
52 | AVRational min_luminance;
53 |
54 | /**
55 | * Max luminance of mastering display (cd/m^2).
56 | */
57 | AVRational max_luminance;
58 |
59 | /**
60 | * Flag indicating whether the display primaries (and white point) are set.
61 | */
62 | int has_primaries;
63 |
64 | /**
65 | * Flag indicating whether the luminance (min_ and max_) have been set.
66 | */
67 | int has_luminance;
68 |
69 | } AVMasteringDisplayMetadata;
70 |
71 | /**
72 | * Allocate an AVMasteringDisplayMetadata structure and set its fields to
73 | * default values. The resulting struct can be freed using av_freep().
74 | *
75 | * @return An AVMasteringDisplayMetadata filled with default values or NULL
76 | * on failure.
77 | */
78 | AVMasteringDisplayMetadata *av_mastering_display_metadata_alloc(void);
79 |
80 | /**
81 | * Allocate a complete AVMasteringDisplayMetadata and add it to the frame.
82 | *
83 | * @param frame The frame which side data is added to.
84 | *
85 | * @return The AVMasteringDisplayMetadata structure to be filled by caller.
86 | */
87 | AVMasteringDisplayMetadata *av_mastering_display_metadata_create_side_data(AVFrame *frame);
88 |
89 | #endif /* AVUTIL_MASTERING_DISPLAY_METADATA_H */
90 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavutil/motion_vector.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_MOTION_VECTOR_H
20 | #define AVUTIL_MOTION_VECTOR_H
21 |
22 | #include
23 |
24 | typedef struct AVMotionVector {
25 | /**
26 | * Where the current macroblock comes from; negative value when it comes
27 | * from the past, positive value when it comes from the future.
28 | * XXX: set exact relative ref frame reference instead of a +/- 1 "direction".
29 | */
30 | int32_t source;
31 | /**
32 | * Width and height of the block.
33 | */
34 | uint8_t w, h;
35 | /**
36 | * Absolute source position. Can be outside the frame area.
37 | */
38 | int16_t src_x, src_y;
39 | /**
40 | * Absolute destination position. Can be outside the frame area.
41 | */
42 | int16_t dst_x, dst_y;
43 | /**
44 | * Extra flag information.
45 | * Currently unused.
46 | */
47 | uint64_t flags;
48 | /**
49 | * Motion vector
50 | * src_x = dst_x + motion_x / motion_scale
51 | * src_y = dst_y + motion_y / motion_scale
52 | */
53 | int32_t motion_x, motion_y;
54 | uint16_t motion_scale;
55 | } AVMotionVector;
56 |
57 | #endif /* AVUTIL_MOTION_VECTOR_H */
58 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavutil/pixelutils.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_PIXELUTILS_H
20 | #define AVUTIL_PIXELUTILS_H
21 |
22 | #include
23 | #include
24 | #include "common.h"
25 |
26 | /**
27 | * Sum of abs(src1[x] - src2[x])
28 | */
29 | typedef int (*av_pixelutils_sad_fn)(const uint8_t *src1, ptrdiff_t stride1,
30 | const uint8_t *src2, ptrdiff_t stride2);
31 |
32 | /**
33 | * Get a potentially optimized pointer to a Sum-of-absolute-differences
34 | * function (see the av_pixelutils_sad_fn prototype).
35 | *
36 | * @param w_bits 1<
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 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavutil/rc4.h:
--------------------------------------------------------------------------------
1 | /*
2 | * RC4 encryption/decryption/pseudo-random number generator
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_RC4_H
22 | #define AVUTIL_RC4_H
23 |
24 | #include
25 |
26 | /**
27 | * @defgroup lavu_rc4 RC4
28 | * @ingroup lavu_crypto
29 | * @{
30 | */
31 |
32 | typedef struct AVRC4 {
33 | uint8_t state[256];
34 | int x, y;
35 | } AVRC4;
36 |
37 | /**
38 | * Allocate an AVRC4 context.
39 | */
40 | AVRC4 *av_rc4_alloc(void);
41 |
42 | /**
43 | * @brief Initializes an AVRC4 context.
44 | *
45 | * @param key_bits must be a multiple of 8
46 | * @param decrypt 0 for encryption, 1 for decryption, currently has no effect
47 | * @return zero on success, negative value otherwise
48 | */
49 | int av_rc4_init(struct AVRC4 *d, const uint8_t *key, int key_bits, int decrypt);
50 |
51 | /**
52 | * @brief Encrypts / decrypts using the RC4 algorithm.
53 | *
54 | * @param count number of bytes
55 | * @param dst destination array, can be equal to src
56 | * @param src source array, can be equal to dst, may be NULL
57 | * @param iv not (yet) used for RC4, should be NULL
58 | * @param decrypt 0 for encryption, 1 for decryption, not (yet) used
59 | */
60 | void av_rc4_crypt(struct AVRC4 *d, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt);
61 |
62 | /**
63 | * @}
64 | */
65 |
66 | #endif /* AVUTIL_RC4_H */
67 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavutil/replaygain.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 AVUTIL_REPLAYGAIN_H
21 | #define AVUTIL_REPLAYGAIN_H
22 |
23 | #include
24 |
25 | /**
26 | * ReplayGain information (see
27 | * http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1.0_specification).
28 | * The size of this struct is a part of the public ABI.
29 | */
30 | typedef struct AVReplayGain {
31 | /**
32 | * Track replay gain in microbels (divide by 100000 to get the value in dB).
33 | * Should be set to INT32_MIN when unknown.
34 | */
35 | int32_t track_gain;
36 | /**
37 | * Peak track amplitude, with 100000 representing full scale (but values
38 | * may overflow). 0 when unknown.
39 | */
40 | uint32_t track_peak;
41 | /**
42 | * Same as track_gain, but for the whole album.
43 | */
44 | int32_t album_gain;
45 | /**
46 | * Same as track_peak, but for the whole album,
47 | */
48 | uint32_t album_peak;
49 | } AVReplayGain;
50 |
51 | #endif /* AVUTIL_REPLAYGAIN_H */
52 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavutil/tea.h:
--------------------------------------------------------------------------------
1 | /*
2 | * A 32-bit implementation of the TEA algorithm
3 | * Copyright (c) 2015 Vesselin Bontchev
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_TEA_H
23 | #define AVUTIL_TEA_H
24 |
25 | #include
26 |
27 | /**
28 | * @file
29 | * @brief Public header for libavutil TEA algorithm
30 | * @defgroup lavu_tea TEA
31 | * @ingroup lavu_crypto
32 | * @{
33 | */
34 |
35 | extern const int av_tea_size;
36 |
37 | struct AVTEA;
38 |
39 | /**
40 | * Allocate an AVTEA context
41 | * To free the struct: av_free(ptr)
42 | */
43 | struct AVTEA *av_tea_alloc(void);
44 |
45 | /**
46 | * Initialize an AVTEA context.
47 | *
48 | * @param ctx an AVTEA context
49 | * @param key a key of 16 bytes used for encryption/decryption
50 | * @param rounds the number of rounds in TEA (64 is the "standard")
51 | */
52 | void av_tea_init(struct AVTEA *ctx, const uint8_t key[16], int rounds);
53 |
54 | /**
55 | * Encrypt or decrypt a buffer using a previously initialized context.
56 | *
57 | * @param ctx an AVTEA context
58 | * @param dst destination array, can be equal to src
59 | * @param src source array, can be equal to dst
60 | * @param count number of 8 byte blocks
61 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used
62 | * @param decrypt 0 for encryption, 1 for decryption
63 | */
64 | void av_tea_crypt(struct AVTEA *ctx, uint8_t *dst, const uint8_t *src,
65 | int count, uint8_t *iv, int decrypt);
66 |
67 | /**
68 | * @}
69 | */
70 |
71 | #endif /* AVUTIL_TEA_H */
72 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 | * Get the current time in microseconds since some unspecified starting point.
33 | * On platforms that support it, the time comes from a monotonic clock
34 | * This property makes this time source ideal for measuring relative time.
35 | * The returned values may not be monotonic on platforms where a monotonic
36 | * clock is not available.
37 | */
38 | int64_t av_gettime_relative(void);
39 |
40 | /**
41 | * Indicates with a boolean result if the av_gettime_relative() time source
42 | * is monotonic.
43 | */
44 | int av_gettime_relative_is_monotonic(void);
45 |
46 | /**
47 | * Sleep for a period of time. Although the duration is expressed in
48 | * microseconds, the actual delay may be rounded to the precision of the
49 | * system timer.
50 | *
51 | * @param usec Number of microseconds to sleep.
52 | * @return zero on success or (negative) error code.
53 | */
54 | int av_usleep(unsigned usec);
55 |
56 | #endif /* AVUTIL_TIME_H */
57 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavutil/time_internal.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_TIME_INTERNAL_H
20 | #define AVUTIL_TIME_INTERNAL_H
21 |
22 | #include
23 | #include "ffmpeg/config.h"
24 |
25 | #if !HAVE_GMTIME_R && !defined(gmtime_r)
26 | static inline struct tm *gmtime_r(const time_t* clock, struct tm *result)
27 | {
28 | struct tm *ptr = gmtime(clock);
29 | if (!ptr)
30 | return NULL;
31 | *result = *ptr;
32 | return result;
33 | }
34 | #endif
35 |
36 | #if !HAVE_LOCALTIME_R && !defined(localtime_r)
37 | static inline struct tm *localtime_r(const time_t* clock, struct tm *result)
38 | {
39 | struct tm *ptr = localtime(clock);
40 | if (!ptr)
41 | return NULL;
42 | *result = *ptr;
43 | return result;
44 | }
45 | #endif
46 |
47 | #endif /* AVUTIL_TIME_INTERNAL_H */
48 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavutil/timer.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 | * high precision timer, useful to profile code
24 | */
25 |
26 | #ifndef AVUTIL_TIMER_H
27 | #define AVUTIL_TIMER_H
28 |
29 | #include
30 | #include
31 | #include
32 |
33 | #include "ffmpeg/config.h"
34 |
35 | #if HAVE_MACH_MACH_TIME_H
36 | #include
37 | #endif
38 |
39 | #include "log.h"
40 |
41 | #if ARCH_AARCH64
42 | # include "aarch64/timer.h"
43 | #elif ARCH_ARM
44 | # include "arm/timer.h"
45 | #elif ARCH_PPC
46 | # include "ppc/timer.h"
47 | #elif ARCH_X86
48 | # include "x86/timer.h"
49 | #endif
50 |
51 | #if !defined(AV_READ_TIME)
52 | # if HAVE_GETHRTIME
53 | # define AV_READ_TIME gethrtime
54 | # elif HAVE_MACH_ABSOLUTE_TIME
55 | # define AV_READ_TIME mach_absolute_time
56 | # endif
57 | #endif
58 |
59 | #ifndef FF_TIMER_UNITS
60 | # define FF_TIMER_UNITS "UNITS"
61 | #endif
62 |
63 | #ifdef AV_READ_TIME
64 | #define START_TIMER \
65 | uint64_t tend; \
66 | uint64_t tstart = AV_READ_TIME(); \
67 |
68 | #define STOP_TIMER(id) \
69 | tend = AV_READ_TIME(); \
70 | { \
71 | static uint64_t tsum = 0; \
72 | static int tcount = 0; \
73 | static int tskip_count = 0; \
74 | static int thistogram[32] = {0}; \
75 | thistogram[av_log2(tend - tstart)]++; \
76 | if (tcount < 2 || \
77 | tend - tstart < 8 * tsum / tcount || \
78 | tend - tstart < 2000) { \
79 | tsum+= tend - tstart; \
80 | tcount++; \
81 | } else \
82 | tskip_count++; \
83 | if (((tcount + tskip_count) & (tcount + tskip_count - 1)) == 0) { \
84 | int i; \
85 | av_log(NULL, AV_LOG_ERROR, \
86 | "%7"PRIu64" " FF_TIMER_UNITS " in %s,%8d runs,%7d skips", \
87 | tsum * 10 / tcount, id, tcount, tskip_count); \
88 | for (i = 0; i < 32; i++) \
89 | av_log(NULL, AV_LOG_VERBOSE, " %2d", av_log2(2*thistogram[i]));\
90 | av_log(NULL, AV_LOG_ERROR, "\n"); \
91 | } \
92 | }
93 | #else
94 | #define START_TIMER
95 | #define STOP_TIMER(id) { }
96 | #endif
97 |
98 | #endif /* AVUTIL_TIMER_H */
99 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 | #if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS) && !defined(PRId64)
30 | #error missing -D__STDC_FORMAT_MACROS / #define __STDC_FORMAT_MACROS
31 | #endif
32 |
33 | #define AV_TS_MAX_STRING_SIZE 32
34 |
35 | /**
36 | * Fill the provided buffer with a string containing a timestamp
37 | * representation.
38 | *
39 | * @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE
40 | * @param ts the timestamp to represent
41 | * @return the buffer in input
42 | */
43 | static inline char *av_ts_make_string(char *buf, int64_t ts)
44 | {
45 | if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
46 | else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%"PRId64, ts);
47 | return buf;
48 | }
49 |
50 | /**
51 | * Convenience macro, the return value should be used only directly in
52 | * function arguments but never stand-alone.
53 | */
54 | #define av_ts2str(ts) av_ts_make_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts)
55 |
56 | /**
57 | * Fill the provided buffer with a string containing a timestamp time
58 | * representation.
59 | *
60 | * @param buf a buffer with size in bytes of at least AV_TS_MAX_STRING_SIZE
61 | * @param ts the timestamp to represent
62 | * @param tb the timebase of the timestamp
63 | * @return the buffer in input
64 | */
65 | static inline char *av_ts_make_time_string(char *buf, int64_t ts, AVRational *tb)
66 | {
67 | if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
68 | else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts);
69 | return buf;
70 | }
71 |
72 | /**
73 | * Convenience macro, the return value should be used only directly in
74 | * function arguments but never stand-alone.
75 | */
76 | #define av_ts2timestr(ts, tb) av_ts_make_time_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts, tb)
77 |
78 | #endif /* AVUTIL_TIMESTAMP_H */
79 |
--------------------------------------------------------------------------------
/app/src/main/cpp/include/libavutil/twofish.h:
--------------------------------------------------------------------------------
1 | /*
2 | * An implementation of the TwoFish algorithm
3 | * Copyright (c) 2015 Supraja Meedinti
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_TWOFISH_H
23 | #define AVUTIL_TWOFISH_H
24 |
25 | #include
26 |
27 |
28 | /**
29 | * @file
30 | * @brief Public header for libavutil TWOFISH algorithm
31 | * @defgroup lavu_twofish TWOFISH
32 | * @ingroup lavu_crypto
33 | * @{
34 | */
35 |
36 | extern const int av_twofish_size;
37 |
38 | struct AVTWOFISH;
39 |
40 | /**
41 | * Allocate an AVTWOFISH context
42 | * To free the struct: av_free(ptr)
43 | */
44 | struct AVTWOFISH *av_twofish_alloc(void);
45 |
46 | /**
47 | * Initialize an AVTWOFISH context.
48 | *
49 | * @param ctx an AVTWOFISH context
50 | * @param key a key of size ranging from 1 to 32 bytes used for encryption/decryption
51 | * @param key_bits number of keybits: 128, 192, 256 If less than the required, padded with zeroes to nearest valid value; return value is 0 if key_bits is 128/192/256, -1 if less than 0, 1 otherwise
52 | */
53 | int av_twofish_init(struct AVTWOFISH *ctx, const uint8_t *key, int key_bits);
54 |
55 | /**
56 | * Encrypt or decrypt a buffer using a previously initialized context
57 | *
58 | * @param ctx an AVTWOFISH context
59 | * @param dst destination array, can be equal to src
60 | * @param src source array, can be equal to dst
61 | * @param count number of 16 byte blocks
62 | * @paran iv initialization vector for CBC mode, NULL for ECB mode
63 | * @param decrypt 0 for encryption, 1 for decryption
64 | */
65 | void av_twofish_crypt(struct AVTWOFISH *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t* iv, int decrypt);
66 |
67 | /**
68 | * @}
69 | */
70 | #endif /* AVUTIL_TWOFISH_H */
71 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 | * @file
29 | * @brief Public header for libavutil XTEA algorithm
30 | * @defgroup lavu_xtea XTEA
31 | * @ingroup lavu_crypto
32 | * @{
33 | */
34 |
35 | typedef struct AVXTEA {
36 | uint32_t key[16];
37 | } AVXTEA;
38 |
39 | /**
40 | * Allocate an AVXTEA context.
41 | */
42 | AVXTEA *av_xtea_alloc(void);
43 |
44 | /**
45 | * Initialize an AVXTEA context.
46 | *
47 | * @param ctx an AVXTEA context
48 | * @param key a key of 16 bytes used for encryption/decryption,
49 | * interpreted as big endian 32 bit numbers
50 | */
51 | void av_xtea_init(struct AVXTEA *ctx, const uint8_t key[16]);
52 |
53 | /**
54 | * Initialize an AVXTEA context.
55 | *
56 | * @param ctx an AVXTEA context
57 | * @param key a key of 16 bytes used for encryption/decryption,
58 | * interpreted as little endian 32 bit numbers
59 | */
60 | void av_xtea_le_init(struct AVXTEA *ctx, const uint8_t key[16]);
61 |
62 | /**
63 | * Encrypt or decrypt a buffer using a previously initialized context,
64 | * in big endian format.
65 | *
66 | * @param ctx an AVXTEA context
67 | * @param dst destination array, can be equal to src
68 | * @param src source array, can be equal to dst
69 | * @param count number of 8 byte blocks
70 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used
71 | * @param decrypt 0 for encryption, 1 for decryption
72 | */
73 | void av_xtea_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src,
74 | int count, uint8_t *iv, int decrypt);
75 |
76 | /**
77 | * Encrypt or decrypt a buffer using a previously initialized context,
78 | * in little endian format.
79 | *
80 | * @param ctx an AVXTEA context
81 | * @param dst destination array, can be equal to src
82 | * @param src source array, can be equal to dst
83 | * @param count number of 8 byte blocks
84 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used
85 | * @param decrypt 0 for encryption, 1 for decryption
86 | */
87 | void av_xtea_le_crypt(struct AVXTEA *ctx, uint8_t *dst, const uint8_t *src,
88 | int count, uint8_t *iv, int decrypt);
89 |
90 | /**
91 | * @}
92 | */
93 |
94 | #endif /* AVUTIL_XTEA_H */
95 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 | * Video postprocessing library.
33 | *
34 | * @{
35 | */
36 |
37 | #include "libpostproc/version.h"
38 |
39 | /**
40 | * Return the LIBPOSTPROC_VERSION_INT constant.
41 | */
42 | unsigned postproc_version(void);
43 |
44 | /**
45 | * Return the libpostproc build-time configuration.
46 | */
47 | const char *postproc_configuration(void);
48 |
49 | /**
50 | * Return the libpostproc license.
51 | */
52 | const char *postproc_license(void);
53 |
54 | #define PP_QUALITY_MAX 6
55 |
56 | #if FF_API_QP_TYPE
57 | #define QP_STORE_T int8_t //deprecated
58 | #endif
59 |
60 | #include
61 |
62 | typedef void pp_context;
63 | typedef void pp_mode;
64 |
65 | #if LIBPOSTPROC_VERSION_INT < (52<<16)
66 | typedef pp_context pp_context_t;
67 | typedef pp_mode pp_mode_t;
68 | extern const char *const pp_help; ///< a simple help text
69 | #else
70 | extern const char pp_help[]; ///< a simple help text
71 | #endif
72 |
73 | void pp_postprocess(const uint8_t * src[3], const int srcStride[3],
74 | uint8_t * dst[3], const int dstStride[3],
75 | int horizontalSize, int verticalSize,
76 | const int8_t *QP_store, int QP_stride,
77 | pp_mode *mode, pp_context *ppContext, int pict_type);
78 |
79 |
80 | /**
81 | * Return a pp_mode or NULL if an error occurred.
82 | *
83 | * @param name the string after "-pp" on the command line
84 | * @param quality a number from 0 to PP_QUALITY_MAX
85 | */
86 | pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality);
87 | void pp_free_mode(pp_mode *mode);
88 |
89 | pp_context *pp_get_context(int width, int height, int flags);
90 | void pp_free_context(pp_context *ppContext);
91 |
92 | #define PP_CPU_CAPS_MMX 0x80000000
93 | #define PP_CPU_CAPS_MMX2 0x20000000
94 | #define PP_CPU_CAPS_3DNOW 0x40000000
95 | #define PP_CPU_CAPS_ALTIVEC 0x10000000
96 | #define PP_CPU_CAPS_AUTO 0x00080000
97 |
98 | #define PP_FORMAT 0x00000008
99 | #define PP_FORMAT_420 (0x00000011|PP_FORMAT)
100 | #define PP_FORMAT_422 (0x00000001|PP_FORMAT)
101 | #define PP_FORMAT_411 (0x00000002|PP_FORMAT)
102 | #define PP_FORMAT_444 (0x00000000|PP_FORMAT)
103 | #define PP_FORMAT_440 (0x00000010|PP_FORMAT)
104 |
105 | #define PP_PICT_TYPE_QP2 0x00000010 ///< MPEG2 style QScale
106 |
107 | /**
108 | * @}
109 | */
110 |
111 | #endif /* POSTPROC_POSTPROCESS_H */
112 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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_VERSION_H
22 | #define POSTPROC_VERSION_H
23 |
24 | /**
25 | * @file
26 | * Libpostproc version macros
27 | */
28 |
29 | #include "libavutil/avutil.h"
30 |
31 | #define LIBPOSTPROC_VERSION_MAJOR 54
32 | #define LIBPOSTPROC_VERSION_MINOR 1
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 | #ifndef FF_API_QP_TYPE
46 | #define FF_API_QP_TYPE (LIBPOSTPROC_VERSION_MAJOR < 55)
47 | #endif
48 |
49 | #endif /* POSTPROC_VERSION_H */
50 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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 SWRESAMPLE_VERSION_H
22 | #define SWRESAMPLE_VERSION_H
23 |
24 | /**
25 | * @file
26 | * Libswresample version macros
27 | */
28 |
29 | #include "libavutil/avutil.h"
30 |
31 | #define LIBSWRESAMPLE_VERSION_MAJOR 2
32 | #define LIBSWRESAMPLE_VERSION_MINOR 0
33 | #define LIBSWRESAMPLE_VERSION_MICRO 101
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 /* SWRESAMPLE_VERSION_H */
46 |
--------------------------------------------------------------------------------
/app/src/main/cpp/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/version.h"
28 |
29 | #define LIBSWSCALE_VERSION_MAJOR 4
30 | #define LIBSWSCALE_VERSION_MINOR 0
31 | #define LIBSWSCALE_VERSION_MICRO 100
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 | #endif /* SWSCALE_VERSION_H */
50 |
--------------------------------------------------------------------------------
/app/src/main/java/com/liu/kinton/CharacterDance/adapter/FolderAdapter.java:
--------------------------------------------------------------------------------
1 | package com.liu.kinton.CharacterDance.adapter;
2 |
3 | import android.content.Context;
4 | import android.support.annotation.NonNull;
5 | import android.view.View;
6 |
7 | import com.liu.kinton.CharacterDance.R;
8 | import com.liu.kinton.CharacterDance.base.BaseAdapter;
9 | import com.liu.kinton.CharacterDance.base.ListItemListener;
10 |
11 |
12 | import java.util.List;
13 |
14 | public class FolderAdapter extends BaseAdapter {
15 |
16 | public FolderAdapter(Context context, List data, ListItemListener listener) {
17 | super(context, data,listener);
18 | }
19 |
20 | @Override
21 | public int getLayoutByType(int itemType) {
22 | return R.layout.layout_item_file;
23 | }
24 |
25 | @Override
26 | public FolderHolder getViewHodler(View view) {
27 | FolderHolder folderHolder = new FolderHolder(view,getContext(),getListener());
28 | return folderHolder;
29 | }
30 |
31 | @Override
32 | public void onBindViewHolder(@NonNull FolderHolder folderHolder, int position) {
33 | folderHolder.clearAll();
34 | folderHolder.setData(getData().get(position));
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/java/com/liu/kinton/CharacterDance/adapter/FolderHolder.java:
--------------------------------------------------------------------------------
1 | package com.liu.kinton.CharacterDance.adapter;
2 |
3 | import android.content.Context;
4 | import android.graphics.Bitmap;
5 | import android.support.annotation.NonNull;
6 | import android.view.View;
7 | import android.widget.ImageView;
8 | import android.widget.TextView;
9 |
10 | import com.liu.kinton.CharacterDance.R;
11 | import com.liu.kinton.CharacterDance.base.BaseViewHolder;
12 | import com.liu.kinton.CharacterDance.base.ListItemListener;
13 | import com.liu.kinton.CharacterDance.utils.AyscnUtils;
14 |
15 | import io.reactivex.Observer;
16 | import io.reactivex.disposables.Disposable;
17 |
18 | public class FolderHolder extends BaseViewHolder {
19 | private ImageView imageView;
20 | private TextView textView;
21 | private Context context;
22 |
23 | public FolderHolder(@NonNull View itemView, Context context, ListItemListener listener) {
24 | super(itemView,listener);
25 | this.context = context;
26 | this.imageView = (ImageView) this.getViewById(R.id.iv_listitem_file_pic);
27 | this.textView = (TextView) this.getViewById(R.id.tv_listitem_path);
28 | }
29 |
30 | @Override
31 | public void setData(String data) {
32 | String[] paths = data.split("/");
33 | textView.setText(paths[paths.length-1]);
34 | AyscnUtils.getInstance().getBitmapByPath(context,data,new Observer(){
35 | @Override
36 | public void onSubscribe(Disposable d) {
37 | }
38 |
39 | @Override
40 | public void onNext(Bitmap bitmap) {
41 | imageView.setImageBitmap(bitmap);
42 | }
43 |
44 | @Override
45 | public void onError(Throwable e) {
46 | }
47 |
48 | @Override
49 | public void onComplete() {
50 | }
51 | });
52 | }
53 |
54 | @Override
55 | public void clearAll() {
56 | imageView.setImageDrawable(null);
57 | textView.setText("");
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/app/src/main/java/com/liu/kinton/CharacterDance/base/BaseAdapter.java:
--------------------------------------------------------------------------------
1 | package com.liu.kinton.CharacterDance.base;
2 |
3 | import android.content.Context;
4 | import android.support.annotation.NonNull;
5 | import android.support.v7.widget.RecyclerView;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import java.util.List;
10 |
11 | public abstract class BaseAdapter extends RecyclerView.Adapter {
12 | private List data;
13 | private Context context;
14 | private ListItemListener listener;
15 |
16 | public BaseAdapter(Context context, List data,ListItemListener listener){
17 | this.context = context;
18 | this.data = data;
19 | this.listener = listener;
20 | }
21 |
22 | public ListItemListener getListener() {
23 | return listener;
24 | }
25 |
26 | public List getData() {
27 | return data;
28 | }
29 |
30 | public void setData(List data) {
31 | this.data = data;
32 | notifyDataSetChanged();
33 | }
34 |
35 | public void clearData(){
36 | this.data.clear();
37 | notifyDataSetChanged();
38 | }
39 |
40 | public Context getContext() {
41 | return context;
42 | }
43 |
44 | public void addData(T item){
45 | this.data.add(item);
46 | notifyDataSetChanged();
47 | }
48 |
49 | public void addList(List items){
50 | this.data.addAll(items);
51 | notifyDataSetChanged();
52 | }
53 |
54 | @NonNull
55 | @Override
56 | public D onCreateViewHolder(@NonNull ViewGroup viewGroup, int itemType) {
57 | View view = View.inflate(viewGroup.getContext(),getLayoutByType(itemType),null);
58 | return getViewHodler(view);
59 | }
60 |
61 | @Override
62 | public void onBindViewHolder(@NonNull D viewHolder, int i) {
63 | viewHolder.setData(data.get(i));
64 | }
65 |
66 | public abstract int getLayoutByType(int itemType);
67 |
68 | public abstract D getViewHodler(View view);
69 |
70 |
71 | @Override
72 | public int getItemCount() {
73 | return data.size();
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/app/src/main/java/com/liu/kinton/CharacterDance/base/BaseListItem.java:
--------------------------------------------------------------------------------
1 | package com.liu.kinton.CharacterDance.base;
2 |
3 | public class BaseListItem {
4 | private int position;
5 |
6 | public int getPosition() {
7 | return position;
8 | }
9 |
10 | public void setPosition(int position) {
11 | this.position = position;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/app/src/main/java/com/liu/kinton/CharacterDance/base/BaseViewHolder.java:
--------------------------------------------------------------------------------
1 | package com.liu.kinton.CharacterDance.base;
2 |
3 | import android.support.annotation.NonNull;
4 | import android.support.v7.widget.RecyclerView;
5 |
6 | import android.view.View;
7 |
8 |
9 | public abstract class BaseViewHolder extends RecyclerView.ViewHolder {
10 | public View itemView;
11 | private ListItemListener listener = null;
12 |
13 | public ListItemListener getListener() {
14 | return listener;
15 | }
16 |
17 | public BaseViewHolder(@NonNull View itemView, ListItemListener listener) {
18 | super(itemView);
19 | this.itemView = itemView;
20 | this.listener = listener;
21 | itemView.setOnClickListener(new View.OnClickListener() {
22 | @Override
23 | public void onClick(View v) {
24 | if(getListener() != null){
25 | getListener().onItemClick(BaseViewHolder.this.getAdapterPosition());
26 | }
27 | }
28 | });
29 | }
30 |
31 | public View getViewById(int viewId){
32 | return itemView.findViewById(viewId);
33 | }
34 |
35 | abstract public void setData(T data);
36 |
37 | abstract public void clearAll();
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/java/com/liu/kinton/CharacterDance/base/ListItemListener.java:
--------------------------------------------------------------------------------
1 | package com.liu.kinton.CharacterDance.base;
2 |
3 |
4 | public interface ListItemListener{
5 |
6 | void onItemClick(int position);
7 |
8 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/liu/kinton/CharacterDance/ffmpegUtils/CmdList.java:
--------------------------------------------------------------------------------
1 | package com.liu.kinton.CharacterDance.ffmpegUtils;
2 |
3 | import java.util.ArrayList;
4 |
5 | public class CmdList extends ArrayList {
6 | public CmdList append(String s) {
7 | this.add(s);
8 | return this;
9 | }
10 |
11 | public CmdList append(int i) {
12 | this.add(i + "");
13 | return this;
14 | }
15 |
16 | public CmdList append(float f) {
17 | this.add(f + "");
18 | return this;
19 | }
20 |
21 | public CmdList append(StringBuilder sb) {
22 | this.add(sb.toString());
23 | return this;
24 | }
25 |
26 | public CmdList append(String[] ss) {
27 | for (String s:ss) {
28 | if(!s.replace(" ","").equals("")) {
29 | this.add(s);
30 | }
31 | }
32 | return this;
33 | }
34 |
35 | @Override
36 | public String toString() {
37 | StringBuilder sb = new StringBuilder();
38 | for (String s : this) {
39 | sb.append(" ").append(s);
40 | }
41 | return sb.toString();
42 | }
43 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/liu/kinton/CharacterDance/ffmpegUtils/FFmpegCmd.java:
--------------------------------------------------------------------------------
1 | package com.liu.kinton.CharacterDance.ffmpegUtils;
2 |
3 | public class FFmpegCmd {
4 | static
5 | {
6 | System.loadLibrary("ffmpeg-cmd");
7 | }
8 |
9 | private static OnCmdExecListener sOnCmdExecListener;
10 | private static long sDuration;
11 |
12 | public static native int exec(int argc, String[] argv);
13 |
14 | public static native void exit();
15 |
16 | public static void exec(String[] cmds, long duration, OnCmdExecListener listener) {
17 | sOnCmdExecListener = listener;
18 | sDuration = duration;
19 |
20 | exec(cmds.length, cmds);
21 | }
22 |
23 | /**
24 | * FFmpeg执行结束回调,由C代码中调用
25 | */
26 | public static void onExecuted(int ret) {
27 | if (sOnCmdExecListener != null) {
28 | if (ret == 0) {
29 | sOnCmdExecListener.onProgress(sDuration);
30 | sOnCmdExecListener.onSuccess();
31 | } else {
32 | sOnCmdExecListener.onFailure();
33 | }
34 | }
35 | }
36 |
37 | /**
38 | * FFmpeg执行进度回调,由C代码调用
39 | */
40 | public static void onProgress(float progress) {
41 | if (sOnCmdExecListener != null) {
42 | if (sDuration != 0) {
43 | sOnCmdExecListener.onProgress(progress / (sDuration / 1000) * 0.95f);
44 | }
45 | }
46 | }
47 |
48 | public interface OnCmdExecListener {
49 | void onSuccess();
50 |
51 | void onFailure();
52 |
53 | void onProgress(float progress);
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/app/src/main/java/com/liu/kinton/CharacterDance/ffmpegUtils/FFmpegUtil.java:
--------------------------------------------------------------------------------
1 | package com.liu.kinton.CharacterDance.ffmpegUtils;
2 |
3 | import android.util.Log;
4 |
5 | public class FFmpegUtil {
6 | private static final String TAG = "FFmpegUtil";
7 |
8 | public static void execCmd(CmdList cmd, long duration, final OnVideoProcessListener listener) {
9 | String[] cmds = cmd.toArray(new String[cmd.size()]);
10 | Log.i(TAG, "cmd:" + cmd);
11 | listener.onProcessStart();
12 | FFmpegCmd.exec(cmds, duration, new FFmpegCmd.OnCmdExecListener() {
13 | @Override
14 | public void onSuccess() {
15 | listener.onProcessSuccess();
16 | }
17 |
18 | @Override
19 | public void onFailure() {
20 | listener.onProcessFailure();
21 | }
22 |
23 | @Override
24 | public void onProgress(float progress) {
25 | listener.onProcessProgress(progress);
26 | }
27 | });
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/liu/kinton/CharacterDance/ffmpegUtils/OnVideoProcessListener.java:
--------------------------------------------------------------------------------
1 | package com.liu.kinton.CharacterDance.ffmpegUtils;
2 |
3 | public interface OnVideoProcessListener {
4 |
5 | public void onProcessStart();
6 |
7 | public void onProcessProgress(float progress);
8 |
9 | public void onProcessSuccess();
10 |
11 | public void onProcessFailure() ;
12 | }
13 |
--------------------------------------------------------------------------------
/app/src/main/java/com/liu/kinton/CharacterDance/utils/DialogUtils.java:
--------------------------------------------------------------------------------
1 | package com.liu.kinton.CharacterDance.utils;
2 |
3 | import android.content.Context;
4 |
5 | import com.liu.kinton.CharacterDance.widget.AlertDialog;
6 | import com.liu.kinton.CharacterDance.widget.ProgressDialog;
7 | import com.liu.kinton.CharacterDance.widget.ShowPhotoDialog;
8 | import com.liu.kinton.CharacterDance.widget.VideoDialog;
9 |
10 | public class DialogUtils {
11 | public interface OnDialogBtnClickListener{
12 | void OnBtnClick(int itemId);
13 | }
14 |
15 | public static AlertDialog createAlertDialogWithText(Context context,OnDialogBtnClickListener listener){
16 | AlertDialog alertDialog = new AlertDialog(context)
17 | .setOnBtnClickListener(listener);
18 | return alertDialog;
19 | }
20 |
21 | public static ProgressDialog createProgressDialogWithText(Context context){
22 | ProgressDialog progressDialog = new ProgressDialog(context);
23 | // .setOnBtnClickListener(listener);
24 | return progressDialog;
25 | }
26 |
27 | public static ShowPhotoDialog createShowPhotoDialog(Context context){
28 | ShowPhotoDialog showPhotoDialog = new ShowPhotoDialog(context);
29 | return showPhotoDialog;
30 | }
31 |
32 | public static VideoDialog createVideoDialog(Context context,String path){
33 | VideoDialog videoDialog = new VideoDialog(context,path);
34 | return videoDialog;
35 | }
36 |
37 |
38 |
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/java/com/liu/kinton/CharacterDance/utils/TextPaint.java:
--------------------------------------------------------------------------------
1 | package com.liu.kinton.CharacterDance.utils;
2 |
3 | import android.graphics.Color;
4 | import android.graphics.Paint;
5 |
6 | public class TextPaint extends Paint {
7 | public TextPaint(){
8 | super();
9 | this.setAntiAlias(true);
10 | this.setStrokeWidth(1);
11 | this.setColor(Color.BLACK);
12 | this.setTextSize(6);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/app/src/main/java/com/liu/kinton/CharacterDance/widget/AlertDialog.java:
--------------------------------------------------------------------------------
1 | package com.liu.kinton.CharacterDance.widget;
2 |
3 | import android.app.Dialog;
4 | import android.content.Context;
5 | import android.os.Bundle;
6 | import android.support.annotation.NonNull;
7 |
8 | import android.graphics.Bitmap;
9 |
10 | import android.util.Log;
11 | import android.view.View;
12 | import android.widget.Button;
13 | import android.widget.ImageView;
14 | import android.widget.TextView;
15 |
16 | import com.liu.kinton.CharacterDance.R;
17 | import com.liu.kinton.CharacterDance.utils.DialogUtils;
18 |
19 |
20 | import butterknife.BindView;
21 | import butterknife.ButterKnife;
22 | import butterknife.OnClick;
23 | import butterknife.Unbinder;
24 |
25 | public class AlertDialog extends Dialog {
26 | @BindView(R.id.iv_alert_choosePic)
27 | ImageView ivContent;
28 | @BindView(R.id.tv_alert_message)
29 | TextView tvAlertMessage;
30 | private Context context;
31 | private Unbinder unbinder;
32 |
33 | public AlertDialog(@NonNull Context context) {
34 | super(context, R.style.dialog);
35 | setLayout(context);
36 | this.context = context;
37 | View view = getLayoutInflater().inflate(R.layout.dialog_alert, null);
38 | setContentView(view);
39 | }
40 |
41 | public AlertDialog setLayout(Context context) {
42 | return this;
43 | }
44 |
45 |
46 | @OnClick(R.id.btn_cancel)
47 | void onCancelClick() {
48 | this.dismiss();
49 | }
50 |
51 | DialogUtils.OnDialogBtnClickListener listener;
52 |
53 |
54 | @Override
55 | protected void onStart() {
56 | super.onStart();
57 | unbinder = ButterKnife.bind(this);
58 | }
59 |
60 | @Override
61 | protected void onStop() {
62 | super.onStop();
63 | unbinder.unbind();
64 | }
65 |
66 | @Override
67 | protected void onCreate(Bundle savedInstanceState) {
68 | super.onCreate(savedInstanceState);
69 | }
70 |
71 | public AlertDialog setOnBtnClickListener(DialogUtils.OnDialogBtnClickListener listener) {
72 | this.listener = listener;
73 | return this;
74 | }
75 |
76 | @OnClick(R.id.btn_cancel)
77 | void cancelDialog() {
78 | this.dismiss();
79 | }
80 |
81 | public void onListenerDettach() {
82 | this.listener = null;
83 | }
84 |
85 | @OnClick(R.id.btn_ensure)
86 | void ensureClick(View view) {
87 | if (listener == null) {
88 | Log.i("ensureClick", "the dialog button clicked listener is not setted !!");
89 | return;
90 | }
91 | listener.OnBtnClick(view.getId());
92 | }
93 |
94 | public AlertDialog setMessage(String message) {
95 | tvAlertMessage.setText(message);
96 | return this;
97 | }
98 |
99 | public AlertDialog setPic(Bitmap bitmap) {
100 | ivContent.setImageBitmap(bitmap);
101 | return this;
102 | }
103 |
104 | }
105 |
--------------------------------------------------------------------------------
/app/src/main/java/com/liu/kinton/CharacterDance/widget/ProgressDialog.java:
--------------------------------------------------------------------------------
1 | package com.liu.kinton.CharacterDance.widget;
2 |
3 | import android.app.Dialog;
4 | import android.content.Context;
5 | import android.os.Bundle;
6 | import android.support.annotation.NonNull;
7 | import android.view.View;
8 |
9 | import com.liu.kinton.CharacterDance.R;
10 |
11 | import butterknife.BindView;
12 | import butterknife.ButterKnife;
13 | import butterknife.Unbinder;
14 |
15 | public class ProgressDialog extends Dialog {
16 | @BindView(R.id.progress_view)
17 | RoundProgress roundProgress;
18 | private Unbinder unbinder;
19 |
20 | public ProgressDialog(@NonNull Context context) {
21 | super(context, R.style.dialog);
22 | View view = getLayoutInflater().inflate(R.layout.dialog_progress,null);
23 | setContentView(view);
24 | unbinder = ButterKnife.bind(this);
25 | this.setCanceledOnTouchOutside(false);
26 | this.setCancelable(false);
27 | }
28 |
29 | public void setProgress(int progress){
30 | roundProgress.setProgress(progress);
31 | }
32 |
33 | @Override
34 | protected void onCreate(Bundle savedInstanceState) {
35 | super.onCreate(savedInstanceState);
36 | }
37 |
38 | @Override
39 | protected void onStart() {
40 | super.onStart();
41 |
42 | }
43 |
44 | @Override
45 | public void dismiss() {
46 | super.dismiss();
47 | //unbinder.unbind();
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/app/src/main/java/com/liu/kinton/CharacterDance/widget/ShowPhotoDialog.java:
--------------------------------------------------------------------------------
1 | package com.liu.kinton.CharacterDance.widget;
2 |
3 | import android.app.Dialog;
4 | import android.content.Context;
5 | import android.graphics.Bitmap;
6 | import android.support.annotation.NonNull;
7 | import android.view.View;
8 | import android.widget.ImageView;
9 |
10 | import com.liu.kinton.CharacterDance.R;
11 |
12 | import butterknife.BindView;
13 | import butterknife.ButterKnife;
14 | import butterknife.OnClick;
15 | import butterknife.Unbinder;
16 |
17 | public class ShowPhotoDialog extends Dialog {
18 | @BindView(R.id.iv_show)
19 | ImageView ivShow;
20 |
21 | private Unbinder unbinder;
22 |
23 | public ShowPhotoDialog(@NonNull Context context) {
24 | super(context);
25 | View view = getLayoutInflater().inflate(R.layout.dialog_photo,null);
26 | setContentView(view);
27 | unbinder = ButterKnife.bind(this);
28 | this.setCanceledOnTouchOutside(false);
29 | this.setCancelable(false);
30 | }
31 |
32 | public void setPiscByBitmap(Bitmap bitmap){
33 | ivShow.setImageBitmap(bitmap);
34 | }
35 |
36 | @Override
37 | public void dismiss() {
38 | super.dismiss();
39 | unbinder.unbind();
40 | }
41 |
42 | @OnClick(R.id.iv_back)
43 | void onBackClick(View view){
44 | this.dismiss();
45 | }
46 |
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/app/src/main/java/com/liu/kinton/CharacterDance/widget/SquareImageView.java:
--------------------------------------------------------------------------------
1 | package com.liu.kinton.CharacterDance.widget;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.AppCompatImageView;
5 | import android.util.AttributeSet;
6 |
7 | public class SquareImageView extends AppCompatImageView{
8 | public SquareImageView(Context context) {
9 | super(context);
10 | }
11 |
12 | public SquareImageView(Context context, AttributeSet attrs) {
13 | super(context, attrs);
14 | }
15 |
16 | public SquareImageView(Context context, AttributeSet attrs, int defStyleAttr) {
17 | super(context, attrs, defStyleAttr);
18 | }
19 |
20 | @Override
21 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
22 | super.onMeasure(widthMeasureSpec, widthMeasureSpec);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_list_item_gray_normal.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_list_item_white_normal.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/button_bg_light_gray_with_left_corner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/button_bg_light_gray_with_right_corner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/button_bg_white_with_left_corner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/button_bg_white_with_right_corner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/dialog_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/main_function_button_bg_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/main_function_button_normal_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/main_function_button_onpress_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selector_bg_list_item_white.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selector_button_bg_white_with_left_corner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selector_button_bg_white_with_right_corner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_folder.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
20 |
31 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
14 |
15 |
20 |
21 |
32 |
33 |
44 |
45 |
56 |
57 |
68 |
69 |
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_alert.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
20 |
21 |
34 |
35 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_buttom_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
15 |
19 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_photo.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
10 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_video.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
11 |
19 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_item_file.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
19 |
20 |
38 |
39 |
46 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/452kinton/CharacterDance/f709827c36eefb67f60a8d5e27bb5620251d96de/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/452kinton/CharacterDance/f709827c36eefb67f60a8d5e27bb5620251d96de/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/452kinton/CharacterDance/f709827c36eefb67f60a8d5e27bb5620251d96de/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/452kinton/CharacterDance/f709827c36eefb67f60a8d5e27bb5620251d96de/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/452kinton/CharacterDance/f709827c36eefb67f60a8d5e27bb5620251d96de/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap/back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/452kinton/CharacterDance/f709827c36eefb67f60a8d5e27bb5620251d96de/app/src/main/res/mipmap/back.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap/camer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/452kinton/CharacterDance/f709827c36eefb67f60a8d5e27bb5620251d96de/app/src/main/res/mipmap/camer.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap/close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/452kinton/CharacterDance/f709827c36eefb67f60a8d5e27bb5620251d96de/app/src/main/res/mipmap/close.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap/folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/452kinton/CharacterDance/f709827c36eefb67f60a8d5e27bb5620251d96de/app/src/main/res/mipmap/folder.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap/pause.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/452kinton/CharacterDance/f709827c36eefb67f60a8d5e27bb5620251d96de/app/src/main/res/mipmap/pause.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap/photo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/452kinton/CharacterDance/f709827c36eefb67f60a8d5e27bb5620251d96de/app/src/main/res/mipmap/photo.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap/play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/452kinton/CharacterDance/f709827c36eefb67f60a8d5e27bb5620251d96de/app/src/main/res/mipmap/play.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap/video.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/452kinton/CharacterDance/f709827c36eefb67f60a8d5e27bb5620251d96de/app/src/main/res/mipmap/video.png
--------------------------------------------------------------------------------
/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #8a9bf8
4 | #697ffb
5 | #FF4081
6 | #676f9e
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | CharacterDance
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/test/java/com/liu/kinton/CharacterDance/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.liu.kinton.CharacterDance;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 |
5 | repositories {
6 | google()
7 | mavenCentral()
8 | jcenter()
9 | }
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:3.2.1'
12 | classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-rc1'
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | jcenter()
21 | maven { url 'https://jitpack.io' }
22 | google()
23 | }
24 | }
25 |
26 | task clean(type: Delete) {
27 | delete rootProject.buildDir
28 | }
29 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/452kinton/CharacterDance/f709827c36eefb67f60a8d5e27bb5620251d96de/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Jun 18 19:04:56 CST 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------