diff --git a/webrtc_player/android/.gitattributes b/webrtc_player/android/.gitattributes
deleted file mode 100644
index 0c9b41ab..00000000
--- a/webrtc_player/android/.gitattributes
+++ /dev/null
@@ -1,2 +0,0 @@
-zlm/libs/arm64-v8a/libZLToolKit.a filter=lfs diff=lfs merge=lfs -text
-zlm/libs/armeabi-v7a/libZLToolKit.a filter=lfs diff=lfs merge=lfs -text
diff --git a/webrtc_player/android/.gitignore b/webrtc_player/android/.gitignore
index d4c3a57e..aa724b77 100644
--- a/webrtc_player/android/.gitignore
+++ b/webrtc_player/android/.gitignore
@@ -13,4 +13,3 @@
.externalNativeBuild
.cxx
local.properties
-/.idea/
diff --git a/webrtc_player/android/.idea/.gitignore b/webrtc_player/android/.idea/.gitignore
new file mode 100644
index 00000000..26d33521
--- /dev/null
+++ b/webrtc_player/android/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/webrtc_player/android/.idea/.name b/webrtc_player/android/.idea/.name
new file mode 100644
index 00000000..377c1793
--- /dev/null
+++ b/webrtc_player/android/.idea/.name
@@ -0,0 +1 @@
+RTCPlayer
\ No newline at end of file
diff --git a/webrtc_player/android/.idea/compiler.xml b/webrtc_player/android/.idea/compiler.xml
new file mode 100644
index 00000000..b589d56e
--- /dev/null
+++ b/webrtc_player/android/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/webrtc_player/android/.idea/deploymentTargetDropDown.xml b/webrtc_player/android/.idea/deploymentTargetDropDown.xml
new file mode 100644
index 00000000..0c0c3383
--- /dev/null
+++ b/webrtc_player/android/.idea/deploymentTargetDropDown.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/webrtc_player/android/.idea/gradle.xml b/webrtc_player/android/.idea/gradle.xml
new file mode 100644
index 00000000..32522c1e
--- /dev/null
+++ b/webrtc_player/android/.idea/gradle.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/webrtc_player/android/.idea/kotlinc.xml b/webrtc_player/android/.idea/kotlinc.xml
new file mode 100644
index 00000000..8d81632f
--- /dev/null
+++ b/webrtc_player/android/.idea/kotlinc.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/webrtc_player/android/.idea/migrations.xml b/webrtc_player/android/.idea/migrations.xml
new file mode 100644
index 00000000..f8051a6f
--- /dev/null
+++ b/webrtc_player/android/.idea/migrations.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/webrtc_player/android/.idea/misc.xml b/webrtc_player/android/.idea/misc.xml
new file mode 100644
index 00000000..0ad17cbd
--- /dev/null
+++ b/webrtc_player/android/.idea/misc.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/webrtc_player/android/.idea/vcs.xml b/webrtc_player/android/.idea/vcs.xml
new file mode 100644
index 00000000..b2bdec2d
--- /dev/null
+++ b/webrtc_player/android/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/webrtc_player/android/README.md b/webrtc_player/android/README.md
new file mode 100644
index 00000000..bd2e7ab3
--- /dev/null
+++ b/webrtc_player/android/README.md
@@ -0,0 +1,104 @@
+# RTCPlayer 播放器
+
+一个基于Android客户端的的RTC播放器
+
+## 项目特点
+
+ - 低延迟
+ - [X]支持[ZLMediakit](https://github.com/ZLMediaKit/ZLMediaKit)流媒体
+ - [ ]支持[SRS](https://github.com/ossrs/srs)
+ - [ ]支持[Janus](https://github.com/meetecho/janus-gateway)
+
+
+
+
+
+
+
+## 延迟情况
+
+- **网页端推流,Android端播放**
+
+
+
+
+
+
+
+三次延迟分别为:490ms、526ms、560ms
+
+- **Android端推屏幕流,网页端播放**
+
+
+
+
+
+
+
+三次延迟分别为:440ms、430ms、387ms
+
+## 接口说明
+
+### Player
+
+- bind(surface: RTCSurfaceView)
+
+ 绑定视图
+
+- play(app: String, streamId: String)
+
+ 播放
+- setVolume(volume:Float)
+
+ 设置音量,范围: 0.0~1.0f
+- stop()
+
+ 停止播放
+- pause()
+
+ 暂停播放
+- resume()
+
+ 恢复播放
+- capture(listener: (bitmap: Bitmap) -> Unit)
+
+ 截图
+- record(duration: Long, result: (path: String) -> Unit)
+
+ 录制
+- setOnErrorListener(listener: (code: Int, msg: String) -> Unit)
+
+ 设置播放器错误监听回调
+- setOnStatusListener(listener: (status: Status) -> Unit)
+
+ 设置播放器状态回调
+
+### Pusher
+
+- bind(surface: RTCSurfaceView, localPreview: Boolean)
+
+ 绑定视图
+
+- push(app: String, streamId: String, mode: PushMode = PushMode.CAMERA, inputFile: String = "")
+
+ 推流,支持Camera、Screen、File
+
+- stop()
+
+ 停止推流
+
+- setOnErrorListener(listener: (code: Int, msg: String) -> Unit)
+
+ 设置播放器错误监听回调
+
+## 联系作者
+如果您需要深度二次开发,并支持其他流媒体服务,可以找我哦!
+[李之阳](https://github.com/leo94666)
+
+## 特别感谢
+
+感谢[ZLMediakit](https://github.com/ZLMediaKit/ZLMediaKit)开源项目
+
+同时感谢JetBrains对开源项目的支持,本项目使用Android Studio开发与调试:
+
+[![Android Studio](https://th.bing.com/th?id=ODLS.d2ea10a5-5792-4f82-bd13-1595fd9d969c&w=32&h=32&qlt=90&pcl=fffffa&o=6&pid=1.2)](https://developer.android.com/studio?hl=zh-cn)
\ No newline at end of file
diff --git a/webrtc_player/android/app-debug.apk b/webrtc_player/android/app-debug.apk
deleted file mode 100644
index 969d48b7..00000000
Binary files a/webrtc_player/android/app-debug.apk and /dev/null differ
diff --git a/webrtc_player/android/app/.gitignore b/webrtc_player/android/app/.gitignore
index c591fdeb..42afabfd 100644
--- a/webrtc_player/android/app/.gitignore
+++ b/webrtc_player/android/app/.gitignore
@@ -1,2 +1 @@
-/build
-.cxx
\ No newline at end of file
+/build
\ No newline at end of file
diff --git a/webrtc_player/android/app/build.gradle b/webrtc_player/android/app/build.gradle
deleted file mode 100644
index 6bacd76e..00000000
--- a/webrtc_player/android/app/build.gradle
+++ /dev/null
@@ -1,56 +0,0 @@
-plugins {
- id 'com.android.application'
- id 'org.jetbrains.kotlin.android'
- id 'kotlin-android-extensions'
- id 'kotlin-kapt'
-
-}
-apply plugin: 'kotlin-android'
-
-android {
- compileSdk 32
-
- defaultConfig {
- applicationId "com.zlmediakit.webrtc"
- minSdk 24
- targetSdk 32
- versionCode 1
- versionName "1.0"
-
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
- }
-
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
- }
- }
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
- kotlinOptions {
- jvmTarget = '1.8'
- }
-}
-
-dependencies {
-
- implementation 'androidx.core:core-ktx:1.7.0'
- implementation 'androidx.appcompat:appcompat:1.5.1'
- implementation 'com.google.android.material:material:1.6.1'
- implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
- testImplementation 'junit:junit:4.13.2'
- androidTestImplementation 'androidx.test.ext:junit:1.1.3'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
- implementation 'com.google.code.gson:gson:2.8.9'
-
- implementation("com.squareup.okhttp3:okhttp:4.10.0")
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
-
- implementation project(':zlm')
- implementation 'com.guolindev.permissionx:permissionx:1.7.1'
-
-
-}
\ No newline at end of file
diff --git a/webrtc_player/android/app/build.gradle.kts b/webrtc_player/android/app/build.gradle.kts
new file mode 100644
index 00000000..9ca6cebf
--- /dev/null
+++ b/webrtc_player/android/app/build.gradle.kts
@@ -0,0 +1,58 @@
+plugins {
+ id("com.android.application")
+ id("org.jetbrains.kotlin.android")
+
+}
+
+android {
+ namespace = "com.top.player"
+ compileSdk = 34
+
+ defaultConfig {
+ applicationId = "com.top.player"
+ minSdk = 24
+ targetSdk = 34
+ versionCode = 1
+ versionName = "1.0"
+
+ testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
+
+ }
+
+ buildTypes {
+ release {
+ isMinifyEnabled = false
+ proguardFiles(
+ getDefaultProguardFile("proguard-android-optimize.txt"),
+ "proguard-rules.pro"
+ )
+ }
+ }
+ compileOptions {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ }
+ kotlinOptions {
+ jvmTarget = "1.8"
+ }
+ viewBinding {
+ enable = true
+ }
+}
+
+dependencies {
+
+ implementation("androidx.appcompat:appcompat:1.5.1")
+ implementation("com.google.android.material:material:1.6.1")
+ implementation("androidx.constraintlayout:constraintlayout:2.1.4")
+ testImplementation("junit:junit:4.13.2")
+ androidTestImplementation("androidx.test.ext:junit:1.1.3")
+ androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")
+
+ implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.22")
+ implementation("com.guolindev.permissionx:permissionx:1.7.1")
+
+ //implementation(project(":RTCPlayer"))
+ implementation("com.rtc.core:RTCPlayer:1.0.0.beta")
+
+}
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/androidTest/java/com/top/player/ExampleInstrumentedTest.java b/webrtc_player/android/app/src/androidTest/java/com/top/player/ExampleInstrumentedTest.java
new file mode 100644
index 00000000..2c5af40e
--- /dev/null
+++ b/webrtc_player/android/app/src/androidTest/java/com/top/player/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.top.player;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.top.player", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/androidTest/java/com/zlmediakit/webrtc/ExampleInstrumentedTest.kt b/webrtc_player/android/app/src/androidTest/java/com/zlmediakit/webrtc/ExampleInstrumentedTest.kt
deleted file mode 100644
index 645a1102..00000000
--- a/webrtc_player/android/app/src/androidTest/java/com/zlmediakit/webrtc/ExampleInstrumentedTest.kt
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.zlmediakit.webrtc
-
-import androidx.test.platform.app.InstrumentationRegistry
-import androidx.test.ext.junit.runners.AndroidJUnit4
-
-import org.junit.Test
-import org.junit.runner.RunWith
-
-import org.junit.Assert.*
-
-/**
- * Instrumented test, which will execute on an Android device.
- *
- * See [testing documentation](http://d.android.com/tools/testing).
- */
-@RunWith(AndroidJUnit4::class)
-class ExampleInstrumentedTest {
- @Test
- fun useAppContext() {
- // Context of the app under test.
- val appContext = InstrumentationRegistry.getInstrumentation().targetContext
- assertEquals("com.zlmediakit.webrtc", appContext.packageName)
- }
-}
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/main/AndroidManifest.xml b/webrtc_player/android/app/src/main/AndroidManifest.xml
index 28a013ba..1e944e3c 100644
--- a/webrtc_player/android/app/src/main/AndroidManifest.xml
+++ b/webrtc_player/android/app/src/main/AndroidManifest.xml
@@ -1,24 +1,27 @@
+ xmlns:tools="http://schemas.android.com/tools">
-
-
+
+
+ android:required="true" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+ tools:overrideLibrary="com.rtc.core"
+ android:name=".App">
@@ -43,12 +45,13 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/main/java/com/zlmediakit/webrtc/App.kt b/webrtc_player/android/app/src/main/java/com/top/player/App.kt
similarity index 80%
rename from webrtc_player/android/app/src/main/java/com/zlmediakit/webrtc/App.kt
rename to webrtc_player/android/app/src/main/java/com/top/player/App.kt
index 5d1796f6..1c457ffd 100644
--- a/webrtc_player/android/app/src/main/java/com/zlmediakit/webrtc/App.kt
+++ b/webrtc_player/android/app/src/main/java/com/top/player/App.kt
@@ -1,4 +1,4 @@
-package com.zlmediakit.webrtc
+package com.top.player
import android.app.Application
diff --git a/webrtc_player/android/app/src/main/java/com/zlmediakit/webrtc/MainActivity.kt b/webrtc_player/android/app/src/main/java/com/top/player/MainActivity.kt
similarity index 87%
rename from webrtc_player/android/app/src/main/java/com/zlmediakit/webrtc/MainActivity.kt
rename to webrtc_player/android/app/src/main/java/com/top/player/MainActivity.kt
index d22a5b8e..8cb2a7e5 100644
--- a/webrtc_player/android/app/src/main/java/com/zlmediakit/webrtc/MainActivity.kt
+++ b/webrtc_player/android/app/src/main/java/com/top/player/MainActivity.kt
@@ -1,4 +1,4 @@
-package com.zlmediakit.webrtc
+package com.top.player
import android.content.Intent
import android.os.Bundle
@@ -11,7 +11,6 @@ class MainActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
-
}
fun toPlayActivity(view: View) {
@@ -23,7 +22,4 @@ class MainActivity : AppCompatActivity() {
}
- fun toDataChannelActivity(view: View) {
-
- }
}
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/main/java/com/top/player/PlayerDemoActivity.kt b/webrtc_player/android/app/src/main/java/com/top/player/PlayerDemoActivity.kt
new file mode 100644
index 00000000..50f810cb
--- /dev/null
+++ b/webrtc_player/android/app/src/main/java/com/top/player/PlayerDemoActivity.kt
@@ -0,0 +1,112 @@
+package com.top.player
+
+import android.os.Bundle
+import android.view.View
+import android.widget.Toast
+import androidx.appcompat.app.AppCompatActivity
+import com.rtc.core.ZLMRTCPlayer
+import com.rtc.core.play.Status
+import com.rtc.core.play.ZLMRTCPlayerImpl
+import com.top.player.databinding.ActivityPlayerBinding
+
+
+class PlayerDemoActivity : AppCompatActivity() {
+
+
+ private val player: ZLMRTCPlayer by lazy {
+ ZLMRTCPlayerImpl(this)
+ }
+
+
+ private val binding by lazy {
+ ActivityPlayerBinding.inflate(layoutInflater)
+ }
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ setContentView(binding.root)
+
+ //ffmpeg -re -stream_loop -1 -i "D:\li\hot\data\data\baseline.mp4" -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp -bf 0 rtsp://zlmediakit.com/live/li
+ //ffmpeg -re -stream_loop -1 -i "D:\li\hot\data\data\test.mp4" -vcodec h264 -acodec aac -f flv -bf 0 rtmp://zlmediakit.com/live/li
+
+ setTitle("Player Demo")
+ player.bind(binding.surfaceViewRender)
+
+ player.setOnErrorListener { code, msg ->
+ Toast.makeText(this, "code:$code,msg:${msg}", Toast.LENGTH_SHORT).show()
+
+ }
+
+ player.setOnStatusListener {
+ when (it) {
+ Status.PREPARING -> {
+ binding.tvStatus.text = "准备播放"
+ }
+
+ Status.PLAYING -> {
+ binding.tvStatus.text = "播放中.."
+ }
+
+ Status.PAUSE -> {
+ binding.tvStatus.text = "暂停中.."
+ }
+
+ Status.RESUME -> {
+ binding.tvStatus.text = "播放中.."
+ }
+
+ Status.STOP -> {
+ binding.tvStatus.text = ""
+ }
+
+ Status.ERROR -> {
+ binding.tvStatus.text = "播放异常"
+ }
+
+ else -> {}
+ }
+ }
+
+ }
+
+
+ override fun onDestroy() {
+ super.onDestroy()
+ player.stop()
+ }
+
+ fun onPlayClick(view: View) {
+
+ player.play(binding.tvApp.text.toString(), binding.tvStreamId.text.toString())
+ }
+
+ fun onPauseClick(view: View) {
+ player.pause()
+ //Toast.makeText(this, "ok", Toast.LENGTH_SHORT).show()
+ }
+
+ fun onStopClick(view: View) {
+ player.stop()
+ }
+
+ fun onResumeClick(view: View) {
+ player.resume()
+ }
+
+ fun onCapture(view: View) {
+ player.capture {
+ Toast.makeText(this, "capture ok", Toast.LENGTH_SHORT).show()
+ }
+ }
+
+ fun onRecord(view: View) {
+ player.record(10 * 1000) {
+ Toast.makeText(this, "" + it, Toast.LENGTH_SHORT).show()
+ }
+ }
+
+ fun onVolume(view: View) {
+ player.setVolume(0.0f)
+ }
+}
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/main/java/com/zlmediakit/webrtc/PusherDemoActivity.kt b/webrtc_player/android/app/src/main/java/com/top/player/PusherDemoActivity.kt
similarity index 60%
rename from webrtc_player/android/app/src/main/java/com/zlmediakit/webrtc/PusherDemoActivity.kt
rename to webrtc_player/android/app/src/main/java/com/top/player/PusherDemoActivity.kt
index 9139dda4..168dafe5 100644
--- a/webrtc_player/android/app/src/main/java/com/zlmediakit/webrtc/PusherDemoActivity.kt
+++ b/webrtc_player/android/app/src/main/java/com/top/player/PusherDemoActivity.kt
@@ -1,21 +1,19 @@
-package com.zlmediakit.webrtc
+package com.top.player
import android.Manifest
import android.content.Intent
-import android.content.pm.PackageManager
import android.os.Bundle
import android.view.View
+import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
-import androidx.core.app.ActivityCompat
-import androidx.core.content.ContextCompat
import com.permissionx.guolindev.PermissionX
-import com.permissionx.guolindev.callback.RequestCallback
-import com.zlm.rtc.ZLMRTCPusher
-import com.zlm.rtc.push.PushMode
-import com.zlm.rtc.push.ZLMRTCPusherImpl
-import kotlinx.android.synthetic.main.activity_player.surface_view_renderer
-import kotlinx.android.synthetic.main.activity_player.tv_app
-import kotlinx.android.synthetic.main.activity_player.tv_stream_id
+import com.rtc.core.RTCSurfaceView
+import com.rtc.core.ZLMRTCPusher
+import com.rtc.core.push.PushMode
+import com.rtc.core.push.ZLMRTCPusherImpl
+import com.top.player.databinding.ActivityPlayerBinding
+import com.top.player.databinding.ActivityPusherBinding
+
class PusherDemoActivity : AppCompatActivity() {
@@ -25,15 +23,25 @@ class PusherDemoActivity : AppCompatActivity() {
}
- override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
- super.onActivityResult(requestCode, resultCode, data)
+ private val binding by lazy {
+ ActivityPusherBinding.inflate(layoutInflater)
}
+
+
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_pusher)
- pusher.bind(surface_view_renderer, true)
+ val rtcSurfaceView = findViewById(R.id.surface_view_render)
+
+ pusher.bind(rtcSurfaceView, true)
+ setTitle("Pusher Demo")
+
+
+ pusher.setOnErrorListener { code, msg ->
+ Toast.makeText(this, "code:${code},msg:${msg}", Toast.LENGTH_SHORT).show()
+ }
}
@@ -42,7 +50,7 @@ class PusherDemoActivity : AppCompatActivity() {
.permissions(Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO)
.request { allGranted, grantedList, deniedList ->
if (allGranted) {
- pusher.push(tv_app.text.toString(), tv_stream_id.text.toString())
+ pusher.push(binding.tvApp.text.toString(), binding.tvStreamId.text.toString())
}
}
}
@@ -53,8 +61,8 @@ class PusherDemoActivity : AppCompatActivity() {
.request { allGranted, grantedList, deniedList ->
if (allGranted) {
pusher.push(
- tv_app.text.toString(),
- tv_stream_id.text.toString(),
+ binding.tvApp.text.toString(),
+ binding.tvStreamId.text.toString(),
PushMode.SCREEN
)
}
@@ -67,8 +75,8 @@ class PusherDemoActivity : AppCompatActivity() {
.request { allGranted, grantedList, deniedList ->
if (allGranted) {
pusher.push(
- tv_app.text.toString(),
- tv_stream_id.text.toString(),
+ binding.tvApp.text.toString(),
+ binding.tvStreamId.text.toString(),
PushMode.FILE,
""
)
@@ -81,5 +89,9 @@ class PusherDemoActivity : AppCompatActivity() {
pusher.stop()
}
+ fun onStopPush(view: View) {
+ pusher.stop()
+ }
+
}
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/main/java/com/zlmediakit/webrtc/PlayDemoActivity.kt b/webrtc_player/android/app/src/main/java/com/zlmediakit/webrtc/PlayDemoActivity.kt
deleted file mode 100644
index fb950b32..00000000
--- a/webrtc_player/android/app/src/main/java/com/zlmediakit/webrtc/PlayDemoActivity.kt
+++ /dev/null
@@ -1,84 +0,0 @@
-package com.zlmediakit.webrtc
-
-import android.annotation.SuppressLint
-import android.graphics.drawable.BitmapDrawable
-import android.os.Bundle
-import android.widget.Toast
-import androidx.appcompat.app.AppCompatActivity
-import com.zlm.rtc.ZLMRTCPlayer
-import kotlinx.android.synthetic.main.activity_main.*
-import kotlinx.android.synthetic.main.activity_main.view.*
-import kotlinx.android.synthetic.main.activity_play.*
-
-
-class PlayDemoActivity : AppCompatActivity() {
-
- private var isSpeaker = true
-
- @SuppressLint("SetTextI18n")
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.activity_play)
-
- lifecycle.addObserver(web_rtc_sv)
-
-
-
-
-
- //http://124.223.98.45/index/api/webrtc?app=live&stream=test&type=play
- url.setText("https://zlmediakit.com/index/api/webrtc?app=live&stream=test&type=play")
-
- //http://192.168.1.17/index/api/webrtc?app=live&stream=test&type=play
- btn_play.setOnClickListener {
- web_rtc_sv?.setVideoPath(url.text.toString())
- web_rtc_sv.start()
- }
-
- web_rtc_sv.setOnErrorListener { errorCode, errorMsg ->
- runOnUiThread {
- Toast.makeText(this, "errorCode:$errorCode,errorMsg:$errorMsg", Toast.LENGTH_SHORT)
- .show()
- }
- }
-
-
- btn_pause.setOnClickListener {
- web_rtc_sv?.pause()
- }
-
- btn_resume.setOnClickListener {
- web_rtc_sv?.resume()
- }
-
- btn_screenshot.setOnClickListener {
- web_rtc_sv?.screenshot {
- runOnUiThread {
- iv_screen.setImageDrawable(BitmapDrawable(it))
- }
- }
- }
-
- btn_mute.setOnClickListener {
- web_rtc_sv.mute(true)
- }
-
-
- selectAudio()
- btn_speaker.setOnClickListener {
- selectAudio()
- }
-
- }
-
- fun selectAudio(){
- if (isSpeaker){
- btn_speaker.setText("扬声器")
- web_rtc_sv.setSpeakerphoneOn(isSpeaker)
- }else{
- btn_speaker.setText("话筒")
- web_rtc_sv.setSpeakerphoneOn(isSpeaker)
- }
- isSpeaker=!isSpeaker
- }
-}
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/main/java/com/zlmediakit/webrtc/PlayerDemoActivity.kt b/webrtc_player/android/app/src/main/java/com/zlmediakit/webrtc/PlayerDemoActivity.kt
deleted file mode 100644
index 0f016858..00000000
--- a/webrtc_player/android/app/src/main/java/com/zlmediakit/webrtc/PlayerDemoActivity.kt
+++ /dev/null
@@ -1,70 +0,0 @@
-package com.zlmediakit.webrtc
-
-import android.os.Bundle
-import android.view.View
-import android.widget.Toast
-import androidx.appcompat.app.AppCompatActivity
-import com.zlm.rtc.ZLMRTCPlayer
-import com.zlm.rtc.play.ZLMRTCPlayerImpl
-import kotlinx.android.synthetic.main.activity_player.surface_view_renderer
-import kotlinx.android.synthetic.main.activity_player.tv_app
-import kotlinx.android.synthetic.main.activity_player.tv_stream_id
-
-class PlayerDemoActivity : AppCompatActivity() {
-
-
- private val player: ZLMRTCPlayer by lazy {
- ZLMRTCPlayerImpl(this)
- }
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
-
- setContentView(R.layout.activity_player)
-
- //ffmpeg -re -stream_loop -1 -i "D:\li\hot\data\data\baseline.mp4" -vcodec h264 -acodec aac -f rtsp -rtsp_transport tcp -bf 0 rtsp://zlmediakit.com/live/li
- //ffmpeg -re -stream_loop -1 -i "D:\li\hot\data\data\test.mp4" -vcodec h264 -acodec aac -f flv -bf 0 rtmp://zlmediakit.com/live/li
-
- player.bind(surface_view_renderer)
-
- }
-
-
- override fun onDestroy() {
- super.onDestroy()
- player.stop()
- }
-
- fun onPlayClick(view: View) {
-
- player.play(tv_app.text.toString(), tv_stream_id.text.toString())
- }
-
- fun onPauseClick(view: View) {
- player.pause()
- }
-
- fun onStopClick(view: View) {
- player.stop()
- }
-
- fun onResumeClick(view: View) {
- player.resume()
- }
-
- fun onCapture(view: View) {
- player.capture {
- Toast.makeText(this, "capture ok", Toast.LENGTH_SHORT).show()
- }
- }
-
- fun onRecord(view: View) {
- player.record(10 * 1000) {
- Toast.makeText(this, "" + it, Toast.LENGTH_SHORT).show()
- }
- }
-
- fun onVolume(view: View) {
- player.setVolume()
- }
-}
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/main/java/com/zlmediakit/webrtc/WebRTCSurfaceView.kt b/webrtc_player/android/app/src/main/java/com/zlmediakit/webrtc/WebRTCSurfaceView.kt
deleted file mode 100644
index 3e94171c..00000000
--- a/webrtc_player/android/app/src/main/java/com/zlmediakit/webrtc/WebRTCSurfaceView.kt
+++ /dev/null
@@ -1,439 +0,0 @@
-package com.zlmediakit.webrtc
-
-import android.content.Context
-import android.graphics.Bitmap
-import android.media.AudioManager
-import android.util.AttributeSet
-import android.util.Log
-import android.view.LayoutInflater
-import android.widget.RelativeLayout
-import androidx.lifecycle.DefaultLifecycleObserver
-import androidx.lifecycle.LifecycleOwner
-import com.google.gson.Gson
-import okhttp3.*
-import okhttp3.MediaType.Companion.toMediaType
-import okhttp3.MediaType.Companion.toMediaTypeOrNull
-import org.webrtc.*
-import org.webrtc.RendererCommon.ScalingType
-import org.webrtc.audio.AudioDeviceModule
-import org.webrtc.audio.JavaAudioDeviceModule
-import java.io.IOException
-import java.util.*
-
-public class WebRTCSurfaceView(context: Context, attrs: AttributeSet?) :
- RelativeLayout(context, attrs), DefaultLifecycleObserver, RendererCommon.RendererEvents {
-
-
- private data class sdp(var sdp: String, var username: String, var password: String)
-
- private data class SdpResponse(var code: Int, var id: String, var sdp: String, var type: String)
-
- private enum class ErrorCode(val errorCode: Int) {
- SUCCESS(0x00),
- GET_REMOTE_SDP_ERROR(0x01);
- }
-
-
- companion object {
- private val TAG = "WebRTCSurfaceView"
-
- }
-
- private var mContext: Context = context
-
- private val eglBase: EglBase = EglBase.create()
- private var mEGLBaseContext: EglBase.Context = eglBase.eglBaseContext
-
- private lateinit var videoUrl: String;
-
- private var mPeerConnectionFactory: PeerConnectionFactory? = null
-
- private var mLocalMediaStream: MediaStream? = null
- private var mLocalAudioTrack: AudioTrack? = null
- private var mAudioSource: AudioSource? = null
-
- private var mLocalSessionDescription: SessionDescription? = null
- private var mRemoteSessionDescription: SessionDescription? = null
-
- private var mLocalPeer: Peer? = null
-
- private var mSurfaceViewRenderer: SurfaceViewRenderer
-
- private lateinit var OnErrorListener: (errorCode: Int, errorMsg: String) -> Unit?
-
- fun setOnErrorListener(listener: (errorCode: Int, errorMsg: String) -> Unit) {
- this.OnErrorListener = listener
- }
-
- private lateinit var OnPreparedListener: () -> Unit?
-
- fun setOnPreparedListener(listener: () -> Unit) {
- this.OnPreparedListener = listener
- }
-
- private val audioManager: AudioManager
-
-
- init {
-
- val view = LayoutInflater.from(mContext).inflate(R.layout.layout_videoview, this)
-
- mPeerConnectionFactory = createConnectionFactory()
-
- mSurfaceViewRenderer = view.findViewById(R.id.surface_view_renderer)
-
- mSurfaceViewRenderer.init(mEGLBaseContext, this)
- mSurfaceViewRenderer.setScalingType(ScalingType.SCALE_ASPECT_FILL)
- mSurfaceViewRenderer.setEnableHardwareScaler(true)
-
-
- //创建媒体流
- mLocalMediaStream = mPeerConnectionFactory?.createLocalMediaStream("ARDAMS")
- //采集音频
- mAudioSource = mPeerConnectionFactory?.createAudioSource(createAudioConstraints())
- mLocalAudioTrack = mPeerConnectionFactory?.createAudioTrack("ARDAMSa0", mAudioSource)
-
- //添加Tracks
- mLocalMediaStream?.addTrack(mLocalAudioTrack)
-
- audioManager = context.getSystemService(Context.AUDIO_SERVICE) as AudioManager
- audioManager.isSpeakerphoneOn = false
-
-
- }
-
-
- private fun set(width: Int, height: Int) {
- layoutParams.width = width
- layoutParams.height = height
- }
-
- private fun createConnectionFactory(): PeerConnectionFactory? {
-
- val options = PeerConnectionFactory.InitializationOptions.builder(mContext)
- .setEnableInternalTracer(false)
- .createInitializationOptions()
-
- PeerConnectionFactory.initialize(options)
-
- val videoEncoderFactory = DefaultVideoEncoderFactory(
- mEGLBaseContext,
- true,
- true
- )
-
- val videoDecoderFactory = DefaultVideoDecoderFactory(mEGLBaseContext)
-
-
- val audioDevice = createJavaAudioDevice()
- val peerConnectionFactory = PeerConnectionFactory.builder()
- .setAudioDeviceModule(audioDevice)
- .setVideoEncoderFactory(videoEncoderFactory)
- .setVideoDecoderFactory(videoDecoderFactory)
- .createPeerConnectionFactory()
- audioDevice.release()
-
- return peerConnectionFactory
-
- }
-
- private fun createAudioConstraints(): MediaConstraints {
- val audioConstraints = MediaConstraints()
- audioConstraints.mandatory.add(
- MediaConstraints.KeyValuePair(
- "googEchoCancellation",
- "true"
- )
- )
- audioConstraints.mandatory.add(
- MediaConstraints.KeyValuePair(
- "googAutoGainControl",
- "false"
- )
- )
- audioConstraints.mandatory.add(
- MediaConstraints.KeyValuePair(
- "googHighpassFilter",
- "true"
- )
- )
- audioConstraints.mandatory.add(
- MediaConstraints.KeyValuePair(
- "googNoiseSuppression",
- "true"
- )
- )
- return audioConstraints
- }
-
- private fun offerOrAnswerConstraint(): MediaConstraints {
- val mediaConstraints = MediaConstraints()
- val keyValuePairs = java.util.ArrayList()
- keyValuePairs.add(MediaConstraints.KeyValuePair("OfferToReceiveAudio", "true"))
- keyValuePairs.add(MediaConstraints.KeyValuePair("OfferToReceiveVideo", "true"))
- mediaConstraints.mandatory.addAll(keyValuePairs)
- return mediaConstraints
- }
-
- private fun createJavaAudioDevice(): AudioDeviceModule {
- val audioTrackErrorCallback: JavaAudioDeviceModule.AudioTrackErrorCallback = object :
- JavaAudioDeviceModule.AudioTrackErrorCallback {
- override fun onWebRtcAudioTrackInitError(errorMessage: String) {
- Log.i(TAG, "onWebRtcAudioTrackInitError ============> $errorMessage")
-
- }
-
- override fun onWebRtcAudioTrackStartError(
- errorCode: JavaAudioDeviceModule.AudioTrackStartErrorCode, errorMessage: String
- ) {
- Log.i(TAG, "onWebRtcAudioTrackStartError ============> $errorCode:$errorMessage")
-
- }
-
- override fun onWebRtcAudioTrackError(errorMessage: String) {
- Log.i(TAG, "onWebRtcAudioTrackError ============> $errorMessage")
-
- }
- }
-
-
- // Set audio track state callbacks.
- val audioTrackStateCallback: JavaAudioDeviceModule.AudioTrackStateCallback = object :
- JavaAudioDeviceModule.AudioTrackStateCallback {
- override fun onWebRtcAudioTrackStart() {
- Log.i(TAG, "onWebRtcAudioTrackStart ============>")
-
- }
-
- override fun onWebRtcAudioTrackStop() {
- Log.i(TAG, "onWebRtcAudioTrackStop ============>")
-
- }
- }
-
- return JavaAudioDeviceModule.builder(mContext)
- .setUseHardwareAcousticEchoCanceler(true)
- .setUseHardwareNoiseSuppressor(true)
- .setAudioTrackErrorCallback(audioTrackErrorCallback)
- .setAudioTrackStateCallback(audioTrackStateCallback)
- .setUseStereoOutput(true) //立体声
- .createAudioDeviceModule()
- }
-
- fun setVideoPath(url: String) {
- videoUrl = url
- }
-
- fun start() {
-
- mLocalPeer = Peer {
- val okHttpClient = OkHttpClient.Builder().build()
-
-
- val body = RequestBody.create("text/plain; charset=utf-8".toMediaType(), it!!)
-
-
- val request: Request = Request.Builder()
- .url(videoUrl)
- .post(body)
- .build()
-
- val call: Call = okHttpClient.newCall(request)
-
- call.enqueue(object : Callback {
- override fun onFailure(call: Call, e: IOException) {
- Log.i(TAG, "onFailure")
- OnErrorListener?.invoke(
- ErrorCode.GET_REMOTE_SDP_ERROR.errorCode,
- e.message.toString()
- )
- }
-
- override fun onResponse(call: Call, response: Response) {
- val body = response.body?.string()
- val sdpResponse = Gson().fromJson(body, SdpResponse::class.java)
-
- try {
- mRemoteSessionDescription = SessionDescription(
- SessionDescription.Type.fromCanonicalForm("answer"),
- sdpResponse.sdp
- )
- Log.i(
- TAG,
- "RemoteSdpObserver onCreateSuccess:[SessionDescription[type=${mRemoteSessionDescription?.type?.name},description=${mRemoteSessionDescription?.description}]]"
- )
- mLocalPeer?.setRemoteDescription(mRemoteSessionDescription!!)
- } catch (e: Exception) {
- Log.i(TAG, e.toString())
- OnErrorListener.invoke(
- ErrorCode.GET_REMOTE_SDP_ERROR.errorCode,
- e.localizedMessage
- )
- }
- }
- })
- }
- }
-
- fun pause() {
- mSurfaceViewRenderer.pauseVideo()
- //mSurfaceViewRenderer.disableFpsReduction()
- }
-
- fun resume() {
- mSurfaceViewRenderer.setFpsReduction(15f)
- }
-
- fun screenshot(listener: (bitmap: Bitmap) -> Unit) {
- mSurfaceViewRenderer.addFrameListener({
- listener.invoke(it)
- }, 1f)
- }
-
- fun setSpeakerphoneOn(on: Boolean) {
- audioManager.isSpeakerphoneOn = on
- }
-
- fun mute(on:Boolean) {
- audioManager.isMicrophoneMute=on
- }
-
- override fun onDestroy(owner: LifecycleOwner) {
- super.onDestroy(owner)
- mSurfaceViewRenderer.release()
- mLocalPeer?.mPeerConnection?.dispose()
- mAudioSource?.dispose()
- mPeerConnectionFactory?.dispose()
- }
-
- override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
- super.onMeasure(widthMeasureSpec, heightMeasureSpec)
-
- }
-
- inner class Peer(var sdp: (String?) -> Unit = {}) : PeerConnection.Observer, SdpObserver {
-
- var mPeerConnection: PeerConnection? = null
-
- init {
- mPeerConnection = createPeerConnection()
- mPeerConnection?.createOffer(this, offerOrAnswerConstraint())
- }
-
- //初始化 RTCPeerConnection 连接管道
- private fun createPeerConnection(): PeerConnection? {
- if (mPeerConnectionFactory == null) {
- mPeerConnectionFactory = createConnectionFactory()
- }
- // 管道连接抽象类实现方法
- val ICEServers = LinkedList()
- val rtcConfig = PeerConnection.RTCConfiguration(ICEServers)
- //修改模式 PlanB无法使用仅接收音视频的配置
- //rtcConfig.sdpSemantics = PeerConnection.SdpSemantics.PLAN_B
- return mPeerConnectionFactory?.createPeerConnection(rtcConfig, this)
- }
-
- fun setRemoteDescription(sdp: SessionDescription) {
- mPeerConnection?.setRemoteDescription(this, sdp)
- }
-
- override fun onCreateSuccess(sessionDescription: SessionDescription?) {
- mPeerConnection?.setLocalDescription(this, sessionDescription)
- mPeerConnection?.addStream(mLocalMediaStream)
- sdp.invoke(sessionDescription?.description)
- }
-
- override fun onSetSuccess() {
-
- }
-
- override fun onCreateFailure(p0: String?) {
-
- }
-
- override fun onSetFailure(p0: String?) {
-
- }
-
- override fun onSignalingChange(signalingState: PeerConnection.SignalingState?) {
- Log.i(TAG, "onSignalingChange ============> " + signalingState.toString())
- }
-
- override fun onIceConnectionChange(iceConnectionState: PeerConnection.IceConnectionState?) {
- Log.i(TAG, "onIceConnectionChange ============> " + iceConnectionState.toString())
-
- }
-
- override fun onIceConnectionReceivingChange(p0: Boolean) {
- Log.i(TAG, "onIceConnectionReceivingChange ============> $p0")
-
- }
-
- override fun onIceGatheringChange(iceGatheringState: PeerConnection.IceGatheringState?) {
- Log.i(TAG, "onIceGatheringChange ============> ${iceGatheringState.toString()}")
- }
-
- override fun onIceCandidate(iceCandidate: IceCandidate?) {
- Log.i(TAG, "onIceCandidate ============> ${iceCandidate.toString()}")
-
-
- }
-
- override fun onIceCandidatesRemoved(p0: Array?) {
- Log.i(TAG, "onIceCandidatesRemoved ============> ${p0.toString()}")
- }
-
- override fun onAddStream(mediaStream: MediaStream?) {
- Log.i(TAG, "onAddStream ============> ${mediaStream?.toString()}")
-
- if (mediaStream?.videoTracks?.isEmpty() != true) {
- val remoteVideoTrack = mediaStream?.videoTracks?.get(0)
- remoteVideoTrack?.setEnabled(true)
- remoteVideoTrack?.addSink(mSurfaceViewRenderer)
- }
-
- if (mediaStream?.audioTracks?.isEmpty() != true) {
- val remoteAudioTrack = mediaStream?.audioTracks?.get(0)
- remoteAudioTrack?.setEnabled(true)
- remoteAudioTrack?.setVolume(1.0)
- }
-
-
- }
-
- override fun onRemoveStream(mediaStream: MediaStream?) {
- Log.i(TAG, "onRemoveStream ============> ${mediaStream.toString()}")
-
- }
-
- override fun onDataChannel(dataChannel: DataChannel?) {
- Log.i(TAG, "onDataChannel ============> ${dataChannel.toString()}")
-
- }
-
- override fun onRenegotiationNeeded() {
- Log.i(TAG, "onRenegotiationNeeded ============>")
-
- }
-
- override fun onAddTrack(rtpReceiver: RtpReceiver?, p1: Array?) {
- Log.i(TAG, "onAddTrack ============>" + rtpReceiver?.track())
- Log.i(TAG, "onAddTrack ============>" + p1?.size)
-
- }
- }
-
- override fun onFirstFrameRendered() {
- Log.i(TAG, "onFirstFrameRendered ============>")
-
- }
-
- override fun onFrameResolutionChanged(frameWidth: Int, frameHeight: Int, rotation: Int) {
- Log.i(TAG, "onFrameResolutionChanged ============> $frameWidth:$frameHeight:$rotation")
- //set(frameWidth,frameHeight)
- }
-
-
-
-
-}
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/webrtc_player/android/app/src/main/res/drawable/ic_launcher_foreground.xml
similarity index 100%
rename from webrtc_player/android/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
rename to webrtc_player/android/app/src/main/res/drawable/ic_launcher_foreground.xml
diff --git a/webrtc_player/android/app/src/main/res/layout/activity_main.xml b/webrtc_player/android/app/src/main/res/layout/activity_main.xml
index 6cb0ffaa..afb6529b 100644
--- a/webrtc_player/android/app/src/main/res/layout/activity_main.xml
+++ b/webrtc_player/android/app/src/main/res/layout/activity_main.xml
@@ -8,6 +8,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="toPlayActivity"
+
android:text="播放" />
-
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/main/res/layout/activity_play.xml b/webrtc_player/android/app/src/main/res/layout/activity_play.xml
deleted file mode 100644
index c84e17e0..00000000
--- a/webrtc_player/android/app/src/main/res/layout/activity_play.xml
+++ /dev/null
@@ -1,93 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/main/res/layout/activity_player.xml b/webrtc_player/android/app/src/main/res/layout/activity_player.xml
index 6f9b47b4..eebedc84 100644
--- a/webrtc_player/android/app/src/main/res/layout/activity_player.xml
+++ b/webrtc_player/android/app/src/main/res/layout/activity_player.xml
@@ -5,16 +5,28 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
-
+
+
+ android:layout_below="@id/surface_view_render">
diff --git a/webrtc_player/android/app/src/main/res/layout/activity_pusher.xml b/webrtc_player/android/app/src/main/res/layout/activity_pusher.xml
index 81bbe808..484ee730 100644
--- a/webrtc_player/android/app/src/main/res/layout/activity_pusher.xml
+++ b/webrtc_player/android/app/src/main/res/layout/activity_pusher.xml
@@ -1,11 +1,11 @@
-
-
@@ -13,8 +13,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
- app:layout_constraintTop_toBottomOf="@id/surface_view_renderer"
- >
+ android:layout_below="@id/surface_view_render"
+ app:layout_constraintTop_toBottomOf="@id/surface_view_render">
+ android:layout_below="@id/surface_view_render">
@@ -82,5 +82,14 @@
android:textAllCaps="false"
android:onClick="onPushFile"/>
+
+
+
+
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/main/res/layout/layout_videoview.xml b/webrtc_player/android/app/src/main/res/layout/layout_videoview.xml
deleted file mode 100644
index 43c56e5e..00000000
--- a/webrtc_player/android/app/src/main/res/layout/layout_videoview.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/webrtc_player/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
index eca70cfe..6f3b755b 100644
--- a/webrtc_player/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
+++ b/webrtc_player/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -2,4 +2,5 @@
+
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/webrtc_player/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
index eca70cfe..6f3b755b 100644
--- a/webrtc_player/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
+++ b/webrtc_player/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -2,4 +2,5 @@
+
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/main/res/values-night/themes.xml b/webrtc_player/android/app/src/main/res/values-night/themes.xml
index 6a2a7eac..79caf632 100644
--- a/webrtc_player/android/app/src/main/res/values-night/themes.xml
+++ b/webrtc_player/android/app/src/main/res/values-night/themes.xml
@@ -1,16 +1,7 @@
-
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/main/res/values/colors.xml b/webrtc_player/android/app/src/main/res/values/colors.xml
index f8c6127d..c8524cd9 100644
--- a/webrtc_player/android/app/src/main/res/values/colors.xml
+++ b/webrtc_player/android/app/src/main/res/values/colors.xml
@@ -1,10 +1,5 @@
- #FFBB86FC
- #FF6200EE
- #FF3700B3
- #FF03DAC5
- #FF018786
#FF000000
#FFFFFFFF
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/main/res/values/strings.xml b/webrtc_player/android/app/src/main/res/values/strings.xml
index 7a3df89f..5fb2987c 100644
--- a/webrtc_player/android/app/src/main/res/values/strings.xml
+++ b/webrtc_player/android/app/src/main/res/values/strings.xml
@@ -1,3 +1,3 @@
- ZLMediakit WebRTC
+ RTCPlayer
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/main/res/values/themes.xml b/webrtc_player/android/app/src/main/res/values/themes.xml
index 119a9df9..df2c41fa 100644
--- a/webrtc_player/android/app/src/main/res/values/themes.xml
+++ b/webrtc_player/android/app/src/main/res/values/themes.xml
@@ -1,16 +1,9 @@
-
+
+
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/test/java/com/top/player/ExampleUnitTest.java b/webrtc_player/android/app/src/test/java/com/top/player/ExampleUnitTest.java
new file mode 100644
index 00000000..efe0b02d
--- /dev/null
+++ b/webrtc_player/android/app/src/test/java/com/top/player/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.top.player;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/webrtc_player/android/app/src/test/java/com/zlmediakit/webrtc/ExampleUnitTest.kt b/webrtc_player/android/app/src/test/java/com/zlmediakit/webrtc/ExampleUnitTest.kt
deleted file mode 100644
index 5f47259f..00000000
--- a/webrtc_player/android/app/src/test/java/com/zlmediakit/webrtc/ExampleUnitTest.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.zlmediakit.webrtc
-
-import org.junit.Test
-
-import org.junit.Assert.*
-
-/**
- * Example local unit test, which will execute on the development machine (host).
- *
- * See [testing documentation](http://d.android.com/tools/testing).
- */
-class ExampleUnitTest {
- @Test
- fun addition_isCorrect() {
- assertEquals(4, 2 + 2)
- }
-}
\ No newline at end of file
diff --git a/webrtc_player/android/build.gradle b/webrtc_player/android/build.gradle
deleted file mode 100644
index c9fd0fc4..00000000
--- a/webrtc_player/android/build.gradle
+++ /dev/null
@@ -1,19 +0,0 @@
-// Top-level build file where you can add configuration options common to all sub-projects/modules.
-buildscript {
- ext.kotlin_version = '1.7.10'
- repositories {
- mavenCentral()
- }
- dependencies {
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- }
-}
-plugins {
- id 'com.android.application' version '7.2.1' apply false
- id 'com.android.library' version '7.2.1' apply false
- id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
-}
-
-task clean(type: Delete) {
- delete rootProject.buildDir
-}
\ No newline at end of file
diff --git a/webrtc_player/android/build.gradle.kts b/webrtc_player/android/build.gradle.kts
new file mode 100644
index 00000000..2d2e5395
--- /dev/null
+++ b/webrtc_player/android/build.gradle.kts
@@ -0,0 +1,6 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+plugins {
+ id("com.android.application") version "8.2.2" apply false
+ id("com.android.library") version "8.2.2" apply false
+ id("org.jetbrains.kotlin.android") version "1.9.22" apply false
+}
\ No newline at end of file
diff --git a/webrtc_player/android/demo.sdp b/webrtc_player/android/demo.sdp
deleted file mode 100644
index 70d2488c..00000000
--- a/webrtc_player/android/demo.sdp
+++ /dev/null
@@ -1,142 +0,0 @@
-v=0
-o=- 6282534540641525368 2 IN IP4 127.0.0.1
-s=-
-t=0 0
-a=group:BUNDLE 0 1 2
-a=extmap-allow-mixed
-a=msid-semantic: WMS
-m=audio 9 UDP/TLS/RTP/SAVPF 111 63 9 102 0 8 13 110 126
-c=IN IP4 0.0.0.0
-a=rtcp:9 IN IP4 0.0.0.0
-a=ice-ufrag:H2Ms
-a=ice-pwd:14ODtTVh5+lT7W0+g9EAlE4j
-a=ice-options:trickle renomination
-a=fingerprint:sha-256 47:81:90:07:43:95:D7:F2:DA:60:DA:79:E5:88:26:65:29:4A:26:28:7A:B7:AB:D3:DB:CE:C9:09:39:EB:31:91
-a=setup:actpass
-a=mid:0
-a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
-a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
-a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
-a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
-a=sendrecv
-a=msid:- ef1bcbd2-7e69-40d3-9532-0f4a698022a7
-a=rtcp-mux
-a=rtpmap:111 opus/48000/2
-a=rtcp-fb:111 transport-cc
-a=fmtp:111 minptime=10;useinbandfec=1
-a=rtpmap:63 red/48000/2
-a=fmtp:63 111/111
-a=rtpmap:9 G722/8000
-a=rtpmap:102 ILBC/8000
-a=rtpmap:0 PCMU/8000
-a=rtpmap:8 PCMA/8000
-a=rtpmap:13 CN/8000
-a=rtpmap:110 telephone-event/48000
-a=rtpmap:126 telephone-event/8000
-a=ssrc:2860285610 cname:2EW1hNfQMKxwbRrt
-a=ssrc:2860285610 msid:- ef1bcbd2-7e69-40d3-9532-0f4a698022a7
-m=video 9 UDP/TLS/RTP/SAVPF 96 97 39 40 98 99 127 103 104 105 106 107 108
-c=IN IP4 0.0.0.0
-a=rtcp:9 IN IP4 0.0.0.0
-a=ice-ufrag:H2Ms
-a=ice-pwd:14ODtTVh5+lT7W0+g9EAlE4j
-a=ice-options:trickle renomination
-a=fingerprint:sha-256 47:81:90:07:43:95:D7:F2:DA:60:DA:79:E5:88:26:65:29:4A:26:28:7A:B7:AB:D3:DB:CE:C9:09:39:EB:31:91
-a=setup:actpass
-a=mid:1
-a=extmap:14 urn:ietf:params:rtp-hdrext:toffset
-a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
-a=extmap:13 urn:3gpp:video-orientation
-a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
-a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
-a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
-a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
-a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space
-a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
-a=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
-a=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
-a=sendonly
-a=msid:- 8b57ef63-835d-4acf-bce9-18e26cebf9b1
-a=rtcp-mux
-a=rtcp-rsize
-a=rtpmap:96 VP8/90000
-a=rtcp-fb:96 goog-remb
-a=rtcp-fb:96 transport-cc
-a=rtcp-fb:96 ccm fir
-a=rtcp-fb:96 nack
-a=rtcp-fb:96 nack pli
-a=rtpmap:97 rtx/90000
-a=fmtp:97 apt=96
-a=rtpmap:39 AV1/90000
-a=rtcp-fb:39 goog-remb
-a=rtcp-fb:39 transport-cc
-a=rtcp-fb:39 ccm fir
-a=rtcp-fb:39 nack
-a=rtcp-fb:39 nack pli
-a=rtpmap:40 rtx/90000
-a=fmtp:40 apt=39
-a=rtpmap:98 VP9/90000
-a=rtcp-fb:98 goog-remb
-a=rtcp-fb:98 transport-cc
-a=rtcp-fb:98 ccm fir
-a=rtcp-fb:98 nack
-a=rtcp-fb:98 nack pli
-a=fmtp:98 profile-id=0
-a=rtpmap:99 rtx/90000
-a=fmtp:99 apt=98
-a=rtpmap:127 H264/90000
-a=rtcp-fb:127 goog-remb
-a=rtcp-fb:127 transport-cc
-a=rtcp-fb:127 ccm fir
-a=rtcp-fb:127 nack
-a=rtcp-fb:127 nack pli
-a=fmtp:127 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
-a=rtpmap:103 rtx/90000
-a=fmtp:103 apt=127
-a=rtpmap:104 H265/90000
-a=rtcp-fb:104 goog-remb
-a=rtcp-fb:104 transport-cc
-a=rtcp-fb:104 ccm fir
-a=rtcp-fb:104 nack
-a=rtcp-fb:104 nack pli
-a=rtpmap:105 rtx/90000
-a=fmtp:105 apt=104
-a=rtpmap:106 red/90000
-a=rtpmap:107 rtx/90000
-a=fmtp:107 apt=106
-a=rtpmap:108 ulpfec/90000
-a=ssrc-group:FID 100166069 2038394461
-a=ssrc:100166069 cname:2EW1hNfQMKxwbRrt
-a=ssrc:100166069 msid:- 8b57ef63-835d-4acf-bce9-18e26cebf9b1
-a=ssrc:2038394461 cname:2EW1hNfQMKxwbRrt
-a=ssrc:2038394461 msid:- 8b57ef63-835d-4acf-bce9-18e26cebf9b1
-m=audio 9 UDP/TLS/RTP/SAVPF 111 63 9 102 0 8 13 110 126
-c=IN IP4 0.0.0.0
-a=rtcp:9 IN IP4 0.0.0.0
-a=ice-ufrag:H2Ms
-a=ice-pwd:14ODtTVh5+lT7W0+g9EAlE4j
-a=ice-options:trickle renomination
-a=fingerprint:sha-256 47:81:90:07:43:95:D7:F2:DA:60:DA:79:E5:88:26:65:29:4A:26:28:7A:B7:AB:D3:DB:CE:C9:09:39:EB:31:91
-a=setup:actpass
-a=mid:2
-a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
-a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
-a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
-a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
-a=sendonly
-a=msid:- 49d08cb1-a325-4a5f-805a-72a215eb67af
-a=rtcp-mux
-a=rtpmap:111 opus/48000/2
-a=rtcp-fb:111 transport-cc
-a=fmtp:111 minptime=10;useinbandfec=1
-a=rtpmap:63 red/48000/2
-a=fmtp:63 111/111
-a=rtpmap:9 G722/8000
-a=rtpmap:102 ILBC/8000
-a=rtpmap:0 PCMU/8000
-a=rtpmap:8 PCMA/8000
-a=rtpmap:13 CN/8000
-a=rtpmap:110 telephone-event/48000
-a=rtpmap:126 telephone-event/8000
-a=ssrc:2666757999 cname:2EW1hNfQMKxwbRrt
-a=ssrc:2666757999 msid:- 49d08cb1-a325-4a5f-805a-72a215eb67af
diff --git a/webrtc_player/android/doc/delay_play1.jpg b/webrtc_player/android/doc/delay_play1.jpg
new file mode 100644
index 00000000..812a3dfd
Binary files /dev/null and b/webrtc_player/android/doc/delay_play1.jpg differ
diff --git a/webrtc_player/android/doc/delay_play2.jpg b/webrtc_player/android/doc/delay_play2.jpg
new file mode 100644
index 00000000..c445a4f3
Binary files /dev/null and b/webrtc_player/android/doc/delay_play2.jpg differ
diff --git a/webrtc_player/android/doc/delay_play3.jpg b/webrtc_player/android/doc/delay_play3.jpg
new file mode 100644
index 00000000..49c58010
Binary files /dev/null and b/webrtc_player/android/doc/delay_play3.jpg differ
diff --git a/webrtc_player/android/zlm/libs/arm64-v8a/libcurl.a b/webrtc_player/android/doc/delay_push1.jpg
similarity index 52%
rename from webrtc_player/android/zlm/libs/arm64-v8a/libcurl.a
rename to webrtc_player/android/doc/delay_push1.jpg
index 8a3ea083..a73864c4 100644
Binary files a/webrtc_player/android/zlm/libs/arm64-v8a/libcurl.a and b/webrtc_player/android/doc/delay_push1.jpg differ
diff --git a/webrtc_player/android/zlm/libs/arm64-v8a/libjingle_peerconnection_so.so b/webrtc_player/android/doc/delay_push2.jpg
similarity index 54%
rename from webrtc_player/android/zlm/libs/arm64-v8a/libjingle_peerconnection_so.so
rename to webrtc_player/android/doc/delay_push2.jpg
index 942fe90f..4371e83a 100644
Binary files a/webrtc_player/android/zlm/libs/arm64-v8a/libjingle_peerconnection_so.so and b/webrtc_player/android/doc/delay_push2.jpg differ
diff --git a/webrtc_player/android/doc/delay_push3.jpg b/webrtc_player/android/doc/delay_push3.jpg
new file mode 100644
index 00000000..4b50ed48
Binary files /dev/null and b/webrtc_player/android/doc/delay_push3.jpg differ
diff --git a/webrtc_player/android/doc/home.jpg b/webrtc_player/android/doc/home.jpg
new file mode 100644
index 00000000..186a2482
Binary files /dev/null and b/webrtc_player/android/doc/home.jpg differ
diff --git a/webrtc_player/android/doc/player.jpg b/webrtc_player/android/doc/player.jpg
new file mode 100644
index 00000000..bc695e6e
Binary files /dev/null and b/webrtc_player/android/doc/player.jpg differ
diff --git a/webrtc_player/android/doc/pusher.jpg b/webrtc_player/android/doc/pusher.jpg
new file mode 100644
index 00000000..710f528e
Binary files /dev/null and b/webrtc_player/android/doc/pusher.jpg differ
diff --git a/webrtc_player/android/gradle.properties b/webrtc_player/android/gradle.properties
index cd0519bb..3e927b11 100644
--- a/webrtc_player/android/gradle.properties
+++ b/webrtc_player/android/gradle.properties
@@ -12,11 +12,9 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
-# Android operating system, and which are packaged with your app"s APK
+# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
-# Kotlin code style for this project: "official" or "obsolete":
-kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
diff --git a/webrtc_player/android/gradle/wrapper/gradle-wrapper.properties b/webrtc_player/android/gradle/wrapper/gradle-wrapper.properties
index 8a5b4f05..7325acda 100644
--- a/webrtc_player/android/gradle/wrapper/gradle-wrapper.properties
+++ b/webrtc_player/android/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Mon Sep 19 22:08:36 CST 2022
+#Fri May 31 15:05:44 CST 2024
distributionBase=GRADLE_USER_HOME
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionPath=wrapper/dists
-zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/webrtc_player/android/pic/Screenshot_2022-09-25-10-06-59-444_com.zlmediakit.webrtc.jpg b/webrtc_player/android/pic/Screenshot_2022-09-25-10-06-59-444_com.zlmediakit.webrtc.jpg
deleted file mode 100644
index 96719cf3..00000000
Binary files a/webrtc_player/android/pic/Screenshot_2022-09-25-10-06-59-444_com.zlmediakit.webrtc.jpg and /dev/null differ
diff --git a/webrtc_player/android/play.sdp b/webrtc_player/android/play.sdp
deleted file mode 100644
index 36265010..00000000
--- a/webrtc_player/android/play.sdp
+++ /dev/null
@@ -1,76 +0,0 @@
-v=0
-o=- 5986549880880292178 2 IN IP4 108.181.24.73
-s=-
-t=0 0
-a=group:BUNDLE 0 1
-a=msid-semantic: WMS ARDAMS
-a=ice-lite
-m=audio 8000 UDP/TLS/RTP/SAVPF 111
-c=IN IP4 108.181.24.73
-a=rtcp:8000 IN IP4 108.181.24.73
-a=ice-ufrag:bLUYSR9AH0A=_2105
-a=ice-pwd:wstnRIopRDwBZyv56AZlGuOm
-a=ice-options:trickle
-a=fingerprint:sha-256 F4:C9:0C:ED:05:93:C0:F9:AC:34:71:60:2D:3E:D0:47:91:CC:FD:38:C7:63:4A:93:C3:48:0C:B4:6F:32:76:FE
-a=setup:passive
-a=mid:0
-a=ice-lite
-a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
-a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
-a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
-a=inactive
-a=rtcp-mux
-a=rtpmap:111 opus/48000/2
-a=rtcp-fb:111 transport-cc
-a=fmtp:111 minptime=10;useinbandfec=1
-a=msid:zlmediakit-mslabel zlmediakit-label-0
-a=ssrc:2 cname:zlmediakit-rtp
-a=ssrc:2 msid:zlmediakit-mslabel zlmediakit-label-0
-a=ssrc:2 mslabel:zlmediakit-mslabel
-a=ssrc:2 label:zlmediakit-label-0
-a=candidate:udpcandidate 1 udp 110 108.181.24.73 8000 typ host
-a=candidate:tcpcandidate 1 tcp 105 108.181.24.73 8000 typ host tcptype passive
-
-
-m=video 8000 UDP/TLS/RTP/SAVPF 127 103
-c=IN IP4 108.181.24.73
-a=rtcp:8000 IN IP4 108.181.24.73
-a=ice-ufrag:bLUYSR9AH0A=_2105
-a=ice-pwd:wstnRIopRDwBZyv56AZlGuOm
-a=ice-options:trickle
-a=fingerprint:sha-256 F4:C9:0C:ED:05:93:C0:F9:AC:34:71:60:2D:3E:D0:47:91:CC:FD:38:C7:63:4A:93:C3:48:0C:B4:6F:32:76:FE
-a=setup:passive
-a=mid:1
-a=ice-lite
-a=extmap:14 urn:ietf:params:rtp-hdrext:toffset
-a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
-a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
-a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
-a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
-a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
-a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space
-a=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
-a=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
-a=sendonly
-a=rtcp-mux
-a=rtpmap:127 H264/90000
-a=rtcp-fb:127 ccm fir
-a=rtcp-fb:127 goog-remb
-a=rtcp-fb:127 nack
-a=rtcp-fb:127 nack pli
-a=rtcp-fb:127 transport-cc
-a=fmtp:127 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
-a=rtpmap:103 rtx/90000
-a=fmtp:103 apt=127
-a=msid:zlmediakit-mslabel zlmediakit-label-1
-a=ssrc:1 cname:zlmediakit-rtp
-a=ssrc:1 msid:zlmediakit-mslabel zlmediakit-label-1
-a=ssrc:1 mslabel:zlmediakit-mslabel
-a=ssrc:1 label:zlmediakit-label-1
-a=ssrc:3 cname:zlmediakit-rtp
-a=ssrc:3 msid:zlmediakit-mslabel zlmediakit-label-1
-a=ssrc:3 mslabel:zlmediakit-mslabel
-a=ssrc:3 label:zlmediakit-label-1
-a=ssrc-group:FID 1 3
-a=candidate:udpcandidate 1 udp 110 108.181.24.73 8000 typ host
-a=candidate:tcpcandidate 1 tcp 105 108.181.24.73 8000 typ host tcptype passive
diff --git a/webrtc_player/android/settings.gradle b/webrtc_player/android/settings.gradle
deleted file mode 100644
index 60b70506..00000000
--- a/webrtc_player/android/settings.gradle
+++ /dev/null
@@ -1,25 +0,0 @@
-pluginManagement {
- repositories {
- gradlePluginPortal()
- google()
- mavenCentral()
- jcenter() // Warning: this repository is going to shut down soon
-
- maven { url 'https://jitpack.io' }
-
- }
-}
-dependencyResolutionManagement {
- repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
- repositories {
- google()
- mavenCentral()
- jcenter() // Warning: this repository is going to shut down soon
-
- maven { url 'https://jitpack.io' }
-
- }
-}
-rootProject.name = "android"
-include ':app'
-include ':zlm'
diff --git a/webrtc_player/android/settings.gradle.kts b/webrtc_player/android/settings.gradle.kts
new file mode 100644
index 00000000..742455a4
--- /dev/null
+++ b/webrtc_player/android/settings.gradle.kts
@@ -0,0 +1,25 @@
+pluginManagement {
+ repositories {
+ mavenCentral()
+ gradlePluginPortal()
+ google()
+ }
+}
+dependencyResolutionManagement {
+ repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
+ repositories {
+ mavenCentral()
+ google()
+ maven {
+ credentials {
+ username = ("6256cd6c7e8dbc28d896a661")
+ password = ("KRuEgA3WYUVy")
+ }
+ url = uri("https://packages.aliyun.com/maven/repository/2302596-release-mpvXBR/")
+ }
+ }
+}
+
+rootProject.name = "RTCPlayer"
+include(":app")
+//include(":RTCPlayer")
diff --git a/webrtc_player/android/success.sdp b/webrtc_player/android/success.sdp
deleted file mode 100644
index 056b97fc..00000000
--- a/webrtc_player/android/success.sdp
+++ /dev/null
@@ -1,112 +0,0 @@
-v=0
-o=- 6005790964057401669 2 IN IP4 127.0.0.1
-s=-
-t=0 0
-a=group:BUNDLE 0 1
-a=extmap-allow-mixed
-a=msid-semantic: WMS ARDAMS
-m=video 9 UDP/TLS/RTP/SAVPF 96 97 39 40 98 99 127 103 104 105 106 107 108
-c=IN IP4 0.0.0.0
-a=rtcp:9 IN IP4 0.0.0.0
-a=ice-ufrag:UITA
-a=ice-pwd:obg6A6ZHKhr5CGzmmgRfTk/y
-a=ice-options:trickle renomination
-a=fingerprint:sha-256 5E:23:E2:B2:0F:ED:FC:A2:20:06:24:0F:6A:4B:99:33:91:39:A7:40:A5:20:88:77:D6:99:04:FB:C7:CD:7F:33
-a=setup:actpass
-a=mid:0
-a=extmap:1 urn:ietf:params:rtp-hdrext:toffset
-a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
-a=extmap:3 urn:3gpp:video-orientation
-a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
-a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
-a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
-a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
-a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space
-a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
-a=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
-a=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
-a=sendrecv
-a=msid:ARDAMS ARDAMSv0
-a=rtcp-mux
-a=rtcp-rsize
-a=rtpmap:96 VP8/90000
-a=rtcp-fb:96 goog-remb
-a=rtcp-fb:96 transport-cc
-a=rtcp-fb:96 ccm fir
-a=rtcp-fb:96 nack
-a=rtcp-fb:96 nack pli
-a=rtpmap:97 rtx/90000
-a=fmtp:97 apt=96
-a=rtpmap:39 AV1/90000
-a=rtcp-fb:39 goog-remb
-a=rtcp-fb:39 transport-cc
-a=rtcp-fb:39 ccm fir
-a=rtcp-fb:39 nack
-a=rtcp-fb:39 nack pli
-a=rtpmap:40 rtx/90000
-a=fmtp:40 apt=39
-a=rtpmap:98 VP9/90000
-a=rtcp-fb:98 goog-remb
-a=rtcp-fb:98 transport-cc
-a=rtcp-fb:98 ccm fir
-a=rtcp-fb:98 nack
-a=rtcp-fb:98 nack pli
-a=fmtp:98 profile-id=0
-a=rtpmap:99 rtx/90000
-a=fmtp:99 apt=98
-a=rtpmap:127 H264/90000
-a=rtcp-fb:127 goog-remb
-a=rtcp-fb:127 transport-cc
-a=rtcp-fb:127 ccm fir
-a=rtcp-fb:127 nack
-a=rtcp-fb:127 nack pli
-a=fmtp:127 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
-a=rtpmap:103 rtx/90000
-a=fmtp:103 apt=127
-a=rtpmap:104 H265/90000
-a=rtcp-fb:104 goog-remb
-a=rtcp-fb:104 transport-cc
-a=rtcp-fb:104 ccm fir
-a=rtcp-fb:104 nack
-a=rtcp-fb:104 nack pli
-a=rtpmap:105 rtx/90000
-a=fmtp:105 apt=104
-a=rtpmap:106 red/90000
-a=rtpmap:107 rtx/90000
-a=fmtp:107 apt=106
-a=rtpmap:108 ulpfec/90000
-a=ssrc-group:FID 1882091013 3163545249
-a=ssrc:1882091013 cname:L6diPFsW7sR8uU/a
-a=ssrc:1882091013 msid:ARDAMS ARDAMSv0
-a=ssrc:3163545249 cname:L6diPFsW7sR8uU/a
-a=ssrc:3163545249 msid:ARDAMS ARDAMSv0
-m=audio 9 UDP/TLS/RTP/SAVPF 111 63 9 102 0 8 13 110 126
-c=IN IP4 0.0.0.0
-a=rtcp:9 IN IP4 0.0.0.0
-a=ice-ufrag:UITA
-a=ice-pwd:obg6A6ZHKhr5CGzmmgRfTk/y
-a=ice-options:trickle renomination
-a=fingerprint:sha-256 5E:23:E2:B2:0F:ED:FC:A2:20:06:24:0F:6A:4B:99:33:91:39:A7:40:A5:20:88:77:D6:99:04:FB:C7:CD:7F:33
-a=setup:actpass
-a=mid:1
-a=extmap:14 urn:ietf:params:rtp-hdrext:ssrc-audio-level
-a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
-a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
-a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
-a=sendrecv
-a=msid:ARDAMS ARDAMSa0
-a=rtcp-mux
-a=rtpmap:111 opus/48000/2
-a=rtcp-fb:111 transport-cc
-a=fmtp:111 minptime=10;useinbandfec=1
-a=rtpmap:63 red/48000/2
-a=fmtp:63 111/111
-a=rtpmap:9 G722/8000
-a=rtpmap:102 ILBC/8000
-a=rtpmap:0 PCMU/8000
-a=rtpmap:8 PCMA/8000
-a=rtpmap:13 CN/8000
-a=rtpmap:110 telephone-event/48000
-a=rtpmap:126 telephone-event/8000
-a=ssrc:1776947399 cname:L6diPFsW7sR8uU/a
-a=ssrc:1776947399 msid:ARDAMS ARDAMSa0
\ No newline at end of file
diff --git a/webrtc_player/android/this.sdp b/webrtc_player/android/this.sdp
deleted file mode 100644
index 4b525e79..00000000
--- a/webrtc_player/android/this.sdp
+++ /dev/null
@@ -1,119 +0,0 @@
-v=0
-o=- 2629706501878304631 2 IN IP4 127.0.0.1
-s=-
-t=0 0
-a=group:BUNDLE 0 1
-a=extmap-allow-mixed
-a=msid-semantic: WMS ARDAMS
-m=video 9 UDP/TLS/RTP/SAVPF 96 97 39 40 98 99 127 103 104 105 106 107 108 43
-c=IN IP4 0.0.0.0
-a=rtcp:9 IN IP4 0.0.0.0
-a=ice-ufrag:+zOA
-a=ice-pwd:q88Il7adjqdu6SeSqAdsv8lv
-a=ice-options:trickle renomination
-a=fingerprint:sha-256 8D:0B:86:0B:8C:DF:22:99:85:DD:60:41:AA:FE:F1:98:FE:FB:29:32:5C:11:6E:47:54:82:21:6C:A0:4F:60:B2
-a=setup:actpass
-a=mid:0
-a=extmap:1 urn:ietf:params:rtp-hdrext:toffset
-a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
-a=extmap:3 urn:3gpp:video-orientation
-a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
-a=extmap:5 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
-a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
-a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
-a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/color-space
-a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
-a=extmap:10 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
-a=extmap:11 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
-a=sendrecv
-a=msid:ARDAMS ARDAMSv0
-a=rtcp-mux
-a=rtcp-rsize
-a=rtpmap:96 VP8/90000
-a=rtcp-fb:96 goog-remb
-a=rtcp-fb:96 transport-cc
-a=rtcp-fb:96 ccm fir
-a=rtcp-fb:96 nack
-a=rtcp-fb:96 nack pli
-a=rtpmap:97 rtx/90000
-a=fmtp:97 apt=96
-a=rtpmap:39 AV1/90000
-a=rtcp-fb:39 goog-remb
-a=rtcp-fb:39 transport-cc
-a=rtcp-fb:39 ccm fir
-a=rtcp-fb:39 nack
-a=rtcp-fb:39 nack pli
-a=rtpmap:40 rtx/90000
-a=fmtp:40 apt=39
-a=rtpmap:98 VP9/90000
-a=rtcp-fb:98 goog-remb
-a=rtcp-fb:98 transport-cc
-a=rtcp-fb:98 ccm fir
-a=rtcp-fb:98 nack
-a=rtcp-fb:98 nack pli
-a=fmtp:98 profile-id=0
-a=rtpmap:99 rtx/90000
-a=fmtp:99 apt=98
-a=rtpmap:127 H264/90000
-a=rtcp-fb:127 goog-remb
-a=rtcp-fb:127 transport-cc
-a=rtcp-fb:127 ccm fir
-a=rtcp-fb:127 nack
-a=rtcp-fb:127 nack pli
-a=fmtp:127 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
-a=rtpmap:103 rtx/90000
-a=fmtp:103 apt=127
-a=rtpmap:104 H265/90000
-a=rtcp-fb:104 goog-remb
-a=rtcp-fb:104 transport-cc
-a=rtcp-fb:104 ccm fir
-a=rtcp-fb:104 nack
-a=rtcp-fb:104 nack pli
-a=rtpmap:105 rtx/90000
-a=fmtp:105 apt=104
-a=rtpmap:106 red/90000
-a=rtpmap:107 rtx/90000
-a=fmtp:107 apt=106
-a=rtpmap:108 ulpfec/90000
-a=rtpmap:43 flexfec-03/90000
-a=rtcp-fb:43 goog-remb
-a=rtcp-fb:43 transport-cc
-a=fmtp:43 repair-window=10000000
-a=ssrc-group:FID 129065984 1082217256
-a=ssrc-group:FEC-FR 129065984 4071693473
-a=ssrc:129065984 cname:T1fpJkmBNuVUtXM8
-a=ssrc:129065984 msid:ARDAMS ARDAMSv0
-a=ssrc:1082217256 cname:T1fpJkmBNuVUtXM8
-a=ssrc:1082217256 msid:ARDAMS ARDAMSv0
-a=ssrc:4071693473 cname:T1fpJkmBNuVUtXM8
-a=ssrc:4071693473 msid:ARDAMS ARDAMSv0
-m=audio 9 UDP/TLS/RTP/SAVPF 111 63 9 102 0 8 13 110 126
-c=IN IP4 0.0.0.0
-a=rtcp:9 IN IP4 0.0.0.0
-a=ice-ufrag:+zOA
-a=ice-pwd:q88Il7adjqdu6SeSqAdsv8lv
-a=ice-options:trickle renomination
-a=fingerprint:sha-256 8D:0B:86:0B:8C:DF:22:99:85:DD:60:41:AA:FE:F1:98:FE:FB:29:32:5C:11:6E:47:54:82:21:6C:A0:4F:60:B2
-a=setup:actpass
-a=mid:1
-a=extmap:14 urn:ietf:params:rtp-hdrext:ssrc-audio-level
-a=extmap:2 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
-a=extmap:4 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
-a=extmap:9 urn:ietf:params:rtp-hdrext:sdes:mid
-a=sendrecv
-a=msid:ARDAMS ARDAMSa0
-a=rtcp-mux
-a=rtpmap:111 opus/48000/2
-a=rtcp-fb:111 transport-cc
-a=fmtp:111 minptime=10;useinbandfec=1
-a=rtpmap:63 red/48000/2
-a=fmtp:63 111/111
-a=rtpmap:9 G722/8000
-a=rtpmap:102 ILBC/8000
-a=rtpmap:0 PCMU/8000
-a=rtpmap:8 PCMA/8000
-a=rtpmap:13 CN/8000
-a=rtpmap:110 telephone-event/48000
-a=rtpmap:126 telephone-event/8000
-a=ssrc:2019904101 cname:T1fpJkmBNuVUtXM8
-a=ssrc:2019904101 msid:ARDAMS ARDAMSa0
\ No newline at end of file
diff --git a/webrtc_player/android/zlm/.gitignore b/webrtc_player/android/zlm/.gitignore
deleted file mode 100644
index 42afabfd..00000000
--- a/webrtc_player/android/zlm/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/build
\ No newline at end of file
diff --git a/webrtc_player/android/zlm/build.gradle b/webrtc_player/android/zlm/build.gradle
deleted file mode 100644
index 033cb6fc..00000000
--- a/webrtc_player/android/zlm/build.gradle
+++ /dev/null
@@ -1,61 +0,0 @@
-plugins {
- id 'com.android.library'
- id 'org.jetbrains.kotlin.android'
-}
-
-android {
- namespace 'com.zlm.rtc'
- compileSdk 34
-
- defaultConfig {
- minSdk 24
-
- testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
- consumerProguardFiles "consumer-rules.pro"
- externalNativeBuild {
- cmake {
- cppFlags ""
- }
- }
- }
-
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "src/main/cpp/CMakeLists.txt"
- version "3.22.1"
- }
- }
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
- kotlinOptions {
- jvmTarget = '1.8'
- }
- sourceSets {
- main{
- jniLibs.srcDirs = ['libs']
- }
- }
-}
-
-dependencies {
-
- implementation 'androidx.core:core-ktx:1.7.0'
- implementation 'androidx.appcompat:appcompat:1.5.1'
- implementation 'com.google.android.material:material:1.6.1'
- implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
- testImplementation 'junit:junit:4.13.2'
- androidTestImplementation 'androidx.test.ext:junit:1.1.3'
- androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
- implementation 'com.google.code.gson:gson:2.8.9'
-
- implementation("com.squareup.okhttp3:okhttp:4.10.0")
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
-}
\ No newline at end of file
diff --git a/webrtc_player/android/zlm/consumer-rules.pro b/webrtc_player/android/zlm/consumer-rules.pro
deleted file mode 100644
index e69de29b..00000000
diff --git a/webrtc_player/android/zlm/libs/arm64-v8a/libZLToolKit.a b/webrtc_player/android/zlm/libs/arm64-v8a/libZLToolKit.a
deleted file mode 100644
index 2410a77c..00000000
--- a/webrtc_player/android/zlm/libs/arm64-v8a/libZLToolKit.a
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:bc218b4b68589b49cb72278af6759deea0146c47079eea708bba5669545e9005
-size 183748898
diff --git a/webrtc_player/android/zlm/libs/arm64-v8a/libcrypto.a b/webrtc_player/android/zlm/libs/arm64-v8a/libcrypto.a
deleted file mode 100644
index 2d478107..00000000
Binary files a/webrtc_player/android/zlm/libs/arm64-v8a/libcrypto.a and /dev/null differ
diff --git a/webrtc_player/android/zlm/libs/arm64-v8a/libcrypto.so b/webrtc_player/android/zlm/libs/arm64-v8a/libcrypto.so
deleted file mode 100644
index 060457de..00000000
Binary files a/webrtc_player/android/zlm/libs/arm64-v8a/libcrypto.so and /dev/null differ
diff --git a/webrtc_player/android/zlm/libs/arm64-v8a/libcurl.so b/webrtc_player/android/zlm/libs/arm64-v8a/libcurl.so
deleted file mode 100644
index a57f1916..00000000
Binary files a/webrtc_player/android/zlm/libs/arm64-v8a/libcurl.so and /dev/null differ
diff --git a/webrtc_player/android/zlm/libs/arm64-v8a/libssl.a b/webrtc_player/android/zlm/libs/arm64-v8a/libssl.a
deleted file mode 100644
index 98ec2d04..00000000
Binary files a/webrtc_player/android/zlm/libs/arm64-v8a/libssl.a and /dev/null differ
diff --git a/webrtc_player/android/zlm/libs/arm64-v8a/libssl.so b/webrtc_player/android/zlm/libs/arm64-v8a/libssl.so
deleted file mode 100644
index 210c7814..00000000
Binary files a/webrtc_player/android/zlm/libs/arm64-v8a/libssl.so and /dev/null differ
diff --git a/webrtc_player/android/zlm/libs/arm64-v8a/libz.a b/webrtc_player/android/zlm/libs/arm64-v8a/libz.a
deleted file mode 100644
index 654aa523..00000000
Binary files a/webrtc_player/android/zlm/libs/arm64-v8a/libz.a and /dev/null differ
diff --git a/webrtc_player/android/zlm/libs/armeabi-v7a/libZLToolKit.a b/webrtc_player/android/zlm/libs/armeabi-v7a/libZLToolKit.a
deleted file mode 100644
index e69de29b..00000000
diff --git a/webrtc_player/android/zlm/libs/armeabi-v7a/libcrypto.a b/webrtc_player/android/zlm/libs/armeabi-v7a/libcrypto.a
deleted file mode 100644
index e69de29b..00000000
diff --git a/webrtc_player/android/zlm/libs/armeabi-v7a/libcrypto.so b/webrtc_player/android/zlm/libs/armeabi-v7a/libcrypto.so
deleted file mode 100644
index e69de29b..00000000
diff --git a/webrtc_player/android/zlm/libs/armeabi-v7a/libcurl.a b/webrtc_player/android/zlm/libs/armeabi-v7a/libcurl.a
deleted file mode 100644
index e69de29b..00000000
diff --git a/webrtc_player/android/zlm/libs/armeabi-v7a/libcurl.so b/webrtc_player/android/zlm/libs/armeabi-v7a/libcurl.so
deleted file mode 100644
index e69de29b..00000000
diff --git a/webrtc_player/android/zlm/libs/armeabi-v7a/libjingle_peerconnection_so.so b/webrtc_player/android/zlm/libs/armeabi-v7a/libjingle_peerconnection_so.so
deleted file mode 100644
index 51ca139f..00000000
Binary files a/webrtc_player/android/zlm/libs/armeabi-v7a/libjingle_peerconnection_so.so and /dev/null differ
diff --git a/webrtc_player/android/zlm/libs/armeabi-v7a/libssl.a b/webrtc_player/android/zlm/libs/armeabi-v7a/libssl.a
deleted file mode 100644
index e69de29b..00000000
diff --git a/webrtc_player/android/zlm/libs/armeabi-v7a/libssl.so b/webrtc_player/android/zlm/libs/armeabi-v7a/libssl.so
deleted file mode 100644
index e69de29b..00000000
diff --git a/webrtc_player/android/zlm/libs/armeabi-v7a/libz.a b/webrtc_player/android/zlm/libs/armeabi-v7a/libz.a
deleted file mode 100644
index e69de29b..00000000
diff --git a/webrtc_player/android/zlm/proguard-rules.pro b/webrtc_player/android/zlm/proguard-rules.pro
deleted file mode 100644
index 481bb434..00000000
--- a/webrtc_player/android/zlm/proguard-rules.pro
+++ /dev/null
@@ -1,21 +0,0 @@
-# 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
\ No newline at end of file
diff --git a/webrtc_player/android/zlm/src/androidTest/java/com/zlm/rtc/ExampleInstrumentedTest.kt b/webrtc_player/android/zlm/src/androidTest/java/com/zlm/rtc/ExampleInstrumentedTest.kt
deleted file mode 100644
index bb55c2f0..00000000
--- a/webrtc_player/android/zlm/src/androidTest/java/com/zlm/rtc/ExampleInstrumentedTest.kt
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.zlm.rtc
-
-import androidx.test.platform.app.InstrumentationRegistry
-import androidx.test.ext.junit.runners.AndroidJUnit4
-
-import org.junit.Test
-import org.junit.runner.RunWith
-
-import org.junit.Assert.*
-
-/**
- * Instrumented test, which will execute on an Android device.
- *
- * See [testing documentation](http://d.android.com/tools/testing).
- */
-@RunWith(AndroidJUnit4::class)
-class ExampleInstrumentedTest {
- @Test
- fun useAppContext() {
- // Context of the app under test.
- val appContext = InstrumentationRegistry.getInstrumentation().targetContext
- assertEquals("com.zlm.rtc.test", appContext.packageName)
- }
-}
\ No newline at end of file
diff --git a/webrtc_player/android/zlm/src/main/AndroidManifest.xml b/webrtc_player/android/zlm/src/main/AndroidManifest.xml
deleted file mode 100644
index b623f424..00000000
--- a/webrtc_player/android/zlm/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/webrtc_player/android/zlm/src/main/cpp/CMakeLists.txt b/webrtc_player/android/zlm/src/main/cpp/CMakeLists.txt
deleted file mode 100644
index 76b6ee11..00000000
--- a/webrtc_player/android/zlm/src/main/cpp/CMakeLists.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-# For more information about using CMake with Android Studio, read the
-# documentation: https://d.android.com/studio/projects/add-native-code.html.
-# For more examples on how to use CMake, see https://github.com/android/ndk-samples.
-
-# Sets the minimum CMake version required for this project.
-cmake_minimum_required(VERSION 3.22.1)
-
-# Declares the project name. The project name can be accessed via ${ PROJECT_NAME},
-# Since this is the top level CMakeLists.txt, the project name is also accessible
-# with ${CMAKE_PROJECT_NAME} (both CMake variables are in-sync within the top level
-# build script scope).
-project("rtc")
-
-
-
-add_library(ZLToolKit IMPORTED STATIC)
-set_target_properties(ZLToolKit PROPERTIES
- IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/${CMAKE_ANDROID_ARCH_ABI}/libZLToolKit.a"
- INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/include"
- )
-
-# 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.
-#
-# In this top level CMakeLists.txt, ${CMAKE_PROJECT_NAME} is used to define
-# the target library name; in the sub-module's CMakeLists.txt, ${PROJECT_NAME}
-# is preferred for the same purpose.
-#
-# In order to load a library into your app from Java/Kotlin, you must call
-# System.loadLibrary() and pass the name of the library defined here;
-# for GameActivity/NativeActivity derived applications, the same library name must be
-# used in the AndroidManifest.xml file.
-add_library(${CMAKE_PROJECT_NAME} SHARED
- # List C/C++ source files with relative paths to this CMakeLists.txt.
- rtc.cpp)
-
-# Specifies libraries CMake should link to your target library. You
-# can link libraries from various origins, such as libraries defined in this
-# build script, prebuilt third-party libraries, or Android system libraries.
-target_link_libraries(${CMAKE_PROJECT_NAME}
- # List libraries link to the target library
- android
- log
- ZLToolKit)
\ No newline at end of file
diff --git a/webrtc_player/android/zlm/src/main/cpp/include/Codec/AACEncoder.h b/webrtc_player/android/zlm/src/main/cpp/include/Codec/AACEncoder.h
deleted file mode 100644
index 657a43b9..00000000
--- a/webrtc_player/android/zlm/src/main/cpp/include/Codec/AACEncoder.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2016-present The ZLMediaKit project authors. All Rights Reserved.
- *
- * This file is part of ZLMediaKit(https://github.com/ZLMediaKit/ZLMediaKit).
- *
- * Use of this source code is governed by MIT-like license that can be found in the
- * LICENSE file in the root of the source tree. All contributing project authors
- * may be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef CODEC_AACENCODER_H_
-#define CODEC_AACENCODER_H_
-
-namespace mediakit {
-
-class AACEncoder {
-public:
- AACEncoder(void);
- virtual ~AACEncoder(void);
- bool init(int iSampleRate, int iAudioChannel, int iAudioSampleBit);
- int inputData(char *pcData, int iLen, unsigned char **ppucOutBuffer);
-
-private:
- unsigned char *_pucPcmBuf = nullptr;
- unsigned int _uiPcmLen = 0;
-
- unsigned char *_pucAacBuf = nullptr;
- void *_hEncoder = nullptr;
-
- unsigned long _ulInputSamples = 0;
- unsigned long _ulMaxInputBytes = 0;
- unsigned long _ulMaxOutputBytes = 0;
-
-};
-
-} /* namespace mediakit */
-
-#endif /* CODEC_AACENCODER_H_ */
diff --git a/webrtc_player/android/zlm/src/main/cpp/include/Codec/H264Encoder.h b/webrtc_player/android/zlm/src/main/cpp/include/Codec/H264Encoder.h
deleted file mode 100644
index 46c86150..00000000
--- a/webrtc_player/android/zlm/src/main/cpp/include/Codec/H264Encoder.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2016-present The ZLMediaKit project authors. All Rights Reserved.
- *
- * This file is part of ZLMediaKit(https://github.com/ZLMediaKit/ZLMediaKit).
- *
- * Use of this source code is governed by MIT-like license that can be found in the
- * LICENSE file in the root of the source tree. All contributing project authors
- * may be found in the AUTHORS file in the root of the source tree.
- */
-#ifndef CODEC_H264ENCODER_H_
-#define CODEC_H264ENCODER_H_
-
-#include
-#ifdef __cplusplus
-extern "C" {
-#endif //__cplusplus
-#include
-#ifdef __cplusplus
-}
-#endif //__cplusplus
-
-namespace mediakit {
-
-class H264Encoder {
-public:
- typedef struct {
- int iType;
- int iLength;
- uint8_t *pucData;
- } H264Frame;
-
- H264Encoder();
- ~H264Encoder();
-
- bool init(int iWidth, int iHeight, int iFps, int iBitRate);
- int inputData(char *yuv[3], int linesize[3], int64_t cts, H264Frame **out_frame);
-
-private:
- x264_t *_pX264Handle = nullptr;
- x264_picture_t *_pPicIn = nullptr;
- x264_picture_t *_pPicOut = nullptr;
- H264Frame _aFrames[10];
-};
-
-} /* namespace mediakit */
-
-#endif /* CODEC_H264ENCODER_H_ */
diff --git a/webrtc_player/android/zlm/src/main/cpp/include/Codec/Transcode.h b/webrtc_player/android/zlm/src/main/cpp/include/Codec/Transcode.h
deleted file mode 100644
index 4cfaee62..00000000
--- a/webrtc_player/android/zlm/src/main/cpp/include/Codec/Transcode.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 2016-present The ZLMediaKit project authors. All Rights Reserved.
- *
- * This file is part of ZLMediaKit(https://github.com/ZLMediaKit/ZLMediaKit).
- *
- * Use of this source code is governed by MIT-like license that can be found in the
- * LICENSE file in the root of the source tree. All contributing project authors
- * may be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef ZLMEDIAKIT_TRANSCODE_H
-#define ZLMEDIAKIT_TRANSCODE_H
-
-#if defined(ENABLE_FFMPEG)
-
-#include "Util/TimeTicker.h"
-#include "Common/MediaSink.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-#include "libswscale/swscale.h"
-#include "libavutil/avutil.h"
-#include "libavutil/pixdesc.h"
-#include "libavcodec/avcodec.h"
-#include "libswresample/swresample.h"
-#include "libavutil/audio_fifo.h"
-#include "libavutil/imgutils.h"
-#ifdef __cplusplus
-}
-#endif
-
-namespace mediakit {
-
-class FFmpegFrame {
-public:
- using Ptr = std::shared_ptr;
-
- FFmpegFrame(std::shared_ptr frame = nullptr);
- ~FFmpegFrame();
-
- AVFrame *get() const;
- void fillPicture(AVPixelFormat target_format, int target_width, int target_height);
-
-private:
- char *_data = nullptr;
- std::shared_ptr _frame;
-};
-
-class FFmpegSwr {
-public:
- using Ptr = std::shared_ptr;
-
- FFmpegSwr(AVSampleFormat output, int channel, int channel_layout, int samplerate);
- ~FFmpegSwr();
- FFmpegFrame::Ptr inputFrame(const FFmpegFrame::Ptr &frame);
-
-private:
- int _target_channels;
- int _target_channel_layout;
- int _target_samplerate;
- AVSampleFormat _target_format;
- SwrContext *_ctx = nullptr;
-};
-
-class TaskManager {
-public:
- virtual ~TaskManager();
-
- void setMaxTaskSize(size_t size);
- void stopThread(bool drop_task);
-
-protected:
- void startThread(const std::string &name);
- bool addEncodeTask(std::function task);
- bool addDecodeTask(bool key_frame, std::function task);
- bool isEnabled() const;
-
-private:
- void onThreadRun(const std::string &name);
-
-private:
- class ThreadExitException : public std::runtime_error {
- public:
- ThreadExitException() : std::runtime_error("exit") {}
- };
-
-private:
- bool _decode_drop_start = false;
- bool _exit = false;
- size_t _max_task = 30;
- std::mutex _task_mtx;
- toolkit::semaphore _sem;
- toolkit::List > _task;
- std::shared_ptr _thread;
-};
-
-class FFmpegDecoder : public TaskManager {
-public:
- using Ptr = std::shared_ptr;
- using onDec = std::function;
-
- FFmpegDecoder(const Track::Ptr &track, int thread_num = 2, const std::vector &codec_name = {});
- ~FFmpegDecoder() override;
-
- bool inputFrame(const Frame::Ptr &frame, bool live, bool async, bool enable_merge = true);
- void setOnDecode(onDec cb);
- void flush();
- const AVCodecContext *getContext() const;
-
-private:
- void onDecode(const FFmpegFrame::Ptr &frame);
- bool inputFrame_l(const Frame::Ptr &frame, bool live, bool enable_merge);
- bool decodeFrame(const char *data, size_t size, uint64_t dts, uint64_t pts, bool live, bool key_frame);
-
-private:
- bool _do_merger = false;
- toolkit::Ticker _ticker;
- onDec _cb;
- std::shared_ptr _context;
- FrameMerger _merger{FrameMerger::h264_prefix};
-};
-
-class FFmpegSws {
-public:
- using Ptr = std::shared_ptr;
-
- FFmpegSws(AVPixelFormat output, int width, int height);
- ~FFmpegSws();
- FFmpegFrame::Ptr inputFrame(const FFmpegFrame::Ptr &frame);
- int inputFrame(const FFmpegFrame::Ptr &frame, uint8_t *data);
-
-private:
- FFmpegFrame::Ptr inputFrame(const FFmpegFrame::Ptr &frame, int &ret, uint8_t *data);
-
-private:
- int _target_width = 0;
- int _target_height = 0;
- int _src_width = 0;
- int _src_height = 0;
- SwsContext *_ctx = nullptr;
- AVPixelFormat _src_format = AV_PIX_FMT_NONE;
- AVPixelFormat _target_format = AV_PIX_FMT_NONE;
-};
-
-}//namespace mediakit
-#endif// ENABLE_FFMPEG
-#endif //ZLMEDIAKIT_TRANSCODE_H
diff --git a/webrtc_player/android/zlm/src/main/cpp/include/Common/Device.h b/webrtc_player/android/zlm/src/main/cpp/include/Common/Device.h
deleted file mode 100644
index 6af52626..00000000
--- a/webrtc_player/android/zlm/src/main/cpp/include/Common/Device.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Copyright (c) 2016-present The ZLMediaKit project authors. All Rights Reserved.
- *
- * This file is part of ZLMediaKit(https://github.com/ZLMediaKit/ZLMediaKit).
- *
- * Use of this source code is governed by MIT-like license that can be found in the
- * LICENSE file in the root of the source tree. All contributing project authors
- * may be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef DEVICE_DEVICE_H_
-#define DEVICE_DEVICE_H_
-
-#include
-#include
-#include
-#include "Util/TimeTicker.h"
-#include "Common/MultiMediaSourceMuxer.h"
-
-namespace mediakit {
-
-class H264Encoder;
-class AACEncoder;
-
-class VideoInfo {
-public:
- CodecId codecId = CodecH264;
- int iWidth;
- int iHeight;
- float iFrameRate;
- int iBitRate = 2 * 1024 * 1024;
-};
-
-class AudioInfo {
-public:
- CodecId codecId = CodecAAC;
- int iChannel;
- int iSampleBit;
- int iSampleRate;
-};
-
-/**
- * MultiMediaSourceMuxer类的包装,方便初学者使用
- */
-class DevChannel : public MultiMediaSourceMuxer{
-public:
- using Ptr = std::shared_ptr;
-
- //fDuration<=0为直播,否则为点播
- DevChannel(const MediaTuple& tuple, float duration = 0, const ProtocolOption &option = ProtocolOption())
- : MultiMediaSourceMuxer(tuple, duration, option) {}
-
- /**
- * 初始化视频Track
- * 相当于MultiMediaSourceMuxer::addTrack(VideoTrack::Ptr );
- * @param info 视频相关信息
- */
- bool initVideo(const VideoInfo &info);
-
- /**
- * 初始化音频Track
- * 相当于MultiMediaSourceMuxer::addTrack(AudioTrack::Ptr );
- * @param info 音频相关信息
- */
- bool initAudio(const AudioInfo &info);
-
- /**
- * 输入264帧
- * @param data 264单帧数据指针
- * @param len 数据指针长度
- * @param dts 解码时间戳,单位毫秒;等于0时内部会自动生成时间戳
- * @param pts 播放时间戳,单位毫秒;等于0时内部会赋值为dts
- */
- bool inputH264(const char *data, int len, uint64_t dts, uint64_t pts = 0);
-
- /**
- * 输入265帧
- * @param data 265单帧数据指针
- * @param len 数据指针长度
- * @param dts 解码时间戳,单位毫秒;等于0时内部会自动生成时间戳
- * @param pts 播放时间戳,单位毫秒;等于0时内部会赋值为dts
- */
- bool inputH265(const char *data, int len, uint64_t dts, uint64_t pts = 0);
-
- /**
- * 输入aac帧
- * @param data_without_adts 不带adts头的aac帧
- * @param len 帧数据长度
- * @param dts 时间戳,单位毫秒
- * @param adts_header adts头
- */
- bool inputAAC(const char *data_without_adts, int len, uint64_t dts, const char *adts_header);
-
- /**
- * 输入OPUS/G711音频帧
- * @param data 音频帧
- * @param len 帧数据长度
- * @param dts 时间戳,单位毫秒
- */
- bool inputAudio(const char *data, int len, uint64_t dts);
-
- /**
- * 输入yuv420p视频帧,内部会完成编码并调用inputH264方法
- * @param yuv yuv420p数据指针
- * @param linesize yuv420p数据linesize
- * @param cts 采集时间戳,单位毫秒
- */
- bool inputYUV(char *yuv[3], int linesize[3], uint64_t cts);
-
- /**
- * 输入pcm数据,内部会完成编码并调用inputAAC方法
- * @param data pcm数据指针,int16整形
- * @param len pcm数据长度
- * @param cts 采集时间戳,单位毫秒
- */
- bool inputPCM(char *data, int len, uint64_t cts);
-
- //// 重载基类方法,确保线程安全 ////
- bool inputFrame(const Frame::Ptr &frame) override;
- bool addTrack(const Track::Ptr & track) override;
- void addTrackCompleted() override;
-
-private:
- MediaOriginType getOriginType(MediaSource &sender) const override;
-
-private:
- std::shared_ptr _pH264Enc;
- std::shared_ptr _pAacEnc;
- std::shared_ptr _video;
- std::shared_ptr _audio;
- toolkit::SmoothTicker _aTicker[2];
-};
-
-} /* namespace mediakit */
-
-#endif /* DEVICE_DEVICE_H_ */
diff --git a/webrtc_player/android/zlm/src/main/cpp/include/Common/JemallocUtil.h b/webrtc_player/android/zlm/src/main/cpp/include/Common/JemallocUtil.h
deleted file mode 100644
index b1c1472a..00000000
--- a/webrtc_player/android/zlm/src/main/cpp/include/Common/JemallocUtil.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2016-present The ZLMediaKit project authors. All Rights Reserved.
-*
-* This file is part of ZLMediaKit(https://github.com/ZLMediaKit/ZLMediaKit).
-*
-* Use of this source code is governed by MIT-like license that can be found in the
-* LICENSE file in the root of the source tree. All contributing project authors
-* may be found in the AUTHORS file in the root of the source tree.
-*/
-
-#ifndef ZLMEDIAKIT_JEMALLOCUTIL_H
-#define ZLMEDIAKIT_JEMALLOCUTIL_H
-#include
-#include
-#include
-namespace mediakit {
-class JemallocUtil {
-public:
- static void enable_profiling();
-
- static void disable_profiling();
-
- static void dump(const std::string &file_name);
- static std::string get_malloc_stats();
- static void some_malloc_stats(const std::function &fn);
-};
-} // namespace mediakit
-#endif // ZLMEDIAKIT_JEMALLOCUTIL_H
diff --git a/webrtc_player/android/zlm/src/main/cpp/include/Common/MediaSink.h b/webrtc_player/android/zlm/src/main/cpp/include/Common/MediaSink.h
deleted file mode 100644
index 683878e3..00000000
--- a/webrtc_player/android/zlm/src/main/cpp/include/Common/MediaSink.h
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * Copyright (c) 2016-present The ZLMediaKit project authors. All Rights Reserved.
- *
- * This file is part of ZLMediaKit(https://github.com/ZLMediaKit/ZLMediaKit).
- *
- * Use of this source code is governed by MIT-like license that can be found in the
- * LICENSE file in the root of the source tree. All contributing project authors
- * may be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef ZLMEDIAKIT_MEDIASINK_H
-#define ZLMEDIAKIT_MEDIASINK_H
-
-#include
-#include
-#include "Util/TimeTicker.h"
-#include "Extension/Frame.h"
-#include "Extension/Track.h"
-
-namespace mediakit{
-
-class TrackListener {
-public:
- virtual ~TrackListener() = default;
-
- /**
- * 添加track,内部会调用Track的clone方法
- * 只会克隆sps pps这些信息 ,而不会克隆Delegate相关关系
- * @param track
- */
- virtual bool addTrack(const Track::Ptr & track) = 0;
-
- /**
- * 添加track完毕
- */
- virtual void addTrackCompleted() {};
-
- /**
- * 重置track
- */
- virtual void resetTracks() {};
-};
-
-class MediaSinkInterface : public FrameWriterInterface, public TrackListener {
-public:
- using Ptr = std::shared_ptr;
-};
-
-/**
- * aac静音音频添加器
- */
-class MuteAudioMaker : public FrameDispatcher {
-public:
- using Ptr = std::shared_ptr;
- bool inputFrame(const Frame::Ptr &frame) override;
-
-private:
- int _track_index = -1;
- uint64_t _audio_idx = 0;
-};
-
-/**
- * 该类的作用是等待Track ready()返回true也就是就绪后再通知派生类进行下一步的操作
- * 目的是输入Frame前由Track截取处理下,以便获取有效的信息(譬如sps pps aa_cfg)
- */
-class MediaSink : public MediaSinkInterface, public TrackSource{
-public:
- using Ptr = std::shared_ptr;
- /**
- * 输入frame
- * @param frame
- */
- bool inputFrame(const Frame::Ptr &frame) override;
-
- /**
- * 添加track,内部会调用Track的clone方法
- * 只会克隆sps pps这些信息 ,而不会克隆Delegate相关关系
- * @param track
- */
- bool addTrack(const Track::Ptr & track) override;
-
- /**
- * 添加Track完毕,如果是单Track,会最多等待3秒才会触发onAllTrackReady
- * 这样会增加生成流的延时,如果添加了音视频双Track,那么可以不调用此方法
- * 否则为了降低流注册延时,请手动调用此方法
- */
- void addTrackCompleted() override;
-
- /**
- * 设置最大track数,取值范围>=1;该方法与addTrackCompleted类型;
- * 在设置单track时,可以加快媒体注册速度
- */
- void setMaxTrackCount(size_t i);
-
- /**
- * 重置track
- */
- void resetTracks() override;
-
- /**
- * 获取所有Track
- * @param trackReady 是否获取已经准备好的Track
- */
- std::vector getTracks(bool trackReady = true) const override;
-
- /**
- * 判断是否已经触发onAllTrackReady事件
- */
- bool isAllTrackReady() const;
-
- /**
- * 设置是否开启音频
- */
- void enableAudio(bool flag);
-
- /**
- * 设置单音频
- */
- void setOnlyAudio();
-
- /**
- * 设置是否开启添加静音音频
- */
- void enableMuteAudio(bool flag);
-
- /**
- * 是否有视频track
- */
- bool haveVideo() const;
-
-protected:
- /**
- * 某track已经准备好,其ready()状态返回true,
- * 此时代表可以获取其例如sps pps等相关信息了
- * @param track
- */
- virtual bool onTrackReady(const Track::Ptr & track) { return false; };
-
- /**
- * 所有Track已经准备好,
- */
- virtual void onAllTrackReady() {};
-
- /**
- * 某Track输出frame,在onAllTrackReady触发后才会调用此方法
- * @param frame
- */
- virtual bool onTrackFrame(const Frame::Ptr &frame) { return false; };
-
-private:
- /**
- * 触发onAllTrackReady事件
- */
- void emitAllTrackReady();
-
- /**
- * 检查track是否准备完毕
- */
- void checkTrackIfReady();
- void onAllTrackReady_l();
- /**
- * 添加aac静音轨道
- */
- bool addMuteAudioTrack();
-
-private:
- bool _audio_add = false;
- bool _have_video = false;
- bool _enable_audio = true;
- bool _only_audio = false;
- bool _add_mute_audio = true;
- bool _all_track_ready = false;
- size_t _max_track_size = 2;
-
- toolkit::Ticker _ticker;
- MuteAudioMaker::Ptr _mute_audio_maker;
-
- std::unordered_map > _frame_unread;
- std::unordered_map > _track_ready_callback;
- std::unordered_map > _track_map;
-};
-
-
-class MediaSinkDelegate : public MediaSink {
-public:
- /**
- * 设置track监听器
- */
- void setTrackListener(TrackListener *listener);
-
-protected:
- void resetTracks() override;
- bool onTrackReady(const Track::Ptr & track) override;
- void onAllTrackReady() override;
-
-private:
- TrackListener *_listener = nullptr;
-};
-
-class Demuxer : protected TrackListener, public TrackSource {
-public:
- void setTrackListener(TrackListener *listener, bool wait_track_ready = false);
- std::vector getTracks(bool trackReady = true) const override;
-
-protected:
- bool addTrack(const Track::Ptr &track) override;
- void addTrackCompleted() override;
- void resetTracks() override;
-
-private:
- MediaSink::Ptr _sink;
- TrackListener *_listener = nullptr;
- std::vector _origin_track;
-};
-
-}//namespace mediakit
-
-#endif //ZLMEDIAKIT_MEDIASINK_H
diff --git a/webrtc_player/android/zlm/src/main/cpp/include/Common/MediaSource.h b/webrtc_player/android/zlm/src/main/cpp/include/Common/MediaSource.h
deleted file mode 100644
index 49f16dd4..00000000
--- a/webrtc_player/android/zlm/src/main/cpp/include/Common/MediaSource.h
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * Copyright (c) 2016-present The ZLMediaKit project authors. All Rights Reserved.
- *
- * This file is part of ZLMediaKit(https://github.com/ZLMediaKit/ZLMediaKit).
- *
- * Use of this source code is governed by MIT-like license that can be found in the
- * LICENSE file in the root of the source tree. All contributing project authors
- * may be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef ZLMEDIAKIT_MEDIASOURCE_H
-#define ZLMEDIAKIT_MEDIASOURCE_H
-
-#include
-#include
-#include
-#include
-#include "Network/Socket.h"
-#include "Extension/Track.h"
-#include "Record/Recorder.h"
-
-namespace toolkit {
-class Session;
-} // namespace toolkit
-
-namespace mediakit {
-
-enum class MediaOriginType : uint8_t {
- unknown = 0,
- rtmp_push ,
- rtsp_push,
- rtp_push,
- pull,
- ffmpeg_pull,
- mp4_vod,
- device_chn,
- rtc_push,
- srt_push
-};
-
-std::string getOriginTypeString(MediaOriginType type);
-
-class MediaSource;
-class MultiMediaSourceMuxer;
-class MediaSourceEvent {
-public:
- friend class MediaSource;
-
- class NotImplemented : public std::runtime_error {
- public:
- template
- NotImplemented(T && ...args) : std::runtime_error(std::forward(args)...) {}
- };
-
- virtual ~MediaSourceEvent() = default;
-
- // 获取媒体源类型
- virtual MediaOriginType getOriginType(MediaSource &sender) const { return MediaOriginType::unknown; }
- // 获取媒体源url或者文件路径
- virtual std::string getOriginUrl(MediaSource &sender) const;
- // 获取媒体源客户端相关信息
- virtual std::shared_ptr getOriginSock(MediaSource &sender) const { return nullptr; }
-
- // 通知拖动进度条
- virtual bool seekTo(MediaSource &sender, uint32_t stamp) { return false; }
- // 通知暂停或恢复
- virtual bool pause(MediaSource &sender, bool pause) { return false; }
- // 通知倍数
- virtual bool speed(MediaSource &sender, float speed) { return false; }
- // 通知其停止产生流
- virtual bool close(MediaSource &sender) { return false; }
- // 获取观看总人数,此函数一般强制重载
- virtual int totalReaderCount(MediaSource &sender) { throw NotImplemented(toolkit::demangle(typeid(*this).name()) + "::totalReaderCount not implemented"); }
- // 通知观看人数变化
- virtual void onReaderChanged(MediaSource &sender, int size);
- //流注册或注销事件
- virtual void onRegist(MediaSource &sender, bool regist) {}
- // 获取丢包率
- virtual float getLossRate(MediaSource &sender, TrackType type) { return -1; }
- // 获取所在线程, 此函数一般强制重载
- virtual toolkit::EventPoller::Ptr getOwnerPoller(MediaSource &sender) { throw NotImplemented(toolkit::demangle(typeid(*this).name()) + "::getOwnerPoller not implemented"); }
-
- ////////////////////////仅供MultiMediaSourceMuxer对象继承////////////////////////
- // 开启或关闭录制
- virtual bool setupRecord(MediaSource &sender, Recorder::type type, bool start, const std::string &custom_path, size_t max_second) { return false; };
- // 获取录制状态
- virtual bool isRecording(MediaSource &sender, Recorder::type type) { return false; }
- // 获取所有track相关信息
- virtual std::vector getMediaTracks(MediaSource &sender, bool trackReady = true) const { return std::vector(); };
- // 获取MultiMediaSourceMuxer对象
- virtual std::shared_ptr getMuxer(MediaSource &sender) { return nullptr; }
-
- class SendRtpArgs {
- public:
- enum Type { kRtpRAW = 0, kRtpPS = 1, kRtpTS = 2 };
- // 是否采用udp方式发送rtp
- bool is_udp = true;
- // rtp类型
- Type type = kRtpPS;
- //发送es流时指定是否只发送纯音频流
- bool only_audio = false;
- //tcp被动方式
- bool passive = false;
- // rtp payload type
- uint8_t pt = 96;
- //是否支持同ssrc多服务器发送
- bool ssrc_multi_send = false;
- // 指定rtp ssrc
- std::string ssrc;
- // 指定本地发送端口
- uint16_t src_port = 0;
- // 发送目标端口
- uint16_t dst_port;
- // 发送目标主机地址,可以是ip或域名
- std::string dst_url;
-
- //udp发送时,是否开启rr rtcp接收超时判断
- bool udp_rtcp_timeout = false;
- //tcp被动发送服务器延时关闭事件,单位毫秒;设置为0时,则使用默认值5000ms
- uint32_t tcp_passive_close_delay_ms = 0;
- //udp 发送时,rr rtcp包接收超时时间,单位毫秒
- uint32_t rtcp_timeout_ms = 30 * 1000;
- //udp 发送时,发送sr rtcp包间隔,单位毫秒
- uint32_t rtcp_send_interval_ms = 5 * 1000;
-
- //发送rtp同时接收,一般用于双向语言对讲, 如果不为空,说明开启接收
- std::string recv_stream_id;
- };
-
- // 开始发送ps-rtp
- virtual void startSendRtp(MediaSource &sender, const SendRtpArgs &args, const std::function cb) { cb(0, toolkit::SockException(toolkit::Err_other, "not implemented"));};
- // 停止发送ps-rtp
- virtual bool stopSendRtp(MediaSource &sender, const std::string &ssrc) {return false; }
-
-private:
- toolkit::Timer::Ptr _async_close_timer;
-};
-
-
-template
-static void getArgsValue(const MAP &allArgs, const KEY &key, TYPE &value) {
- auto val = ((MAP &)allArgs)[key];
- if (!val.empty()) {
- value = (TYPE)val;
- }
-}
-
-class ProtocolOption {
-public:
- ProtocolOption();
-
- enum {
- kModifyStampOff = 0, // 采用源视频流绝对时间戳,不做任何改变
- kModifyStampSystem = 1, // 采用zlmediakit接收数据时的系统时间戳(有平滑处理)
- kModifyStampRelative = 2 // 采用源视频流时间戳相对时间戳(增长量),有做时间戳跳跃和回退矫正
- };
- // 时间戳类型
- int modify_stamp;
-
- //转协议是否开启音频
- bool enable_audio;
- //添加静音音频,在关闭音频时,此开关无效
- bool add_mute_audio;
- // 无人观看时,是否直接关闭(而不是通过on_none_reader hook返回close)
- // 此配置置1时,此流如果无人观看,将不触发on_none_reader hook回调,
- // 而是将直接关闭流
- bool auto_close;
-
- //断连续推延时,单位毫秒,默认采用配置文件
- uint32_t continue_push_ms;
-
- // 平滑发送定时器间隔,单位毫秒,置0则关闭;开启后影响cpu性能同时增加内存
- // 该配置开启后可以解决一些流发送不平滑导致zlmediakit转发也不平滑的问题
- uint32_t paced_sender_ms;
-
- //是否开启转换为hls(mpegts)
- bool enable_hls;
- //是否开启转换为hls(fmp4)
- bool enable_hls_fmp4;
- //是否开启MP4录制
- bool enable_mp4;
- //是否开启转换为rtsp/webrtc
- bool enable_rtsp;
- //是否开启转换为rtmp/flv
- bool enable_rtmp;
- //是否开启转换为http-ts/ws-ts
- bool enable_ts;
- //是否开启转换为http-fmp4/ws-fmp4
- bool enable_fmp4;
-
- // hls协议是否按需生成,如果hls.segNum配置为0(意味着hls录制),那么hls将一直生成(不管此开关)
- bool hls_demand;
- // rtsp[s]协议是否按需生成
- bool rtsp_demand;
- // rtmp[s]、http[s]-flv、ws[s]-flv协议是否按需生成
- bool rtmp_demand;
- // http[s]-ts协议是否按需生成
- bool ts_demand;
- // http[s]-fmp4、ws[s]-fmp4协议是否按需生成
- bool fmp4_demand;
-
- //是否将mp4录制当做观看者
- bool mp4_as_player;
- //mp4切片大小,单位秒
- size_t mp4_max_second;
- //mp4录制保存路径
- std::string mp4_save_path;
-
- //hls录制保存路径
- std::string hls_save_path;
-
- // 支持通过on_publish返回值替换stream_id
- std::string stream_replace;
-
- // 最大track数
- size_t max_track = 2;
-
- template
- ProtocolOption(const MAP &allArgs) : ProtocolOption() {
- load(allArgs);
- }
-
- template
- void load(const MAP &allArgs) {
-#define GET_OPT_VALUE(key) getArgsValue(allArgs, #key, key)
- GET_OPT_VALUE(modify_stamp);
- GET_OPT_VALUE(enable_audio);
- GET_OPT_VALUE(add_mute_audio);
- GET_OPT_VALUE(auto_close);
- GET_OPT_VALUE(continue_push_ms);
- GET_OPT_VALUE(paced_sender_ms);
-
- GET_OPT_VALUE(enable_hls);
- GET_OPT_VALUE(enable_hls_fmp4);
- GET_OPT_VALUE(enable_mp4);
- GET_OPT_VALUE(enable_rtsp);
- GET_OPT_VALUE(enable_rtmp);
- GET_OPT_VALUE(enable_ts);
- GET_OPT_VALUE(enable_fmp4);
-
- GET_OPT_VALUE(hls_demand);
- GET_OPT_VALUE(rtsp_demand);
- GET_OPT_VALUE(rtmp_demand);
- GET_OPT_VALUE(ts_demand);
- GET_OPT_VALUE(fmp4_demand);
-
- GET_OPT_VALUE(mp4_max_second);
- GET_OPT_VALUE(mp4_as_player);
- GET_OPT_VALUE(mp4_save_path);
-
- GET_OPT_VALUE(hls_save_path);
- GET_OPT_VALUE(stream_replace);
- GET_OPT_VALUE(max_track);
- }
-};
-
-//该对象用于拦截感兴趣的MediaSourceEvent事件
-class MediaSourceEventInterceptor : public MediaSourceEvent {
-public:
- void setDelegate(const std::weak_ptr &listener);
- std::shared_ptr getDelegate() const;
-
- MediaOriginType getOriginType(MediaSource &sender) const override;
- std::string getOriginUrl(MediaSource &sender) const override;
- std::shared_ptr getOriginSock(MediaSource &sender) const override;
-
- bool seekTo(MediaSource &sender, uint32_t stamp) override;
- bool pause(MediaSource &sender, bool pause) override;
- bool speed(MediaSource &sender, float speed) override;
- bool close(MediaSource &sender) override;
- int totalReaderCount(MediaSource &sender) override;
- void onReaderChanged(MediaSource &sender, int size) override;
- void onRegist(MediaSource &sender, bool regist) override;
- bool setupRecord(MediaSource &sender, Recorder::type type, bool start, const std::string &custom_path, size_t max_second) override;
- bool isRecording(MediaSource &sender, Recorder::type type) override;
- std::vector getMediaTracks(MediaSource &sender, bool trackReady = true) const override;
- void startSendRtp(MediaSource &sender, const SendRtpArgs &args, const std::function cb) override;
- bool stopSendRtp(MediaSource &sender, const std::string &ssrc) override;
- float getLossRate(MediaSource &sender, TrackType type) override;
- toolkit::EventPoller::Ptr getOwnerPoller(MediaSource &sender) override;
- std::shared_ptr getMuxer(MediaSource &sender) override;
-
-private:
- std::weak_ptr _listener;
-};
-
-/**
- * 解析url获取媒体相关信息
- */
-class MediaInfo: public MediaTuple {
-public:
- MediaInfo() = default;
- MediaInfo(const std::string &url) { parse(url); }
- void parse(const std::string &url);
- std::string getUrl() const { return schema + "://" + shortUrl(); }
-
-public:
- uint16_t port = 0;
- std::string full_url;
- std::string schema;
- std::string host;
-};
-
-bool equalMediaTuple(const MediaTuple& a, const MediaTuple& b);
-
-/**
- * 媒体源,任何rtsp/rtmp的直播流都源自该对象
- */
-class MediaSource: public TrackSource, public std::enable_shared_from_this {
-public:
- static MediaSource& NullMediaSource();
- using Ptr = std::shared_ptr;
-
- MediaSource(const std::string &schema, const MediaTuple& tuple);
- virtual ~MediaSource();
-
- ////////////////获取MediaSource相关信息////////////////
-
- // 获取协议类型
- const std::string& getSchema() const {
- return _schema;
- }
-
- const MediaTuple& getMediaTuple() const {
- return _tuple;
- }
-
- std::string getUrl() const { return _schema + "://" + _tuple.shortUrl(); }
-
- //获取对象所有权
- std::shared_ptr getOwnership();
-
- // 获取所有Track
- std::vector getTracks(bool ready = true) const override;
-
- // 获取流当前时间戳
- virtual uint32_t getTimeStamp(TrackType type) { return 0; };
- // 设置时间戳
- virtual void setTimeStamp(uint32_t stamp) {};
-
- // 获取数据速率,单位bytes/s
- int getBytesSpeed(TrackType type = TrackInvalid);
- // 获取流创建GMT unix时间戳,单位秒
- uint64_t getCreateStamp() const { return _create_stamp; }
- // 获取流上线时间,单位秒
- uint64_t getAliveSecond() const;
-
- ////////////////MediaSourceEvent相关接口实现////////////////
-
- // 设置监听者
- virtual void setListener(const std::weak_ptr &listener);
- // 获取监听者
- std::weak_ptr getListener() const;
-
- // 本协议获取观看者个数,可能返回本协议的观看人数,也可能返回总人数
- virtual int readerCount() = 0;
- // 观看者个数,包括(hls/rtsp/rtmp)
- virtual int totalReaderCount();
- // 获取播放器列表
- virtual void getPlayerList(const std::function &info_list)> &cb,
- const std::function &on_change) {
- assert(cb);
- cb(std::list());
- }
-
- virtual bool broadcastMessage(const toolkit::Any &data) { return false; }
-
- // 获取媒体源类型
- MediaOriginType getOriginType() const;
- // 获取媒体源url或者文件路径
- std::string getOriginUrl() const;
- // 获取媒体源客户端相关信息
- std::shared_ptr getOriginSock() const;
-
- // 拖动进度条
- bool seekTo(uint32_t stamp);
- // 暂停
- bool pause(bool pause);
- // 倍数播放
- bool speed(float speed);
- // 关闭该流
- bool close(bool force);
- // 该流观看人数变化
- void onReaderChanged(int size);
- // 开启或关闭录制
- bool setupRecord(Recorder::type type, bool start, const std::string &custom_path, size_t max_second);
- // 获取录制状态
- bool isRecording(Recorder::type type);
- // 开始发送ps-rtp
- void startSendRtp(const MediaSourceEvent::SendRtpArgs &args, const std::function cb);
- // 停止发送ps-rtp
- bool stopSendRtp(const std::string &ssrc);
- // 获取丢包率
- float getLossRate(mediakit::TrackType type);
- // 获取所在线程
- toolkit::EventPoller::Ptr getOwnerPoller();
- // 获取MultiMediaSourceMuxer对象
- std::shared_ptr getMuxer();
-
- ////////////////static方法,查找或生成MediaSource////////////////
-
- // 同步查找流
- static Ptr find(const std::string &schema, const std::string &vhost, const std::string &app, const std::string &id, bool from_mp4 = false);
- static Ptr find(const MediaInfo &info, bool from_mp4 = false) {
- return find(info.schema, info.vhost, info.app, info.stream, from_mp4);
- }
-
- // 忽略schema,同步查找流,可能返回rtmp/rtsp/hls类型
- static Ptr find(const std::string &vhost, const std::string &app, const std::string &stream_id, bool from_mp4 = false);
-
- // 异步查找流
- static void findAsync(const MediaInfo &info, const std::shared_ptr &session, const std::function &cb);
- // 遍历所有流
- static void for_each_media(const std::function &cb, const std::string &schema = "", const std::string &vhost = "", const std::string &app = "", const std::string &stream = "");
- // 从mp4文件生成MediaSource
- static MediaSource::Ptr createFromMP4(const std::string &schema, const std::string &vhost, const std::string &app, const std::string &stream, const std::string &file_path = "", bool check_app = true);
-
-protected:
- //媒体注册
- void regist();
-
-private:
- // 媒体注销
- bool unregist();
- // 触发媒体事件
- void emitEvent(bool regist);
-
-protected:
- toolkit::BytesSpeed _speed[TrackMax];
- MediaTuple _tuple;
-
-private:
- std::atomic_flag _owned { false };
- time_t _create_stamp;
- toolkit::Ticker _ticker;
- std::string _schema;
- std::weak_ptr _listener;
- // 对象个数统计
- toolkit::ObjectStatistic _statistic;
-};
-
-} /* namespace mediakit */
-#endif //ZLMEDIAKIT_MEDIASOURCE_H
diff --git a/webrtc_player/android/zlm/src/main/cpp/include/Common/MultiMediaSourceMuxer.h b/webrtc_player/android/zlm/src/main/cpp/include/Common/MultiMediaSourceMuxer.h
deleted file mode 100644
index 9ca34370..00000000
--- a/webrtc_player/android/zlm/src/main/cpp/include/Common/MultiMediaSourceMuxer.h
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Copyright (c) 2016-present The ZLMediaKit project authors. All Rights Reserved.
- *
- * This file is part of ZLMediaKit(https://github.com/ZLMediaKit/ZLMediaKit).
- *
- * Use of this source code is governed by MIT-like license that can be found in the
- * LICENSE file in the root of the source tree. All contributing project authors
- * may be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef ZLMEDIAKIT_MULTIMEDIASOURCEMUXER_H
-#define ZLMEDIAKIT_MULTIMEDIASOURCEMUXER_H
-
-#include "Common/Stamp.h"
-#include "Common/MediaSource.h"
-#include "Common/MediaSink.h"
-#include "Record/Recorder.h"
-#include "Rtp/RtpSender.h"
-#include "Record/HlsRecorder.h"
-#include "Record/HlsMediaSource.h"
-#include "Rtsp/RtspMediaSourceMuxer.h"
-#include "Rtmp/RtmpMediaSourceMuxer.h"
-#include "TS/TSMediaSourceMuxer.h"
-#include "FMP4/FMP4MediaSourceMuxer.h"
-
-namespace mediakit {
-
-class MultiMediaSourceMuxer : public MediaSourceEventInterceptor, public MediaSink, public std::enable_shared_from_this{
-public:
- using Ptr = std::shared_ptr;
- using RingType = toolkit::RingBuffer;
-
- class Listener {
- public:
- virtual ~Listener() = default;
- virtual void onAllTrackReady() = 0;
- };
-
- MultiMediaSourceMuxer(const MediaTuple& tuple, float dur_sec = 0.0,const ProtocolOption &option = ProtocolOption());
-
- /**
- * 设置事件监听器
- * @param listener 监听器
- */
- void setMediaListener(const std::weak_ptr &listener);
-
- /**
- * 设置Track就绪事件监听器
- * @param listener 事件监听器
- */
- void setTrackListener(const std::weak_ptr &listener);
-
- /**
- * 返回总的消费者个数
- */
- int totalReaderCount() const;
-
- /**
- * 判断是否生效(是否正在转其他协议)
- */
- bool isEnabled();
-
- /**
- * 设置MediaSource时间戳
- * @param stamp 时间戳
- */
- void setTimeStamp(uint32_t stamp);
-
- /**
- * 重置track
- */
- void resetTracks() override;
-
- /////////////////////////////////MediaSourceEvent override/////////////////////////////////
-
- /**
- * 观看总人数
- * @param sender 事件发送者
- * @return 观看总人数
- */
- int totalReaderCount(MediaSource &sender) override;
-
- /**
- * 设置录制状态
- * @param type 录制类型
- * @param start 开始或停止
- * @param custom_path 开启录制时,指定自定义路径
- * @return 是否设置成功
- */
- bool setupRecord(MediaSource &sender, Recorder::type type, bool start, const std::string &custom_path, size_t max_second) override;
-
- /**
- * 获取录制状态
- * @param type 录制类型
- * @return 录制状态
- */
- bool isRecording(MediaSource &sender, Recorder::type type) override;
-
- /**
- * 开始发送ps-rtp流
- * @param dst_url 目标ip或域名
- * @param dst_port 目标端口
- * @param ssrc rtp的ssrc
- * @param is_udp 是否为udp
- * @param cb 启动成功或失败回调
- */
- void startSendRtp(MediaSource &sender, const MediaSourceEvent::SendRtpArgs &args, const std::function cb) override;
-
- /**
- * 停止ps-rtp发送
- * @return 是否成功
- */
- bool stopSendRtp(MediaSource &sender, const std::string &ssrc) override;
-
- /**
- * 获取所有Track
- * @param trackReady 是否筛选过滤未就绪的track
- * @return 所有Track
- */
- std::vector getMediaTracks(MediaSource &sender, bool trackReady = true) const override;
-
- /**
- * 获取所属线程
- */
- toolkit::EventPoller::Ptr getOwnerPoller(MediaSource &sender) override;
-
- /**
- * 获取本对象
- */
- std::shared_ptr getMuxer(MediaSource &sender) override;
-
- const ProtocolOption &getOption() const;
- const MediaTuple &getMediaTuple() const;
- std::string shortUrl() const;
-
-protected:
- /////////////////////////////////MediaSink override/////////////////////////////////
-
- /**
- * 某track已经准备好,其ready()状态返回true,
- * 此时代表可以获取其例如sps pps等相关信息了
- * @param track
- */
- bool onTrackReady(const Track::Ptr & track) override;
-
- /**
- * 所有Track已经准备好,
- */
- void onAllTrackReady() override;
-
- /**
- * 某Track输出frame,在onAllTrackReady触发后才会调用此方法
- * @param frame
- */
- bool onTrackFrame(const Frame::Ptr &frame) override;
- bool onTrackFrame_l(const Frame::Ptr &frame);
-
-private:
- void createGopCacheIfNeed();
-
-private:
- bool _is_enable = false;
- bool _create_in_poller = false;
- bool _video_key_pos = false;
- float _dur_sec;
- std::shared_ptr _paced_sender;
- MediaTuple _tuple;
- ProtocolOption _option;
- toolkit::Ticker _last_check;
- std::unordered_map _stamps;
- std::weak_ptr _track_listener;
- std::unordered_multimap _rtp_sender;
- FMP4MediaSourceMuxer::Ptr _fmp4;
- RtmpMediaSourceMuxer::Ptr _rtmp;
- RtspMediaSourceMuxer::Ptr _rtsp;
- TSMediaSourceMuxer::Ptr _ts;
- MediaSinkInterface::Ptr _mp4;
- HlsRecorder::Ptr _hls;
- HlsFMP4Recorder::Ptr _hls_fmp4;
- toolkit::EventPoller::Ptr _poller;
- RingType::Ptr _ring;
-
- //对象个数统计
- toolkit::ObjectStatistic _statistic;
-};
-
-}//namespace mediakit
-#endif //ZLMEDIAKIT_MULTIMEDIASOURCEMUXER_H
diff --git a/webrtc_player/android/zlm/src/main/cpp/include/Common/PacketCache.h b/webrtc_player/android/zlm/src/main/cpp/include/Common/PacketCache.h
deleted file mode 100644
index 5e930a5f..00000000
--- a/webrtc_player/android/zlm/src/main/cpp/include/Common/PacketCache.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-* Copyright (c) 2016-present The ZLMediaKit project authors. All Rights Reserved.
-*
-* This file is part of ZLMediaKit(https://github.com/ZLMediaKit/ZLMediaKit).
-*
-* Use of this source code is governed by MIT-like license that can be found in the
-* LICENSE file in the root of the source tree. All contributing project authors
-* may be found in the AUTHORS file in the root of the source tree.
-*/
-
-#ifndef ZLMEDIAKIT_PACKET_CACHE_H_
-#define ZLMEDIAKIT_PACKET_CACHE_H_
-
-#include "Common/config.h"
-#include "Util/List.h"
-
-namespace mediakit {
-/// 缓存刷新策略类
-class FlushPolicy {
-public:
- bool isFlushAble(bool is_video, bool is_key, uint64_t new_stamp, size_t cache_size);
-
-private:
- // 音视频的最后时间戳
- uint64_t _last_stamp[2] = { 0, 0 };
-};
-
-/// 合并写缓存模板
-/// \tparam packet 包类型
-/// \tparam policy 刷新缓存策略
-/// \tparam packet_list 包缓存类型
-template > >
-class PacketCache {
-public:
- PacketCache() { _cache = std::make_shared(); }
-
- virtual ~PacketCache() = default;
-
- void inputPacket(uint64_t stamp, bool is_video, std::shared_ptr pkt, bool key_pos) {
- bool flag = flushImmediatelyWhenCloseMerge();
- if (!flag && _policy.isFlushAble(is_video, key_pos, stamp, _cache->size())) {
- flush();
- }
-
- //追加数据到最后
- _cache->emplace_back(std::move(pkt));
- if (key_pos) {
- _key_pos = key_pos;
- }
-
- if (flag) {
- flush();
- }
- }
-
- void flush() {
- if (_cache->empty()) {
- return;
- }
- onFlush(std::move(_cache), _key_pos);
- _cache = std::make_shared();
- _key_pos = false;
- }
-
- virtual void clearCache() {
- _cache->clear();
- }
-
- virtual void onFlush(std::shared_ptr, bool key_pos) = 0;
-
-private:
- bool flushImmediatelyWhenCloseMerge() {
- // 一般的协议关闭合并写时,立即刷新缓存,这样可以减少一帧的延时,但是rtp例外
- // 因为rtp的包很小,一个RtpPacket包中也不是完整的一帧图像,所以在关闭合并写时,
- // 还是有必要缓冲一帧的rtp(也就是时间戳相同的rtp)再输出,这样虽然会增加一帧的延时
- // 但是却对性能提升很大,这样做还是比较划算的
-
- GET_CONFIG(int, mergeWriteMS, General::kMergeWriteMS);
- GET_CONFIG(int, rtspLowLatency, Rtsp::kLowLatency);
- return std::is_same::value ? rtspLowLatency : (mergeWriteMS <= 0);
- }
-
-private:
- bool _key_pos = false;
- policy _policy;
- std::shared_ptr _cache;
-};
-}
-
-#endif //ZLMEDIAKIT_PACKET_CACHE_H_
diff --git a/webrtc_player/android/zlm/src/main/cpp/include/Common/Parser.h b/webrtc_player/android/zlm/src/main/cpp/include/Common/Parser.h
deleted file mode 100644
index 324658ba..00000000
--- a/webrtc_player/android/zlm/src/main/cpp/include/Common/Parser.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 2016-present The ZLMediaKit project authors. All Rights Reserved.
- *
- * This file is part of ZLMediaKit(https://github.com/ZLMediaKit/ZLMediaKit).
- *
- * Use of this source code is governed by MIT-like license that can be found in the
- * LICENSE file in the root of the source tree. All contributing project authors
- * may be found in the AUTHORS file in the root of the source tree.
- */
-
-#ifndef ZLMEDIAKIT_PARSER_H
-#define ZLMEDIAKIT_PARSER_H
-
-#include