Skip to content

Commit eef7577

Browse files
authored
Feat/release 0.9.43 (#1447)
* wip. * win/linux. * release: 0.9.43.
1 parent a8c9da9 commit eef7577

File tree

15 files changed

+34
-24
lines changed

15 files changed

+34
-24
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Changelog
22

33
--------------------------------------------
4+
[0.9.43] - 2023-09-15
5+
6+
* [Native] fix: send frame cryptor events from signaling thread.
7+
* [Native] fix: h264 freeze when using E2EE.
8+
49
[0.9.42+hotfix.1] - 2023-09-15
510

611
* [Windows/Linux] fix: fix cannot start vp8/h264 encoder correctly.

android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ android {
5252
}
5353

5454
dependencies {
55-
implementation 'io.github.webrtc-sdk:android:114.5735.03'
55+
implementation 'io.github.webrtc-sdk:android:114.5735.04'
5656
implementation 'com.github.davidliu:audioswitch:d18e3e31d427c27f1593030e024b370bf24480fd'
5757
implementation 'androidx.annotation:annotation:1.1.0'
5858
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

android/src/main/java/com/cloudwebrtc/webrtc/FlutterRTCFrameCryptor.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@ private void frameCryptorFactoryCreateFrameCryptor(Map<String, Object> params, @
181181
if(type.equals("sender")) {
182182
RtpSender rtpSender = pco.getRtpSenderById(rtpSenderId);
183183

184-
FrameCryptor frameCryptor = FrameCryptorFactory.createFrameCryptorForRtpSender(rtpSender,
184+
FrameCryptor frameCryptor = FrameCryptorFactory.createFrameCryptorForRtpSender(stateProvider.getPeerConnectionFactory(),
185+
rtpSender,
185186
participantId,
186187
frameCryptorAlgorithmFromInt(algorithm),
187188
keyProvider);
@@ -196,7 +197,8 @@ private void frameCryptorFactoryCreateFrameCryptor(Map<String, Object> params, @
196197
} else if(type.equals("receiver")) {
197198
RtpReceiver rtpReceiver = pco.getRtpReceiverById(rtpReceiverId);
198199

199-
FrameCryptor frameCryptor = FrameCryptorFactory.createFrameCryptorForRtpReceiver(rtpReceiver,
200+
FrameCryptor frameCryptor = FrameCryptorFactory.createFrameCryptorForRtpReceiver(stateProvider.getPeerConnectionFactory(),
201+
rtpReceiver,
200202
participantId,
201203
frameCryptorAlgorithmFromInt(algorithm),
202204
keyProvider);

common/cpp/include/flutter_frame_cryptor.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class FlutterFrameCryptor {
9191
FlutterWebRTCBase* base_;
9292
std::map<std::string, scoped_refptr<libwebrtc::RTCFrameCryptor>>
9393
frame_cryptors_;
94-
std::map<std::string, std::unique_ptr<FlutterFrameCryptorObserver>>
94+
std::map<std::string, scoped_refptr<FlutterFrameCryptorObserver>>
9595
frame_cryptor_observers_;
9696
std::map<std::string, scoped_refptr<libwebrtc::KeyProvider>> key_providers_;
9797
};

common/cpp/src/flutter_frame_cryptor.cc

+7-9
Original file line numberDiff line numberDiff line change
@@ -159,18 +159,17 @@ void FlutterFrameCryptor::FrameCryptorFactoryCreateFrameCryptor(
159159
return;
160160
}
161161
auto frameCryptor =
162-
libwebrtc::FrameCryptorFactory::frameCryptorFromRtpSender(
162+
libwebrtc::FrameCryptorFactory::frameCryptorFromRtpSender(base_->factory_,
163163
string(participantId), sender, AlgorithmFromInt(algorithm),
164164
keyProvider);
165165
std::string event_channel = "FlutterWebRTC/frameCryptorEvent" + uuid;
166166

167-
std::unique_ptr<FlutterFrameCryptorObserver> observer(
168-
new FlutterFrameCryptorObserver(base_->messenger_, event_channel));
167+
scoped_refptr<FlutterFrameCryptorObserver> observer(new RefCountedObject<FlutterFrameCryptorObserver>(base_->messenger_, event_channel));
169168

170-
frameCryptor->RegisterRTCFrameCryptorObserver(observer.get());
169+
frameCryptor->RegisterRTCFrameCryptorObserver(observer);
171170

172171
frame_cryptors_[uuid] = frameCryptor;
173-
frame_cryptor_observers_[uuid] = std::move(observer);
172+
frame_cryptor_observers_[uuid] = observer;
174173
EncodableMap params;
175174
params[EncodableValue("frameCryptorId")] = uuid;
176175

@@ -185,19 +184,18 @@ void FlutterFrameCryptor::FrameCryptorFactoryCreateFrameCryptor(
185184
std::string uuid = base_->GenerateUUID();
186185
auto keyProvider = key_providers_[keyProviderId];
187186
auto frameCryptor =
188-
libwebrtc::FrameCryptorFactory::frameCryptorFromRtpReceiver(
187+
libwebrtc::FrameCryptorFactory::frameCryptorFromRtpReceiver(base_->factory_,
189188
string(participantId), receiver, AlgorithmFromInt(algorithm),
190189
keyProvider);
191190

192191
std::string event_channel = "FlutterWebRTC/frameCryptorEvent" + uuid;
193192

194-
std::unique_ptr<FlutterFrameCryptorObserver> observer(
195-
new FlutterFrameCryptorObserver(base_->messenger_, event_channel));
193+
scoped_refptr<FlutterFrameCryptorObserver> observer(new RefCountedObject<FlutterFrameCryptorObserver>(base_->messenger_, event_channel));
196194

197195
frameCryptor->RegisterRTCFrameCryptorObserver(observer.get());
198196

199197
frame_cryptors_[uuid] = frameCryptor;
200-
frame_cryptor_observers_[uuid] = std::move(observer);
198+
frame_cryptor_observers_[uuid] = observer;
201199
EncodableMap params;
202200
params[EncodableValue("frameCryptorId")] = uuid;
203201

common/darwin/Classes/FlutterRTCFrameCryptor.m

+4-2
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ - (void)frameCryptorFactoryCreateFrameCryptor:(nonnull NSDictionary*)constraints
146146
}
147147

148148
RTCFrameCryptor* frameCryptor =
149-
[[RTCFrameCryptor alloc] initWithRtpSender:sender
149+
[[RTCFrameCryptor alloc] initWithFactory:self.peerConnectionFactory
150+
rtpSender:sender
150151
participantId:participantId
151152
algorithm:[self getAlgorithm:algorithm]
152153
keyProvider:keyProvider];
@@ -172,7 +173,8 @@ - (void)frameCryptorFactoryCreateFrameCryptor:(nonnull NSDictionary*)constraints
172173
return;
173174
}
174175
RTCFrameCryptor* frameCryptor =
175-
[[RTCFrameCryptor alloc] initWithRtpReceiver:receiver
176+
[[RTCFrameCryptor alloc] initWithFactory:self.peerConnectionFactory
177+
rtpReceiver:receiver
176178
participantId:participantId
177179
algorithm:[self getAlgorithm:algorithm]
178180
keyProvider:keyProvider];

example/ios/Podfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line to define a global platform for your project
2-
# platform :ios, '11.0'
2+
platform :ios, '12.0'
33

44
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
55
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

ios/flutter_webrtc.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A new flutter plugin project.
1515
s.source_files = 'Classes/**/*'
1616
s.public_header_files = 'Classes/**/*.h'
1717
s.dependency 'Flutter'
18-
s.dependency 'WebRTC-SDK', '114.5735.06'
19-
s.ios.deployment_target = '11.0'
18+
s.dependency 'WebRTC-SDK', '114.5735.07'
19+
s.ios.deployment_target = '12.0'
2020
s.static_framework = true
2121
end

macos/flutter_webrtc.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ A new flutter plugin project.
1515
s.source_files = ['Classes/**/*']
1616

1717
s.dependency 'FlutterMacOS'
18-
s.dependency 'WebRTC-SDK', '114.5735.06'
18+
s.dependency 'WebRTC-SDK', '114.5735.07'
1919
s.osx.deployment_target = '10.13'
2020
end

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_webrtc
22
description: Flutter WebRTC plugin for iOS/Android/Destkop/Web, based on GoogleWebRTC.
3-
version: 0.9.42+hotfix.1
3+
version: 0.9.43
44
homepage: https://github.com/cloudwebrtc/flutter-webrtc
55
environment:
66
sdk: '>=2.12.0 <4.0.0'

third_party/libwebrtc/include/rtc_frame_cryptor.h

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define LIB_RTC_FRAME_CYRPTOR_H_
33

44
#include "base/refcount.h"
5+
#include "rtc_peerconnection_factory.h"
56
#include "rtc_rtp_receiver.h"
67
#include "rtc_rtp_sender.h"
78
#include "rtc_types.h"
@@ -69,7 +70,7 @@ enum RTCFrameCryptionState {
6970
kInternalError,
7071
};
7172

72-
class RTCFrameCryptorObserver {
73+
class RTCFrameCryptorObserver : public RefCountInterface {
7374
public:
7475
virtual void OnFrameCryptionStateChanged(const string participant_id,
7576
RTCFrameCryptionState state) = 0;
@@ -98,7 +99,7 @@ class RTCFrameCryptor : public RefCountInterface {
9899
virtual const string participant_id() const = 0;
99100

100101
virtual void RegisterRTCFrameCryptorObserver(
101-
RTCFrameCryptorObserver* observer) = 0;
102+
scoped_refptr<RTCFrameCryptorObserver> observer) = 0;
102103

103104
virtual void DeRegisterRTCFrameCryptorObserver() = 0;
104105

@@ -110,14 +111,16 @@ class FrameCryptorFactory {
110111
public:
111112
/// Create a frame cyrptor for [RTCRtpSender].
112113
LIB_WEBRTC_API static scoped_refptr<RTCFrameCryptor>
113-
frameCryptorFromRtpSender(const string participant_id,
114+
frameCryptorFromRtpSender(scoped_refptr<RTCPeerConnectionFactory> factory,
115+
const string participant_id,
114116
scoped_refptr<RTCRtpSender> sender,
115117
Algorithm algorithm,
116118
scoped_refptr<KeyProvider> key_provider);
117119

118120
/// Create a frame cyrptor for [RTCRtpReceiver].
119121
LIB_WEBRTC_API static scoped_refptr<RTCFrameCryptor>
120-
frameCryptorFromRtpReceiver(const string participant_id,
122+
frameCryptorFromRtpReceiver(scoped_refptr<RTCPeerConnectionFactory> factory,
123+
const string participant_id,
121124
scoped_refptr<RTCRtpReceiver> receiver,
122125
Algorithm algorithm,
123126
scoped_refptr<KeyProvider> key_provider);
880 Bytes
Binary file not shown.
56 Bytes
Binary file not shown.
-1 KB
Binary file not shown.
344 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)