├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── drawable │ │ │ │ ├── timg.jpeg │ │ │ │ ├── timg_2.jpeg │ │ │ │ └── ic_launcher_background.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── layout │ │ │ │ ├── activity_grey_image_test.xml │ │ │ │ ├── activity_camera2_y_u_v_crop.xml │ │ │ │ ├── activity_camera2.xml │ │ │ │ ├── activity_yuv420_to_nv_21.xml │ │ │ │ ├── activity_zoom_yuv.xml │ │ │ │ ├── activity_camera.xml │ │ │ │ ├── activity_camera1_y_u_v_crop.xml │ │ │ │ ├── activity_r_g_b_a_handle.xml │ │ │ │ ├── activity_bitmap2_y_u_v.xml │ │ │ │ └── activity_main.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── luoye │ │ │ └── bzyuv │ │ │ ├── PermissionUtil.java │ │ │ ├── Bitmap2YUVActivity.java │ │ │ ├── RGBAHandleActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── GreyImageTestActivity.java │ │ │ ├── Camera2Activity.java │ │ │ ├── CameraActivity.java │ │ │ ├── YUV420ToNV21Activity.java │ │ │ ├── ZoomYUVActivity.java │ │ │ ├── Camera1YUVCropActivity.java │ │ │ └── Camera2YUVCropActivity.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── luoye │ │ │ └── bzyuvlib │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── luoye │ │ └── bzyuvlib │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── bzyuv ├── .gitignore ├── consumer-rules.pro ├── src │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── cpp │ │ │ ├── lib │ │ │ │ ├── x86 │ │ │ │ │ └── libyuv_static.a │ │ │ │ ├── x86_64 │ │ │ │ │ └── libyuv_static.a │ │ │ │ ├── arm64-v8a │ │ │ │ │ └── libyuv_static.a │ │ │ │ └── armeabi-v7a │ │ │ │ │ └── libyuv_static.a │ │ │ ├── bz_time.h │ │ │ ├── bz_time.cpp │ │ │ ├── BZLogUtil.h │ │ │ ├── include │ │ │ │ ├── libyuv │ │ │ │ │ ├── version.h │ │ │ │ │ ├── rotate_argb.h │ │ │ │ │ ├── scale_uv.h │ │ │ │ │ ├── basic_types.h │ │ │ │ │ ├── scale_argb.h │ │ │ │ │ ├── compare.h │ │ │ │ │ ├── cpu_id.h │ │ │ │ │ ├── compare_row.h │ │ │ │ │ ├── rotate.h │ │ │ │ │ ├── mjpeg_decoder.h │ │ │ │ │ ├── convert_from.h │ │ │ │ │ ├── rotate_row.h │ │ │ │ │ ├── scale.h │ │ │ │ │ ├── video_common.h │ │ │ │ │ ├── convert_from_argb.h │ │ │ │ │ └── macros_msa.h │ │ │ │ └── libyuv.h │ │ │ ├── BZLogUtil.cpp │ │ │ └── CMakeLists.txt │ │ └── java │ │ │ └── com │ │ │ └── luoye │ │ │ └── bzyuvlib │ │ │ ├── BZYUVSoLoadingUtil.java │ │ │ └── BZYUVUtil.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── luoye │ │ └── bzyuv │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── gradle ├── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties └── libs.versions.toml ├── README_cn.md ├── settings.gradle ├── gradle.properties ├── README.md ├── gradlew.bat ├── .gitignore └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /bzyuv/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /bzyuv/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bzyuv/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | BZYUVLib 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/timg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bookzhan/bzyuvlib/HEAD/app/src/main/res/drawable/timg.jpeg -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bookzhan/bzyuvlib/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/timg_2.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bookzhan/bzyuvlib/HEAD/app/src/main/res/drawable/timg_2.jpeg -------------------------------------------------------------------------------- /bzyuv/src/main/cpp/lib/x86/libyuv_static.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bookzhan/bzyuvlib/HEAD/bzyuv/src/main/cpp/lib/x86/libyuv_static.a -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bookzhan/bzyuvlib/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bookzhan/bzyuvlib/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bookzhan/bzyuvlib/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /bzyuv/src/main/cpp/lib/x86_64/libyuv_static.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bookzhan/bzyuvlib/HEAD/bzyuv/src/main/cpp/lib/x86_64/libyuv_static.a -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bookzhan/bzyuvlib/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bookzhan/bzyuvlib/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bookzhan/bzyuvlib/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bookzhan/bzyuvlib/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /bzyuv/src/main/cpp/lib/arm64-v8a/libyuv_static.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bookzhan/bzyuvlib/HEAD/bzyuv/src/main/cpp/lib/arm64-v8a/libyuv_static.a -------------------------------------------------------------------------------- /bzyuv/src/main/cpp/lib/armeabi-v7a/libyuv_static.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bookzhan/bzyuvlib/HEAD/bzyuv/src/main/cpp/lib/armeabi-v7a/libyuv_static.a -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bookzhan/bzyuvlib/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bookzhan/bzyuvlib/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bookzhan/bzyuvlib/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #008577 4 | #00574B 5 | #D81B60 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jan 05 21:55:29 CST 2024 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.14.3-all.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /bzyuv/src/main/cpp/bz_time.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by zhandalin on 2017-04-21 11:26. 3 | * 说明:获取时间 4 | */ 5 | 6 | #ifndef BZFFMPEG_BZ_TIME_H 7 | #define BZFFMPEG_BZ_TIME_H 8 | 9 | #include 10 | #include 11 | 12 | 13 | //返回当前时间的微妙值 14 | int64_t getMicrosecondTime(); 15 | 16 | //返回当前时间的毫秒值 17 | int64_t getCurrentTime(); 18 | 19 | #endif //BZFFMPEG_BZ_TIME_H 20 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /bzyuv/src/main/cpp/bz_time.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by zhandalin on 2017-04-21 11:26. 3 | * 说明: 4 | */ 5 | 6 | #include "bz_time.h" 7 | 8 | 9 | int64_t getCurrentTime() { 10 | struct timeval tv; 11 | gettimeofday(&tv, NULL); 12 | return (int64_t) tv.tv_sec * 1000 + tv.tv_usec / 1000; 13 | } 14 | 15 | int64_t getMicrosecondTime() { 16 | struct timeval tv; 17 | gettimeofday(&tv, NULL); 18 | return (int64_t) tv.tv_sec * 1000000 + tv.tv_usec; 19 | } -------------------------------------------------------------------------------- /app/src/test/java/com/luoye/bzyuvlib/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.luoye.bzyuvlib; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /bzyuv/src/main/cpp/BZLogUtil.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by luoye on 2017/3/16. 3 | // 4 | 5 | #ifndef BZFFMPEG_BZLOG_H 6 | #define BZFFMPEG_BZLOG_H 7 | 8 | #include 9 | #include 10 | 11 | #define LOG_BUF_SIZE 1024 12 | #define BZLOG_TAG "bz_" 13 | 14 | class BZLogUtil { 15 | public: 16 | static bool enableLog; 17 | 18 | static void logV(const char *fmt, ...); 19 | 20 | static void logD(const char *fmt, ...); 21 | 22 | static void logW(const char *fmt, ...); 23 | 24 | static void logE(const char *fmt, ...); 25 | }; 26 | 27 | #endif //BZFFMPEG_BZLOG_H 28 | -------------------------------------------------------------------------------- /bzyuv/src/main/cpp/include/libyuv/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 The LibYuv Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef INCLUDE_LIBYUV_VERSION_H_ 12 | #define INCLUDE_LIBYUV_VERSION_H_ 13 | 14 | #define LIBYUV_VERSION 1787 15 | 16 | #endif // INCLUDE_LIBYUV_VERSION_H_ 17 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /bzyuv/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_grey_image_test.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 21 | 22 | -------------------------------------------------------------------------------- /bzyuv/src/androidTest/java/com/luoye/bzyuv/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.luoye.bzyuv; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | 25 | assertEquals("com.luoye.bzyuv.test", appContext.getPackageName()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/luoye/bzyuvlib/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.luoye.bzyuvlib; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | 25 | assertEquals("com.luoye.bzyuvlib", appContext.getPackageName()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /README_cn.md: -------------------------------------------------------------------------------- 1 | 之前基于RenderScript写了一个YUV转RGBA的工程,地址:https://blog.raoyunsoft.com/post/20 喜欢的可以去看看,比Android原生的ScriptIntrinsicYuvToRGB要强大很多,但是近期在使用的过程中发现RenderScript比Google的libyuv速度要慢很多,于是我又基于libyuv写了一个YUV转换的工程,同时支持Camera1,Camera2输出的YUV转换,以及对YUV镜像,旋转,从YUV输出灰度图,灰度图转成RGBA, 单通道平移,具体支持的功能如下: 2 | 3 | 1. yuv420pToRGBA/yuv420pToBGRA 4 | 2. preHandleYUV 5 | 3. yv12ToRGBA/yv12ToBGRA 6 | 4. nv21ToRGBA/nv21ToBGRA 7 | 5. cropNV21/cropYUV420 8 | 6. zoomYUV420 9 | 7. bitmapToYUV420 10 | 8. yuvToGrey 11 | 9. greyToRGBA 12 | 10. translationSingleChannel 13 | 11. 支持RGBA的旋转,镜像 14 | 12. yuvI420ToNV21 15 | 13. yuvI420ToNV12 16 | 17 | 18 | 19 | #### 如何使用: 20 | 21 | ##### 1.先添加mavenCentral(),如下所示 22 | 23 | ``` 24 | allprojects { 25 | repositories { 26 | maven { url "https://nexus.raoyunsoft.com/repository/maven-releases/" } 27 | } 28 | } 29 | ``` 30 | 31 | ##### 2.然后implementation 'com.guaishou.bzlib:bzyuv:1.1.22@aar' 32 | 33 | 34 | 35 | 如果帮到了你,请给一个star 36 | -------------------------------------------------------------------------------- /bzyuv/src/main/java/com/luoye/bzyuvlib/BZYUVSoLoadingUtil.java: -------------------------------------------------------------------------------- 1 | package com.luoye.bzyuvlib; 2 | 3 | import android.util.Log; 4 | 5 | /** 6 | * Created by bookzhan on 2024−03-11 22:43. 7 | * description: 8 | */ 9 | public class BZYUVSoLoadingUtil { 10 | private static SoLoadingListener mSoLoadingListener; 11 | 12 | public static void setSoLoadingListener(SoLoadingListener soLoadingListener) { 13 | mSoLoadingListener = soLoadingListener; 14 | } 15 | 16 | public static void loadLibrary(String soName) { 17 | try { 18 | System.loadLibrary(soName); 19 | } catch (Throwable throwable) { 20 | Log.e(BZYUVSoLoadingUtil.class.getSimpleName(), "loadSo fail soName=" + soName, throwable); 21 | if (null != mSoLoadingListener) { 22 | mSoLoadingListener.onSoLoadingFail(soName); 23 | } 24 | } 25 | } 26 | 27 | public interface SoLoadingListener { 28 | void onSoLoadingFail(String soName); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | google { 4 | content { 5 | includeGroupByRegex("com\\.android.*") 6 | includeGroupByRegex("com\\.google.*") 7 | includeGroupByRegex("androidx.*") 8 | } 9 | } 10 | mavenCentral() 11 | gradlePluginPortal() 12 | } 13 | } 14 | dependencyResolutionManagement { 15 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 16 | repositories { 17 | maven { url "https://maven.aliyun.com/nexus/content/groups/public" } 18 | google() 19 | mavenCentral() 20 | maven { 21 | url "https://nexus.raoyunsoft.com/repository/maven-private/" 22 | credentials { 23 | username = "deployment" 24 | password = "deployment" 25 | } 26 | } 27 | maven { url "https://jitpack.io" } 28 | } 29 | } 30 | 31 | include ':app', ':bzyuv' 32 | rootProject.name='BZYUVLib' 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_camera2_y_u_v_crop.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 18 | 19 | 24 | 25 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_camera2.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 18 | 19 | 24 | 25 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_yuv420_to_nv_21.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 18 | 19 | 24 | 25 | 30 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | 21 | -------------------------------------------------------------------------------- /bzyuv/src/main/cpp/include/libyuv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011 The LibYuv Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef INCLUDE_LIBYUV_H_ 12 | #define INCLUDE_LIBYUV_H_ 13 | 14 | #include "libyuv/basic_types.h" 15 | #include "libyuv/compare.h" 16 | #include "libyuv/convert.h" 17 | #include "libyuv/convert_argb.h" 18 | #include "libyuv/convert_from.h" 19 | #include "libyuv/convert_from_argb.h" 20 | #include "libyuv/cpu_id.h" 21 | #include "libyuv/mjpeg_decoder.h" 22 | #include "libyuv/planar_functions.h" 23 | #include "libyuv/rotate.h" 24 | #include "libyuv/rotate_argb.h" 25 | #include "libyuv/row.h" 26 | #include "libyuv/scale.h" 27 | #include "libyuv/scale_argb.h" 28 | #include "libyuv/scale_row.h" 29 | #include "libyuv/scale_uv.h" 30 | #include "libyuv/version.h" 31 | #include "libyuv/video_common.h" 32 | 33 | #endif // INCLUDE_LIBYUV_H_ 34 | -------------------------------------------------------------------------------- /bzyuv/src/main/cpp/include/libyuv/rotate_argb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012 The LibYuv Project Authors. All rights reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | #ifndef INCLUDE_LIBYUV_ROTATE_ARGB_H_ 12 | #define INCLUDE_LIBYUV_ROTATE_ARGB_H_ 13 | 14 | #include "libyuv/basic_types.h" 15 | #include "libyuv/rotate.h" // For RotationMode. 16 | 17 | #ifdef __cplusplus 18 | namespace libyuv { 19 | extern "C" { 20 | #endif 21 | 22 | // Rotate ARGB frame 23 | LIBYUV_API 24 | int ARGBRotate(const uint8_t* src_argb, 25 | int src_stride_argb, 26 | uint8_t* dst_argb, 27 | int dst_stride_argb, 28 | int src_width, 29 | int src_height, 30 | enum RotationMode mode); 31 | 32 | #ifdef __cplusplus 33 | } // extern "C" 34 | } // namespace libyuv 35 | #endif 36 | 37 | #endif // INCLUDE_LIBYUV_ROTATE_ARGB_H_ 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_zoom_yuv.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 20 | 21 | 26 | 27 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_camera.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 20 | 21 | 26 | 27 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_camera1_y_u_v_crop.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 15 | 16 | 20 | 21 | 26 | 27 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_r_g_b_a_handle.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 15 | 16 | 22 | 23 |