Skip to content

jira/DEVEX-60 #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion Android/APIExample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,36 @@ Since version 4.0.0, Agora SDK provides an Extension Interface Framework. Develo
In order to enable it, you could do as follows:

1. Download [opencv](https://agora-adc-artifacts.s3.cn-north-1.amazonaws.com.cn/androidLibs/opencv4.zip) library, unzip it and copy into Android/APIExample/agora-simple-filter/src/main/jniLibs
2. Download [Agora SDK包](https://docs.agora.io/cn/video-call-4.x/downloads?platform=Android), unzip it and copy c++ .so library (keeps arch folder) to Android/APIExample/agora-simple-filter/src/main/agoraLibs
2. Download [Agora SDK包](https://doc.shengwang.cn/doc/rtc/android/resources), unzip it and copy c++ .so library (keeps arch folder) to Android/APIExample/agora-simple-filter/src/main/agoraLibs

```text
Android/APIExample/agora-simple-filter/src/main/agoraLibs
├── arm64-v8a
├── armeabi-v7a
├── x86
└── x86_64
```

3. Modify simpleFilter to true in Android/APIExample/gradle.properties

### Stream Encrypt

This project contains custom stream encrypt examples, which cannot be enabled by default.
The configuration method is as follows:

1. Download [Agora SDK包](https://doc.shengwang.cn/doc/rtc/android/resources), unzip it and copy c++ .so library (keeps arch folder) to Android/APIExample/agora-stream-encrypt/src/main/agoraLibs

```text
Android/APIExample/agora-stream-encrypt/src/main/agoraLibs
├── arm64-v8a
├── armeabi-v7a
├── x86
└── x86_64
```

2. Modify streamEncrypt to true in Android/APIExample/gradle.properties


## Contact Us

- For potential issues, take a look at our [FAQ](https://docs.agora.io/en/faq) first
Expand Down
27 changes: 26 additions & 1 deletion Android/APIExample/README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,34 @@
从4.0.0SDK开始,Agora SDK支持插件系统和开放的云市场帮助开发者发布自己的音视频插件,本项目包含了一个SimpleFilter示例,默认是禁用的状态,如果需要开启编译和使用需要完成以下步骤:

1. 下载 [opencv](https://agora-adc-artifacts.s3.cn-north-1.amazonaws.com.cn/androidLibs/opencv4.zip) 解压后复制到 Android/APIExample/agora-simple-filter/src/main/jniLibs
2. 手动下载[Agora SDK包](https://docs.agora.io/cn/video-call-4.x/downloads?platform=Android), 解压后将c++动态库(包括架构文件夹)copy到Android/APIExample/agora-simple-filter/src/main/agoraLibs
2. 手动下载[Agora SDK包](https://doc.shengwang.cn/doc/rtc/android/resources), 解压后将c++动态库(包括架构文件夹)copy到Android/APIExample/agora-simple-filter/src/main/agoraLibs

```text
Android/APIExample/agora-simple-filter/src/main/agoraLibs
├── arm64-v8a
├── armeabi-v7a
├── x86
└── x86_64
```

3. 修改Android/APIExample/gradle.properties配置文件中simpleFilter值为true

### 自定义加密

本项目包含自定义加密示例,默认是不启用的。配置方法如下:

1. 手动下载[Agora SDK包](https://doc.shengwang.cn/doc/rtc/android/resources), 解压后将c++动态库(包括架构文件夹)copy到Android/APIExample/agora-stream-encrypt/src/main/agoraLibs

```text
Android/APIExample/agora-stream-encrypt/src/main/agoraLibs
├── arm64-v8a
├── armeabi-v7a
├── x86
└── x86_64
```

2. 修改Android/APIExample/gradle.properties配置文件中streamEncrypt值为true

## 联系我们

- 如果你遇到了困难,可以先参阅 [常见问题](https://docs.agora.io/cn/faq)
Expand Down
1 change: 1 addition & 0 deletions Android/APIExample/agora-stream-encrypt/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
48 changes: 48 additions & 0 deletions Android/APIExample/agora-stream-encrypt/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 32
buildToolsVersion "32.0.0"

defaultConfig {
minSdkVersion 21
targetSdkVersion 32
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"

externalNativeBuild {
cmake {
cppFlags "-std=c++14"
abiFilters "armeabi-v7a", "arm64-v8a"
arguments "-DANDROID_STL=c++_shared"
}
}
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
version "3.10.2"

}
}

}

dependencies {
api fileTree(dir: "libs", include: ["*.jar", "*.aar"])
implementation 'androidx.appcompat:appcompat:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
Empty file.
21 changes: 21 additions & 0 deletions Android/APIExample/agora-stream-encrypt/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<manifest package="io.agora.api.streamencrypt">

</manifest>
1 change: 1 addition & 0 deletions Android/APIExample/agora-stream-encrypt/src/main/agoraLibs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# 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)

project(agora-stream-encrypt)

#link agora so
set(agora-lib-so ${PROJECT_SOURCE_DIR}/../agoraLibs/${CMAKE_ANDROID_ARCH_ABI}/libagora-rtc-sdk.so)
link_libraries(${agora-lib-so})

set(agora-ffmpeg-so ${PROJECT_SOURCE_DIR}/../agoraLibs/${CMAKE_ANDROID_ARCH_ABI}/libagora-ffmpeg.so)
link_libraries(${agora-ffmpeg-so})

set(agora-soundtouch-so ${PROJECT_SOURCE_DIR}/../agoraLibs/${CMAKE_ANDROID_ARCH_ABI}/libagora-soundtouch.so)
link_libraries(${agora-soundtouch-so})

set(agora-fdkaac-so ${PROJECT_SOURCE_DIR}/../agoraLibs/${CMAKE_ANDROID_ARCH_ABI}/libagora-fdkaac.so)
link_libraries(${agora-fdkaac-so})


set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")


# 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.

add_library( # Sets the name of the library.
agora-stream-encrypt

# Sets the library as a shared library.
SHARED
# Provides a relative path to your source file(s).
packet_processing_plugin_jni.cpp)

# 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_include_directories(agora-stream-encrypt PRIVATE ${PROJECT_SOURCE_DIR})

target_link_libraries( # Specifies the target library.
agora-stream-encrypt
${agora-lib-so}
${agora-ffmpeg-so}
${agora-soundtouch-so}
${agora-fdkaac-so}

# Links the target library to the log library
# included in the NDK.
${log-lib}
# ${GLESv2}
${GLESv3}
EGL
android)
Loading