Skip to content
This repository has been archived by the owner on Dec 22, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master' into dev/3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
plutoless committed Jun 3, 2020
2 parents 5cbf1d8 + cf71bc9 commit a34e832
Show file tree
Hide file tree
Showing 325 changed files with 49,648 additions and 23,766 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
17 changes: 17 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security
# Label to use when marking an issue as stale
staleLabel: wontfix
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
2 changes: 1 addition & 1 deletion Android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,5 @@ Or use `Gradle` to build and run.
- You can file bugs about this sample at [issue](https://github.com/AgoraIO/Advanced-Video/issues)


## Licence
## License
The MIT License (MIT).
10 changes: 7 additions & 3 deletions Android/README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
## 模块

### 自定义视频源
Demo 可以参考 [sample-custom-render](https://github.com/AgoraIO/Advanced-Video/tree/master/Android/sample-custom-render) 文件夹。

默认 Agora SDK 会启动视频模块进行的采集和后续的处理。同时 SDK 也提供了 MediaIO 接口,可以将第三方的视频源传给 Agora SDK 进行传输。 这就需要开发者具备一定的技术能力,自行维护采集和渲染的生命周期。

Demo 包含两个外部视频源的示例代码(屏幕分享和本地视频),提供一个发送自定义视频源的参考方案。不同项目要结合实际情况选择实现方案。

关于 MediaIO 视频源接口的使用,请参考[此页](https://docs.agora.io/cn/Interactive%20Broadcast/custom_video_android?platform=Android)
关于 MediaIO 视频源接口的使用,请参考[此页](https://docs.agora.io/cn/Interactive%20Broadcast/custom_video_android?platform=Android)

通常视频帧的格式为 i420, NV21 或 texture。很多情况下开发者需要创建和管理 OpenGL 线程。Demo 维护 OpenGL 线程维护的思路来自 [grafika](https://github.com/google/grafika) 项目,如果您不熟悉或者想深入了解这个项目请移步其主页。

Expand All @@ -28,11 +29,13 @@ Demo 不提供 .mp4 视频文件,使用者应自行拷贝所需的视频文件

使用 [MediaExtractor](https://developer.android.com/reference/android/media/MediaExtractor) 从 .mp4 文件中将视频帧解压出来(保存到 ByteBuffer),以一定的频率(比如帧的播放时间戳)发送到 [MediaCodec](https://developer.android.com/reference/android/media/MediaCodec) 解码器, 解码的结果被绘制到一个预先设置的 Surface 中(由 texture 生成),继而进行本地渲染或者视频发送。

#### <h4 id="switching"> 视频输入源的切换 </h4>
### <h4 id="switching"> 视频输入源的切换 </h4>
Demo 可以参考 [sample-switch-external-video](https://github.com/AgoraIO/Advanced-Video/tree/master/Android/sample-switch-external-video) 文件夹。

同一时间只有一个视频输入源在工作,视频输入源可以随时以 SDK 无感知的方式进行切换。 视频帧在 foreground service 的 OpenGL 线程里进行处理、发送和渲染(通常指的是本地渲染),因此可以进行后台的采集和发送。

### 使用 Agora SDK 的裸数据插件接口进行视频包的自定义加密
Demo 可以参考 [sample-video-encrypt](https://github.com/AgoraIO/Advanced-Video/tree/master/Android/sample-video-encrypt) 文件夹。

关于裸数据接口的使用,请参考文档:[音频裸数据](https://docs.agora.io/cn/Video/raw_data_audio_android?platform=Android)[视频裸数据](https://docs.agora.io/cn/Video/raw_data_video_android?platform=Android)

Expand All @@ -45,8 +48,9 @@ C++ 裸数据接口的代码需要编译成以 **"libamp-xxx.so"** 的形式命
在 JCenter(maven) 上发布的 sdk 是没有 C++ 裸数据接口的头文件的。当前 demo 里已经上传了相关头文件,但后续的 SDK 版本可能对其进行修改,到时开发者需自行到 Agora 下载页进行下载和覆盖更新。

### Push 接口
Demo 可以参考 [sample-push-video](https://github.com/AgoraIO/Advanced-Video/tree/master/Android/sample-push-video) 文件夹。

除了 MediaIO interface, push 接口也同样用来发送第三方视频源. 更多细节请参考 [Push Interface](https://docs.agora.io/cn/Interactive%20Broadcast/custom_video_android?platform=Android#%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A7%86%E9%A2%91%E9%87%87%E9%9B%86).
除了 MediaIO interface, push 接口也同样用来发送第三方视频源. 更多细节请参考 [Push Interface](https://docs.agora.io/cn/Interactive%20Broadcast/custom_video_android?platform=Android#%E8%87%AA%E5%AE%9A%E4%B9%89%E8%A7%86%E9%A2%91%E9%87%87%E9%9B%86)


在这个 demo 中,我们关注的是 push 接口的实现,忽略了如后台运行和异步多线程等。如果想了解这些细节,请参考 [视频输入源的切换](#switching)
Expand Down
5 changes: 4 additions & 1 deletion Android/azure-templates/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
inputs:
workingDirectory: ${{ parameters.project }}/${{ parameters.module }}
gradleWrapperFile: ${{ parameters.project }}/gradlew
options: '--stacktrace'
gradleOptions: '-Xmx3072m'
publishJUnitResults: false
testResultsFiles: '**/TEST-*.xml'
Expand All @@ -30,7 +31,9 @@ jobs:
Contents: '**/*.apk'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- script: cd $(Build.ArtifactStagingDirectory) && zip -r ${{ parameters.name }}.zip .

- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
PathtoPublish: '$(Build.ArtifactStagingDirectory)/${{ parameters.name }}.zip'
ArtifactName: ${{ parameters.name }}
2 changes: 1 addition & 1 deletion Android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {

}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.android.tools.build:gradle:3.5.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion Android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

android.useDeprecateNdk=true
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import androidx.appcompat.app.AppCompatActivity;

import io.agora.advancedvideo.AgoraApplication;
import io.agora.advancedvideo.R;
import io.agora.advancedvideo.rtc.EngineConfig;
import io.agora.advancedvideo.rtc.EventHandler;
import io.agora.advancedvideo.utils.WindowUtil;
Expand Down Expand Up @@ -73,6 +74,8 @@ protected EngineConfig config() {
return application().engineConfig();
}

protected String token() {return getString(R.string.agora_access_token);}

protected void registerRtcEventHandler(EventHandler handler) {
application().registerEventHandler(handler);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"io.agora.advancedvideo.switchvideoinput.SwitchVideoInputActivity",
"io.agora.advancedvideo.videoencryption.VideoActivity",
"io.agora.advancedvideo.customrenderer.CustomRemoteRenderActivity" ,
"io.agora.advancedvideo.videopush.VideoPushActivity"
"io.agora.advancedvideo.videopush.VideoPushActivity",
"io.agora.advancedvideo.rawdatasample.RawDataActivity"
}
)
public abstract class BaseLiveActivity extends BaseActivity {
Expand Down
1 change: 1 addition & 0 deletions Android/lib-raw-data/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
44 changes: 44 additions & 0 deletions Android/lib-raw-data/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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.

add_library( # Sets the name of the library.
apm-plugin-raw-data

# Sets the library as a shared library.
SHARED

# Provides a relative path to your source file(s).
src/main/cpp/io_agora_advancedvideo_rawdata_MediaPreProcessing.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_link_libraries( # Specifies the target library.
apm-plugin-raw-data

# Links the target library to the log library
# included in the NDK.
${log-lib})
54 changes: 54 additions & 0 deletions Android/lib-raw-data/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"

defaultConfig {
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"

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

externalNativeBuild {
cmake {
cppFlags "-std=c++11"
arguments "-DANDROID_STL=c++_static",
"-DANDROID_PLATFORM=android-15",
"-DANDROID_TOOLCHAIN=clang",
"-DANDROID_STL_FORCE_FEATURES=OFF",
"-DANDROID_ARM_NEON=TRUE"
}
}

ndk {
abiFilters "arm64-v8a", "armeabi-v7a"
// DO NOT MODIFY THIS LINE, IT'S UPDATED BY BUILD MACHINE AUTOMATICALLY.
}
}

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

externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

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/lib-raw-data/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
1 change: 1 addition & 0 deletions Android/lib-raw-data/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<manifest package="io.agora.advancedvideo.rawdata" />
Loading

0 comments on commit a34e832

Please sign in to comment.