### Gradle Setup for YYEVA Android Source: https://github.com/yylive/yyeva-android/blob/main/README_en.md Configure Maven repositories and add YYEVA Android dependencies to your project using Gradle. Supports different versions including beta releases. ```Groovy allprojects { repositories { maven { url 'https://jitpack.io' } } } ``` ```Groovy dependencies { implementation 'com.github.yylive.YYEVA-Android:yyeva:1.0.17' } ``` ```Groovy // 2.0.0-beta dependencies { implementation 'com.github.yylive.YYEVA-Android:yyeva:2.0.0-beta' } ``` -------------------------------- ### IEvaAnimView Interface Source: https://github.com/yylive/yyeva-android/blob/main/README_en.md Core interface for controlling the animation playback. Provides methods to start, stop, loop, set playback speed, background, video mode, start point, mute, and log settings. ```APIDOC interface IEvaAnimView { //播放文件 fun startPlay(file: File) //播放本地文件 fun startPlay(assetManager: AssetManager, assetsPath: String) //停止播放 fun stopPlay() //是否正在运行 fun isRunning(): Boolean //循环播放 fun setLoop(playLoop: Int) //设置背景图 fun setBgImage(bg: Bitmap) //speed为倍速 fun setVideoFps(fps: Int, speed: Float = 1.0f) //设置资源颜色区域和透明区域的对齐方式 /* const val VIDEO_MODE_SPLIT_HORIZONTAL = 1 // 视频左右对齐(alpha左\rgb右) const val VIDEO_MODE_SPLIT_VERTICAL = 2 // 视频上下对齐(alpha上\rgb下) const val VIDEO_MODE_SPLIT_HORIZONTAL_REVERSE = 3 // 视频左右对齐(rgb左\alpha右) const val VIDEO_MODE_SPLIT_VERTICAL_REVERSE = 4 // 视频上下对齐(rgb上\alpha下) const val YYEVAColorRegion_AlphaMP4_alphaHalfRightTop = 5 // 视频上下对齐(rgb上\alpha下)1/4 elpha */ fun setVideoMode(mode: Int) //设置起始播放位置 毫秒 //硬解某些机型会有跳帧前几帧解析异常的问题,不建议使用。 fun setStartPoint(startPoint: Long) //设置静音 fun setMute(isMute: Boolean) //是否不透明度mp4 fun setNormalMp4(isNormalMp4: Boolean) //是否停留在最后一帧 fun setLastFrame(isSetLastFrame: Boolean) //设置日志打印 fun setLog(log: IELog) // ... other methods } ``` -------------------------------- ### YYEVA Android IEvaAnimView Interface Source: https://github.com/yylive/yyeva-android/blob/main/README.md Defines core methods for controlling animation playback within YYEVA. It allows starting, stopping, looping animations, and setting background images, providing essential control over the animation lifecycle. ```APIDOC IEvaAnimView: // 播放文件 startPlay(file: File) - file: The File object pointing to the animation file. // 播放本地文件 startPlay(assetManager: AssetManager, assetsPath: String) - assetManager: The Android AssetManager. - assetsPath: The path to the animation file within the assets. // 停止播放 stopPlay() - Stops the currently playing animation. // 是否正在运行 isRunning(): Boolean - Returns true if an animation is currently playing, false otherwise. // 循环播放 setLoop(playLoop: Int) - playLoop: The number of times to loop the animation. Use 0 for infinite loop. // 设置背景图 setBgImage(bg: Bitmap) - bg: The Bitmap to be used as the background image. ``` -------------------------------- ### CMake Configuration for yyeva-android Native Library Source: https://github.com/yylive/yyeva-android/blob/main/yyevac/CMakeLists.txt This CMakeLists.txt file configures the native build for the yyeva-android project. It defines the shared library 'yyeva', links it with Android NDK libraries (log, EGL, GLESv2, jnigraphics), and includes a static library 'parson'. It also sets the output directory for native libraries. ```CMake # For more information about using CMake with Android Studio, read the # documentation: https://d.android.com/studio/projects/add-native-code.html # Sets the minimum version of CMake required to build the native library. cmake_minimum_required(VERSION 3.4.1) # Creates and names a library, sets it as either STATIC # or SHARED, and provides the relative paths to its source code. # You can define multiple libraries, and CMake builds them for you. # Gradle automatically packages shared libraries with your APK. set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/jniLibs/${ANDROID_ABI}) include_directories(${CMAKE_SOURCE_DIR} src/main/cpp) add_library( # Sets the name of the library. yyeva # Sets the library as a shared library. SHARED # Provides a relative path to your source file(s). src/main/cpp/yyevajni.cpp src/main/cpp/bean/effect.cpp src/main/cpp/bean/evaanimeconfig.cpp src/main/cpp/bean/evasrc.cpp src/main/cpp/bean/evasrcmap.cpp src/main/cpp/bean/evaframe.cpp src/main/cpp/bean/evaframeall.cpp src/main/cpp/bean/evaframeset.cpp src/main/cpp/egl/eglcore.cpp src/main/cpp/engine/yuvrender.cpp src/main/cpp/engine/render.cpp src/main/cpp/engine/mp4render.cpp src/main/cpp/engine/bgrender.cpp src/main/cpp/engine/rendercontroller.cpp src/main/cpp/engine/evaengine.cpp src/main/cpp/util/shaderutil.cpp src/main/cpp/util/glfloatarray.cpp src/main/cpp/util/vertexutil.cpp src/main/cpp/util/texcoordsutil.cpp src/main/cpp/util/textureloadutil.cpp src/main/cpp/mix/evamixrender.cpp src/main/cpp/mix/mixshader.cpp src/main/cpp/vulkan_wrapper/vulkan_wrapper.cpp ) add_library(parson STATIC src/main/cpp/util/parson.c) # Searches for a specified prebuilt library and stores the path as a # variable. Because CMake includes system libraries in the search path by # default, you only need to specify the name of the public NDK library # you want to add. CMake verifies that the library exists before # completing its build. find_library( # Sets the name of the path variable. log-lib # Specifies the name of the NDK library that # you want CMake to locate. log ) # Specifies libraries CMake should link to your target library. You # can link multiple libraries, such as libraries you define in this # build script, prebuilt third-party libraries, or system libraries. target_link_libraries( # Specifies the target library. yyeva android # GLESv3 GLESv2 EGL jnigraphics parson # Links the target library to the log library # included in the NDK. ${log-lib} ) ``` -------------------------------- ### YYEVA Android IEvaFetchResource Interface Source: https://github.com/yylive/yyeva-android/blob/main/README.md Defines methods for fetching resources (images, text) and controlling playback properties like video FPS, mute, and playback mode for YYEVA animations. It handles resource loading and provides callbacks for results. ```APIDOC IEvaFetchResource: // 获取图片 (暂时不支持Bitmap.Config.ALPHA_8 主要是因为一些机型opengl兼容问题) setImage(resource: EvaResource, result:(Bitmap?) -> Unit) - resource: The EvaResource object representing the image. - result: A callback function that receives the loaded Bitmap or null. // 获取文字 setText(resource: EvaResource, result:(String?) -> Unit) - resource: The EvaResource object representing the text. - result: A callback function that receives the loaded String or null. // 资源释放通知 releaseSrc(resources: List) - resources: A list of EvaResource objects to be released. // speed为倍速 setVideoFps(fps: Int, speed: Float = 1.0f) - fps: The target frame rate. - speed: The playback speed multiplier (defaults to 1.0). // 设置资源颜色区域和透明区域的对齐方式 /* const val VIDEO_MODE_SPLIT_HORIZONTAL = 1 // 视频左右对齐(alpha左\rgb右) const val VIDEO_MODE_SPLIT_VERTICAL = 2 // 视频上下对齐(alpha上\rgb下) const val VIDEO_MODE_SPLIT_HORIZONTAL_REVERSE = 3 // 视频左右对齐(rgb左\alpha右) const val VIDEO_MODE_SPLIT_VERTICAL_REVERSE = 4 // 视频上下对齐(rgb上\alpha下) const val YYEVAColorRegion_AlphaMP4_alphaHalfRightTop = 5 // 视频上下对齐(rgb上\alpha下)1/4 elpha */ setVideoMode(mode: Int) - mode: An integer representing the video alignment mode. // 设置起始播放位置 毫秒 // 硬解某些机型会有跳帧前几帧解析异常的问题,不建议使用。 setStartPoint(startPoint: Long) - startPoint: The starting playback position in milliseconds. // 设置静音 setMute(isMute: Boolean) - isMute: True to mute, false otherwise. // 是否不透明度mp4 setNormalMp4(isNormalMp4: Boolean) - isNormalMp4: True if the MP4 is not an alpha channel MP4. // 是否停留在最后一帧 setLastFrame(isSetLastFrame: Boolean) - isSetLastFrame: True to stay on the last frame, false to continue playback. // 设置日志打印 setLog(log: IELog) - log: An implementation of the IELog interface for logging. ``` -------------------------------- ### IEvaFetchResource Interface Source: https://github.com/yylive/yyeva-android/blob/main/README_en.md Interface for fetching animation resources like images and text. It also includes a callback for resource release notifications, crucial for memory management. ```APIDOC interface IEvaFetchResource { // 获取图片 (暂时不支持Bitmap.Config.ALPHA_8 主要是因为一些机型opengl兼容问题) fun setImage(resource: EvaResource, result:(Bitmap?) -> Unit) // 获取文字 fun setText(resource: EvaResource, result:(String?) -> Unit) // 资源释放通知 fun releaseSrc(resources: List) } ``` -------------------------------- ### Add YYEVA Android Gradle Dependency Source: https://github.com/yylive/yyeva-android/blob/main/README.md Instructions to add the YYEVA Android library dependency using Gradle. Includes repository configuration and implementation lines for both stable and beta versions. ```groovy allprojects { repositories { maven { url 'https://jitpack.io' } } } ``` ```groovy dependencies { implementation 'com.github.yylive.YYEVA-Android:yyeva:1.0.17' } ``` ```groovy // 2.0.0-beta版本 dependencies { implementation 'com.github.yylive.YYEVA-Android:yyeva:2.0.0-beta' } ``` -------------------------------- ### OptionParams Class Source: https://github.com/yylive/yyeva-android/blob/main/README_en.md Configuration class for YYEVA animations, used with the 2.0.0-beta version. Allows setting frame rate, play count, mute status, remote service usage, MP4 address, scale type, and filter type. ```APIDOC class OptionParams { var frameRate = 30 var playCount = 1 var isMute = false var isRemoteService = true //使用多进程 var mp4Address = "" var scaleType = 1 // 1=>裁剪居中, 2=>全屏拉伸 3=>原资源大小 var filterType = "" //高清算法 hermite lagrange } ``` -------------------------------- ### YYEVA Android OptionParams for Playback Source: https://github.com/yylive/yyeva-android/blob/main/README.md Configuration class for playback options in YYEVA-Android v2.0.0-beta. It allows customization of frame rate, play count, mute status, scaling, and filtering. ```kotlin class OptionParams { var frameRate = 30 var playCount = 1 var isMute = false var isRemoteService = true //使用多进程 var mp4Address = "" var scaleType = 1 // 1=>裁剪居中, 2=>全屏拉伸 3=>原资源大小 var filterType = "" //高清算法 hermite lagrange } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.