22 | * It's good practice to explicitly release() the surface, preferably from a "finally" block.
23 | */
24 | public class OffscreenSurface extends EglSurfaceBase {
25 | /**
26 | * Creates an off-screen surface with the specified width and height.
27 | */
28 | public OffscreenSurface(EglCore eglCore, int width, int height) {
29 | super(eglCore);
30 | createOffscreenSurface(width, height);
31 | }
32 |
33 | /**
34 | * Releases any resources associated with the surface.
35 | */
36 | public void release() {
37 | releaseEglSurface();
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/java/com/richie/multimedialearning/utils/gles/drawable/Drawable2d.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2014 Google Inc. All rights reserved.
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.richie.multimedialearning.utils.gles.drawable;
18 |
19 | import com.richie.multimedialearning.utils.gles.GlUtil;
20 |
21 | import java.nio.FloatBuffer;
22 |
23 | /**
24 | * Base class for stuff we like to draw.
25 | */
26 | public class Drawable2d {
27 | public static final int COORDS_PER_VERTEX = 2;
28 | private static final int SIZEOF_FLOAT = 4;
29 | public static final int VERTEX_STRIDE = COORDS_PER_VERTEX * SIZEOF_FLOAT;
30 | public static final int TEX_COORD_STRIDE = 2 * SIZEOF_FLOAT;
31 |
32 | private FloatBuffer mVertexArray;
33 | private FloatBuffer mTexCoordArray;
34 | private int mVertexCount;
35 |
36 | public Drawable2d() {
37 | }
38 |
39 | /**
40 | * Prepares a drawable from a "pre-fabricated" shape definition.
41 | *
42 | * Does no EGL/GL operations, so this can be done at any time.
43 | */
44 | public Drawable2d(float[] vertexArray, float[] texCoordArray) {
45 | updateVertexArray(vertexArray);
46 | updateTexCoordArray(texCoordArray);
47 | }
48 |
49 | /**
50 | * update vertex array and create buffer
51 | *
52 | * @param vertexArray
53 | */
54 | public void updateVertexArray(float[] vertexArray) {
55 | mVertexArray = GlUtil.createFloatBuffer(vertexArray);
56 | mVertexCount = vertexArray.length / COORDS_PER_VERTEX;
57 | }
58 |
59 | /**
60 | * update texture coordinate array and create buffer
61 | *
62 | * @param texCoordArray
63 | */
64 | public void updateTexCoordArray(float[] texCoordArray) {
65 | mTexCoordArray = GlUtil.createFloatBuffer(texCoordArray);
66 | }
67 |
68 | /**
69 | * Returns the array of vertices.
70 | *
71 | * To avoid allocations, this returns internal state. The caller must not modify it.
72 | */
73 | public FloatBuffer getVertexArray() {
74 | return mVertexArray;
75 | }
76 |
77 | /**
78 | * Returns the array of texture coordinates.
79 | *
80 | * To avoid allocations, this returns internal state. The caller must not modify it.
81 | */
82 | public FloatBuffer getTexCoordArray() {
83 | return mTexCoordArray;
84 | }
85 |
86 | /**
87 | * Returns the number of vertices stored in the vertex array.
88 | */
89 | public int getVertexCount() {
90 | return mVertexCount;
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/app/src/main/java/com/richie/multimedialearning/utils/gles/drawable/Drawable2dFull.java:
--------------------------------------------------------------------------------
1 | package com.richie.multimedialearning.utils.gles.drawable;
2 |
3 | /**
4 | * @author Richie on 2019.05.09
5 | * Draw reatangle
6 | */
7 | public class Drawable2dFull extends Drawable2d {
8 | /**
9 | * A "full" square, extending from -1 to +1 in both dimensions. When the model/view/projection
10 | * matrix is identity, this will exactly cover the viewport.
11 | *
12 | * The texture coordinates are Y-inverted relative to RECTANGLE. (This seems to work out
13 | * right with external textures from SurfaceTexture.)
14 | */
15 | private static final float[] FULL_RECTANGLE_COORDS = {
16 | -1.0f, -1.0f, // 0 bottom left
17 | 1.0f, -1.0f, // 1 bottom right
18 | -1.0f, 1.0f, // 2 top left
19 | 1.0f, 1.0f, // 3 top right
20 | };
21 | private static final float[] FULL_RECTANGLE_TEX_COORDS = {
22 | 0.0f, 0.0f, // 0 bottom left
23 | 1.0f, 0.0f, // 1 bottom right
24 | 0.0f, 1.0f, // 2 top left
25 | 1.0f, 1.0f // 3 top right
26 | };
27 |
28 | public Drawable2dFull() {
29 | super(FULL_RECTANGLE_COORDS, FULL_RECTANGLE_TEX_COORDS);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/com/richie/multimedialearning/utils/gles/program/Program.java:
--------------------------------------------------------------------------------
1 | package com.richie.multimedialearning.utils.gles.program;
2 |
3 | import android.opengl.GLES20;
4 |
5 | import com.richie.multimedialearning.utils.gles.GlUtil;
6 | import com.richie.multimedialearning.utils.gles.drawable.Drawable2d;
7 |
8 | /**
9 | * Base class for GL program
10 | */
11 | public abstract class Program {
12 |
13 | // Handles to the GL program and various components of it.
14 | protected int mProgramHandle;
15 | protected Drawable2d mDrawable2d;
16 |
17 | public Program(String vertexShader, String fragmentShader) {
18 | mProgramHandle = GlUtil.createProgram(vertexShader, fragmentShader);
19 | mDrawable2d = createDrawable2d();
20 | glGetLocations();
21 | }
22 |
23 | /**
24 | * Draw frame in identity mvp matrix
25 | *
26 | * @param textureId
27 | * @param texMatrix
28 | */
29 | public void drawFrame(int textureId, float[] texMatrix) {
30 | drawFrame(textureId, texMatrix, GlUtil.IDENTITY_MATRIX);
31 | }
32 |
33 | /**
34 | * Draw frame in specified area
35 | *
36 | * @param textureId
37 | * @param texMatrix
38 | * @param mvpMatrix
39 | * @param x viewport x
40 | * @param y viewport y
41 | * @param width viewport width
42 | * @param height viewport height
43 | */
44 | public void drawFrame(int textureId, float[] texMatrix, float[] mvpMatrix, int x, int y, int width, int height) {
45 | int[] originalViewport = new int[4];
46 | GLES20.glGetIntegerv(GLES20.GL_VIEWPORT, originalViewport, 0);
47 | GLES20.glViewport(x, y, width, height);
48 | drawFrame(textureId, texMatrix, mvpMatrix);
49 | GLES20.glViewport(originalViewport[0], originalViewport[1], originalViewport[2], originalViewport[3]);
50 | }
51 |
52 | /**
53 | * Releases the program.
54 | *
55 | * The appropriate EGL context must be current (i.e. the one that was used to create
56 | * the program).
57 | */
58 | public void release() {
59 | GLES20.glDeleteProgram(mProgramHandle);
60 | mProgramHandle = -1;
61 | }
62 |
63 | /**
64 | * Issues the draw call. Does the full setup on every call.
65 | *
66 | * @param textureId texture ID
67 | * @param mvpMatrix The 4x4 projection matrix.
68 | * @param texMatrix A 4x4 transformation matrix for texture coords. (Primarily intended
69 | * for use with SurfaceTexture.)
70 | */
71 | public abstract void drawFrame(int textureId, float[] texMatrix, float[] mvpMatrix);
72 |
73 | /**
74 | * Create drawable2d that OpenGL will use
75 | *
76 | * @return
77 | */
78 | protected abstract Drawable2d createDrawable2d();
79 |
80 | /**
81 | * Call GLES20.glGetXXXLocation method to get location of attributes and uniforms
82 | */
83 | protected abstract void glGetLocations();
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/app/src/main/java/com/richie/multimedialearning/utils/wav/WavUtils.java:
--------------------------------------------------------------------------------
1 | package com.richie.multimedialearning.utils.wav;
2 |
3 | import com.richie.multimedialearning.utils.ConvertUtils;
4 |
5 | import java.io.BufferedInputStream;
6 | import java.io.File;
7 | import java.io.FileInputStream;
8 | import java.io.IOException;
9 |
10 | /**
11 | * @author Richie on 2019.04.16
12 | */
13 | public final class WavUtils {
14 |
15 | /**
16 | * 检索 WAV 文件的头信息
17 | *
18 | * @param wavFile
19 | * @return
20 | * @throws IOException
21 | */
22 | public static WaveHeader retrieveHeader(File wavFile) throws IOException {
23 | try (BufferedInputStream bis = new BufferedInputStream(new FileInputStream(wavFile))) {
24 | byte[] headerBytes = new byte[44];
25 | int readLength = bis.read(headerBytes, 0, headerBytes.length);
26 | if (headerBytes.length != readLength) {
27 | // wrong wav file
28 | throw new IOException("Wrong wav format!");
29 | }
30 | byte[] tempSize2 = new byte[2];
31 | byte[] tempSize4 = new byte[4];
32 | WaveHeader waveHeader = new WaveHeader();
33 | System.arraycopy(headerBytes, 4, tempSize4, 0, tempSize4.length);
34 | waveHeader.ChunkSize = ConvertUtils.fromByteArrayToInt(tempSize4);
35 | System.arraycopy(headerBytes, 16, tempSize4, 0, tempSize4.length);
36 | waveHeader.Subchunk1Size = ConvertUtils.fromByteArrayToInt(tempSize4);
37 | System.arraycopy(headerBytes, 20, tempSize2, 0, tempSize2.length);
38 | waveHeader.AudioFormat = ConvertUtils.fromByteArrayToShort(tempSize2);
39 | System.arraycopy(headerBytes, 22, tempSize2, 0, tempSize2.length);
40 | waveHeader.NumChannels = ConvertUtils.fromByteArrayToShort(tempSize2);
41 | System.arraycopy(headerBytes, 24, tempSize4, 0, tempSize4.length);
42 | waveHeader.SampleRate = ConvertUtils.fromByteArrayToInt(tempSize4);
43 | System.arraycopy(headerBytes, 28, tempSize4, 0, tempSize4.length);
44 | waveHeader.BitsRate = ConvertUtils.fromByteArrayToInt(tempSize4);
45 | System.arraycopy(headerBytes, 32, tempSize2, 0, tempSize2.length);
46 | waveHeader.BlockAlign = ConvertUtils.fromByteArrayToShort(tempSize2);
47 | System.arraycopy(headerBytes, 34, tempSize2, 0, tempSize2.length);
48 | waveHeader.BitsPerSample = ConvertUtils.fromByteArrayToShort(tempSize2);
49 | System.arraycopy(headerBytes, 40, tempSize4, 0, tempSize4.length);
50 | waveHeader.Subchunk2Size = ConvertUtils.fromByteArrayToInt(tempSize4);
51 | return waveHeader;
52 | }
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/app/src/main/java/com/richie/multimedialearning/utils/wav/WaveHeader.java:
--------------------------------------------------------------------------------
1 | package com.richie.multimedialearning.utils.wav;
2 |
3 | import java.io.ByteArrayOutputStream;
4 | import java.io.IOException;
5 |
6 | /**
7 | * wav文件头
8 | * https://blog.csdn.net/imxiangzi/article/details/80265978
9 | */
10 | final class WaveHeader {
11 | private static final char ChunkID[] = {'R', 'I', 'F', 'F'};
12 | private static final char Format[] = {'W', 'A', 'V', 'E'};
13 | private static final char Subchunk1ID[] = {'f', 'm', 't', ' '};
14 | private static final char Subchunk2ID[] = {'d', 'a', 't', 'a'};
15 | public int ChunkSize; // 文件的长度减去RIFF区块ChunkID和ChunkSize的长度
16 | public int Subchunk1Size = 16; // Format区块数据的长度(不包含ID和Size的长度)
17 | public short AudioFormat; // Data区块的音频数据的格式,PCM音频数据的值为1
18 | public short NumChannels; // 音频数据的声道数,1:单声道,2:双声道
19 | public int SampleRate; // 音频数据的采样率
20 | public int BitsPerSample; // 每个采样点存储的bit数,8,16
21 | public int BitsRate; // 每秒数据字节数 = SampleRate * NumChannels * BitsPerSample / 8
22 | public short BlockAlign; // 每个采样点所需的字节数 = NumChannels * BitsPerSample / 8
23 | public int Subchunk2Size; // 音频数据的长度,N = ByteRate * seconds
24 |
25 | byte[] getHeader() throws IOException {
26 | ByteArrayOutputStream baos = new ByteArrayOutputStream();
27 | writeChar(baos, ChunkID);
28 | writeInt(baos, ChunkSize);
29 | writeChar(baos, Format);
30 | writeChar(baos, Subchunk1ID);
31 | writeInt(baos, Subchunk1Size);
32 | writeShort(baos, AudioFormat);
33 | writeShort(baos, NumChannels);
34 | writeInt(baos, SampleRate);
35 | BitsRate = NumChannels * BitsPerSample * SampleRate / 8;
36 | BlockAlign = (short) (NumChannels * BitsPerSample / 8);
37 | writeInt(baos, BitsRate);
38 | writeShort(baos, BlockAlign);
39 | writeShort(baos, BitsPerSample);
40 | writeChar(baos, Subchunk2ID);
41 | writeInt(baos, Subchunk2Size);
42 | baos.flush();
43 | byte[] bytesHeader = baos.toByteArray();
44 | baos.close();
45 | return bytesHeader;
46 | }
47 |
48 | private void writeShort(ByteArrayOutputStream bos, int s) throws IOException {
49 | byte[] buf = new byte[2];
50 | buf[1] = (byte) ((s << 16) >> 24);
51 | buf[0] = (byte) ((s << 24) >> 24);
52 | bos.write(buf);
53 | }
54 |
55 | private void writeInt(ByteArrayOutputStream bos, int i) throws IOException {
56 | byte[] buf = new byte[4];
57 | buf[3] = (byte) (i >> 24);
58 | buf[2] = (byte) ((i << 8) >> 24);
59 | buf[1] = (byte) ((i << 16) >> 24);
60 | buf[0] = (byte) ((i << 24) >> 24);
61 | bos.write(buf);
62 | }
63 |
64 | private void writeChar(ByteArrayOutputStream bos, char[] chars) {
65 | for (char c : chars) {
66 | bos.write(c);
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_audio_record.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_audio_track.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
19 |
20 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_camera_open_gl.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
16 |
25 |
26 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_camera_preview.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_codec.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
18 |
19 |
30 |
31 |
42 |
43 |
54 |
55 |
66 |
67 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_ffmpeg_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
20 |
21 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_ffmpeg_video.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_media_codec.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_media_muxur_extract.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
25 |
26 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_open_gl.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_simple_player.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_surface.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isuperqiang/MultiMediaLearning/17636dfbf243185dfbc47bce9ae4f9d9c59d73d4/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isuperqiang/MultiMediaLearning/17636dfbf243185dfbc47bce9ae4f9d9c59d73d4/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isuperqiang/MultiMediaLearning/17636dfbf243185dfbc47bce9ae4f9d9c59d73d4/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isuperqiang/MultiMediaLearning/17636dfbf243185dfbc47bce9ae4f9d9c59d73d4/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isuperqiang/MultiMediaLearning/17636dfbf243185dfbc47bce9ae4f9d9c59d73d4/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isuperqiang/MultiMediaLearning/17636dfbf243185dfbc47bce9ae4f9d9c59d73d4/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isuperqiang/MultiMediaLearning/17636dfbf243185dfbc47bce9ae4f9d9c59d73d4/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isuperqiang/MultiMediaLearning/17636dfbf243185dfbc47bce9ae4f9d9c59d73d4/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isuperqiang/MultiMediaLearning/17636dfbf243185dfbc47bce9ae4f9d9c59d73d4/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isuperqiang/MultiMediaLearning/17636dfbf243185dfbc47bce9ae4f9d9c59d73d4/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 16dp
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | MultiMedia
3 | CodecActivity
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/test/java/com/richie/multimedialearning/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.richie.multimedialearning;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.assertEquals;
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 |
18 | @Test
19 | public void ptClassLoader() {
20 | ClassLoader classLoader = getClass().getClassLoader();
21 | System.out.println("app:" + classLoader);
22 | while (classLoader.getParent() != null) {
23 | classLoader = classLoader.getParent();
24 | System.out.println("parent:" + classLoader);
25 | }
26 | }
27 |
28 | }
--------------------------------------------------------------------------------
/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 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.6.4'
11 |
12 | // NOTE: Do not place your application dependencies here; they belong
13 | // in the individual module build.gradle files
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | google()
20 | jcenter()
21 | maven { url 'https://jitpack.io' }
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/ffmpeg/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | .cxx
--------------------------------------------------------------------------------
/ffmpeg/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 28
5 | buildToolsVersion "29.0.3"
6 |
7 | defaultConfig {
8 | minSdkVersion 19
9 | targetSdkVersion 28
10 | versionCode 1
11 | versionName "1.0"
12 | externalNativeBuild {
13 | cmake {
14 | cppFlags ""
15 | }
16 | ndk {
17 | abiFilters "armeabi-v7a"
18 | }
19 | }
20 | }
21 |
22 | buildTypes {
23 | release {
24 | minifyEnabled false
25 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
26 | }
27 | }
28 |
29 | externalNativeBuild {
30 | cmake {
31 | path "src/main/cpp/CMakeLists.txt"
32 | }
33 | }
34 |
35 | compileOptions {
36 | sourceCompatibility JavaVersion.VERSION_1_8
37 | targetCompatibility JavaVersion.VERSION_1_8
38 | }
39 | }
40 |
41 | dependencies {
42 | implementation fileTree(dir: 'libs', include: ['*.jar'])
43 | }
--------------------------------------------------------------------------------
/ffmpeg/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
--------------------------------------------------------------------------------
/ffmpeg/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavcodec/ac3_parser.h:
--------------------------------------------------------------------------------
1 | /*
2 | * AC-3 parser prototypes
3 | * Copyright (c) 2003 Fabrice Bellard
4 | * Copyright (c) 2003 Michael Niedermayer
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_AC3_PARSER_H
24 | #define AVCODEC_AC3_PARSER_H
25 |
26 | #include
27 | #include
28 |
29 | /**
30 | * Extract the bitstream ID and the frame size from AC-3 data.
31 | */
32 | int av_ac3_parse_header(const uint8_t *buf, size_t size,
33 | uint8_t *bitstream_id, uint16_t *frame_size);
34 |
35 |
36 | #endif /* AVCODEC_AC3_PARSER_H */
37 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavcodec/adts_parser.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_ADTS_PARSER_H
20 | #define AVCODEC_ADTS_PARSER_H
21 |
22 | #include
23 | #include
24 |
25 | #define AV_AAC_ADTS_HEADER_SIZE 7
26 |
27 | /**
28 | * Extract the number of samples and frames from AAC data.
29 | * @param[in] buf pointer to AAC data buffer
30 | * @param[out] samples Pointer to where number of samples is written
31 | * @param[out] frames Pointer to where number of frames is written
32 | * @return Returns 0 on success, error code on failure.
33 | */
34 | int av_adts_header_parse(const uint8_t *buf, uint32_t *samples,
35 | uint8_t *frames);
36 |
37 | #endif /* AVCODEC_ADTS_PARSER_H */
38 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/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 |
71 | void (*get_pixels_unaligned)(int16_t *block /* align 16 */,
72 | const uint8_t *pixels,
73 | ptrdiff_t line_size);
74 | } AVDCT;
75 |
76 | /**
77 | * Allocates a AVDCT context.
78 | * This needs to be initialized with avcodec_dct_init() after optionally
79 | * configuring it with AVOptions.
80 | *
81 | * To free it use av_free()
82 | */
83 | AVDCT *avcodec_dct_alloc(void);
84 |
85 | int avcodec_dct_init(AVDCT *);
86 |
87 | const AVClass *avcodec_dct_get_class(void);
88 |
89 | #endif /* AVCODEC_AVDCT_H */
90 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavcodec/dxva2.h:
--------------------------------------------------------------------------------
1 | /*
2 | * DXVA2 HW acceleration
3 | *
4 | * copyright (c) 2009 Laurent Aimar
5 | *
6 | * This file is part of FFmpeg.
7 | *
8 | * FFmpeg is free software; you can redistribute it and/or
9 | * modify it under the terms of the GNU Lesser General Public
10 | * License as published by the Free Software Foundation; either
11 | * version 2.1 of the License, or (at your option) any later version.
12 | *
13 | * FFmpeg is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | * Lesser General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Lesser General Public
19 | * License along with FFmpeg; if not, write to the Free Software
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | */
22 |
23 | #ifndef AVCODEC_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 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavcodec/jni.h:
--------------------------------------------------------------------------------
1 | /*
2 | * JNI public API functions
3 | *
4 | * Copyright (c) 2015-2016 Matthieu Bouron
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_JNI_H
24 | #define AVCODEC_JNI_H
25 |
26 | /*
27 | * Manually set a Java virtual machine which will be used to retrieve the JNI
28 | * environment. Once a Java VM is set it cannot be changed afterwards, meaning
29 | * you can call multiple times av_jni_set_java_vm with the same Java VM pointer
30 | * however it will error out if you try to set a different Java VM.
31 | *
32 | * @param vm Java virtual machine
33 | * @param log_ctx context used for logging, can be NULL
34 | * @return 0 on success, < 0 otherwise
35 | */
36 | int av_jni_set_java_vm(void *vm, void *log_ctx);
37 |
38 | /*
39 | * Get the Java virtual machine which has been set with av_jni_set_java_vm.
40 | *
41 | * @param vm Java virtual machine
42 | * @return a pointer to the Java virtual machine
43 | */
44 | void *av_jni_get_java_vm(void *log_ctx);
45 |
46 | #endif /* AVCODEC_JNI_H */
47 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavcodec/vaapi.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Video Acceleration API (shared data between FFmpeg and the video player)
3 | * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1
4 | *
5 | * Copyright (C) 2008-2009 Splitted-Desktop Systems
6 | *
7 | * This file is part of FFmpeg.
8 | *
9 | * FFmpeg is free software; you can redistribute it and/or
10 | * modify it under the terms of the GNU Lesser General Public
11 | * License as published by the Free Software Foundation; either
12 | * version 2.1 of the License, or (at your option) any later version.
13 | *
14 | * FFmpeg is distributed in the hope that it will be useful,
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 | * Lesser General Public License for more details.
18 | *
19 | * You should have received a copy of the GNU Lesser General Public
20 | * License along with FFmpeg; if not, write to the Free Software
21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 | */
23 |
24 | #ifndef AVCODEC_VAAPI_H
25 | #define AVCODEC_VAAPI_H
26 |
27 | /**
28 | * @file
29 | * @ingroup lavc_codec_hwaccel_vaapi
30 | * Public libavcodec VA API header.
31 | */
32 |
33 | #include
34 | #include "libavutil/attributes.h"
35 | #include "version.h"
36 |
37 | #if FF_API_STRUCT_VAAPI_CONTEXT
38 |
39 | /**
40 | * @defgroup lavc_codec_hwaccel_vaapi VA API Decoding
41 | * @ingroup lavc_codec_hwaccel
42 | * @{
43 | */
44 |
45 | /**
46 | * This structure is used to share data between the FFmpeg library and
47 | * the client video application.
48 | * This shall be zero-allocated and available as
49 | * AVCodecContext.hwaccel_context. All user members can be set once
50 | * during initialization or through each AVCodecContext.get_buffer()
51 | * function call. In any case, they must be valid prior to calling
52 | * decoding functions.
53 | *
54 | * Deprecated: use AVCodecContext.hw_frames_ctx instead.
55 | */
56 | struct attribute_deprecated vaapi_context{
57 | /**
58 | * Window system dependent data
59 | *
60 | * - encoding: unused
61 | * - decoding: Set by user
62 | */
63 | void * display;
64 |
65 | /**
66 | * Configuration ID
67 | *
68 | * - encoding: unused
69 | * - decoding: Set by user
70 | */
71 | uint32_t config_id;
72 |
73 | /**
74 | * Context ID (video decode pipeline)
75 | *
76 | * - encoding: unused
77 | * - decoding: Set by user
78 | */
79 | uint32_t context_id;
80 | };
81 |
82 | /* @} */
83 |
84 | #endif /* FF_API_STRUCT_VAAPI_CONTEXT */
85 |
86 | #endif /* AVCODEC_VAAPI_H */
87 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavcodec/vorbis_parser.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 | * A public API for Vorbis parsing
22 | *
23 | * Determines the duration for each packet.
24 | */
25 |
26 | #ifndef AVCODEC_VORBIS_PARSER_H
27 | #define AVCODEC_VORBIS_PARSER_H
28 |
29 | #include
30 |
31 | typedef struct AVVorbisParseContext AVVorbisParseContext;
32 |
33 | /**
34 | * Allocate and initialize the Vorbis parser using headers in the extradata.
35 | */
36 | AVVorbisParseContext *av_vorbis_parse_init(const uint8_t *extradata,
37 | int extradata_size);
38 |
39 | /**
40 | * Free the parser and everything associated with it.
41 | */
42 | void av_vorbis_parse_free(AVVorbisParseContext **s);
43 |
44 | #define VORBIS_FLAG_HEADER 0x00000001
45 | #define VORBIS_FLAG_COMMENT 0x00000002
46 | #define VORBIS_FLAG_SETUP 0x00000004
47 |
48 | /**
49 | * Get the duration for a Vorbis packet.
50 | *
51 | * If @p flags is @c NULL,
52 | * special frames are considered invalid.
53 | *
54 | * @param s Vorbis parser context
55 | * @param buf buffer containing a Vorbis frame
56 | * @param buf_size size of the buffer
57 | * @param flags flags for special frames
58 | */
59 | int av_vorbis_parse_frame_flags(AVVorbisParseContext *s, const uint8_t *buf,
60 | int buf_size, int *flags);
61 |
62 | /**
63 | * Get the duration for a Vorbis packet.
64 | *
65 | * @param s Vorbis parser context
66 | * @param buf buffer containing a Vorbis frame
67 | * @param buf_size size of the buffer
68 | */
69 | int av_vorbis_parse_frame(AVVorbisParseContext *s, const uint8_t *buf,
70 | int buf_size);
71 |
72 | void av_vorbis_parse_reset(AVVorbisParseContext *s);
73 |
74 | #endif /* AVCODEC_VORBIS_PARSER_H */
75 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavdevice/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVDEVICE_VERSION_H
20 | #define AVDEVICE_VERSION_H
21 |
22 | /**
23 | * @file
24 | * @ingroup lavd
25 | * Libavdevice version macros
26 | */
27 |
28 | #include "libavutil/version.h"
29 |
30 | #define LIBAVDEVICE_VERSION_MAJOR 58
31 | #define LIBAVDEVICE_VERSION_MINOR 11
32 | #define LIBAVDEVICE_VERSION_MICRO 103
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 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavfilter/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Version macros.
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVFILTER_VERSION_H
22 | #define AVFILTER_VERSION_H
23 |
24 | /**
25 | * @file
26 | * @ingroup lavfi
27 | * Libavfilter version macros
28 | */
29 |
30 | #include "libavutil/version.h"
31 |
32 | #define LIBAVFILTER_VERSION_MAJOR 7
33 | #define LIBAVFILTER_VERSION_MINOR 93
34 | #define LIBAVFILTER_VERSION_MICRO 100
35 |
36 |
37 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
38 | LIBAVFILTER_VERSION_MINOR, \
39 | LIBAVFILTER_VERSION_MICRO)
40 | #define LIBAVFILTER_VERSION AV_VERSION(LIBAVFILTER_VERSION_MAJOR, \
41 | LIBAVFILTER_VERSION_MINOR, \
42 | LIBAVFILTER_VERSION_MICRO)
43 | #define LIBAVFILTER_BUILD LIBAVFILTER_VERSION_INT
44 |
45 | #define LIBAVFILTER_IDENT "Lavfi" AV_STRINGIFY(LIBAVFILTER_VERSION)
46 |
47 | /**
48 | * FF_API_* defines may be placed below to indicate public API that will be
49 | * dropped at a future version bump. The defines themselves are not part of
50 | * the public API and may change, break or disappear at any time.
51 | */
52 |
53 | #ifndef FF_API_OLD_FILTER_OPTS_ERROR
54 | #define FF_API_OLD_FILTER_OPTS_ERROR (LIBAVFILTER_VERSION_MAJOR < 8)
55 | #endif
56 | #ifndef FF_API_LAVR_OPTS
57 | #define FF_API_LAVR_OPTS (LIBAVFILTER_VERSION_MAJOR < 8)
58 | #endif
59 | #ifndef FF_API_FILTER_GET_SET
60 | #define FF_API_FILTER_GET_SET (LIBAVFILTER_VERSION_MAJOR < 8)
61 | #endif
62 | #ifndef FF_API_SWS_PARAM_OPTION
63 | #define FF_API_SWS_PARAM_OPTION (LIBAVFILTER_VERSION_MAJOR < 8)
64 | #endif
65 | #ifndef FF_API_NEXT
66 | #define FF_API_NEXT (LIBAVFILTER_VERSION_MAJOR < 8)
67 | #endif
68 |
69 | #endif /* AVFILTER_VERSION_H */
70 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/adler32.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2006 Mans Rullgard
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | /**
22 | * @file
23 | * @ingroup lavu_adler32
24 | * Public header for Adler-32 hash function implementation.
25 | */
26 |
27 | #ifndef AVUTIL_ADLER32_H
28 | #define AVUTIL_ADLER32_H
29 |
30 | #include
31 | #include "attributes.h"
32 |
33 | /**
34 | * @defgroup lavu_adler32 Adler-32
35 | * @ingroup lavu_hash
36 | * Adler-32 hash function implementation.
37 | *
38 | * @{
39 | */
40 |
41 | /**
42 | * Calculate the Adler32 checksum of a buffer.
43 | *
44 | * Passing the return value to a subsequent av_adler32_update() call
45 | * allows the checksum of multiple buffers to be calculated as though
46 | * they were concatenated.
47 | *
48 | * @param adler initial checksum value
49 | * @param buf pointer to input buffer
50 | * @param len size of input buffer
51 | * @return updated checksum
52 | */
53 | unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf,
54 | unsigned int len) av_pure;
55 |
56 | /**
57 | * @}
58 | */
59 |
60 | #endif /* AVUTIL_ADLER32_H */
61 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/aes.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2007 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_AES_H
22 | #define AVUTIL_AES_H
23 |
24 | #include
25 |
26 | #include "attributes.h"
27 | #include "version.h"
28 |
29 | /**
30 | * @defgroup lavu_aes AES
31 | * @ingroup lavu_crypto
32 | * @{
33 | */
34 |
35 | extern const int av_aes_size;
36 |
37 | struct AVAES;
38 |
39 | /**
40 | * Allocate an AVAES context.
41 | */
42 | struct AVAES *av_aes_alloc(void);
43 |
44 | /**
45 | * Initialize an AVAES context.
46 | * @param key_bits 128, 192 or 256
47 | * @param decrypt 0 for encryption, 1 for decryption
48 | */
49 | int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt);
50 |
51 | /**
52 | * Encrypt or decrypt a buffer using a previously initialized context.
53 | * @param count number of 16 byte blocks
54 | * @param dst destination array, can be equal to src
55 | * @param src source array, can be equal to dst
56 | * @param iv initialization vector for CBC mode, if NULL then ECB will be used
57 | * @param decrypt 0 for encryption, 1 for decryption
58 | */
59 | void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv,
60 | int decrypt);
61 |
62 | /**
63 | * @}
64 | */
65 |
66 | #endif /* AVUTIL_AES_H */
67 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/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 8-byte iv
71 | */
72 | void av_aes_ctr_set_iv(struct AVAESCTR *a, const uint8_t *iv);
73 |
74 | /**
75 | * Forcefully change the "full" 16-byte iv, including the counter
76 | */
77 | void av_aes_ctr_set_full_iv(struct AVAESCTR *a, const uint8_t *iv);
78 |
79 | /**
80 | * Increment the top 64 bit of the iv (performed after each frame)
81 | */
82 | void av_aes_ctr_increment_iv(struct AVAESCTR *a);
83 |
84 | /**
85 | * @}
86 | */
87 |
88 | #endif /* AVUTIL_AES_CTR_H */
89 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/avassert.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2010 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | /**
22 | * @file
23 | * simple assert() macros that are a bit more flexible than ISO C assert().
24 | * @author Michael Niedermayer
25 | */
26 |
27 | #ifndef AVUTIL_AVASSERT_H
28 | #define AVUTIL_AVASSERT_H
29 |
30 | #include
31 | #include "avutil.h"
32 | #include "log.h"
33 |
34 | /**
35 | * assert() equivalent, that is always enabled.
36 | */
37 | #define av_assert0(cond) do { \
38 | if (!(cond)) { \
39 | av_log(NULL, AV_LOG_PANIC, "Assertion %s failed at %s:%d\n", \
40 | AV_STRINGIFY(cond), __FILE__, __LINE__); \
41 | abort(); \
42 | } \
43 | } while (0)
44 |
45 |
46 | /**
47 | * assert() equivalent, that does not lie in speed critical code.
48 | * These asserts() thus can be enabled without fearing speed loss.
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 | #define av_assert2_fpu() av_assert0_fpu()
63 | #else
64 | #define av_assert2(cond) ((void)0)
65 | #define av_assert2_fpu() ((void)0)
66 | #endif
67 |
68 | /**
69 | * Assert that floating point operations can be executed.
70 | *
71 | * This will av_assert0() that the cpu is not in MMX state on X86
72 | */
73 | void av_assert0_fpu(void);
74 |
75 | #endif /* AVUTIL_AVASSERT_H */
76 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/avconfig.h:
--------------------------------------------------------------------------------
1 | /* Generated by ffmpeg configure */
2 | #ifndef AVUTIL_AVCONFIG_H
3 | #define AVUTIL_AVCONFIG_H
4 | #define AV_HAVE_BIGENDIAN 0
5 | #define AV_HAVE_FAST_UNALIGNED 1
6 | #endif /* AVUTIL_AVCONFIG_H */
7 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/base64.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2006 Ryan Martell. (rdm4@martellventures.com)
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_BASE64_H
22 | #define AVUTIL_BASE64_H
23 |
24 | #include
25 |
26 | /**
27 | * @defgroup lavu_base64 Base64
28 | * @ingroup lavu_crypto
29 | * @{
30 | */
31 |
32 | /**
33 | * Decode a base64-encoded string.
34 | *
35 | * @param out buffer for decoded data
36 | * @param in null-terminated input string
37 | * @param out_size size in bytes of the out buffer, must be at
38 | * least 3/4 of the length of in, that is AV_BASE64_DECODE_SIZE(strlen(in))
39 | * @return number of bytes written, or a negative value in case of
40 | * invalid input
41 | */
42 | int av_base64_decode(uint8_t *out, const char *in, int out_size);
43 |
44 | /**
45 | * Calculate the output size in bytes needed to decode a base64 string
46 | * with length x to a data buffer.
47 | */
48 | #define AV_BASE64_DECODE_SIZE(x) ((x) * 3LL / 4)
49 |
50 | /**
51 | * Encode data to base64 and null-terminate.
52 | *
53 | * @param out buffer for encoded data
54 | * @param out_size size in bytes of the out buffer (including the
55 | * null terminator), must be at least AV_BASE64_SIZE(in_size)
56 | * @param in input buffer containing the data to encode
57 | * @param in_size size in bytes of the in buffer
58 | * @return out or NULL in case of error
59 | */
60 | char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size);
61 |
62 | /**
63 | * Calculate the output size needed to base64-encode x bytes to a
64 | * null-terminated string.
65 | */
66 | #define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1)
67 |
68 | /**
69 | * @}
70 | */
71 |
72 | #endif /* AVUTIL_BASE64_H */
73 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/blowfish.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Blowfish algorithm
3 | * Copyright (c) 2012 Samuel Pitoiset
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_BLOWFISH_H
23 | #define AVUTIL_BLOWFISH_H
24 |
25 | #include
26 |
27 | /**
28 | * @defgroup lavu_blowfish Blowfish
29 | * @ingroup lavu_crypto
30 | * @{
31 | */
32 |
33 | #define AV_BF_ROUNDS 16
34 |
35 | typedef struct AVBlowfish {
36 | uint32_t p[AV_BF_ROUNDS + 2];
37 | uint32_t s[4][256];
38 | } AVBlowfish;
39 |
40 | /**
41 | * 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 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/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
66 | av_camellia_crypt(struct AVCAMELLIA *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv,
67 | int decrypt);
68 |
69 | /**
70 | * @}
71 | */
72 | #endif /* AVUTIL_CAMELLIA_H */
73 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/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 | /**
47 | * Initialize an AVCAST5 context.
48 | *
49 | * @param ctx an AVCAST5 context
50 | * @param key a key of 5,6,...16 bytes used for encryption/decryption
51 | * @param key_bits number of keybits: possible are 40,48,...,128
52 | * @return 0 on success, less than 0 on failure
53 | */
54 | int av_cast5_init(struct AVCAST5 *ctx, const uint8_t *key, int key_bits);
55 |
56 | /**
57 | * Encrypt or decrypt a buffer using a previously initialized context, ECB mode only
58 | *
59 | * @param ctx an AVCAST5 context
60 | * @param dst destination array, can be equal to src
61 | * @param src source array, can be equal to dst
62 | * @param count number of 8 byte blocks
63 | * @param decrypt 0 for encryption, 1 for decryption
64 | */
65 | void av_cast5_crypt(struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, int decrypt);
66 |
67 | /**
68 | * Encrypt or decrypt a buffer using a previously initialized context
69 | *
70 | * @param ctx an AVCAST5 context
71 | * @param dst destination array, can be equal to src
72 | * @param src source array, can be equal to dst
73 | * @param count number of 8 byte blocks
74 | * @param iv initialization vector for CBC mode, NULL for ECB mode
75 | * @param decrypt 0 for encryption, 1 for decryption
76 | */
77 | void av_cast5_crypt2(struct AVCAST5 *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv,
78 | int decrypt);
79 | /**
80 | * @}
81 | */
82 | #endif /* AVUTIL_CAST5_H */
83 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/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,
63 | int decrypt);
64 |
65 | /**
66 | * @brief Calculates CBC-MAC using the DES algorithm.
67 | *
68 | * @param count number of 8 byte blocks
69 | * @param dst destination array, can be equal to src, must be 8-byte aligned
70 | * @param src source array, can be equal to dst, must be 8-byte aligned, may be NULL
71 | */
72 | void av_des_mac(struct AVDES *d, uint8_t *dst, const uint8_t *src, int count);
73 |
74 | /**
75 | * @}
76 | */
77 |
78 | #endif /* AVUTIL_DES_H */
79 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/dovi_meta.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2020 Vacing Fang
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 | * DOVI configuration
24 | */
25 |
26 |
27 | #ifndef AVUTIL_DOVI_META_H
28 | #define AVUTIL_DOVI_META_H
29 |
30 | #include
31 | #include
32 |
33 | /*
34 | * DOVI configuration
35 | * ref: dolby-vision-bitstreams-within-the-iso-base-media-file-format-v2.1.2
36 | dolby-vision-bitstreams-in-mpeg-2-transport-stream-multiplex-v1.2
37 | * @code
38 | * uint8_t dv_version_major, the major version number that the stream complies with
39 | * uint8_t dv_version_minor, the minor version number that the stream complies with
40 | * uint8_t dv_profile, the Dolby Vision profile
41 | * uint8_t dv_level, the Dolby Vision level
42 | * uint8_t rpu_present_flag
43 | * uint8_t el_present_flag
44 | * uint8_t bl_present_flag
45 | * uint8_t dv_bl_signal_compatibility_id
46 | * @endcode
47 | *
48 | * @note The struct must be allocated with av_dovi_alloc() and
49 | * its size is not a part of the public ABI.
50 | */
51 | typedef struct AVDOVIDecoderConfigurationRecord {
52 | uint8_t dv_version_major;
53 | uint8_t dv_version_minor;
54 | uint8_t dv_profile;
55 | uint8_t dv_level;
56 | uint8_t rpu_present_flag;
57 | uint8_t el_present_flag;
58 | uint8_t bl_present_flag;
59 | uint8_t dv_bl_signal_compatibility_id;
60 | } AVDOVIDecoderConfigurationRecord;
61 |
62 | /**
63 | * Allocate a AVDOVIDecoderConfigurationRecord structure and initialize its
64 | * fields to default values.
65 | *
66 | * @return the newly allocated struct or NULL on failure
67 | */
68 | AVDOVIDecoderConfigurationRecord *av_dovi_alloc(size_t *size);
69 |
70 | #endif /* AVUTIL_DOVI_META_H */
71 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/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 "N-100408-g081a179"
5 | #endif /* AVUTIL_FFVERSION_H */
6 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/file.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef AVUTIL_FILE_H
20 | #define AVUTIL_FILE_H
21 |
22 | #include
23 |
24 | #include "avutil.h"
25 |
26 | /**
27 | * @file
28 | * Misc file utilities.
29 | */
30 |
31 | /**
32 | * Read the file with name filename, and put its content in a newly
33 | * allocated buffer or map it with mmap() when available.
34 | * In case of success set *bufptr to the read or mmapped buffer, and
35 | * *size to the size in bytes of the buffer in *bufptr.
36 | * Unlike mmap this function succeeds with zero sized files, in this
37 | * case *bufptr will be set to NULL and *size will be set to 0.
38 | * The returned buffer must be released with av_file_unmap().
39 | *
40 | * @param log_offset loglevel offset used for logging
41 | * @param log_ctx context used for logging
42 | * @return a non negative number in case of success, a negative value
43 | * corresponding to an AVERROR error code in case of failure
44 | */
45 | av_warn_unused_result
46 | int av_file_map(const char *filename, uint8_t **bufptr, size_t *size,
47 | int log_offset, void *log_ctx);
48 |
49 | /**
50 | * Unmap or free the buffer bufptr created by av_file_map().
51 | *
52 | * @param size size in bytes of bufptr, must be the same as returned
53 | * by av_file_map()
54 | */
55 | void av_file_unmap(uint8_t *bufptr, size_t size);
56 |
57 | /**
58 | * Wrapper to work around the lack of mkstemp() on mingw.
59 | * Also, tries to create file in /tmp first, if possible.
60 | * *prefix can be a character constant; *filename will be allocated internally.
61 | * @return file descriptor of opened file (or negative value corresponding to an
62 | * AVERROR code on error)
63 | * and opened file name in **filename.
64 | * @note On very old libcs it is necessary to set a secure umask before
65 | * calling this, av_tempfile() can't call umask itself as it is used in
66 | * libraries and could interfere with the calling application.
67 | * @deprecated as fd numbers cannot be passed saftely between libs on some platforms
68 | */
69 | int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_ctx);
70 |
71 | #endif /* AVUTIL_FILE_H */
72 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/hwcontext_cuda.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 | #ifndef AVUTIL_HWCONTEXT_CUDA_H
21 | #define AVUTIL_HWCONTEXT_CUDA_H
22 |
23 | #ifndef CUDA_VERSION
24 |
25 | #include
26 |
27 | #endif
28 |
29 | #include "pixfmt.h"
30 |
31 | /**
32 | * @file
33 | * An API-specific header for AV_HWDEVICE_TYPE_CUDA.
34 | *
35 | * This API supports dynamic frame pools. AVHWFramesContext.pool must return
36 | * AVBufferRefs whose data pointer is a CUdeviceptr.
37 | */
38 |
39 | typedef struct AVCUDADeviceContextInternal AVCUDADeviceContextInternal;
40 |
41 | /**
42 | * This struct is allocated as AVHWDeviceContext.hwctx
43 | */
44 | typedef struct AVCUDADeviceContext {
45 | CUcontext cuda_ctx;
46 | CUstream stream;
47 | AVCUDADeviceContextInternal *internal;
48 | } AVCUDADeviceContext;
49 |
50 | /**
51 | * AVHWFramesContext.hwctx is currently not used
52 | */
53 |
54 | /**
55 | * @defgroup hwcontext_cuda Device context creation flags
56 | *
57 | * Flags for av_hwdevice_ctx_create.
58 | *
59 | * @{
60 | */
61 |
62 | /**
63 | * Use primary device context instead of creating a new one.
64 | */
65 | #define AV_CUDA_USE_PRIMARY_CONTEXT (1 << 0)
66 |
67 | /**
68 | * @}
69 | */
70 |
71 | #endif /* AVUTIL_HWCONTEXT_CUDA_H */
72 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/hwcontext_dxva2.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 | #ifndef AVUTIL_HWCONTEXT_DXVA2_H
21 | #define AVUTIL_HWCONTEXT_DXVA2_H
22 |
23 | /**
24 | * @file
25 | * An API-specific header for AV_HWDEVICE_TYPE_DXVA2.
26 | *
27 | * Only fixed-size pools are supported.
28 | *
29 | * For user-allocated pools, AVHWFramesContext.pool must return AVBufferRefs
30 | * with the data pointer set to a pointer to IDirect3DSurface9.
31 | */
32 |
33 | #include
34 | #include
35 |
36 | /**
37 | * This struct is allocated as AVHWDeviceContext.hwctx
38 | */
39 | typedef struct AVDXVA2DeviceContext {
40 | IDirect3DDeviceManager9 *devmgr;
41 | } AVDXVA2DeviceContext;
42 |
43 | /**
44 | * This struct is allocated as AVHWFramesContext.hwctx
45 | */
46 | typedef struct AVDXVA2FramesContext {
47 | /**
48 | * The surface type (e.g. DXVA2_VideoProcessorRenderTarget or
49 | * DXVA2_VideoDecoderRenderTarget). Must be set by the caller.
50 | */
51 | DWORD surface_type;
52 |
53 | /**
54 | * The surface pool. When an external pool is not provided by the caller,
55 | * this will be managed (allocated and filled on init, freed on uninit) by
56 | * libavutil.
57 | */
58 | IDirect3DSurface9 **surfaces;
59 | int nb_surfaces;
60 |
61 | /**
62 | * Certain drivers require the decoder to be destroyed before the surfaces.
63 | * To allow internally managed pools to work properly in such cases, this
64 | * field is provided.
65 | *
66 | * If it is non-NULL, libavutil will call IDirectXVideoDecoder_Release() on
67 | * it just before the internal surface pool is freed.
68 | *
69 | * This is for convenience only. Some code uses other methods to manage the
70 | * decoder reference.
71 | */
72 | IDirectXVideoDecoder *decoder_to_release;
73 | } AVDXVA2FramesContext;
74 |
75 | #endif /* AVUTIL_HWCONTEXT_DXVA2_H */
76 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/hwcontext_mediacodec.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_HWCONTEXT_MEDIACODEC_H
20 | #define AVUTIL_HWCONTEXT_MEDIACODEC_H
21 |
22 | /**
23 | * MediaCodec details.
24 | *
25 | * Allocated as AVHWDeviceContext.hwctx
26 | */
27 | typedef struct AVMediaCodecDeviceContext {
28 | /**
29 | * android/view/Surface handle, to be filled by the user.
30 | *
31 | * This is the default surface used by decoders on this device.
32 | */
33 | void *surface;
34 | } AVMediaCodecDeviceContext;
35 |
36 | #endif /* AVUTIL_HWCONTEXT_MEDIACODEC_H */
37 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/hwcontext_qsv.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_HWCONTEXT_QSV_H
20 | #define AVUTIL_HWCONTEXT_QSV_H
21 |
22 | #include
23 |
24 | /**
25 | * @file
26 | * An API-specific header for AV_HWDEVICE_TYPE_QSV.
27 | *
28 | * This API does not support dynamic frame pools. AVHWFramesContext.pool must
29 | * contain AVBufferRefs whose data pointer points to an mfxFrameSurface1 struct.
30 | */
31 |
32 | /**
33 | * This struct is allocated as AVHWDeviceContext.hwctx
34 | */
35 | typedef struct AVQSVDeviceContext {
36 | mfxSession session;
37 | } AVQSVDeviceContext;
38 |
39 | /**
40 | * This struct is allocated as AVHWFramesContext.hwctx
41 | */
42 | typedef struct AVQSVFramesContext {
43 | mfxFrameSurface1 *surfaces;
44 | int nb_surfaces;
45 |
46 | /**
47 | * A combination of MFX_MEMTYPE_* describing the frame pool.
48 | */
49 | int frame_type;
50 | } AVQSVFramesContext;
51 |
52 | #endif /* AVUTIL_HWCONTEXT_QSV_H */
53 |
54 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/hwcontext_vdpau.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_HWCONTEXT_VDPAU_H
20 | #define AVUTIL_HWCONTEXT_VDPAU_H
21 |
22 | #include
23 |
24 | /**
25 | * @file
26 | * An API-specific header for AV_HWDEVICE_TYPE_VDPAU.
27 | *
28 | * This API supports dynamic frame pools. AVHWFramesContext.pool must return
29 | * AVBufferRefs whose data pointer is a VdpVideoSurface.
30 | */
31 |
32 | /**
33 | * This struct is allocated as AVHWDeviceContext.hwctx
34 | */
35 | typedef struct AVVDPAUDeviceContext {
36 | VdpDevice device;
37 | VdpGetProcAddress *get_proc_address;
38 | } AVVDPAUDeviceContext;
39 |
40 | /**
41 | * AVHWFramesContext.hwctx is currently not used
42 | */
43 |
44 | #endif /* AVUTIL_HWCONTEXT_VDPAU_H */
45 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/hwcontext_videotoolbox.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_HWCONTEXT_VIDEOTOOLBOX_H
20 | #define AVUTIL_HWCONTEXT_VIDEOTOOLBOX_H
21 |
22 | #include
23 |
24 | #include
25 |
26 | #include "pixfmt.h"
27 |
28 | /**
29 | * @file
30 | * An API-specific header for AV_HWDEVICE_TYPE_VIDEOTOOLBOX.
31 | *
32 | * This API currently does not support frame allocation, as the raw VideoToolbox
33 | * API does allocation, and FFmpeg itself never has the need to allocate frames.
34 | *
35 | * If the API user sets a custom pool, AVHWFramesContext.pool must return
36 | * AVBufferRefs whose data pointer is a CVImageBufferRef or CVPixelBufferRef.
37 | *
38 | * Currently AVHWDeviceContext.hwctx and AVHWFramesContext.hwctx are always
39 | * NULL.
40 | */
41 |
42 | /**
43 | * Convert a VideoToolbox (actually CoreVideo) format to AVPixelFormat.
44 | * Returns AV_PIX_FMT_NONE if no known equivalent was found.
45 | */
46 | enum AVPixelFormat av_map_videotoolbox_format_to_pixfmt(uint32_t cv_fmt);
47 |
48 | /**
49 | * Convert an AVPixelFormat to a VideoToolbox (actually CoreVideo) format.
50 | * Returns 0 if no known equivalent was found.
51 | */
52 | uint32_t av_map_videotoolbox_format_from_pixfmt(enum AVPixelFormat pix_fmt);
53 |
54 | /**
55 | * Same as av_map_videotoolbox_format_from_pixfmt function, but can map and
56 | * return full range pixel formats via a flag.
57 | */
58 | uint32_t av_map_videotoolbox_format_from_pixfmt2(enum AVPixelFormat pix_fmt, bool full_range);
59 |
60 | #endif /* AVUTIL_HWCONTEXT_VIDEOTOOLBOX_H */
61 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/intfloat.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2011 Mans Rullgard
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_INTFLOAT_H
22 | #define AVUTIL_INTFLOAT_H
23 |
24 | #include
25 | #include "attributes.h"
26 |
27 | union av_intfloat32 {
28 | uint32_t i;
29 | float f;
30 | };
31 |
32 | union av_intfloat64 {
33 | uint64_t i;
34 | double f;
35 | };
36 |
37 | /**
38 | * Reinterpret a 32-bit integer as a float.
39 | */
40 | static av_always_inline float av_int2float(uint32_t i) {
41 | union av_intfloat32 v;
42 | v.i = i;
43 | return v.f;
44 | }
45 |
46 | /**
47 | * Reinterpret a float as a 32-bit integer.
48 | */
49 | static av_always_inline uint32_t av_float2int(float f) {
50 | union av_intfloat32 v;
51 | v.f = f;
52 | return v.i;
53 | }
54 |
55 | /**
56 | * Reinterpret a 64-bit integer as a double.
57 | */
58 | static av_always_inline double av_int2double(uint64_t i) {
59 | union av_intfloat64 v;
60 | v.i = i;
61 | return v.f;
62 | }
63 |
64 | /**
65 | * Reinterpret a double as a 64-bit integer.
66 | */
67 | static av_always_inline uint64_t av_double2int(double f) {
68 | union av_intfloat64 v;
69 | v.f = f;
70 | return v.i;
71 | }
72 |
73 | #endif /* AVUTIL_INTFLOAT_H */
74 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/lfg.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Lagged Fibonacci PRNG
3 | * Copyright (c) 2008 Michael Niedermayer
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_LFG_H
23 | #define AVUTIL_LFG_H
24 |
25 | #include
26 |
27 | /**
28 | * Context structure for the Lagged Fibonacci PRNG.
29 | * The exact layout, types and content of this struct may change and should
30 | * not be accessed directly. Only its sizeof() is guranteed to stay the same
31 | * to allow easy instanciation.
32 | */
33 | typedef struct AVLFG {
34 | unsigned int state[64];
35 | int index;
36 | } AVLFG;
37 |
38 | void av_lfg_init(AVLFG *c, unsigned int seed);
39 |
40 | /**
41 | * Seed the state of the ALFG using binary data.
42 | *
43 | * Return value: 0 on success, negative value (AVERROR) on failure.
44 | */
45 | int av_lfg_init_from_data(AVLFG *c, const uint8_t *data, unsigned int length);
46 |
47 | /**
48 | * Get the next random unsigned 32-bit number using an ALFG.
49 | *
50 | * Please also consider a simple LCG like state= state*1664525+1013904223,
51 | * it may be good enough and faster for your specific use case.
52 | */
53 | static inline unsigned int av_lfg_get(AVLFG *c) {
54 | unsigned a = c->state[c->index & 63] =
55 | c->state[(c->index - 24) & 63] + c->state[(c->index - 55) & 63];
56 | c->index += 1U;
57 | return a;
58 | }
59 |
60 | /**
61 | * Get the next random unsigned 32-bit number using a MLFG.
62 | *
63 | * Please also consider av_lfg_get() above, it is faster.
64 | */
65 | static inline unsigned int av_mlfg_get(AVLFG *c) {
66 | unsigned int a = c->state[(c->index - 55) & 63];
67 | unsigned int b = c->state[(c->index - 24) & 63];
68 | a = c->state[c->index & 63] = 2 * a * b + a + b;
69 | c->index += 1U;
70 | return a;
71 | }
72 |
73 | /**
74 | * Get the next two numbers generated by a Box-Muller Gaussian
75 | * generator using the random numbers issued by lfg.
76 | *
77 | * @param out array where the two generated numbers are placed
78 | */
79 | void av_bmg_get(AVLFG *lfg, double out[2]);
80 |
81 | #endif /* AVUTIL_LFG_H */
82 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/lzo.h:
--------------------------------------------------------------------------------
1 | /*
2 | * LZO 1x decompression
3 | * copyright (c) 2006 Reimar Doeffinger
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_LZO_H
23 | #define AVUTIL_LZO_H
24 |
25 | /**
26 | * @defgroup lavu_lzo LZO
27 | * @ingroup lavu_crypto
28 | *
29 | * @{
30 | */
31 |
32 | #include
33 |
34 | /** @name Error flags returned by av_lzo1x_decode
35 | * @{ */
36 | /// end of the input buffer reached before decoding finished
37 | #define AV_LZO_INPUT_DEPLETED 1
38 | /// decoded data did not fit into output buffer
39 | #define AV_LZO_OUTPUT_FULL 2
40 | /// a reference to previously decoded data was wrong
41 | #define AV_LZO_INVALID_BACKPTR 4
42 | /// a non-specific error in the compressed bitstream
43 | #define AV_LZO_ERROR 8
44 | /** @} */
45 |
46 | #define AV_LZO_INPUT_PADDING 8
47 | #define AV_LZO_OUTPUT_PADDING 12
48 |
49 | /**
50 | * @brief Decodes LZO 1x compressed data.
51 | * @param out output buffer
52 | * @param outlen size of output buffer, number of bytes left are returned here
53 | * @param in input buffer
54 | * @param inlen size of input buffer, number of bytes left are returned here
55 | * @return 0 on success, otherwise a combination of the error flags above
56 | *
57 | * Make sure all buffers are appropriately padded, in must provide
58 | * AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes.
59 | */
60 | int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen);
61 |
62 | /**
63 | * @}
64 | */
65 |
66 | #endif /* AVUTIL_LZO_H */
67 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/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 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/md5.h:
--------------------------------------------------------------------------------
1 | /*
2 | * copyright (c) 2006 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | /**
22 | * @file
23 | * @ingroup lavu_md5
24 | * Public header for MD5 hash function implementation.
25 | */
26 |
27 | #ifndef AVUTIL_MD5_H
28 | #define AVUTIL_MD5_H
29 |
30 | #include
31 | #include
32 |
33 | #include "attributes.h"
34 | #include "version.h"
35 |
36 | /**
37 | * @defgroup lavu_md5 MD5
38 | * @ingroup lavu_hash
39 | * MD5 hash function implementation.
40 | *
41 | * @{
42 | */
43 |
44 | extern const int av_md5_size;
45 |
46 | struct AVMD5;
47 |
48 | /**
49 | * Allocate an AVMD5 context.
50 | */
51 | struct AVMD5 *av_md5_alloc(void);
52 |
53 | /**
54 | * Initialize MD5 hashing.
55 | *
56 | * @param ctx pointer to the function context (of size av_md5_size)
57 | */
58 | void av_md5_init(struct AVMD5 *ctx);
59 |
60 | /**
61 | * Update hash value.
62 | *
63 | * @param ctx hash function context
64 | * @param src input data to update hash with
65 | * @param len input data length
66 | */
67 | #if FF_API_CRYPTO_SIZE_T
68 |
69 | void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, int len);
70 |
71 | #else
72 | void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, size_t len);
73 | #endif
74 |
75 | /**
76 | * Finish hashing and output digest value.
77 | *
78 | * @param ctx hash function context
79 | * @param dst buffer where output digest value is stored
80 | */
81 | void av_md5_final(struct AVMD5 *ctx, uint8_t *dst);
82 |
83 | /**
84 | * Hash an array of data.
85 | *
86 | * @param dst The output buffer to write the digest into
87 | * @param src The data to hash
88 | * @param len The length of the data, in bytes
89 | */
90 | #if FF_API_CRYPTO_SIZE_T
91 |
92 | void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len);
93 |
94 | #else
95 | void av_md5_sum(uint8_t *dst, const uint8_t *src, size_t len);
96 | #endif
97 |
98 | /**
99 | * @}
100 | */
101 |
102 | #endif /* AVUTIL_MD5_H */
103 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/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 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/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 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/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,
61 | int decrypt);
62 |
63 | /**
64 | * @}
65 | */
66 |
67 | #endif /* AVUTIL_RC4_H */
68 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/replaygain.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_REPLAYGAIN_H
20 | #define AVUTIL_REPLAYGAIN_H
21 |
22 | #include
23 |
24 | /**
25 | * ReplayGain information (see
26 | * http://wiki.hydrogenaudio.org/index.php?title=ReplayGain_1.0_specification).
27 | * The size of this struct is a part of the public ABI.
28 | */
29 | typedef struct AVReplayGain {
30 | /**
31 | * Track replay gain in microbels (divide by 100000 to get the value in dB).
32 | * Should be set to INT32_MIN when unknown.
33 | */
34 | int32_t track_gain;
35 | /**
36 | * Peak track amplitude, with 100000 representing full scale (but values
37 | * may overflow). 0 when unknown.
38 | */
39 | uint32_t track_peak;
40 | /**
41 | * Same as track_gain, but for the whole album.
42 | */
43 | int32_t album_gain;
44 | /**
45 | * Same as track_peak, but for the whole album,
46 | */
47 | uint32_t album_peak;
48 | } AVReplayGain;
49 |
50 | #endif /* AVUTIL_REPLAYGAIN_H */
51 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/ripemd.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2007 Michael Niedermayer
3 | * Copyright (C) 2013 James Almer
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | /**
23 | * @file
24 | * @ingroup lavu_ripemd
25 | * Public header for RIPEMD hash function implementation.
26 | */
27 |
28 | #ifndef AVUTIL_RIPEMD_H
29 | #define AVUTIL_RIPEMD_H
30 |
31 | #include
32 | #include
33 |
34 | #include "attributes.h"
35 | #include "version.h"
36 |
37 | /**
38 | * @defgroup lavu_ripemd RIPEMD
39 | * @ingroup lavu_hash
40 | * RIPEMD hash function implementation.
41 | *
42 | * @{
43 | */
44 |
45 | extern const int av_ripemd_size;
46 |
47 | struct AVRIPEMD;
48 |
49 | /**
50 | * Allocate an AVRIPEMD context.
51 | */
52 | struct AVRIPEMD *av_ripemd_alloc(void);
53 |
54 | /**
55 | * Initialize RIPEMD hashing.
56 | *
57 | * @param context pointer to the function context (of size av_ripemd_size)
58 | * @param bits number of bits in digest (128, 160, 256 or 320 bits)
59 | * @return zero if initialization succeeded, -1 otherwise
60 | */
61 | int av_ripemd_init(struct AVRIPEMD *context, int bits);
62 |
63 | /**
64 | * Update hash value.
65 | *
66 | * @param context hash function context
67 | * @param data input data to update hash with
68 | * @param len input data length
69 | */
70 | #if FF_API_CRYPTO_SIZE_T
71 |
72 | void av_ripemd_update(struct AVRIPEMD *context, const uint8_t *data, unsigned int len);
73 |
74 | #else
75 | void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, size_t len);
76 | #endif
77 |
78 | /**
79 | * Finish hashing and output digest value.
80 | *
81 | * @param context hash function context
82 | * @param digest buffer where output digest value is stored
83 | */
84 | void av_ripemd_final(struct AVRIPEMD *context, uint8_t *digest);
85 |
86 | /**
87 | * @}
88 | */
89 |
90 | #endif /* AVUTIL_RIPEMD_H */
91 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/sha.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2007 Michael Niedermayer
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | /**
22 | * @file
23 | * @ingroup lavu_sha
24 | * Public header for SHA-1 & SHA-256 hash function implementations.
25 | */
26 |
27 | #ifndef AVUTIL_SHA_H
28 | #define AVUTIL_SHA_H
29 |
30 | #include
31 | #include
32 |
33 | #include "attributes.h"
34 | #include "version.h"
35 |
36 | /**
37 | * @defgroup lavu_sha SHA
38 | * @ingroup lavu_hash
39 | * SHA-1 and SHA-256 (Secure Hash Algorithm) hash function implementations.
40 | *
41 | * This module supports the following SHA hash functions:
42 | *
43 | * - SHA-1: 160 bits
44 | * - SHA-224: 224 bits, as a variant of SHA-2
45 | * - SHA-256: 256 bits, as a variant of SHA-2
46 | *
47 | * @see For SHA-384, SHA-512, and variants thereof, see @ref lavu_sha512.
48 | *
49 | * @{
50 | */
51 |
52 | extern const int av_sha_size;
53 |
54 | struct AVSHA;
55 |
56 | /**
57 | * Allocate an AVSHA context.
58 | */
59 | struct AVSHA *av_sha_alloc(void);
60 |
61 | /**
62 | * Initialize SHA-1 or SHA-2 hashing.
63 | *
64 | * @param context pointer to the function context (of size av_sha_size)
65 | * @param bits number of bits in digest (SHA-1 - 160 bits, SHA-2 224 or 256 bits)
66 | * @return zero if initialization succeeded, -1 otherwise
67 | */
68 | int av_sha_init(struct AVSHA *context, int bits);
69 |
70 | /**
71 | * Update hash value.
72 | *
73 | * @param ctx hash function context
74 | * @param data input data to update hash with
75 | * @param len input data length
76 | */
77 | #if FF_API_CRYPTO_SIZE_T
78 |
79 | void av_sha_update(struct AVSHA *ctx, const uint8_t *data, unsigned int len);
80 |
81 | #else
82 | void av_sha_update(struct AVSHA *ctx, const uint8_t *data, size_t len);
83 | #endif
84 |
85 | /**
86 | * Finish hashing and output digest value.
87 | *
88 | * @param context hash function context
89 | * @param digest buffer where output digest value is stored
90 | */
91 | void av_sha_final(struct AVSHA *context, uint8_t *digest);
92 |
93 | /**
94 | * @}
95 | */
96 |
97 | #endif /* AVUTIL_SHA_H */
98 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/sha512.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2007 Michael Niedermayer
3 | * Copyright (C) 2013 James Almer
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | /**
23 | * @file
24 | * @ingroup lavu_sha512
25 | * Public header for SHA-512 implementation.
26 | */
27 |
28 | #ifndef AVUTIL_SHA512_H
29 | #define AVUTIL_SHA512_H
30 |
31 | #include
32 | #include
33 |
34 | #include "attributes.h"
35 | #include "version.h"
36 |
37 | /**
38 | * @defgroup lavu_sha512 SHA-512
39 | * @ingroup lavu_hash
40 | * SHA-512 (Secure Hash Algorithm) hash function implementations.
41 | *
42 | * This module supports the following SHA-2 hash functions:
43 | *
44 | * - SHA-512/224: 224 bits
45 | * - SHA-512/256: 256 bits
46 | * - SHA-384: 384 bits
47 | * - SHA-512: 512 bits
48 | *
49 | * @see For SHA-1, SHA-256, and variants thereof, see @ref lavu_sha.
50 | *
51 | * @{
52 | */
53 |
54 | extern const int av_sha512_size;
55 |
56 | struct AVSHA512;
57 |
58 | /**
59 | * Allocate an AVSHA512 context.
60 | */
61 | struct AVSHA512 *av_sha512_alloc(void);
62 |
63 | /**
64 | * Initialize SHA-2 512 hashing.
65 | *
66 | * @param context pointer to the function context (of size av_sha512_size)
67 | * @param bits number of bits in digest (224, 256, 384 or 512 bits)
68 | * @return zero if initialization succeeded, -1 otherwise
69 | */
70 | int av_sha512_init(struct AVSHA512 *context, int bits);
71 |
72 | /**
73 | * Update hash value.
74 | *
75 | * @param context hash function context
76 | * @param data input data to update hash with
77 | * @param len input data length
78 | */
79 | #if FF_API_CRYPTO_SIZE_T
80 |
81 | void av_sha512_update(struct AVSHA512 *context, const uint8_t *data, unsigned int len);
82 |
83 | #else
84 | void av_sha512_update(struct AVSHA512* context, const uint8_t* data, size_t len);
85 | #endif
86 |
87 | /**
88 | * Finish hashing and output digest value.
89 | *
90 | * @param context hash function context
91 | * @param digest buffer where output digest value is stored
92 | */
93 | void av_sha512_final(struct AVSHA512 *context, uint8_t *digest);
94 |
95 | /**
96 | * @}
97 | */
98 |
99 | #endif /* AVUTIL_SHA512_H */
100 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/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 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/time.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2000-2003 Fabrice Bellard
3 | *
4 | * This file is part of FFmpeg.
5 | *
6 | * FFmpeg is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * FFmpeg is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with FFmpeg; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef AVUTIL_TIME_H
22 | #define AVUTIL_TIME_H
23 |
24 | #include
25 |
26 | /**
27 | * Get the current time in microseconds.
28 | */
29 | int64_t av_gettime(void);
30 |
31 | /**
32 | * 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 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/timestamp.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | /**
20 | * @file
21 | * timestamp utils, mostly useful for debugging/logging purposes
22 | */
23 |
24 | #ifndef AVUTIL_TIMESTAMP_H
25 | #define AVUTIL_TIMESTAMP_H
26 |
27 | #include "common.h"
28 |
29 | #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 | if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
45 | else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%"
46 | 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 | if (ts == AV_NOPTS_VALUE) snprintf(buf, AV_TS_MAX_STRING_SIZE, "NOPTS");
67 | else snprintf(buf, AV_TS_MAX_STRING_SIZE, "%.6g", av_q2d(*tb) * ts);
68 | return buf;
69 | }
70 |
71 | /**
72 | * Convenience macro, the return value should be used only directly in
73 | * function arguments but never stand-alone.
74 | */
75 | #define av_ts2timestr(ts, tb) av_ts_make_time_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts, tb)
76 |
77 | #endif /* AVUTIL_TIMESTAMP_H */
78 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/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
66 | av_twofish_crypt(struct AVTWOFISH *ctx, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv,
67 | int decrypt);
68 |
69 | /**
70 | * @}
71 | */
72 | #endif /* AVUTIL_TWOFISH_H */
73 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libavutil/xtea.h:
--------------------------------------------------------------------------------
1 | /*
2 | * A 32-bit implementation of the XTEA algorithm
3 | * Copyright (c) 2012 Samuel Pitoiset
4 | *
5 | * This file is part of FFmpeg.
6 | *
7 | * FFmpeg is free software; you can redistribute it and/or
8 | * modify it under the terms of the GNU Lesser General Public
9 | * License as published by the Free Software Foundation; either
10 | * version 2.1 of the License, or (at your option) any later version.
11 | *
12 | * FFmpeg is distributed in the hope that it will be useful,
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 | * Lesser General Public License for more details.
16 | *
17 | * You should have received a copy of the GNU Lesser General Public
18 | * License along with FFmpeg; if not, write to the Free Software
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 | */
21 |
22 | #ifndef AVUTIL_XTEA_H
23 | #define AVUTIL_XTEA_H
24 |
25 | #include
26 |
27 | /**
28 | * @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 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libswresample/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Version macros.
3 | *
4 | * This file is part of libswresample
5 | *
6 | * libswresample is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License, or (at your option) any later version.
10 | *
11 | * libswresample is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with libswresample; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 | #ifndef 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 3
32 | #define LIBSWRESAMPLE_VERSION_MINOR 8
33 | #define LIBSWRESAMPLE_VERSION_MICRO 100
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 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/ffmpeg/include/libswscale/version.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of FFmpeg.
3 | *
4 | * FFmpeg is free software; you can redistribute it and/or
5 | * modify it under the terms of the GNU Lesser General Public
6 | * License as published by the Free Software Foundation; either
7 | * version 2.1 of the License, or (at your option) any later version.
8 | *
9 | * FFmpeg is distributed in the hope that it will be useful,
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * Lesser General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU Lesser General Public
15 | * License along with FFmpeg; if not, write to the Free Software
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 | */
18 |
19 | #ifndef SWSCALE_VERSION_H
20 | #define SWSCALE_VERSION_H
21 |
22 | /**
23 | * @file
24 | * swscale version macros
25 | */
26 |
27 | #include "libavutil/version.h"
28 |
29 | #define LIBSWSCALE_VERSION_MAJOR 5
30 | #define LIBSWSCALE_VERSION_MINOR 8
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 | #ifndef FF_API_SWS_VECTOR
50 | #define FF_API_SWS_VECTOR (LIBSWSCALE_VERSION_MAJOR < 6)
51 | #endif
52 |
53 | #endif /* SWSCALE_VERSION_H */
54 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/log_util.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Richie on 2020/5/5.
3 | //
4 | #ifndef _Included_RICHIE_ANDROID_LOG_UTIL_H
5 | #define _Included_RICHIE_ANDROID_LOG_UTIL_H
6 |
7 | #include
8 |
9 | // ANDROID_LOG_VERBOSE, 2
10 | /** Debug logging. Should typically be disabled for a release apk. */
11 | // ANDROID_LOG_DEBUG, 3
12 | /** Informational logging. Should typically be disabled for a release apk. */
13 | // ANDROID_LOG_INFO, 4
14 | /** Warning logging. For use with recoverable failures. */
15 | // ANDROID_LOG_WARN, 5
16 | /** Error logging. For use with unrecoverable failures. */
17 | // ANDROID_LOG_ERROR, 6
18 | /** Not logging. For release. */
19 | // ANDROID_LOG_OFF, 7
20 | #define LOG_LEVEL 3
21 | #define TAG "ffmpeg-native"
22 | #define LOGV(...) if(LOG_LEVEL <= ANDROID_LOG_VERBOSE) __android_log_print(ANDROID_LOG_VERBOSE, TAG ,__VA_ARGS__)
23 | #define LOGD(...) if(LOG_LEVEL <= ANDROID_LOG_DEBUG) __android_log_print(ANDROID_LOG_DEBUG, TAG ,__VA_ARGS__)
24 | #define LOGI(...) if(LOG_LEVEL <= ANDROID_LOG_INFO) __android_log_print(ANDROID_LOG_INFO, TAG ,__VA_ARGS__)
25 | #define LOGW(...) if(LOG_LEVEL <= ANDROID_LOG_WARN) __android_log_print(ANDROID_LOG_WARN, TAG ,__VA_ARGS__)
26 | #define LOGE(...) if(LOG_LEVEL <= ANDROID_LOG_ERROR) __android_log_print(ANDROID_LOG_ERROR, TAG ,__VA_ARGS__)
27 |
28 | #endif // _Included_RICHIE_ANDROID_LOG_UTIL_H
29 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/media/const.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Richie on 2020/12/27.
3 | //
4 |
5 | #ifndef MULTIMEDIALEARNING_CONST_H
6 | #define MULTIMEDIALEARNING_CONST_H
7 |
8 | extern "C" {
9 | #include
10 | };
11 |
12 | // 音频编码格式:浮点型数据(32位)
13 | static const AVSampleFormat ENCODE_AUDIO_DEST_FORMAT = AV_SAMPLE_FMT_FLTP;
14 | // 音频编码采样率
15 | static const int ENCODE_AUDIO_DEST_SAMPLE_RATE = 44100;
16 | // 音频编码通道数
17 | static const int ENCODE_AUDIO_DEST_CHANNEL_COUNTS = 2;
18 | // 音频编码声道格式
19 | static const uint64_t ENCODE_AUDIO_DEST_CHANNEL_LAYOUT = AV_CH_LAYOUT_STEREO;
20 | // 音频编码比特率
21 | static const int ENCODE_AUDIO_DEST_BIT_RATE = 64000;
22 | // ACC音频一帧采样数
23 | static const int ACC_NB_SAMPLES = 1024;
24 | // 视频编码帧率
25 | static const int ENCODE_VIDEO_FPS = 25;
26 |
27 | #endif //MULTIMEDIALEARNING_CONST_H
28 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/media/decoder/audio/audio_decoder.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Richie on 2020/12/27.
3 | //
4 |
5 | #ifndef MULTIMEDIALEARNING_AUDIO_DECODER_H
6 | #define MULTIMEDIALEARNING_AUDIO_DECODER_H
7 |
8 |
9 | #include "../base_decoder.h"
10 | #include "../../const.h"
11 | #include "../../render/audio/audio_render.h"
12 |
13 | extern "C" {
14 | #include
15 | #include
16 | #include
17 | }
18 |
19 | class AudioDecoder : public BaseDecoder {
20 | private:
21 |
22 | const char *TAG = "AudioDecoder";
23 |
24 | // 音频转换器
25 | SwrContext *m_swr = NULL;
26 |
27 | // OpeSL ES音频播放器
28 | AudioRender *m_render = NULL;
29 |
30 | // 输出缓冲
31 | uint8_t *m_out_buffer[2] = {NULL, NULL};
32 |
33 | // 重采样后,每个通道包含的采样数
34 | // acc默认为1024,重采样后可能会变化
35 | int m_dest_nb_sample = 1024;
36 |
37 | // 重采样以后,一帧数据的大小
38 | size_t m_dest_data_size = 0;
39 |
40 | /**
41 | * 初始化转换工具
42 | */
43 | void InitSwr();
44 |
45 | /**
46 | * 计算重采样后通道采样数和帧数据大小
47 | */
48 | void CalculateSampleArgs();
49 |
50 | /**
51 | * 初始化输出缓冲
52 | */
53 | void InitOutBuffer();
54 |
55 | /**
56 | * 初始化渲染器
57 | */
58 | void InitRender();
59 |
60 | /**
61 | * 释放缓冲区
62 | */
63 | void ReleaseOutBuffer();
64 |
65 | /**
66 | * 采样格式:16位
67 | */
68 | AVSampleFormat GetSampleFmt() {
69 | if (ForSynthesizer()) {
70 | return ENCODE_AUDIO_DEST_FORMAT;
71 | } else {
72 | return AV_SAMPLE_FMT_S16;
73 | }
74 | }
75 |
76 | /**
77 | * 采样率
78 | */
79 | int GetSampleRate(int spr) {
80 | if (ForSynthesizer()) {
81 | return ENCODE_AUDIO_DEST_SAMPLE_RATE;
82 | } else {
83 | return spr;
84 | }
85 | }
86 |
87 | public:
88 | AudioDecoder(JNIEnv *env, const jstring path, bool forSynthesizer);
89 |
90 | ~AudioDecoder();
91 |
92 | void SetRender(AudioRender *render);
93 |
94 | protected:
95 | void Prepare(JNIEnv *env) override;
96 |
97 | void Render(AVFrame *frame) override;
98 |
99 | void Release(JNIEnv *env) override;
100 |
101 | bool NeedLoopDecode() override {
102 | return true;
103 | }
104 |
105 | AVMediaType GetMediaType() override {
106 | return AVMEDIA_TYPE_AUDIO;
107 | }
108 |
109 | const char *const LogSpec() override {
110 | return "AUDIO";
111 | };
112 | };
113 |
114 |
115 | #endif //MULTIMEDIALEARNING_AUDIO_DECODER_H
116 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/media/decoder/decode_state.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Richie on 2020/12/22.
3 | //
4 | // 定义解码状态
5 |
6 | #ifndef MULTIMEDIALEARNING_DECODE_STATE_H
7 | #define MULTIMEDIALEARNING_DECODE_STATE_H
8 |
9 | enum DecodeState {
10 | PREPARE,
11 | START,
12 | DECODING,
13 | PAUSE,
14 | STOP,
15 | FINISH
16 | };
17 |
18 | #endif //MULTIMEDIALEARNING_DECODE_STATE_H
19 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/media/decoder/i_decode_state_cb.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Richie on 2020/12/23 0023.
3 | //
4 |
5 | #include "i_decode_state_cb.h"
6 |
7 | IDecodeStateCb::IDecodeStateCb() {
8 |
9 | }
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/media/decoder/i_decode_state_cb.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Richie on 2020/12/23 0023.
3 | //
4 | // 解码回调接口
5 |
6 | #ifndef MULTIMEDIALEARNING_I_DECODE_STATE_CB_H
7 | #define MULTIMEDIALEARNING_I_DECODE_STATE_CB_H
8 |
9 | #include "../one_frame.h"
10 |
11 | // 声明IDecoder,在cpp中include,避免重复引用
12 | class IDecoder;
13 |
14 | class IDecodeStateCb {
15 | public:
16 | IDecodeStateCb();
17 |
18 | virtual void DecodePrepare(IDecoder *decoder) = 0;
19 |
20 | virtual void DecodeReady(IDecoder *decoder) = 0;
21 |
22 | virtual void DecodeRunning(IDecoder *decoder) = 0;
23 |
24 | virtual void DecodePause(IDecoder *decoder) = 0;
25 |
26 | virtual bool DecodeOneFrame(IDecoder *decoder, OneFrame *frame) = 0;
27 |
28 | virtual void DecodeFinish(IDecoder *decoder) = 0;
29 |
30 | virtual void DecodeStop(IDecoder *decoder) = 0;
31 | };
32 |
33 |
34 | #endif //MULTIMEDIALEARNING_I_DECODE_STATE_CB_H
35 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/media/decoder/i_decoder.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Richie on 2020/12/22.
3 | //
4 | // 定义解码器
5 |
6 | #ifndef MULTIMEDIALEARNING_I_DECODER_H
7 | #define MULTIMEDIALEARNING_I_DECODER_H
8 |
9 | #include "i_decode_state_cb.h"
10 |
11 | class IDecoder {
12 | public:
13 | virtual void Start() = 0;
14 |
15 | virtual void Pause() = 0;
16 |
17 | virtual void Stop() = 0;
18 |
19 | virtual bool IsPlaying() = 0;
20 |
21 | virtual long GetDuration() = 0;
22 |
23 | virtual long GetCurrPos() = 0;
24 |
25 | virtual void SetStateReceiver(IDecodeStateCb *cb) = 0;
26 | };
27 |
28 | #endif //MULTIMEDIALEARNING_I_DECODER_H
29 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/media/decoder/video/v_decoder.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Richie on 2020/12/23 0023.
3 | //
4 | // 视频解码器
5 | #include "v_decoder.h"
6 |
7 | VideoDecoder::VideoDecoder(JNIEnv *env, jstring path, bool for_synthesizer)
8 | : BaseDecoder(env, path, for_synthesizer) {
9 | }
10 |
11 | VideoDecoder::~VideoDecoder() {
12 | delete m_video_render;
13 | }
14 |
15 | void VideoDecoder::SetRender(VideoRender *render) {
16 | this->m_video_render = render;
17 | }
18 |
19 | void VideoDecoder::Prepare(JNIEnv *env) {
20 | InitRender(env);
21 | InitBuffer();
22 | InitSws();
23 | }
24 |
25 | void VideoDecoder::InitRender(JNIEnv *env) {
26 | if (m_video_render != nullptr) {
27 | int dst_size[2] = {-1, -1};
28 | m_video_render->InitRender(env, width(), height(), dst_size);
29 |
30 | m_dst_w = dst_size[0];
31 | m_dst_h = dst_size[1];
32 | if (m_dst_w == -1) {
33 | m_dst_w = width();
34 | }
35 | if (m_dst_h == -1) {
36 | m_dst_w = height();
37 | }
38 | LOGI(TAG, "dst %d, %d", m_dst_w, m_dst_h)
39 | } else {
40 | LOGE(TAG, "Init render error, you should call SetRender first!")
41 | }
42 | }
43 |
44 | void VideoDecoder::InitBuffer() {
45 | m_rgb_frame = av_frame_alloc();
46 | // 获取缓存大小
47 | int numBytes = av_image_get_buffer_size(DST_FORMAT, m_dst_w, m_dst_h, 1);
48 | // 分配内存
49 | m_buf_for_rgb_frame = (uint8_t *) av_malloc(numBytes * sizeof(uint8_t));
50 | // 将内存分配给RgbFrame,并将内存格式化为三个通道后,分别保存其地址
51 | av_image_fill_arrays(m_rgb_frame->data, m_rgb_frame->linesize,
52 | m_buf_for_rgb_frame, DST_FORMAT, m_dst_w, m_dst_h, 1);
53 | }
54 |
55 | void VideoDecoder::InitSws() {
56 | // 初始化格式转换工具
57 | m_sws_ctx = sws_getContext(width(), height(), video_pixel_format(),
58 | m_dst_w, m_dst_h, DST_FORMAT,
59 | SWS_FAST_BILINEAR, nullptr, nullptr, nullptr);
60 | }
61 |
62 | void VideoDecoder::Render(AVFrame *frame) {
63 | sws_scale(m_sws_ctx, frame->data, frame->linesize, 0,
64 | height(), m_rgb_frame->data, m_rgb_frame->linesize);
65 | auto *one_frame = new OneFrame(m_rgb_frame->data[0], m_rgb_frame->linesize[0], frame->pts,
66 | time_base(), nullptr, false);
67 | m_video_render->Render(one_frame);
68 |
69 | if (m_state_cb != nullptr && m_state_cb->DecodeOneFrame(this, one_frame)) {
70 | Wait(0, 200);
71 | }
72 | }
73 |
74 | bool VideoDecoder::NeedLoopDecode() {
75 | return true;
76 | }
77 |
78 | void VideoDecoder::Release(JNIEnv *env) {
79 | LOGE(TAG, "[VIDEO] release")
80 | if (m_rgb_frame != nullptr) {
81 | av_frame_free(&m_rgb_frame);
82 | m_rgb_frame = nullptr;
83 | }
84 | if (m_buf_for_rgb_frame != nullptr) {
85 | free(m_buf_for_rgb_frame);
86 | m_buf_for_rgb_frame = nullptr;
87 | }
88 | if (m_sws_ctx != nullptr) {
89 | sws_freeContext(m_sws_ctx);
90 | m_sws_ctx = nullptr;
91 | }
92 | if (m_video_render != nullptr) {
93 | m_video_render->ReleaseRender(env);
94 | m_video_render = nullptr;
95 | }
96 | }
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/media/decoder/video/v_decoder.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Richie on 2020/12/23 0023.
3 | //
4 | // 视频解码器
5 |
6 | #ifndef MULTIMEDIALEARNING_V_DECODER_H
7 | #define MULTIMEDIALEARNING_V_DECODER_H
8 |
9 | #include
10 | #include
11 | #include
12 | #include "../base_decoder.h"
13 | #include "../../one_frame.h"
14 | #include "../../render/video/video_render.h"
15 |
16 | extern "C" {
17 | #include
18 | #include
19 | }
20 |
21 | class VideoDecoder : public BaseDecoder {
22 | private:
23 | const char *TAG = "VideoDecoder";
24 |
25 | //视频数据目标格式
26 | const AVPixelFormat DST_FORMAT = AV_PIX_FMT_RGBA;
27 |
28 | //存放YUV转换为RGB后的数据
29 | AVFrame *m_rgb_frame = nullptr;
30 |
31 | uint8_t *m_buf_for_rgb_frame = nullptr;
32 |
33 | //视频格式转换器
34 | SwsContext *m_sws_ctx = nullptr;
35 |
36 | //视频渲染器
37 | VideoRender *m_video_render = nullptr;
38 |
39 | //显示的目标宽
40 | int m_dst_w{};
41 |
42 | //显示的目标高
43 | int m_dst_h{};
44 |
45 | /**
46 | * 初始化渲染器
47 | */
48 | void InitRender(JNIEnv *env);
49 |
50 | /**
51 | * 初始化显示器
52 | * @param env
53 | */
54 | void InitBuffer();
55 |
56 | /**
57 | * 初始化视频数据转换器
58 | */
59 | void InitSws();
60 |
61 | public:
62 | VideoDecoder(JNIEnv *env, jstring path, bool for_synthesizer = false);
63 |
64 | ~VideoDecoder();
65 |
66 | void SetRender(VideoRender *render);
67 |
68 | protected:
69 | AVMediaType GetMediaType() override {
70 | return AVMEDIA_TYPE_VIDEO;
71 | }
72 |
73 | /**
74 | * 是否需要循环解码
75 | */
76 | bool NeedLoopDecode() override;
77 |
78 | /**
79 | * 准备解码环境
80 | * 注:在解码线程中回调
81 | * @param env 解码线程绑定的jni环境
82 | */
83 | void Prepare(JNIEnv *env) override;
84 |
85 | /**
86 | * 渲染
87 | * 注:在解码线程中回调
88 | * @param frame 解码RGBA数据
89 | */
90 | void Render(AVFrame *frame) override;
91 |
92 | /**
93 | * 释放回调
94 | */
95 | void Release(JNIEnv *env) override;
96 |
97 | const char *const LogSpec() override {
98 | return "VIDEO";
99 | };
100 | };
101 |
102 | #endif //MULTIMEDIALEARNING_V_DECODER_H
103 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/media/one_frame.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Richie on 2020/12/23 0023.
3 | //
4 | // 一个音频/视频数据帧
5 |
6 | #ifndef MULTIMEDIALEARNING_ONE_FRAME_H
7 | #define MULTIMEDIALEARNING_ONE_FRAME_H
8 |
9 | #include
10 | #include "../utils/logger.h"
11 |
12 | extern "C" {
13 | #include "../ffmpeg/include/libavutil/rational.h"
14 | }
15 |
16 | class OneFrame {
17 | public:
18 | uint8_t *data = nullptr;
19 | int line_size;
20 | int64_t pts;
21 | AVRational time_base;
22 | uint8_t *ext_data = nullptr;
23 | // 是否自动回收data和ext_data
24 | bool autoRecycle = true;
25 |
26 | OneFrame(uint8_t *data, int line_size, int64_t pts, AVRational time_base,
27 | uint8_t *ext_data = nullptr, bool autoRecycle = true) {
28 | this->data = data;
29 | this->line_size = line_size;
30 | this->pts = pts;
31 | this->time_base = time_base;
32 | this->ext_data = ext_data;
33 | this->autoRecycle = autoRecycle;
34 | }
35 |
36 | ~OneFrame() {
37 | if (autoRecycle) {
38 | if (data != nullptr) {
39 | free(data);
40 | data = nullptr;
41 | }
42 | if (ext_data != nullptr) {
43 | free(ext_data);
44 | ext_data = nullptr;
45 | }
46 | }
47 | }
48 | };
49 |
50 | #endif //MULTIMEDIALEARNING_ONE_FRAME_H
51 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/media/player/default/player.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Richie on 2020/12/23 0023.
3 | //
4 |
5 | #include "player.h"
6 | #include "../../render/video/native/native_render.h"
7 | #include "../../render/audio/opensl_render.h"
8 |
9 |
10 | Player::Player(JNIEnv *env, jstring path, jobject surface) {
11 | m_v_decoder = new VideoDecoder(env, path);
12 | // 本地窗口播放
13 | m_v_render = new NativeRender(env, surface);
14 | m_v_decoder->SetRender(m_v_render);
15 |
16 | // 音频解码
17 | m_a_decoder = new AudioDecoder(env, path, false);
18 | m_a_render = new OpenSLRender();
19 | m_a_decoder->SetRender(m_a_render);
20 | }
21 |
22 | Player::~Player() = default;
23 | // 此处不需要 delete 成员指针
24 | // 在BaseDecoder中的线程已经使用智能指针,会自动释放
25 |
26 | void Player::play() {
27 | if (m_v_decoder != nullptr) {
28 | m_v_decoder->Start();
29 | m_a_decoder->Start();
30 | }
31 | }
32 |
33 | void Player::pause() {
34 | if (m_v_decoder != nullptr) {
35 | m_v_decoder->Pause();
36 | m_a_decoder->Pause();
37 | }
38 | }
39 |
40 | void Player::release(JNIEnv *env) {
41 | if (m_v_render != nullptr) {
42 | m_v_render->ReleaseRender(env);
43 | m_a_render->ReleaseRender();
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/media/player/default/player.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Richie on 2020/12/23 0023.
3 | //
4 | // 普通播放器
5 | #ifndef MULTIMEDIALEARNING_PLAYER_H
6 | #define MULTIMEDIALEARNING_PLAYER_H
7 |
8 | #include
9 | #include "../../decoder/video/v_decoder.h"
10 | #include "../../decoder/audio/audio_decoder.h"
11 | #include "../../render/audio/audio_render.h"
12 | #include "../../render/video/video_render.h"
13 |
14 | class Player {
15 | private:
16 | VideoDecoder *m_v_decoder;
17 | VideoRender *m_v_render;
18 |
19 | AudioDecoder *m_a_decoder;
20 | AudioRender *m_a_render;
21 | public:
22 | Player(JNIEnv *env, jstring path, jobject surface);
23 |
24 | ~Player();
25 |
26 | void play();
27 |
28 | void pause();
29 |
30 | void release(JNIEnv *env);
31 | };
32 |
33 | #endif //MULTIMEDIALEARNING_PLAYER_H
34 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/media/render/audio/audio_render.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Richie on 2020/12/27.
3 | //
4 |
5 | #ifndef MULTIMEDIALEARNING_AUDIO_RENDER_H
6 | #define MULTIMEDIALEARNING_AUDIO_RENDER_H
7 |
8 |
9 | #include
10 |
11 | class AudioRender {
12 | public:
13 | virtual void InitRender() = 0;
14 |
15 | virtual void Render(uint8_t *pcm, int size) = 0;
16 |
17 | virtual void ReleaseRender() = 0;
18 |
19 | virtual ~AudioRender() {}
20 | };
21 |
22 |
23 | #endif //MULTIMEDIALEARNING_AUDIO_RENDER_H
24 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/media/render/audio/opensl_render.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Richie on 2020/12/27.
3 | //
4 |
5 | #ifndef MULTIMEDIALEARNING_OPENSL_RENDER_H
6 | #define MULTIMEDIALEARNING_OPENSL_RENDER_H
7 |
8 | #include
9 | #include
10 | #include
11 | #include
12 | #include
13 | #include "audio_render.h"
14 | #include "../../utils/logger.h"
15 |
16 | extern "C" {
17 | #include
18 | }
19 |
20 | static const char *TAG = "OpenSLRender";
21 |
22 | class OpenSLRender : public AudioRender {
23 | private:
24 |
25 | class PcmData {
26 | public:
27 | PcmData(uint8_t *pcm, int size) {
28 | this->pcm = pcm;
29 | this->size = size;
30 | }
31 |
32 | ~PcmData() {
33 | if (pcm != nullptr) {
34 | //释放已使用的内存
35 | free(pcm);
36 | pcm = nullptr;
37 | used = false;
38 | }
39 | }
40 |
41 | uint8_t *pcm = nullptr;
42 | int size = 0;
43 | bool used = false;
44 | };
45 |
46 | const SLuint32 SL_QUEUE_BUFFER_COUNT = 2;
47 |
48 | // 引擎接口
49 | SLObjectItf m_engine_obj = nullptr;
50 | SLEngineItf m_engine = nullptr;
51 |
52 | //混音器
53 | SLObjectItf m_output_mix_obj = nullptr;
54 | SLEnvironmentalReverbItf m_output_mix_evn_reverb = nullptr;
55 | SLEnvironmentalReverbSettings m_reverb_settings = SL_I3DL2_ENVIRONMENT_PRESET_DEFAULT;
56 |
57 | //pcm播放器
58 | SLObjectItf m_pcm_player_obj = nullptr;
59 | SLPlayItf m_pcm_player = nullptr;
60 | SLVolumeItf m_pcm_player_volume = nullptr;
61 |
62 | //缓冲器队列接口
63 | SLAndroidSimpleBufferQueueItf m_pcm_buffer{};
64 |
65 | std::queue m_data_queue;
66 |
67 | // 缓存线程等待锁变量
68 | pthread_mutex_t m_cache_mutex = PTHREAD_MUTEX_INITIALIZER;
69 | pthread_cond_t m_cache_cond = PTHREAD_COND_INITIALIZER;
70 |
71 | bool CreateEngine();
72 |
73 | bool CreateOutputMixer();
74 |
75 | bool ConfigPlayer();
76 |
77 | void StartRender();
78 |
79 | void BlockEnqueue();
80 |
81 | static bool CheckError(SLresult result, const std::string &hint);
82 |
83 | void static sRenderPcm(OpenSLRender *that);
84 |
85 | void static sReadPcmBufferCbFun(SLAndroidSimpleBufferQueueItf bufferQueueItf, void *context);
86 |
87 | void WaitForCache() {
88 | pthread_mutex_lock(&m_cache_mutex);
89 | pthread_cond_wait(&m_cache_cond, &m_cache_mutex);
90 | pthread_mutex_unlock(&m_cache_mutex);
91 | }
92 |
93 | void SendCacheReadySignal() {
94 | pthread_mutex_lock(&m_cache_mutex);
95 | pthread_cond_signal(&m_cache_cond);
96 | pthread_mutex_unlock(&m_cache_mutex);
97 | }
98 |
99 | public:
100 | OpenSLRender();
101 |
102 | ~OpenSLRender();
103 |
104 | void InitRender() override;
105 |
106 | void Render(uint8_t *pcm, int size) override;
107 |
108 | void ReleaseRender() override;
109 | };
110 |
111 | #endif //MULTIMEDIALEARNING_OPENSL_RENDER_H
112 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/media/render/video/native/native_render.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Richie on 2020/12/23 0023.
3 | //
4 |
5 | #include "native_render.h"
6 |
7 | NativeRender::NativeRender(JNIEnv *env, jobject surface) {
8 | m_surface_ref = env->NewGlobalRef(surface);
9 | }
10 |
11 | NativeRender::~NativeRender() = default;
12 |
13 | void NativeRender::InitRender(JNIEnv *env, int video_width, int video_height, int *dst_size) {
14 | // 初始化窗口
15 | m_native_window = ANativeWindow_fromSurface(env, m_surface_ref);
16 |
17 | // 绘制区域的宽高
18 | int windowWidth = ANativeWindow_getWidth(m_native_window);
19 | int windowHeight = ANativeWindow_getHeight(m_native_window);
20 |
21 | // 计算目标视频的宽高
22 | m_dst_w = windowWidth;
23 | m_dst_h = m_dst_w * video_height / video_width;
24 | if (m_dst_h > windowHeight) {
25 | m_dst_h = windowHeight;
26 | m_dst_w = windowHeight * video_width / video_height;
27 | }
28 | LOGE(TAG, "windowW: %d, windowH: %d, dstVideoW: %d, dstVideoH: %d",
29 | windowWidth, windowHeight, m_dst_w, m_dst_h)
30 |
31 | //设置宽高限制缓冲区中的像素数量
32 | ANativeWindow_setBuffersGeometry(m_native_window, windowWidth,
33 | windowHeight, WINDOW_FORMAT_RGBA_8888);
34 |
35 | dst_size[0] = m_dst_w;
36 | dst_size[1] = m_dst_h;
37 | }
38 |
39 | void NativeRender::Render(OneFrame *one_frame) {
40 | //锁定窗口
41 | ANativeWindow_lock(m_native_window, &m_out_buffer, nullptr);
42 | auto *dst = (uint8_t *) m_out_buffer.bits;
43 | // 获取stride:一行可以保存的内存像素数量*4(即:rgba的位数)
44 | int dstStride = m_out_buffer.stride * 4;
45 | int srcStride = one_frame->line_size;
46 |
47 | // 由于window的stride和帧的stride不同,因此需要逐行复制
48 | for (int h = 0; h < m_dst_h; h++) {
49 | memcpy(dst + h * dstStride, one_frame->data + h * srcStride, srcStride);
50 | }
51 | //释放窗口
52 | ANativeWindow_unlockAndPost(m_native_window);
53 | }
54 |
55 | void NativeRender::ReleaseRender(JNIEnv *env) {
56 | if (m_surface_ref != nullptr) {
57 | env->DeleteGlobalRef(m_surface_ref);
58 | }
59 | if (m_native_window != nullptr) {
60 | ANativeWindow_release(m_native_window);
61 | }
62 | av_free(&m_out_buffer);
63 | }
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/media/render/video/native/native_render.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Richie on 2020/12/23 0023.
3 | //
4 | // 本地窗口绘制器
5 |
6 | #ifndef MULTIMEDIALEARNING_NATIVE_RENDER_H
7 | #define MULTIMEDIALEARNING_NATIVE_RENDER_H
8 |
9 | #include
10 | #include
11 | #include
12 | #include "../video_render.h"
13 |
14 | extern "C" {
15 | #include
16 | }
17 |
18 | class NativeRender : public VideoRender {
19 |
20 | private:
21 | const char *TAG = "NativeRender";
22 | // Surface引用,必须使用引用,否则无法在线程中操作
23 | jobject m_surface_ref = nullptr;
24 |
25 | // 存放输出到屏幕的缓存数据
26 | ANativeWindow_Buffer m_out_buffer{};
27 |
28 | // 本地窗口
29 | ANativeWindow *m_native_window = nullptr;
30 |
31 | //显示的目标宽
32 | int m_dst_w{};
33 |
34 | //显示的目标高
35 | int m_dst_h{};
36 |
37 | public:
38 | NativeRender(JNIEnv *env, jobject surface);
39 |
40 | ~NativeRender();
41 |
42 | void InitRender(JNIEnv *env, int video_width, int video_height, int *dst_size) override;
43 |
44 | void Render(OneFrame *one_frame) override;
45 |
46 | void ReleaseRender(JNIEnv *env) override;
47 | };
48 |
49 | #endif //MULTIMEDIALEARNING_NATIVE_RENDER_H
50 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/media/render/video/video_render.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Richie on 2020/12/23 0023.
3 | //
4 |
5 | #ifndef MULTIMEDIALEARNING_VIDEO_RENDER_H
6 | #define MULTIMEDIALEARNING_VIDEO_RENDER_H
7 |
8 | #include
9 | #include
10 | #include "../../one_frame.h"
11 |
12 | class VideoRender {
13 | public:
14 | VideoRender() {
15 |
16 | }
17 |
18 | ~VideoRender() {
19 |
20 | }
21 |
22 | virtual void InitRender(JNIEnv *env, int video_width, int video_height, int *dst_size) = 0;
23 |
24 | virtual void Render(OneFrame *oneFrame) = 0;
25 |
26 | virtual void ReleaseRender(JNIEnv *env) = 0;
27 | };
28 |
29 | #endif //MULTIMEDIALEARNING_VIDEO_RENDER_H
30 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/utils/logger.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Richie on 2020/12/23 0023.
3 | //
4 |
5 | #ifndef MULTIMEDIALEARNING_LOGGER_H
6 | #define MULTIMEDIALEARNING_LOGGER_H
7 |
8 | #include
9 |
10 | #define LOG
11 |
12 | #ifdef LOG
13 | #define LOGD(TAG, FORMAT, ...) __android_log_print(ANDROID_LOG_DEBUG,TAG,FORMAT,##__VA_ARGS__);
14 | #define LOGI(TAG, FORMAT, ...) __android_log_print(ANDROID_LOG_INFO,TAG,FORMAT,##__VA_ARGS__);
15 | #define LOGW(TAG, FORMAT, ...) __android_log_print(ANDROID_LOG_WARN,TAG,FORMAT,##__VA_ARGS__);
16 | #define LOGE(TAG, FORMAT, ...) __android_log_print(ANDROID_LOG_ERROR,TAG,FORMAT,##__VA_ARGS__);
17 |
18 | #define LOG_INFO(TAG, SPEC, FMT, ...) LOGI(TAG, "[%s] " FMT, SPEC, ##__VA_ARGS__)
19 | #define LOG_ERROR(TAG, SPEC, FMT, ...) LOGE(TAG, "[%s] " FMT, SPEC, ##__VA_ARGS__)
20 | #else
21 | #define LOGD(TAG, FORMAT,...);
22 | #define LOGI(TAG, FORMAT,...);
23 | #define LOGW(TAG, FORMAT,...) __android_log_print(ANDROID_LOG_WARN,TAG,FORMAT,##__VA_ARGS__);
24 | #define LOGE(TAG, FORMAT,...) __android_log_print(ANDROID_LOG_ERROR,TAG,FORMAT,##__VA_ARGS__);
25 | #endif
26 | #endif //MULTIMEDIALEARNING_LOGGER_H
27 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/cpp/utils/timer.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by Richie on 2020/12/23 0023.
3 | //
4 |
5 | #ifndef MULTIMEDIALEARNING_TIMER_H
6 | #define MULTIMEDIALEARNING_TIMER_H
7 |
8 | #include "sys/time.h"
9 |
10 | int64_t GetCurMsTime() {
11 | timeval tv;
12 | gettimeofday(&tv, nullptr);
13 | int64_t ts = (int64_t) tv.tv_sec * 1000 + tv.tv_usec / 1000;
14 | return ts;
15 | }
16 |
17 | #endif //MULTIMEDIALEARNING_TIMER_H
18 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/java/cn/richie/ffmpeg/FFmpegNative.java:
--------------------------------------------------------------------------------
1 | package cn.richie.ffmpeg;
2 |
3 | import android.view.Surface;
4 |
5 | /**
6 | * @author Richie on 2020.12.15
7 | */
8 | public class FFmpegNative {
9 | static {
10 | System.loadLibrary("ffmpegnative");
11 | }
12 |
13 | private long mPlayerHandle;
14 |
15 | public static native String getVersion();
16 |
17 | public native void createPlayer(String path, Surface surface);
18 |
19 | public native void play();
20 |
21 | public native void pause();
22 |
23 | public native void releasePlayer();
24 | }
25 |
--------------------------------------------------------------------------------
/ffmpeg/src/main/jniLibs/armeabi-v7a/libavcodec.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isuperqiang/MultiMediaLearning/17636dfbf243185dfbc47bce9ae4f9d9c59d73d4/ffmpeg/src/main/jniLibs/armeabi-v7a/libavcodec.so
--------------------------------------------------------------------------------
/ffmpeg/src/main/jniLibs/armeabi-v7a/libavdevice.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isuperqiang/MultiMediaLearning/17636dfbf243185dfbc47bce9ae4f9d9c59d73d4/ffmpeg/src/main/jniLibs/armeabi-v7a/libavdevice.so
--------------------------------------------------------------------------------
/ffmpeg/src/main/jniLibs/armeabi-v7a/libavfilter.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isuperqiang/MultiMediaLearning/17636dfbf243185dfbc47bce9ae4f9d9c59d73d4/ffmpeg/src/main/jniLibs/armeabi-v7a/libavfilter.so
--------------------------------------------------------------------------------
/ffmpeg/src/main/jniLibs/armeabi-v7a/libavformat.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isuperqiang/MultiMediaLearning/17636dfbf243185dfbc47bce9ae4f9d9c59d73d4/ffmpeg/src/main/jniLibs/armeabi-v7a/libavformat.so
--------------------------------------------------------------------------------
/ffmpeg/src/main/jniLibs/armeabi-v7a/libavutil.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isuperqiang/MultiMediaLearning/17636dfbf243185dfbc47bce9ae4f9d9c59d73d4/ffmpeg/src/main/jniLibs/armeabi-v7a/libavutil.so
--------------------------------------------------------------------------------
/ffmpeg/src/main/jniLibs/armeabi-v7a/libswresample.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isuperqiang/MultiMediaLearning/17636dfbf243185dfbc47bce9ae4f9d9c59d73d4/ffmpeg/src/main/jniLibs/armeabi-v7a/libswresample.so
--------------------------------------------------------------------------------
/ffmpeg/src/main/jniLibs/armeabi-v7a/libswscale.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isuperqiang/MultiMediaLearning/17636dfbf243185dfbc47bce9ae4f9d9c59d73d4/ffmpeg/src/main/jniLibs/armeabi-v7a/libswscale.so
--------------------------------------------------------------------------------
/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 | android.useAndroidX=true
15 | # Automatically convert third-party libraries to use AndroidX
16 | android.enableJetifier=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/isuperqiang/MultiMediaLearning/17636dfbf243185dfbc47bce9ae4f9d9c59d73d4/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Dec 15 21:13:59 CST 2020
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-5.6.4-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 | include ':ffmpeg'
3 |
--------------------------------------------------------------------------------