Skip to content

Commit

Permalink
Upgrade libwebrtc-bin to 130.0.6723.58 version (#177)
Browse files Browse the repository at this point in the history
Additionally:
- upgrade Gradle to 8.0
  • Loading branch information
evdokimovs authored Oct 24, 2024
1 parent 4a74f27 commit 26915a4
Show file tree
Hide file tree
Showing 20 changed files with 85 additions and 99 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ All user visible changes to this project will be documented in this file. This p
### Changed

- Upgraded `flutter_rust_bridge` to 2.4.0 version. ([#172])
- Upgraded [libwebrtc] to [130.0.6723.58] version. ([#177])

### Fixed

Expand All @@ -26,6 +27,8 @@ All user visible changes to this project will be documented in this file. This p
[#172]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/172
[#173]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/173
[#175]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/175
[#177]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/177
[130.0.6723.58]: https://github.com/instrumentisto/libwebrtc-bin/releases/tag/130.0.6723.58



Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Medea Flutter-WebRTC
====================

[![pub](https://img.shields.io/pub/v/medea_flutter_webrtc "pub")](https://pub.dev/packages/medea_flutter_webrtc)
[![libwebrtc](https://img.shields.io/badge/libwebrtc-128.0.6613.119-blue "libwebrtc")](https://github.com/instrumentisto/libwebrtc-bin/releases/tag/128.0.6613.119)
[![libwebrtc](https://img.shields.io/badge/libwebrtc-130.0.6723.58-blue "libwebrtc")](https://github.com/instrumentisto/libwebrtc-bin/releases/tag/130.0.6723.58)
[![OpenAL](https://img.shields.io/badge/OpenAL-1.23.1-blue "OpenAL")](https://github.com/kcat/openal-soft/releases/tag/1.23.1)

[Changelog](https://github.com/instrumentisto/medea-flutter-webrtc/blob/main/CHANGELOG.md)
Expand Down
25 changes: 16 additions & 9 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ group 'com.instrumentisto.medea_flutter_webrtc'
version '0.11.2-dev'

buildscript {
ext.kotlin_version = '1.9.0'
ext.kotlin_version = "1.8.22"
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath("com.android.tools.build:gradle:8.1.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
}
}

rootProject.allprojects {
repositories {
google()
Expand All @@ -26,10 +25,14 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdk = 34
if (project.android.hasProperty("namespace")) {
namespace = "com.instrumentisto.medea_flutter_webrtc"
}

compileSdk 34

defaultConfig {
minSdkVersion 24
minSdk 21
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles 'proguard-rules.pro'
}
Expand All @@ -43,8 +46,12 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}

buildFeatures {
buildConfig = true
}

kotlinOptions {
jvmTarget = '1.8'
jvmTarget = JavaVersion.VERSION_1_8
}

sourceSets {
Expand All @@ -53,7 +60,7 @@ android {
}

dependencies {
implementation 'com.github.instrumentisto:libwebrtc-bin:128.0.6613.119@aar'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version'
implementation 'com.github.instrumentisto:libwebrtc-bin:130.0.6723.58@aar'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
}
2 changes: 1 addition & 1 deletion crates/libwebrtc-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "libwebrtc-sys"
version = "0.0.0+128.0.6613.119"
version = "0.0.0+130.0.6723.58"
edition = "2021"
rust-version = "1.81"
publish = false
Expand Down
12 changes: 6 additions & 6 deletions crates/libwebrtc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use walkdir::{DirEntry, WalkDir};
/// [`libwebrtc-bin`]: https://github.com/instrumentisto/libwebrtc-bin
static LIBWEBRTC_URL: &str =
"https://github.com/instrumentisto/libwebrtc-bin/releases/download\
/128.0.6613.119";
/130.0.6723.58";

/// URL for downloading `openal-soft` source code.
static OPENAL_URL: &str =
Expand Down Expand Up @@ -124,19 +124,19 @@ fn get_target() -> anyhow::Result<String> {
fn get_expected_libwebrtc_hash() -> anyhow::Result<&'static str> {
Ok(match get_target()?.as_str() {
"aarch64-unknown-linux-gnu" => {
"80639f0071a150526d7912d50211f84cc869bf23ab528cfeaac865e6a68b2deb"
"0a72efd8b909c4160a124e01d7e92713bd8cfc6121e687749ea99a40cafefcae"
}
"x86_64-unknown-linux-gnu" => {
"cb6d01215039d2ad7e2845310cfc78d21fa5639faa3240d4f88509f90f9fa9c4"
"4f34d432abc67f9291661cf3922355d142cd521501ee2ec4bed43b0413f05fa3"
}
"aarch64-apple-darwin" => {
"2028e9d5c023034cfbb7672bc35c308e86d33c88cb6968de02cb2909972f0a70"
"7517dd8828979daaec3bec2e7c8b9ed8237a133c85613914be626af9bcb67d32"
}
"x86_64-apple-darwin" => {
"b7bd405a2743e2ce4b3d516897b519e39f757e04ebb39cc170963836224e18a9"
"2349aa45ce63bbb6a799950b156072f5f61e25a9baa85222eac09180bad79b09"
}
"x86_64-pc-windows-msvc" => {
"7fda2fdec88f365309d285fb7be132c3e921d056e94b97830769f8033baaae9e"
"d81d8028bb11e27d130db9d98d0fa1453a0958c872f4eaab78c86c4a8e8c777f"
}
arch => return Err(anyhow::anyhow!("Unsupported target: {arch}")),
})
Expand Down
6 changes: 3 additions & 3 deletions crates/libwebrtc-sys/include/adm.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ class OpenALAudioDeviceModule : public ExtendedADM {

int32_t GetPlayoutUnderrunCount() const override { return -1; }

virtual absl::optional<Stats> GetStats() const { return absl::nullopt; }
virtual std::optional<Stats> GetStats() const { return std::nullopt; }

#if defined(WEBRTC_IOS)
virtual int GetPlayoutAudioParameters(AudioParameters* params) const {
return absl::nullopt;
return std::nullopt;
}
virtual int GetRecordAudioParameters(AudioParameters* params) const {
return absl::nullopt;
return std::nullopt;
}
#endif // WEBRTC_IOS

Expand Down
2 changes: 1 addition & 1 deletion crates/libwebrtc-sys/include/device_video_capturer.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class DeviceVideoCapturer : public rtc::AdaptedVideoTrackSource,
// Indicates that the encoder should denoise video before encoding it.
// If it's not set, the default configuration is used which is different
// depending on a video codec.
absl::optional<bool> needs_denoising() const override;
std::optional<bool> needs_denoising() const override;

// Returns state of this `DeviceVideoCapturer`.
webrtc::MediaSourceInterface::SourceState state() const override;
Expand Down
2 changes: 1 addition & 1 deletion crates/libwebrtc-sys/include/mac_capturer.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class MacCapturer : public rtc::AdaptedVideoTrackSource,
//
// If it's not set, the default configuration is used, which is different
// depending on a video codec.
absl::optional<bool> needs_denoising() const override;
std::optional<bool> needs_denoising() const override;

// Returns state of this `DeviceVideoCapturer`.
webrtc::MediaSourceInterface::SourceState state() const override;
Expand Down
2 changes: 1 addition & 1 deletion crates/libwebrtc-sys/include/screen_video_capturer.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ScreenVideoCapturer : public rtc::AdaptedVideoTrackSource,
//
// If it's not set, the default configuration is used which differs depending
// on a video codec.
absl::optional<bool> needs_denoising() const override;
std::optional<bool> needs_denoising() const override;

// Returns state of this `ScreenVideoCapturer`.
webrtc::MediaSourceInterface::SourceState state() const override;
Expand Down
2 changes: 1 addition & 1 deletion crates/libwebrtc-sys/src/cpp/device_video_capturer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ bool DeviceVideoCapturer::is_screencast() const {
}

// Returns `false`.
absl::optional<bool> DeviceVideoCapturer::needs_denoising() const {
std::optional<bool> DeviceVideoCapturer::needs_denoising() const {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion crates/libwebrtc-sys/src/cpp/mac_capturer.mm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ - (void)capturer:(RTCVideoCapturer*)capturer didCaptureVideoFrame:(RTCVideoFrame
}

// Returns `false`.
absl::optional<bool> MacCapturer::needs_denoising() const {
std::optional<bool> MacCapturer::needs_denoising() const {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion crates/libwebrtc-sys/src/cpp/screen_video_capturer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ bool ScreenVideoCapturer::is_screencast() const {
}

// Always returns `false`.
absl::optional<bool> ScreenVideoCapturer::needs_denoising() const {
std::optional<bool> ScreenVideoCapturer::needs_denoising() const {
return false;
}

Expand Down
63 changes: 19 additions & 44 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,65 +1,40 @@
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin
// Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion flutter.compileSdkVersion
namespace = "com.instrumentisto.medea_flutter_webrtc_example"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
jvmTarget = JavaVersion.VERSION_1_8
}

defaultConfig {
applicationId "com.instrumentisto.medea_flutter_webrtc_example"
minSdkVersion 24
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
applicationId = "com.instrumentisto.medea_flutter_webrtc_example"
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}

buildTypes {
release {
signingConfig signingConfigs.debug
signingConfig = signingConfigs.debug
}
}
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
source = "../.."
}
17 changes: 2 additions & 15 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,16 @@
buildscript {
ext.kotlin_version = '1.9.0'
repositories {
google()
mavenCentral()
}

dependencies {
classpath("com.android.tools.build:gradle:7.4.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}

rootProject.buildDir = '../build'
rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
project.evaluationDependsOn(":app")
}

tasks.register("clean", Delete) {
Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
30 changes: 22 additions & 8 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
include ':app'
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.1.0" apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
}

include ":app"
2 changes: 1 addition & 1 deletion example/macos/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
medea_flutter_webrtc: d2feb7c8e2ca9a165ad8a00db8ec9867c90b174c
medea_flutter_webrtc: 790273ab2ce7a27fd2e28c5d0f92c3ee564f6f24

PODFILE CHECKSUM: 353c8bcc5d5b0994e508d035b5431cfe18c1dea7

Expand Down
4 changes: 2 additions & 2 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: f652077d0bdf60abe4c1f6377448e8655008eef28f128bc023f7b5e8dfeb48fc
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "14.2.4"
version: "14.2.5"
watcher:
dependency: transitive
description:
Expand Down
Loading

0 comments on commit 26915a4

Please sign in to comment.