├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── drawable │ │ │ │ └── cover.jpg │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ ├── activity_opengl_player.xml │ │ │ │ ├── activity_simpler_render.xml │ │ │ │ ├── activity_egl_player.xml │ │ │ │ ├── activity_ffmpeg_info.xml │ │ │ │ ├── activity_synthesizer.xml │ │ │ │ ├── activity_simple_player.xml │ │ │ │ └── activity_main.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ ├── jniLibs │ │ │ ├── x86 │ │ │ │ ├── libavcodec.so │ │ │ │ ├── libavutil.so │ │ │ │ ├── libswscale.so │ │ │ │ ├── libavdevice.so │ │ │ │ ├── libavfilter.so │ │ │ │ ├── libavformat.so │ │ │ │ └── libswresample.so │ │ │ └── armeabi-v7a │ │ │ │ ├── libavutil.so │ │ │ │ ├── libavcodec.so │ │ │ │ ├── libavdevice.so │ │ │ │ ├── libavfilter.so │ │ │ │ ├── libavformat.so │ │ │ │ ├── libswscale.so │ │ │ │ └── libswresample.so │ │ ├── cpp │ │ │ ├── ffmpeg │ │ │ │ └── include │ │ │ │ │ ├── libavutil │ │ │ │ │ ├── avconfig.h │ │ │ │ │ ├── ffversion.h │ │ │ │ │ ├── hwcontext_mediacodec.h │ │ │ │ │ ├── macros.h │ │ │ │ │ ├── hwcontext_vdpau.h │ │ │ │ │ ├── random_seed.h │ │ │ │ │ ├── hwcontext_cuda.h │ │ │ │ │ ├── hwcontext_qsv.h │ │ │ │ │ ├── replaygain.h │ │ │ │ │ ├── adler32.h │ │ │ │ │ ├── motion_vector.h │ │ │ │ │ ├── time.h │ │ │ │ │ ├── intfloat.h │ │ │ │ │ ├── aes.h │ │ │ │ │ ├── hwcontext_videotoolbox.h │ │ │ │ │ ├── rc4.h │ │ │ │ │ ├── pixelutils.h │ │ │ │ │ ├── lzo.h │ │ │ │ │ ├── tea.h │ │ │ │ │ ├── camellia.h │ │ │ │ │ ├── twofish.h │ │ │ │ │ ├── base64.h │ │ │ │ │ ├── aes_ctr.h │ │ │ │ │ ├── des.h │ │ │ │ │ ├── ripemd.h │ │ │ │ │ ├── avassert.h │ │ │ │ │ ├── hwcontext_dxva2.h │ │ │ │ │ ├── blowfish.h │ │ │ │ │ ├── md5.h │ │ │ │ │ ├── lfg.h │ │ │ │ │ ├── cast5.h │ │ │ │ │ ├── sha.h │ │ │ │ │ ├── timestamp.h │ │ │ │ │ ├── sha512.h │ │ │ │ │ ├── file.h │ │ │ │ │ ├── tx.h │ │ │ │ │ ├── xtea.h │ │ │ │ │ ├── hmac.h │ │ │ │ │ ├── bswap.h │ │ │ │ │ ├── crc.h │ │ │ │ │ └── downmix_info.h │ │ │ │ │ ├── libavcodec │ │ │ │ │ ├── ac3_parser.h │ │ │ │ │ ├── adts_parser.h │ │ │ │ │ ├── jni.h │ │ │ │ │ ├── vorbis_parser.h │ │ │ │ │ ├── vaapi.h │ │ │ │ │ ├── dxva2.h │ │ │ │ │ ├── avdct.h │ │ │ │ │ ├── d3d11va.h │ │ │ │ │ └── avfft.h │ │ │ │ │ ├── libswresample │ │ │ │ │ └── version.h │ │ │ │ │ ├── libavdevice │ │ │ │ │ └── version.h │ │ │ │ │ ├── libswscale │ │ │ │ │ └── version.h │ │ │ │ │ └── libavfilter │ │ │ │ │ └── version.h │ │ │ ├── native-lib.cpp │ │ │ └── CMakeLists.txt │ │ ├── java │ │ │ └── com │ │ │ │ └── cxp │ │ │ │ └── learningvideo │ │ │ │ ├── media │ │ │ │ ├── encoder │ │ │ │ │ ├── IEncodeStateListener.kt │ │ │ │ │ ├── DefEncodeStateListener.kt │ │ │ │ │ ├── AudioEncoder.kt │ │ │ │ │ └── VideoEncoder.kt │ │ │ │ ├── DecodeState.kt │ │ │ │ ├── IDecorderProgress.kt │ │ │ │ ├── Frame.kt │ │ │ │ ├── IDecoderStateListener.kt │ │ │ │ ├── IExtractor.kt │ │ │ │ ├── decoder │ │ │ │ │ ├── DefDecodeStateListener.kt │ │ │ │ │ ├── VideoDecoder.kt │ │ │ │ │ └── AudioDecoder.kt │ │ │ │ ├── extractor │ │ │ │ │ ├── AudioExtractor.kt │ │ │ │ │ ├── VideoExtractor.kt │ │ │ │ │ └── MMExtractor.kt │ │ │ │ ├── IDecoder.kt │ │ │ │ └── muxer │ │ │ │ │ └── MP4Repack.kt │ │ │ │ ├── MainApp.kt │ │ │ │ ├── opengl │ │ │ │ ├── drawer │ │ │ │ │ └── IDrawer.kt │ │ │ │ ├── DefGLSurfaceView.kt │ │ │ │ ├── SimpleRender.kt │ │ │ │ ├── egl │ │ │ │ │ └── EGLSurfaceHolder.kt │ │ │ │ └── OpenGLTools.kt │ │ │ │ ├── FFmpegActivity.kt │ │ │ │ ├── SimpleRenderActivity.kt │ │ │ │ ├── MainActivity.kt │ │ │ │ ├── SimplePlayerActivity.kt │ │ │ │ ├── utils │ │ │ │ └── Test.kt │ │ │ │ ├── OpenGLPlayerActivity.kt │ │ │ │ ├── SoulPlayerActivity.kt │ │ │ │ ├── EGLPlayerActivity.kt │ │ │ │ └── MultiOpenGLPlayerActivity.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── cxp │ │ │ └── learningvideo │ │ │ └── ExampleUnitTest.kt │ └── androidTest │ │ └── java │ │ └── com │ │ └── cxp │ │ └── learningvideo │ │ └── ExampleInstrumentedTest.kt ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── cover.jpg ├── qrcode_for_wx.jpg ├── .gitignore ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── README.md └── gradlew.bat /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/cover.jpg -------------------------------------------------------------------------------- /qrcode_for_wx.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/qrcode_for_wx.jpg -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/* 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Learning Video 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/res/drawable/cover.jpg -------------------------------------------------------------------------------- /app/src/main/jniLibs/x86/libavcodec.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/jniLibs/x86/libavcodec.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/x86/libavutil.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/jniLibs/x86/libavutil.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/x86/libswscale.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/jniLibs/x86/libswscale.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/x86/libavdevice.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/jniLibs/x86/libavdevice.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/x86/libavfilter.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/jniLibs/x86/libavfilter.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/x86/libavformat.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/jniLibs/x86/libavformat.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/x86/libswresample.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/jniLibs/x86/libswresample.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi-v7a/libavutil.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/jniLibs/armeabi-v7a/libavutil.so -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi-v7a/libavcodec.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/jniLibs/armeabi-v7a/libavcodec.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi-v7a/libavdevice.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/jniLibs/armeabi-v7a/libavdevice.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi-v7a/libavfilter.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/jniLibs/armeabi-v7a/libavfilter.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi-v7a/libavformat.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/jniLibs/armeabi-v7a/libavformat.so -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi-v7a/libswscale.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/jniLibs/armeabi-v7a/libswscale.so -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi-v7a/libswresample.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/jniLibs/armeabi-v7a/libswresample.so -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/githubhaohao/LearningVideo/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/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 | -------------------------------------------------------------------------------- /app/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 "4.2.2" 5 | #endif /* AVUTIL_FFVERSION_H */ 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Sep 02 09:37:42 CST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/cxp/learningvideo/media/encoder/IEncodeStateListener.kt: -------------------------------------------------------------------------------- 1 | package com.cxp.learningvideo.media.encoder 2 | 3 | 4 | /** 5 | * 编码状态回调接口 6 | * 7 | * @author Chen Xiaoping (562818444@qq.com) 8 | * @since LearningVideo 9 | * @version LearningVideo 10 | * 11 | */ 12 | interface IEncodeStateListener { 13 | fun encodeStart(encoder: BaseEncoder) 14 | fun encodeProgress(encoder: BaseEncoder) 15 | fun encoderFinish(encoder: BaseEncoder) 16 | } -------------------------------------------------------------------------------- /app/src/test/java/com/cxp/learningvideo/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.cxp.learningvideo 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/cxp/learningvideo/media/DecodeState.kt: -------------------------------------------------------------------------------- 1 | package com.cxp.learningvideo.media 2 | 3 | 4 | /** 5 | * 解码状态 6 | * 7 | * @author Chen Xiaoping (562818444@qq.com) 8 | * @since LearningVideo 9 | * @version LearningVideo 10 | * @Datetime 2019-09-02 10:00 11 | * 12 | */ 13 | enum class DecodeState { 14 | /**开始状态*/ 15 | START, 16 | /**解码中*/ 17 | DECODING, 18 | /**解码暂停*/ 19 | PAUSE, 20 | /**正在快进*/ 21 | SEEKING, 22 | /**解码完成*/ 23 | FINISH, 24 | /**解码器释放*/ 25 | STOP 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/cxp/learningvideo/media/IDecorderProgress.kt: -------------------------------------------------------------------------------- 1 | package com.cxp.learningvideo.media 2 | 3 | 4 | /** 5 | * 解码进度 6 | * 7 | * @author Chen Xiaoping (562818444@qq.com) 8 | * @since LearningVideo 9 | * @version LearningVideo 10 | * @Datetime 2019-09-02 09:54 11 | * 12 | */ 13 | interface IDecoderProgress { 14 | /** 15 | * 视频宽高回调 16 | */ 17 | fun videoSizeChange(width: Int, height: Int, rotationAngle: Int) 18 | 19 | /** 20 | * 视频播放进度回调 21 | */ 22 | fun videoProgressChange(pos: Long) 23 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_opengl_player.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/cxp/learningvideo/media/encoder/DefEncodeStateListener.kt: -------------------------------------------------------------------------------- 1 | package com.cxp.learningvideo.media.encoder 2 | 3 | 4 | /** 5 | * 默认编码回调接口 6 | * 7 | * @author Chen Xiaoping (562818444@qq.com) 8 | * @since LearningVideo 9 | * @version LearningVideo 10 | * 11 | */ 12 | interface DefEncodeStateListener: IEncodeStateListener { 13 | 14 | override fun encodeStart(encoder: BaseEncoder) { 15 | 16 | } 17 | 18 | override fun encodeProgress(encoder: BaseEncoder) { 19 | 20 | } 21 | 22 | override fun encoderFinish(encoder: BaseEncoder) { 23 | 24 | } 25 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_simpler_render.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/cxp/learningvideo/MainApp.kt: -------------------------------------------------------------------------------- 1 | package com.cxp.learningvideo 2 | 3 | import android.annotation.SuppressLint 4 | import android.app.Application 5 | import android.content.Context 6 | 7 | 8 | /** 9 | * 10 | * @author Chen Xiaoping (562818444@qq.com) 11 | * @since LearningVideo 12 | * @version LearningVideo 13 | * @Datetime 2019-10-10 09:28 14 | * 15 | */ 16 | 17 | @SuppressLint("StaticFieldLeak") 18 | var CONTEXT: Context? = null 19 | 20 | class MainApp: Application() { 21 | 22 | 23 | override fun onCreate() { 24 | super.onCreate() 25 | CONTEXT = this 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_egl_player.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_ffmpeg_info.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/cxp/learningvideo/media/Frame.kt: -------------------------------------------------------------------------------- 1 | package com.cxp.learningvideo.media 2 | 3 | import android.media.MediaCodec 4 | import java.nio.ByteBuffer 5 | 6 | 7 | /** 8 | * 一帧数据 9 | * 10 | * @author Chen Xiaoping (562818444@qq.com) 11 | * @since LearningVideo 12 | * @version LearningVideo 13 | * @Datetime 2019-12-15 19:28 14 | * 15 | */ 16 | class Frame { 17 | var buffer: ByteBuffer? = null 18 | 19 | var bufferInfo = MediaCodec.BufferInfo() 20 | private set 21 | 22 | fun setBufferInfo(info: MediaCodec.BufferInfo) { 23 | bufferInfo.set(info.offset, info.size, info.presentationTimeUs, info.flags) 24 | } 25 | } -------------------------------------------------------------------------------- /app/src/main/java/com/cxp/learningvideo/opengl/drawer/IDrawer.kt: -------------------------------------------------------------------------------- 1 | package com.cxp.learningvideo.opengl.drawer 2 | 3 | import android.graphics.SurfaceTexture 4 | 5 | 6 | /** 7 | * 渲染器 8 | * 9 | * @author Chen Xiaoping (562818444@qq.com) 10 | * @since LearningVideo 11 | * @version LearningVideo 12 | * @Datetime 2019-10-12 10:04 13 | * 14 | */ 15 | interface IDrawer { 16 | fun setVideoSize(videoW: Int, videoH: Int) 17 | fun setWorldSize(worldW: Int, worldH: Int) 18 | fun setAlpha(alpha: Float) 19 | fun draw() 20 | fun setTextureID(id: Int) 21 | fun getSurfaceTexture(cb: (st: SurfaceTexture)->Unit) {} 22 | fun release() 23 | } -------------------------------------------------------------------------------- /app/src/main/java/com/cxp/learningvideo/media/IDecoderStateListener.kt: -------------------------------------------------------------------------------- 1 | package com.cxp.learningvideo.media 2 | 3 | 4 | /** 5 | * 解码状态回调接口 6 | * 7 | * @author Chen Xiaoping (562818444@qq.com) 8 | * @since LearningVideo 9 | * @version LearningVideo 10 | * @Datetime 2019-09-02 09:56 11 | * 12 | */ 13 | interface IDecoderStateListener { 14 | fun decoderPrepare(decodeJob: BaseDecoder?) 15 | fun decoderReady(decodeJob: BaseDecoder?) 16 | fun decoderRunning(decodeJob: BaseDecoder?) 17 | fun decoderPause(decodeJob: BaseDecoder?) 18 | fun decodeOneFrame(decodeJob: BaseDecoder?, frame: Frame) 19 | fun decoderFinish(decodeJob: BaseDecoder?) 20 | fun decoderDestroy(decodeJob: BaseDecoder?) 21 | fun decoderError(decodeJob: BaseDecoder?, msg: String) 22 | } -------------------------------------------------------------------------------- /app/src/androidTest/java/com/cxp/learningvideo/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.cxp.learningvideo 2 | 3 | import android.support.test.InstrumentationRegistry 4 | import android.support.test.runner.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getTargetContext() 22 | assertEquals("com.cxp.learningvideo", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/cxp/learningvideo/FFmpegActivity.kt: -------------------------------------------------------------------------------- 1 | package com.cxp.learningvideo 2 | 3 | import android.os.Bundle 4 | import android.support.v7.app.AppCompatActivity 5 | import kotlinx.android.synthetic.main.activity_ffmpeg_info.* 6 | 7 | 8 | /** 9 | * FFmpeg测试页面 10 | * 11 | * @author Chen Xiaoping (562818444@qq.com) 12 | * @since LearningVideo 13 | * @version LearningVideo 14 | * 15 | */ 16 | class FFmpegActivity: AppCompatActivity() { 17 | override fun onCreate(savedInstanceState: Bundle?) { 18 | super.onCreate(savedInstanceState) 19 | setContentView(R.layout.activity_ffmpeg_info) 20 | tv.text = ffmpegInfo() 21 | } 22 | 23 | private external fun ffmpegInfo(): String 24 | 25 | companion object { 26 | init { 27 | System.loadLibrary("native-lib") 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_synthesizer.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 |