├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── layout │ │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── tcking │ │ │ └── github │ │ │ └── com │ │ │ └── giraffeplayer │ │ │ └── example │ │ │ └── MainActivity.java │ ├── test │ │ └── java │ │ │ └── tcking │ │ │ └── github │ │ │ └── com │ │ │ └── giraffeplayer │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── tcking │ │ └── github │ │ └── com │ │ └── giraffeplayer │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── ijkplayer-java ├── .gitignore ├── gradle.properties ├── src │ ├── main │ │ ├── jniLibs │ │ │ ├── x86 │ │ │ │ ├── libijksdl.so │ │ │ │ ├── libijkffmpeg.so │ │ │ │ └── libijkplayer.so │ │ │ ├── x86_64 │ │ │ │ ├── libijksdl.so │ │ │ │ ├── libijkffmpeg.so │ │ │ │ └── libijkplayer.so │ │ │ ├── armeabi │ │ │ │ ├── libijksdl.so │ │ │ │ ├── libijkffmpeg.so │ │ │ │ └── libijkplayer.so │ │ │ ├── arm64-v8a │ │ │ │ ├── libijksdl.so │ │ │ │ ├── libijkffmpeg.so │ │ │ │ └── libijkplayer.so │ │ │ └── armeabi-v7a │ │ │ │ ├── libijksdl.so │ │ │ │ ├── libijkffmpeg.so │ │ │ │ └── libijkplayer.so │ │ ├── res │ │ │ └── values │ │ │ │ └── strings.xml │ │ ├── java │ │ │ └── tv │ │ │ │ └── danmaku │ │ │ │ └── ijk │ │ │ │ └── media │ │ │ │ └── player │ │ │ │ ├── ffmpeg │ │ │ │ └── FFmpegApi.java │ │ │ │ ├── pragma │ │ │ │ ├── Pragma.java │ │ │ │ └── DebugLog.java │ │ │ │ ├── IjkLibLoader.java │ │ │ │ ├── exceptions │ │ │ │ └── IjkMediaException.java │ │ │ │ ├── ISurfaceTextureHost.java │ │ │ │ ├── MediaInfo.java │ │ │ │ ├── misc │ │ │ │ ├── IMediaFormat.java │ │ │ │ ├── IMediaDataSource.java │ │ │ │ ├── ITrackInfo.java │ │ │ │ ├── AndroidMediaFormat.java │ │ │ │ ├── IjkTrackInfo.java │ │ │ │ ├── AndroidTrackInfo.java │ │ │ │ └── IjkMediaFormat.java │ │ │ │ ├── ISurfaceTextureHolder.java │ │ │ │ ├── annotations │ │ │ │ ├── AccessedByNative.java │ │ │ │ └── CalledByNative.java │ │ │ │ ├── TextureMediaPlayer.java │ │ │ │ ├── AbstractMediaPlayer.java │ │ │ │ ├── IMediaPlayer.java │ │ │ │ ├── MediaPlayerProxy.java │ │ │ │ ├── IjkMediaCodecInfo.java │ │ │ │ └── AndroidMediaPlayer.java │ │ ├── AndroidManifest.xml │ │ ├── .settings │ │ │ └── org.eclipse.jdt.core.prefs │ │ ├── .classpath │ │ ├── project.properties │ │ └── .project │ └── androidTest │ │ └── java │ │ └── tv │ │ └── danmaku │ │ └── ijk │ │ └── media │ │ └── player │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── giraffeplayer ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable-hdpi │ │ │ │ ├── ic_stop_white_24dp.png │ │ │ │ ├── ic_volume_up_white_36dp.png │ │ │ │ ├── ic_brightness_6_white_36dp.png │ │ │ │ ├── ic_chevron_left_white_36dp.png │ │ │ │ ├── ic_fullscreen_white_24dp.png │ │ │ │ ├── ic_play_arrow_white_24dp.png │ │ │ │ ├── ic_volume_off_white_36dp.png │ │ │ │ ├── ic_fullscreen_exit_white_24dp.png │ │ │ │ ├── ic_fullscreen_exit_white_36dp.png │ │ │ │ └── ic_play_circle_outline_white_36dp.png │ │ │ ├── drawable-mdpi │ │ │ │ ├── ic_stop_white_24dp.png │ │ │ │ ├── ic_volume_up_white_36dp.png │ │ │ │ ├── ic_brightness_6_white_36dp.png │ │ │ │ ├── ic_chevron_left_white_36dp.png │ │ │ │ ├── ic_fullscreen_white_24dp.png │ │ │ │ ├── ic_play_arrow_white_24dp.png │ │ │ │ ├── ic_volume_off_white_36dp.png │ │ │ │ ├── ic_fullscreen_exit_white_24dp.png │ │ │ │ ├── ic_fullscreen_exit_white_36dp.png │ │ │ │ └── ic_play_circle_outline_white_36dp.png │ │ │ ├── drawable-xhdpi │ │ │ │ ├── ic_stop_white_24dp.png │ │ │ │ ├── ic_fullscreen_white_24dp.png │ │ │ │ ├── ic_play_arrow_white_24dp.png │ │ │ │ ├── ic_volume_off_white_36dp.png │ │ │ │ ├── ic_volume_up_white_36dp.png │ │ │ │ ├── ic_brightness_6_white_36dp.png │ │ │ │ ├── ic_chevron_left_white_36dp.png │ │ │ │ ├── ic_fullscreen_exit_white_24dp.png │ │ │ │ ├── ic_fullscreen_exit_white_36dp.png │ │ │ │ └── ic_play_circle_outline_white_36dp.png │ │ │ ├── drawable-xxhdpi │ │ │ │ ├── ic_stop_white_24dp.png │ │ │ │ ├── ic_fullscreen_white_24dp.png │ │ │ │ ├── ic_play_arrow_white_24dp.png │ │ │ │ ├── ic_volume_off_white_36dp.png │ │ │ │ ├── ic_volume_up_white_36dp.png │ │ │ │ ├── ic_brightness_6_white_36dp.png │ │ │ │ ├── ic_chevron_left_white_36dp.png │ │ │ │ ├── ic_fullscreen_exit_white_24dp.png │ │ │ │ ├── ic_fullscreen_exit_white_36dp.png │ │ │ │ └── ic_play_circle_outline_white_36dp.png │ │ │ ├── drawable-xxxhdpi │ │ │ │ ├── ic_stop_white_24dp.png │ │ │ │ ├── ic_volume_up_white_36dp.png │ │ │ │ ├── ic_fullscreen_white_24dp.png │ │ │ │ ├── ic_play_arrow_white_24dp.png │ │ │ │ ├── ic_volume_off_white_36dp.png │ │ │ │ ├── ic_brightness_6_white_36dp.png │ │ │ │ ├── ic_chevron_left_white_36dp.png │ │ │ │ ├── ic_fullscreen_exit_white_24dp.png │ │ │ │ ├── ic_fullscreen_exit_white_36dp.png │ │ │ │ └── ic_play_circle_outline_white_36dp.png │ │ │ ├── drawable │ │ │ │ └── app_video_center_bg.xml │ │ │ ├── values-ch │ │ │ │ └── strings.xml │ │ │ ├── values-es │ │ │ │ └── strings.xml │ │ │ ├── values-ro │ │ │ │ └── strings.xml │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ └── color.xml │ │ │ └── layout │ │ │ │ └── giraffe_player.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── tcking │ │ │ └── github │ │ │ └── com │ │ │ └── giraffeplayer │ │ │ ├── IMediaController.java │ │ │ ├── IRenderView.java │ │ │ ├── GiraffePlayerActivity.java │ │ │ ├── SurfaceRenderView.java │ │ │ ├── TextureRenderView.java │ │ │ └── MeasureHelper.java │ ├── test │ │ └── java │ │ │ └── tcking │ │ │ └── github │ │ │ └── com │ │ │ └── giraffeplayer │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── tcking │ │ └── github │ │ └── com │ │ └── giraffeplayer │ │ └── ApplicationTest.java ├── build.gradle └── proguard-rules.pro ├── screencap ├── device-2015-10-28-142934.png ├── device-2015-10-28-143207.png ├── device-2015-10-28-143304.png ├── device-2015-10-28-143343.png └── device-2015-10-28-143722.png ├── .idea └── runConfigurations.xml ├── gradle.properties ├── gradlew.bat ├── README.md ├── gradlew └── LICENSE /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /ijkplayer-java/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':giraffeplayer', ':ijkplayer-java' 2 | -------------------------------------------------------------------------------- /ijkplayer-java/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_NAME=ijkplayer-java 2 | POM_ARTIFACT_ID=ijkplayer-java 3 | POM_PACKAGING=aar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | /captures 8 | **/*.iml 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | GiraffePlayerExample 3 | 4 | -------------------------------------------------------------------------------- /giraffeplayer/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | /captures 8 | -------------------------------------------------------------------------------- /screencap/device-2015-10-28-142934.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/screencap/device-2015-10-28-142934.png -------------------------------------------------------------------------------- /screencap/device-2015-10-28-143207.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/screencap/device-2015-10-28-143207.png -------------------------------------------------------------------------------- /screencap/device-2015-10-28-143304.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/screencap/device-2015-10-28-143304.png -------------------------------------------------------------------------------- /screencap/device-2015-10-28-143343.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/screencap/device-2015-10-28-143343.png -------------------------------------------------------------------------------- /screencap/device-2015-10-28-143722.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/screencap/device-2015-10-28-143722.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ijkplayer-java/src/main/jniLibs/x86/libijksdl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/ijkplayer-java/src/main/jniLibs/x86/libijksdl.so -------------------------------------------------------------------------------- /ijkplayer-java/src/main/jniLibs/x86/libijkffmpeg.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/ijkplayer-java/src/main/jniLibs/x86/libijkffmpeg.so -------------------------------------------------------------------------------- /ijkplayer-java/src/main/jniLibs/x86/libijkplayer.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/ijkplayer-java/src/main/jniLibs/x86/libijkplayer.so -------------------------------------------------------------------------------- /ijkplayer-java/src/main/jniLibs/x86_64/libijksdl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/ijkplayer-java/src/main/jniLibs/x86_64/libijksdl.so -------------------------------------------------------------------------------- /ijkplayer-java/src/main/jniLibs/armeabi/libijksdl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/ijkplayer-java/src/main/jniLibs/armeabi/libijksdl.so -------------------------------------------------------------------------------- /ijkplayer-java/src/main/jniLibs/arm64-v8a/libijksdl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/ijkplayer-java/src/main/jniLibs/arm64-v8a/libijksdl.so -------------------------------------------------------------------------------- /ijkplayer-java/src/main/jniLibs/armeabi-v7a/libijksdl.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/ijkplayer-java/src/main/jniLibs/armeabi-v7a/libijksdl.so -------------------------------------------------------------------------------- /ijkplayer-java/src/main/jniLibs/armeabi/libijkffmpeg.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/ijkplayer-java/src/main/jniLibs/armeabi/libijkffmpeg.so -------------------------------------------------------------------------------- /ijkplayer-java/src/main/jniLibs/armeabi/libijkplayer.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/ijkplayer-java/src/main/jniLibs/armeabi/libijkplayer.so -------------------------------------------------------------------------------- /ijkplayer-java/src/main/jniLibs/x86_64/libijkffmpeg.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/ijkplayer-java/src/main/jniLibs/x86_64/libijkffmpeg.so -------------------------------------------------------------------------------- /ijkplayer-java/src/main/jniLibs/x86_64/libijkplayer.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/ijkplayer-java/src/main/jniLibs/x86_64/libijkplayer.so -------------------------------------------------------------------------------- /ijkplayer-java/src/main/jniLibs/arm64-v8a/libijkffmpeg.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/ijkplayer-java/src/main/jniLibs/arm64-v8a/libijkffmpeg.so -------------------------------------------------------------------------------- /ijkplayer-java/src/main/jniLibs/arm64-v8a/libijkplayer.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/ijkplayer-java/src/main/jniLibs/arm64-v8a/libijkplayer.so -------------------------------------------------------------------------------- /ijkplayer-java/src/main/jniLibs/armeabi-v7a/libijkffmpeg.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/ijkplayer-java/src/main/jniLibs/armeabi-v7a/libijkffmpeg.so -------------------------------------------------------------------------------- /ijkplayer-java/src/main/jniLibs/armeabi-v7a/libijkplayer.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/ijkplayer-java/src/main/jniLibs/armeabi-v7a/libijkplayer.so -------------------------------------------------------------------------------- /ijkplayer-java/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-hdpi/ic_stop_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-hdpi/ic_stop_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-mdpi/ic_stop_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-mdpi/ic_stop_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xhdpi/ic_stop_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xhdpi/ic_stop_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxhdpi/ic_stop_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxhdpi/ic_stop_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxxhdpi/ic_stop_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxxhdpi/ic_stop_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-hdpi/ic_volume_up_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-hdpi/ic_volume_up_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-mdpi/ic_volume_up_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-mdpi/ic_volume_up_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-hdpi/ic_brightness_6_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-hdpi/ic_brightness_6_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-hdpi/ic_chevron_left_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-hdpi/ic_chevron_left_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-hdpi/ic_fullscreen_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-hdpi/ic_fullscreen_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-hdpi/ic_play_arrow_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-hdpi/ic_play_arrow_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-hdpi/ic_volume_off_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-hdpi/ic_volume_off_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-mdpi/ic_brightness_6_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-mdpi/ic_brightness_6_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-mdpi/ic_chevron_left_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-mdpi/ic_chevron_left_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-mdpi/ic_fullscreen_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-mdpi/ic_fullscreen_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-mdpi/ic_play_arrow_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-mdpi/ic_play_arrow_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-mdpi/ic_volume_off_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-mdpi/ic_volume_off_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xhdpi/ic_fullscreen_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xhdpi/ic_fullscreen_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xhdpi/ic_play_arrow_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xhdpi/ic_play_arrow_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xhdpi/ic_volume_off_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xhdpi/ic_volume_off_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xhdpi/ic_volume_up_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xhdpi/ic_volume_up_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxhdpi/ic_fullscreen_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxhdpi/ic_fullscreen_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxhdpi/ic_play_arrow_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxhdpi/ic_play_arrow_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxhdpi/ic_volume_off_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxhdpi/ic_volume_off_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxhdpi/ic_volume_up_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxhdpi/ic_volume_up_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxxhdpi/ic_volume_up_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxxhdpi/ic_volume_up_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xhdpi/ic_brightness_6_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xhdpi/ic_brightness_6_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xhdpi/ic_chevron_left_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xhdpi/ic_chevron_left_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxhdpi/ic_brightness_6_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxhdpi/ic_brightness_6_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxhdpi/ic_chevron_left_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxhdpi/ic_chevron_left_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxxhdpi/ic_fullscreen_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxxhdpi/ic_fullscreen_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxxhdpi/ic_play_arrow_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxxhdpi/ic_play_arrow_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxxhdpi/ic_volume_off_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxxhdpi/ic_volume_off_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-hdpi/ic_fullscreen_exit_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-hdpi/ic_fullscreen_exit_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-hdpi/ic_fullscreen_exit_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-hdpi/ic_fullscreen_exit_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-mdpi/ic_fullscreen_exit_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-mdpi/ic_fullscreen_exit_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-mdpi/ic_fullscreen_exit_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-mdpi/ic_fullscreen_exit_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xhdpi/ic_fullscreen_exit_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xhdpi/ic_fullscreen_exit_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xhdpi/ic_fullscreen_exit_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xhdpi/ic_fullscreen_exit_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxhdpi/ic_fullscreen_exit_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxhdpi/ic_fullscreen_exit_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxhdpi/ic_fullscreen_exit_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxhdpi/ic_fullscreen_exit_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxxhdpi/ic_brightness_6_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxxhdpi/ic_brightness_6_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxxhdpi/ic_chevron_left_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxxhdpi/ic_chevron_left_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-hdpi/ic_play_circle_outline_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-hdpi/ic_play_circle_outline_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-mdpi/ic_play_circle_outline_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-mdpi/ic_play_circle_outline_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxxhdpi/ic_fullscreen_exit_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxxhdpi/ic_fullscreen_exit_white_24dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxxhdpi/ic_fullscreen_exit_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxxhdpi/ic_fullscreen_exit_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xhdpi/ic_play_circle_outline_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xhdpi/ic_play_circle_outline_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxhdpi/ic_play_circle_outline_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxhdpi/ic_play_circle_outline_white_36dp.png -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable-xxxhdpi/ic_play_circle_outline_white_36dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RDFS/GiraffePlayer/master/giraffeplayer/src/main/res/drawable-xxxhdpi/ic_play_circle_outline_white_36dp.png -------------------------------------------------------------------------------- /ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/ffmpeg/FFmpegApi.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.ijk.media.player.ffmpeg; 2 | 3 | public class FFmpegApi { 4 | public static native String av_base64_encode(byte in[]); 5 | } 6 | -------------------------------------------------------------------------------- /ijkplayer-java/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 6 | 7 | -------------------------------------------------------------------------------- /ijkplayer-java/src/main/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 3 | org.eclipse.jdt.core.compiler.compliance=1.6 4 | org.eclipse.jdt.core.compiler.source=1.6 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Feb 17 09:33:21 CST 2016 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-2.10-all.zip 7 | -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/drawable/app_video_center_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/values-ch/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | GiraffePlayer 3 | 请指定播放视频的地址 4 | 发送了点小问题,稍后重试 5 | 不能播放此视频 6 | 播放器不支持此设备 7 | 8 | -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/values-es/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | GiraffePlayer 3 | Porfavor introduce la direccion de streaming 4 | El Player tiene una problema 5 | player not support this device 6 | 7 | -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/values-ro/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | GiraffePlayer 3 | Please specify the address of the video playback 4 | Player encountered a small problem 5 | player not support this device 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/test/java/tcking/github/com/giraffeplayer/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package tcking.github.com.giraffeplayer; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | GiraffePlayer 3 | Please specify the address of the video playback 4 | Player encountered a small problem 5 | can not play this video 6 | player not support this device 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /giraffeplayer/src/test/java/tcking/github/com/giraffeplayer/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package tcking.github.com.giraffeplayer; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /app/src/androidTest/java/tcking/github/com/giraffeplayer/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package tcking.github.com.giraffeplayer; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /ijkplayer-java/src/androidTest/java/tv/danmaku/ijk/media/player/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package tv.danmaku.ijk.media.player; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /giraffeplayer/src/androidTest/java/tcking/github/com/giraffeplayer/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package tcking.github.com.giraffeplayer; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /ijkplayer-java/src/main/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /giraffeplayer/src/main/res/values/color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #FAFAFA 5 | #F5F5F5 6 | #EEEEEE 7 | #E0E0E0 8 | #BDBDBD 9 | #9E9E9E 10 | #757575 11 | #616161 12 | #424242 13 | #212121 14 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /ijkplayer-java/src/main/project.properties: -------------------------------------------------------------------------------- 1 | # This file is automatically generated by Android Tools. 2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED! 3 | # 4 | # This file must be checked in Version Control Systems. 5 | # 6 | # To customize properties used by the Ant build system edit 7 | # "ant.properties", and override values to adapt the script to your 8 | # project structure. 9 | # 10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt 12 | 13 | # Project target. 14 | target=android-22 15 | android.library=true 16 | -------------------------------------------------------------------------------- /ijkplayer-java/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /opt/android/ADK/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/tangchao/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /giraffeplayer/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | 4 | android { 5 | compileSdkVersion 23 6 | buildToolsVersion "23.0.1" 7 | 8 | defaultConfig { 9 | minSdkVersion 10 10 | targetSdkVersion 23 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(include: ['*.jar'], dir: 'libs') 24 | testCompile 'junit:junit:4.12' 25 | compile 'com.android.support:appcompat-v7:23.1.0' 26 | compile project(':ijkplayer-java') 27 | } 28 | -------------------------------------------------------------------------------- /giraffeplayer/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/tangchao/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /giraffeplayer/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 13 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion "23.0.1" 6 | 7 | defaultConfig { 8 | applicationId "tcking.github.com.giraffeplayer" 9 | minSdkVersion 10 10 | targetSdkVersion 21 11 | versionCode 1 12 | versionName "1.0" 13 | 14 | ndk { 15 | abiFilters "armeabi","armeabi-v7a","arm64-v8a","x86","x86_64" 16 | } 17 | } 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | } 25 | 26 | dependencies { 27 | compile fileTree(dir: 'libs', include: ['*.jar']) 28 | compile 'com.android.support:appcompat-v7:23.2.1' 29 | compile project(':giraffeplayer') 30 | 31 | testCompile 'junit:junit:4.12' 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 12 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/pragma/Pragma.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Zhang Rui 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 | package tv.danmaku.ijk.media.player.pragma; 17 | 18 | /*- 19 | * configurated by app project 20 | */ 21 | public class Pragma { 22 | public static final boolean ENABLE_VERBOSE = true; 23 | } 24 | -------------------------------------------------------------------------------- /ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/IjkLibLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013-2014 Zhang Rui 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 tv.danmaku.ijk.media.player; 18 | 19 | public interface IjkLibLoader { 20 | void loadLibrary(String libName) throws UnsatisfiedLinkError, 21 | SecurityException; 22 | } 23 | -------------------------------------------------------------------------------- /ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/exceptions/IjkMediaException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013-2014 Zhang Rui 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 tv.danmaku.ijk.media.player.exceptions; 18 | 19 | public class IjkMediaException extends Exception { 20 | private static final long serialVersionUID = 7234796519009099506L; 21 | } 22 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | android.useDeprecatedNdk=true 20 | -------------------------------------------------------------------------------- /ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/ISurfaceTextureHost.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Zhang Rui 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 tv.danmaku.ijk.media.player; 18 | 19 | import android.graphics.SurfaceTexture; 20 | 21 | public interface ISurfaceTextureHost { 22 | void releaseSurfaceTexture(SurfaceTexture surfaceTexture); 23 | } 24 | -------------------------------------------------------------------------------- /ijkplayer-java/src/main/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | ijkplayer-java 4 | 5 | 6 | 7 | 8 | 9 | com.android.ide.eclipse.adt.ResourceManagerBuilder 10 | 11 | 12 | 13 | 14 | com.android.ide.eclipse.adt.PreCompilerBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.jdt.core.javabuilder 20 | 21 | 22 | 23 | 24 | com.android.ide.eclipse.adt.ApkBuilder 25 | 26 | 27 | 28 | 29 | 30 | com.android.ide.eclipse.adt.AndroidNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/MediaInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013-2014 Zhang Rui 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 tv.danmaku.ijk.media.player; 18 | 19 | public class MediaInfo { 20 | public String mMediaPlayerName; 21 | 22 | public String mVideoDecoder; 23 | public String mVideoDecoderImpl; 24 | 25 | public String mAudioDecoder; 26 | public String mAudioDecoderImpl; 27 | 28 | public IjkMediaMeta mMeta; 29 | } 30 | -------------------------------------------------------------------------------- /ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/misc/IMediaFormat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Zhang Rui 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 tv.danmaku.ijk.media.player.misc; 18 | 19 | public interface IMediaFormat { 20 | // Common keys 21 | String KEY_MIME = "mime"; 22 | 23 | // Video Keys 24 | String KEY_WIDTH = "width"; 25 | String KEY_HEIGHT = "height"; 26 | 27 | String getString(String name); 28 | 29 | int getInteger(String name); 30 | } 31 | -------------------------------------------------------------------------------- /ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/ISurfaceTextureHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Zhang Rui 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 tv.danmaku.ijk.media.player; 18 | 19 | import android.graphics.SurfaceTexture; 20 | 21 | public interface ISurfaceTextureHolder { 22 | void setSurfaceTexture(SurfaceTexture surfaceTexture); 23 | 24 | SurfaceTexture getSurfaceTexture(); 25 | 26 | void setSurfaceTextureHost(ISurfaceTextureHost surfaceTextureHost); 27 | } 28 | -------------------------------------------------------------------------------- /ijkplayer-java/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | // http://tools.android.com/tech-docs/new-build-system/tips 5 | //noinspection GroovyAssignabilityCheck 6 | compileSdkVersion rootProject.ext.compileSdkVersion 7 | //noinspection GroovyAssignabilityCheck 8 | buildToolsVersion rootProject.ext.buildToolsVersion 9 | 10 | defaultConfig { 11 | minSdkVersion 9 12 | targetSdkVersion rootProject.ext.targetSdkVersion 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | } 25 | 26 | ext { 27 | optionalPlugins = ['tools/gradle-mvn-push.gradle', 'tools/gradle-bintray-upload.gradle']; 28 | } 29 | 30 | ext.optionalPlugins.each{ value -> 31 | def plugin_file = new File(rootProject.projectDir, value); 32 | if (plugin_file.exists()) { 33 | apply from: plugin_file 34 | } 35 | } -------------------------------------------------------------------------------- /ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/misc/IMediaDataSource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Zhang Rui 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 tv.danmaku.ijk.media.player.misc; 18 | 19 | import java.io.IOException; 20 | 21 | @SuppressWarnings("RedundantThrows") 22 | public interface IMediaDataSource { 23 | int readAt(long position, byte[] buffer, int offset, int size) throws IOException; 24 | 25 | long getSize() throws IOException; 26 | 27 | void close() throws IOException; 28 | } 29 | -------------------------------------------------------------------------------- /ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/misc/ITrackInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Zhang Rui 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 tv.danmaku.ijk.media.player.misc; 18 | 19 | public interface ITrackInfo { 20 | int MEDIA_TRACK_TYPE_AUDIO = 2; 21 | int MEDIA_TRACK_TYPE_METADATA = 5; 22 | int MEDIA_TRACK_TYPE_SUBTITLE = 4; 23 | int MEDIA_TRACK_TYPE_TIMEDTEXT = 3; 24 | int MEDIA_TRACK_TYPE_UNKNOWN = 0; 25 | int MEDIA_TRACK_TYPE_VIDEO = 1; 26 | 27 | IMediaFormat getFormat(); 28 | 29 | String getLanguage(); 30 | 31 | int getTrackType(); 32 | 33 | String getInfoInline(); 34 | } 35 | -------------------------------------------------------------------------------- /ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/annotations/AccessedByNative.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013-2014 Zhang Rui 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 tv.danmaku.ijk.media.player.annotations; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * is used by the JNI generator to create the necessary JNI 26 | * bindings and expose this method to native code. 27 | */ 28 | @Target(ElementType.FIELD) 29 | @Retention(RetentionPolicy.CLASS) 30 | public @interface AccessedByNative { 31 | } -------------------------------------------------------------------------------- /giraffeplayer/src/main/java/tcking/github/com/giraffeplayer/IMediaController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Zhang Rui 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 tcking.github.com.giraffeplayer; 18 | 19 | import android.view.View; 20 | import android.widget.MediaController; 21 | 22 | public interface IMediaController { 23 | void hide(); 24 | 25 | boolean isShowing(); 26 | 27 | void setAnchorView(View view); 28 | 29 | void setEnabled(boolean enabled); 30 | 31 | void setMediaPlayer(MediaController.MediaPlayerControl player); 32 | 33 | void show(int timeout); 34 | 35 | void show(); 36 | 37 | //---------- 38 | // Extends 39 | //---------- 40 | void showOnce(View view); 41 | } 42 | -------------------------------------------------------------------------------- /ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/annotations/CalledByNative.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013-2014 Zhang Rui 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 tv.danmaku.ijk.media.player.annotations; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * is used by the JNI generator to create the necessary JNI 26 | * bindings and expose this method to native code. 27 | */ 28 | @Target(ElementType.METHOD) 29 | @Retention(RetentionPolicy.CLASS) 30 | public @interface CalledByNative { 31 | /* 32 | * If present, tells which inner class the method belongs to. 33 | */ 34 | String value() default ""; 35 | } -------------------------------------------------------------------------------- /ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/misc/AndroidMediaFormat.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Zhang Rui 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 tv.danmaku.ijk.media.player.misc; 18 | 19 | import android.annotation.TargetApi; 20 | import android.media.MediaFormat; 21 | import android.os.Build; 22 | 23 | public class AndroidMediaFormat implements IMediaFormat { 24 | private final MediaFormat mMediaFormat; 25 | 26 | public AndroidMediaFormat(MediaFormat mediaFormat) { 27 | mMediaFormat = mediaFormat; 28 | } 29 | 30 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN) 31 | @Override 32 | public int getInteger(String name) { 33 | if (mMediaFormat == null) 34 | return 0; 35 | 36 | return mMediaFormat.getInteger(name); 37 | } 38 | 39 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN) 40 | @Override 41 | public String getString(String name) { 42 | if (mMediaFormat == null) 43 | return null; 44 | 45 | return mMediaFormat.getString(name); 46 | } 47 | 48 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN) 49 | @Override 50 | public String toString() { 51 | StringBuilder out = new StringBuilder(128); 52 | out.append(getClass().getName()); 53 | out.append('{'); 54 | if (mMediaFormat != null) { 55 | out.append(mMediaFormat.toString()); 56 | } else { 57 | out.append("null"); 58 | } 59 | out.append('}'); 60 | return out.toString(); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /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 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 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 Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /giraffeplayer/src/main/java/tcking/github/com/giraffeplayer/IRenderView.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Zhang Rui 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 tcking.github.com.giraffeplayer; 18 | 19 | import android.graphics.SurfaceTexture; 20 | import android.support.annotation.NonNull; 21 | import android.support.annotation.Nullable; 22 | import android.view.Surface; 23 | import android.view.SurfaceHolder; 24 | import android.view.View; 25 | 26 | import tv.danmaku.ijk.media.player.IMediaPlayer; 27 | 28 | public interface IRenderView { 29 | static final int AR_ASPECT_FIT_PARENT = 0; // without clip 30 | static final int AR_ASPECT_FILL_PARENT = 1; // may clip 31 | static final int AR_ASPECT_WRAP_CONTENT = 2; 32 | static final int AR_MATCH_PARENT = 3; 33 | static final int AR_16_9_FIT_PARENT = 4; 34 | static final int AR_4_3_FIT_PARENT = 5; 35 | 36 | View getView(); 37 | 38 | boolean shouldWaitForResize(); 39 | 40 | void setVideoSize(int videoWidth, int videoHeight); 41 | 42 | void setVideoSampleAspectRatio(int videoSarNum, int videoSarDen); 43 | 44 | void setVideoRotation(int degree); 45 | 46 | void setAspectRatio(int aspectRatio); 47 | 48 | void addRenderCallback(@NonNull IRenderCallback callback); 49 | 50 | void removeRenderCallback(@NonNull IRenderCallback callback); 51 | 52 | interface ISurfaceHolder { 53 | void bindToMediaPlayer(IMediaPlayer mp); 54 | 55 | @NonNull 56 | IRenderView getRenderView(); 57 | 58 | @Nullable 59 | SurfaceHolder getSurfaceHolder(); 60 | 61 | @Nullable 62 | Surface openSurface(); 63 | 64 | @Nullable 65 | SurfaceTexture getSurfaceTexture(); 66 | } 67 | 68 | public interface IRenderCallback { 69 | /** 70 | * @param holder 71 | * @param width could be 0 72 | * @param height could be 0 73 | */ 74 | void onSurfaceCreated(@NonNull ISurfaceHolder holder, int width, int height); 75 | 76 | /** 77 | * @param holder 78 | * @param format could be 0 79 | * @param width 80 | * @param height 81 | */ 82 | void onSurfaceChanged(@NonNull ISurfaceHolder holder, int format, int width, int height); 83 | 84 | void onSurfaceDestroyed(@NonNull ISurfaceHolder holder); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/TextureMediaPlayer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Zhang Rui 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 tv.danmaku.ijk.media.player; 18 | 19 | import android.annotation.TargetApi; 20 | import android.graphics.SurfaceTexture; 21 | import android.os.Build; 22 | import android.view.Surface; 23 | import android.view.SurfaceHolder; 24 | 25 | @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) 26 | public class TextureMediaPlayer extends MediaPlayerProxy implements IMediaPlayer, ISurfaceTextureHolder { 27 | private SurfaceTexture mSurfaceTexture; 28 | private ISurfaceTextureHost mSurfaceTextureHost; 29 | 30 | public TextureMediaPlayer(IMediaPlayer backEndMediaPlayer) { 31 | super(backEndMediaPlayer); 32 | } 33 | 34 | public void releaseSurfaceTexture() { 35 | if (mSurfaceTexture != null) { 36 | if (mSurfaceTextureHost != null) { 37 | mSurfaceTextureHost.releaseSurfaceTexture(mSurfaceTexture); 38 | } else { 39 | mSurfaceTexture.release(); 40 | } 41 | mSurfaceTexture = null; 42 | } 43 | } 44 | 45 | //-------------------- 46 | // IMediaPlayer 47 | //-------------------- 48 | @Override 49 | public void reset() { 50 | super.reset(); 51 | releaseSurfaceTexture(); 52 | } 53 | 54 | @Override 55 | public void release() { 56 | super.release(); 57 | releaseSurfaceTexture(); 58 | } 59 | 60 | @Override 61 | public void setDisplay(SurfaceHolder sh) { 62 | if (mSurfaceTexture == null) 63 | super.setDisplay(sh); 64 | } 65 | 66 | @Override 67 | public void setSurface(Surface surface) { 68 | if (mSurfaceTexture == null) 69 | super.setSurface(surface); 70 | } 71 | 72 | //-------------------- 73 | // ISurfaceTextureHolder 74 | //-------------------- 75 | 76 | @Override 77 | public void setSurfaceTexture(SurfaceTexture surfaceTexture) { 78 | if (mSurfaceTexture == surfaceTexture) 79 | return; 80 | 81 | releaseSurfaceTexture(); 82 | mSurfaceTexture = surfaceTexture; 83 | if (surfaceTexture == null) { 84 | super.setSurface(null); 85 | } else { 86 | super.setSurface(new Surface(surfaceTexture)); 87 | } 88 | } 89 | 90 | @Override 91 | public SurfaceTexture getSurfaceTexture() { 92 | return mSurfaceTexture; 93 | } 94 | 95 | @Override 96 | public void setSurfaceTextureHost(ISurfaceTextureHost surfaceTextureHost) { 97 | mSurfaceTextureHost = surfaceTextureHost; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/misc/IjkTrackInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Zhang Rui 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 tv.danmaku.ijk.media.player.misc; 18 | 19 | import android.text.TextUtils; 20 | 21 | import tv.danmaku.ijk.media.player.IjkMediaMeta; 22 | 23 | public class IjkTrackInfo implements ITrackInfo { 24 | private int mTrackType = MEDIA_TRACK_TYPE_UNKNOWN; 25 | private IjkMediaMeta.IjkStreamMeta mStreamMeta; 26 | 27 | public IjkTrackInfo(IjkMediaMeta.IjkStreamMeta streamMeta) { 28 | mStreamMeta = streamMeta; 29 | } 30 | 31 | public void setMediaMeta(IjkMediaMeta.IjkStreamMeta streamMeta) { 32 | mStreamMeta = streamMeta; 33 | } 34 | 35 | @Override 36 | public IMediaFormat getFormat() { 37 | return new IjkMediaFormat(mStreamMeta); 38 | } 39 | 40 | @Override 41 | public String getLanguage() { 42 | if (mStreamMeta == null || TextUtils.isEmpty(mStreamMeta.mLanguage)) 43 | return "und"; 44 | 45 | return mStreamMeta.mLanguage; 46 | } 47 | 48 | @Override 49 | public int getTrackType() { 50 | return mTrackType; 51 | } 52 | 53 | public void setTrackType(int trackType) { 54 | mTrackType = trackType; 55 | } 56 | 57 | @Override 58 | public String toString() { 59 | return getClass().getSimpleName() + '{' + getInfoInline() + "}"; 60 | } 61 | 62 | @Override 63 | public String getInfoInline() { 64 | StringBuilder out = new StringBuilder(128); 65 | switch (mTrackType) { 66 | case MEDIA_TRACK_TYPE_VIDEO: 67 | out.append("VIDEO"); 68 | out.append(", "); 69 | out.append(mStreamMeta.getCodecShortNameInline()); 70 | out.append(", "); 71 | out.append(mStreamMeta.getBitrateInline()); 72 | out.append(", "); 73 | out.append(mStreamMeta.getResolutionInline()); 74 | break; 75 | case MEDIA_TRACK_TYPE_AUDIO: 76 | out.append("AUDIO"); 77 | out.append(", "); 78 | out.append(mStreamMeta.getCodecShortNameInline()); 79 | out.append(", "); 80 | out.append(mStreamMeta.getBitrateInline()); 81 | out.append(", "); 82 | out.append(mStreamMeta.getSampleRateInline()); 83 | break; 84 | case MEDIA_TRACK_TYPE_TIMEDTEXT: 85 | out.append("TIMEDTEXT"); 86 | break; 87 | case MEDIA_TRACK_TYPE_SUBTITLE: 88 | out.append("SUBTITLE"); 89 | break; 90 | default: 91 | out.append("UNKNOWN"); 92 | break; 93 | } 94 | return out.toString(); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GiraffePlayer 2 | out of the box android video player base on [ijkplayer](https://github.com/Bilibili/ijkplayer) 3 | 4 | # features 5 | 1. base on ijkplayer,support RTMP , HLS (http & https) , MP4,M4A etc. 6 | 2. gestures for volume control 7 | 3. gestures for brightness control 8 | 4. gestures for forward or backward 9 | 5. fullscreen by manual or sensor 10 | 6. try to replay when error(only for live video) 11 | 7. set video scale type (double click video will switch the scale types in app,you can find the difference) 12 | 1. fitParent:可能会剪裁,保持原视频的大小,显示在中心,当原视频的大小超过view的大小超过部分裁剪处理 13 | 2. fillParent:可能会剪裁,等比例放大视频,直到填满View为止,超过View的部分作裁剪处理 14 | 3. wrapContent:将视频的内容完整居中显示,如果视频大于view,则按比例缩视频直到完全显示在view中 15 | 4. fitXY:不剪裁,非等比例拉伸画面填满整个View 16 | 5. 16:9:不剪裁,非等比例拉伸画面到16:9,并完全显示在View中 17 | 6. 4:3:不剪裁,非等比例拉伸画面到4:3,并完全显示在View中 18 | 19 | # how to import library 20 | 1. git clone https://github.com/tcking/GiraffePlayer.git 21 | 2. android studio->file->New->Import module->select `giraffeplayer` 22 | 23 | ## notice: 24 | the player default support 6 CPU architecture:ARMv5, ARMv7, ARMv8,x86 and 86_64,if your project need't support all of the architectures,you can remove the folder in `ijkplayer-java/src/main/jniLibs` to generate a light APK. 25 | read this first:[How to use 32-bit native libaries on 64-bit Android device](http://stackoverflow.com/questions/30782848/how-to-use-32-bit-native-libaries-on-64-bit-android-device),[What you should know about .so files](http://ph0b.com/android-abis-and-so-files/),[关于Android的.so文件你所需要知道的](http://www.jianshu.com/p/cb05698a1968) 26 | 27 | # How to use ([example code](https://github.com/tcking/GiraffePlayer/blob/master/app/src/main/java/tcking/github/com/giraffeplayer/example/MainActivity.java)) 28 | ## case 1: only what to play a vedio fullscreen 29 | just call`GiraffePlayerActivity.configPlayer(activity).play(url)`,all is done. 30 | 31 | ## case 2: embed a player in a layout 32 | ### step 1: include video layout in your layout xml file 33 | ``` xml 34 | 35 | 39 | 40 | ``` 41 | notice:the giraffe player is match_parent default,if you want to specify `height` or `width` you can overwrite `layout_width` and `layout_width` in `include` tag 42 | 43 | ### step 2: new player and call `play` 44 | ``` java 45 | 46 | GiraffePlayer player = new GiraffePlayer(activity); 47 | player.play(url); 48 | 49 | ``` 50 | 51 | # API: 52 | * `play(url)` //play video 53 | * `stop()` //stop play 54 | * `pause()` 55 | * `start()` 56 | * `forward()` // forward or back,example: forward(0.1f) forward(-0.1f) 57 | * `getCurrentPosition()` 58 | * `setScaleType()` 59 | * `toggleAspectRatio()` 60 | * `seekTo()` //seek to specify position 61 | * `getDuration()` //get video duration 62 | * `onInfo()` //callback when have some information 63 | * `onError()` 64 | * `onComplete()` 65 | * `onControlPanelVisibilityChange()` //callback when control panel visibility change 66 | # screencap 67 | 68 | ![](https://github.com/tcking/GiraffePlayer/blob/master/screencap/device-2015-10-28-142934.png) 69 | ![](https://github.com/tcking/GiraffePlayer/blob/master/screencap/device-2015-10-28-143207.png) 70 | ![](https://github.com/tcking/GiraffePlayer/blob/master/screencap/device-2015-10-28-143304.png) 71 | ![](https://github.com/tcking/GiraffePlayer/blob/master/screencap/device-2015-10-28-143343.png) 72 | ![](https://github.com/tcking/GiraffePlayer/blob/master/screencap/device-2015-10-28-143722.png) -------------------------------------------------------------------------------- /ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/misc/AndroidTrackInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Zhang Rui 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 tv.danmaku.ijk.media.player.misc; 18 | 19 | import android.annotation.TargetApi; 20 | import android.media.MediaFormat; 21 | import android.media.MediaPlayer; 22 | import android.os.Build; 23 | 24 | public class AndroidTrackInfo implements ITrackInfo { 25 | private final MediaPlayer.TrackInfo mTrackInfo; 26 | 27 | public static AndroidTrackInfo[] fromMediaPlayer(MediaPlayer mp) { 28 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) 29 | return fromTrackInfo(mp.getTrackInfo()); 30 | 31 | return null; 32 | } 33 | 34 | private static AndroidTrackInfo[] fromTrackInfo(MediaPlayer.TrackInfo[] trackInfos) { 35 | if (trackInfos == null) 36 | return null; 37 | 38 | AndroidTrackInfo androidTrackInfo[] = new AndroidTrackInfo[trackInfos.length]; 39 | for (int i = 0; i < trackInfos.length; ++i) { 40 | androidTrackInfo[i] = new AndroidTrackInfo(trackInfos[i]); 41 | } 42 | 43 | return androidTrackInfo; 44 | } 45 | 46 | private AndroidTrackInfo(MediaPlayer.TrackInfo trackInfo) { 47 | mTrackInfo = trackInfo; 48 | } 49 | 50 | @TargetApi(Build.VERSION_CODES.KITKAT) 51 | @Override 52 | public IMediaFormat getFormat() { 53 | if (mTrackInfo == null) 54 | return null; 55 | 56 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) 57 | return null; 58 | 59 | MediaFormat mediaFormat = mTrackInfo.getFormat(); 60 | if (mediaFormat == null) 61 | return null; 62 | 63 | return new AndroidMediaFormat(mediaFormat); 64 | } 65 | 66 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN) 67 | @Override 68 | public String getLanguage() { 69 | if (mTrackInfo == null) 70 | return "und"; 71 | 72 | return mTrackInfo.getLanguage(); 73 | } 74 | 75 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN) 76 | @Override 77 | public int getTrackType() { 78 | if (mTrackInfo == null) 79 | return MEDIA_TRACK_TYPE_UNKNOWN; 80 | 81 | return mTrackInfo.getTrackType(); 82 | } 83 | 84 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN) 85 | @Override 86 | public String toString() { 87 | StringBuilder out = new StringBuilder(128); 88 | out.append(getClass().getSimpleName()); 89 | out.append('{'); 90 | if (mTrackInfo != null) { 91 | out.append(mTrackInfo.toString()); 92 | } else { 93 | out.append("null"); 94 | } 95 | out.append('}'); 96 | return out.toString(); 97 | } 98 | 99 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN) 100 | @Override 101 | public String getInfoInline() { 102 | if (mTrackInfo != null) { 103 | return mTrackInfo.toString(); 104 | } else { 105 | return "null"; 106 | } 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/AbstractMediaPlayer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013-2014 Zhang Rui 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 tv.danmaku.ijk.media.player; 18 | 19 | import tv.danmaku.ijk.media.player.misc.IMediaDataSource; 20 | 21 | @SuppressWarnings("WeakerAccess") 22 | public abstract class AbstractMediaPlayer implements IMediaPlayer { 23 | private OnPreparedListener mOnPreparedListener; 24 | private OnCompletionListener mOnCompletionListener; 25 | private OnBufferingUpdateListener mOnBufferingUpdateListener; 26 | private OnSeekCompleteListener mOnSeekCompleteListener; 27 | private OnVideoSizeChangedListener mOnVideoSizeChangedListener; 28 | private OnErrorListener mOnErrorListener; 29 | private OnInfoListener mOnInfoListener; 30 | 31 | public final void setOnPreparedListener(OnPreparedListener listener) { 32 | mOnPreparedListener = listener; 33 | } 34 | 35 | public final void setOnCompletionListener(OnCompletionListener listener) { 36 | mOnCompletionListener = listener; 37 | } 38 | 39 | public final void setOnBufferingUpdateListener( 40 | OnBufferingUpdateListener listener) { 41 | mOnBufferingUpdateListener = listener; 42 | } 43 | 44 | public final void setOnSeekCompleteListener(OnSeekCompleteListener listener) { 45 | mOnSeekCompleteListener = listener; 46 | } 47 | 48 | public final void setOnVideoSizeChangedListener( 49 | OnVideoSizeChangedListener listener) { 50 | mOnVideoSizeChangedListener = listener; 51 | } 52 | 53 | public final void setOnErrorListener(OnErrorListener listener) { 54 | mOnErrorListener = listener; 55 | } 56 | 57 | public final void setOnInfoListener(OnInfoListener listener) { 58 | mOnInfoListener = listener; 59 | } 60 | 61 | public void resetListeners() { 62 | mOnPreparedListener = null; 63 | mOnBufferingUpdateListener = null; 64 | mOnCompletionListener = null; 65 | mOnSeekCompleteListener = null; 66 | mOnVideoSizeChangedListener = null; 67 | mOnErrorListener = null; 68 | mOnInfoListener = null; 69 | } 70 | 71 | protected final void notifyOnPrepared() { 72 | if (mOnPreparedListener != null) 73 | mOnPreparedListener.onPrepared(this); 74 | } 75 | 76 | protected final void notifyOnCompletion() { 77 | if (mOnCompletionListener != null) 78 | mOnCompletionListener.onCompletion(this); 79 | } 80 | 81 | protected final void notifyOnBufferingUpdate(int percent) { 82 | if (mOnBufferingUpdateListener != null) 83 | mOnBufferingUpdateListener.onBufferingUpdate(this, percent); 84 | } 85 | 86 | protected final void notifyOnSeekComplete() { 87 | if (mOnSeekCompleteListener != null) 88 | mOnSeekCompleteListener.onSeekComplete(this); 89 | } 90 | 91 | protected final void notifyOnVideoSizeChanged(int width, int height, 92 | int sarNum, int sarDen) { 93 | if (mOnVideoSizeChangedListener != null) 94 | mOnVideoSizeChangedListener.onVideoSizeChanged(this, width, height, 95 | sarNum, sarDen); 96 | } 97 | 98 | protected final boolean notifyOnError(int what, int extra) { 99 | return mOnErrorListener != null && mOnErrorListener.onError(this, what, extra); 100 | } 101 | 102 | protected final boolean notifyOnInfo(int what, int extra) { 103 | return mOnInfoListener != null && mOnInfoListener.onInfo(this, what, extra); 104 | } 105 | 106 | public void setDataSource(IMediaDataSource mediaDataSource) { 107 | throw new UnsupportedOperationException(); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/pragma/DebugLog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Zhang Rui 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 tv.danmaku.ijk.media.player.pragma; 18 | 19 | import java.util.Locale; 20 | 21 | 22 | import android.util.Log; 23 | 24 | @SuppressWarnings({"SameParameterValue", "WeakerAccess"}) 25 | public class DebugLog { 26 | public static final boolean ENABLE_ERROR = Pragma.ENABLE_VERBOSE; 27 | public static final boolean ENABLE_INFO = Pragma.ENABLE_VERBOSE; 28 | public static final boolean ENABLE_WARN = Pragma.ENABLE_VERBOSE; 29 | public static final boolean ENABLE_DEBUG = Pragma.ENABLE_VERBOSE; 30 | public static final boolean ENABLE_VERBOSE = Pragma.ENABLE_VERBOSE; 31 | 32 | public static void e(String tag, String msg) { 33 | if (ENABLE_ERROR) { 34 | Log.e(tag, msg); 35 | } 36 | } 37 | 38 | public static void e(String tag, String msg, Throwable tr) { 39 | if (ENABLE_ERROR) { 40 | Log.e(tag, msg, tr); 41 | } 42 | } 43 | 44 | public static void efmt(String tag, String fmt, Object... args) { 45 | if (ENABLE_ERROR) { 46 | String msg = String.format(Locale.US, fmt, args); 47 | Log.e(tag, msg); 48 | } 49 | } 50 | 51 | public static void i(String tag, String msg) { 52 | if (ENABLE_INFO) { 53 | Log.i(tag, msg); 54 | } 55 | } 56 | 57 | public static void i(String tag, String msg, Throwable tr) { 58 | if (ENABLE_INFO) { 59 | Log.i(tag, msg, tr); 60 | } 61 | } 62 | 63 | public static void ifmt(String tag, String fmt, Object... args) { 64 | if (ENABLE_INFO) { 65 | String msg = String.format(Locale.US, fmt, args); 66 | Log.i(tag, msg); 67 | } 68 | } 69 | 70 | public static void w(String tag, String msg) { 71 | if (ENABLE_WARN) { 72 | Log.w(tag, msg); 73 | } 74 | } 75 | 76 | public static void w(String tag, String msg, Throwable tr) { 77 | if (ENABLE_WARN) { 78 | Log.w(tag, msg, tr); 79 | } 80 | } 81 | 82 | public static void wfmt(String tag, String fmt, Object... args) { 83 | if (ENABLE_WARN) { 84 | String msg = String.format(Locale.US, fmt, args); 85 | Log.w(tag, msg); 86 | } 87 | } 88 | 89 | public static void d(String tag, String msg) { 90 | if (ENABLE_DEBUG) { 91 | Log.d(tag, msg); 92 | } 93 | } 94 | 95 | public static void d(String tag, String msg, Throwable tr) { 96 | if (ENABLE_DEBUG) { 97 | Log.d(tag, msg, tr); 98 | } 99 | } 100 | 101 | public static void dfmt(String tag, String fmt, Object... args) { 102 | if (ENABLE_DEBUG) { 103 | String msg = String.format(Locale.US, fmt, args); 104 | Log.d(tag, msg); 105 | } 106 | } 107 | 108 | public static void v(String tag, String msg) { 109 | if (ENABLE_VERBOSE) { 110 | Log.v(tag, msg); 111 | } 112 | } 113 | 114 | public static void v(String tag, String msg, Throwable tr) { 115 | if (ENABLE_VERBOSE) { 116 | Log.v(tag, msg, tr); 117 | } 118 | } 119 | 120 | public static void vfmt(String tag, String fmt, Object... args) { 121 | if (ENABLE_VERBOSE) { 122 | String msg = String.format(Locale.US, fmt, args); 123 | Log.v(tag, msg); 124 | } 125 | } 126 | 127 | public static void printStackTrace(Throwable e) { 128 | if (ENABLE_WARN) { 129 | e.printStackTrace(); 130 | } 131 | } 132 | 133 | public static void printCause(Throwable e) { 134 | if (ENABLE_WARN) { 135 | Throwable cause = e.getCause(); 136 | if (cause != null) 137 | e = cause; 138 | 139 | printStackTrace(e); 140 | } 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 18 | 22 | 26 | 30 | 31 | 41 | 42 |