Skip to content

Commit

Permalink
feat: upgrade native sdk 4.3.2.234
Browse files Browse the repository at this point in the history
  • Loading branch information
peilinok committed Dec 18, 2024
1 parent ed146c1 commit 458316d
Show file tree
Hide file tree
Showing 26 changed files with 1,617 additions and 39 deletions.
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ dependencies {
if (isDev(project)) {
api fileTree(dir: "libs", include: ["*.jar"])
} else {
api 'io.agora.rtc:iris-rtc:4.3.2.11-build.1'
api 'io.agora.rtc:agora-special-full:4.3.2.11'
api 'io.agora.rtc:full-screen-sharing:4.3.2.11'
api 'io.agora.rtc:iris-rtc:4.3.2.234-build.1'
api 'io.agora.rtc:agora-special-full:4.3.2.234'
api 'io.agora.rtc:full-screen-sharing:4.3.2.234'
}
}

Expand Down
30 changes: 30 additions & 0 deletions android/src/main/cpp/third_party/include/agora_rtc/AgoraBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,14 @@ enum ERROR_CODE_TYPE {
ERR_PCMSEND_FORMAT = 200, // unsupport pcm format
ERR_PCMSEND_BUFFEROVERFLOW = 201, // buffer overflow, the pcm send rate too quickly

// 250~270 RDT error code
ERR_RDT_USER_NOT_EXIST = 250,
ERR_RDT_USER_NOT_READY = 251,
ERR_RDT_DATA_BLOCKED = 252,
ERR_RDT_CMD_EXCEED_LIMIT = 253,
ERR_RDT_DATA_EXCEED_LIMIT = 254,
ERR_RDT_ENCRYPTION = 255,

/// @cond
// signaling: 400~600
ERR_LOGIN_ALREADY_LOGIN = 428,
Expand Down Expand Up @@ -6266,6 +6274,28 @@ struct RecorderStreamInfo {
RecorderStreamInfo() : channelId(NULL), uid(0) {}
RecorderStreamInfo(const char* channelId, uid_t uid) : channelId(channelId), uid(uid) {}
};

/**
* Reliable Data Transmission Tunnel message type
*/
enum RdtStreamType {
RDT_STREAM_CMD, // Reliable; High priority; Limit 256 bytes per packet, 100 packets per second
RDT_STREAM_DATA, // Reliable; Low priority; Restricted by congestion control; Limit 128K bytes per packet
RDT_STREAM_COUNT,
};

/**
* Reliable Data Transmission tunnel state
*/
enum RdtState {
RDT_STATE_CLOSED, // initial or closed
RDT_STATE_OPENED, // opened and can send data
RDT_STATE_BLOCKED, // send buffer is full, can't send data, but can send cmd
RDT_STATE_PENDING, // reconnecting tunnel, can't send data
RDT_STATE_BROKEN, // rdt tunnel broken, will auto reset and rebuild tunnel
};


} // namespace rtc

namespace base {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2282,6 +2282,45 @@ class IRtcEngineEventHandler {
(void)cached;
}

/** Occurs when the local user receives the rdt data from the remote user.
*
* The SDK triggers this callback when the user receives the data stream that another user sends
* by calling the \ref agora::rtc::IRtcEngine::sendRdtMessage "sendRdtMessage" method.
*
* @param userId ID of the user who sends the data.
* @param type The RDT stream type
* @param data The sending data.
* @param length The length (byte) of the data.
*/
virtual void onRdtMessage(uid_t userId, RdtStreamType type, const char *data, size_t length) {
(void)userId;
(void)type;
(void)data;
(void)length;
};

/** Occurs when the RDT tunnel state changed
*
* @param userId ID of the user who sends the data.
* @param state The RDT tunnel state
*/
virtual void onRdtStateChanged(uid_t userId, RdtState state) {
(void)userId;
(void)state;
}

/** Occurs when the Media Control Message sent by others use sendMediaControlMessage
*
* @param userId ID of the user who sends the data.
* @param data The sending data.
* @param length The length (byte) of the data.
*/
virtual void onMediaControlMessage(uid_t userId, const char* data, size_t length) {
(void)userId;
(void)data;
(void)length;
}

/**
* Occurs when the token expires.
*
Expand Down Expand Up @@ -7669,6 +7708,27 @@ class IRtcEngine : public agora::base::IEngineBase {
*/
virtual int sendStreamMessage(int streamId, const char* data, size_t length) = 0;

/** Send Reliable message to remote uid in channel.
* @param uid remote user id.
* @param type Reliable Data Transmission tunnel message type.
* @param data The pointer to the sent data.
* @param length The length of the sent data.
* @return
* - 0: Success.
* - < 0: Failure.
*/
virtual int sendRdtMessage(uid_t uid, RdtStreamType type, const char *data, size_t length) = 0;

/** Send media control message
* @param uid Remote user id. In particular, if uid=0, the user is broadcast to the channel
* @param data The pointer to the sent data.
* @param length The length of the sent data, max 1024.
* @return
* - 0: Success.
* - < 0: Failure.
*/
virtual int sendMediaControlMessage(uid_t uid, const char* data, size_t length) = 0;

/** **DEPRECATED** Adds a watermark image to the local video or CDN live stream.
This method is not recommend, Use \ref agora::rtc::IRtcEngine::addVideoWatermark(const char* watermarkUrl, const WatermarkOptions& options) "addVideoWatermark"2 instead.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ class IRtcEngineEventHandlerEx : public IRtcEngineEventHandler {
using IRtcEngineEventHandler::onConnectionBanned;
using IRtcEngineEventHandler::onStreamMessage;
using IRtcEngineEventHandler::onStreamMessageError;
using IRtcEngineEventHandler::onRdtMessage;
using IRtcEngineEventHandler::onRdtStateChanged;
using IRtcEngineEventHandler::onMediaControlMessage;
using IRtcEngineEventHandler::onRequestToken;
using IRtcEngineEventHandler::onTokenPrivilegeWillExpire;
using IRtcEngineEventHandler::onLicenseValidationFailure;
Expand Down Expand Up @@ -661,6 +664,51 @@ class IRtcEngineEventHandlerEx : public IRtcEngineEventHandler {
(void)cached;
}

/** Occurs when the local user receives the rdt data from the remote user.
*
* The SDK triggers this callback when the user receives the data stream that another user sends
* by calling the \ref agora::rtc::IRtcEngine::sendRdtMessage "sendRdtMessage" method.
*
* @param connection The RtcConnection object.
* @param userId ID of the user who sends the data.
* @param type The RDT stream type
* @param data The sending data.
* @param length The length (byte) of the data.
*/
virtual void onRdtMessage(const RtcConnection& connection, uid_t userId, RdtStreamType type, const char *data, size_t length) {
(void)connection;
(void)userId;
(void)type;
(void)data;
(void)length;
}

/** Occurs when the RDT tunnel state changed
*
* @param connection The RtcConnection object.
* @param userId ID of the user who sends the data.
* @param state The RDT tunnel state
*/
virtual void onRdtStateChanged(const RtcConnection& connection, uid_t userId, RdtState state) {
(void)connection;
(void)userId;
(void)state;
}

/** Occurs when the Media Control Message sent by others use sendMediaControlMessage
*
* @param connection The RtcConnection object.
* @param userId ID of the user who sends the data.
* @param data The sending data.
* @param length The length (byte) of the data.
*/
virtual void onMediaControlMessage(const RtcConnection& connection, uid_t userId, const char* data, size_t length) {
(void)connection;
(void)userId;
(void)data;
(void)length;
}

/**
* Occurs when the token expires.
*
Expand Down Expand Up @@ -1690,6 +1738,30 @@ class IRtcEngineEx : public IRtcEngine {
* - < 0: Failure.
*/
virtual int sendStreamMessageEx(int streamId, const char* data, size_t length, const RtcConnection& connection) = 0;

/** Send Reliable message to remote uid in channel.
* @param uid Remote user id.
* @param type Reliable Data Transmission tunnel message type.
* @param data The pointer to the sent data.
* @param length The length of the sent data.
* @param connection The RtcConnection object.
* @return
* - 0: Success.
* - < 0: Failure.
*/
virtual int sendRdtMessageEx(uid_t uid, RdtStreamType type, const char *data, size_t length, const RtcConnection& connection) = 0;

/** Send media control message
* @param uid Remote user id. In particular, if uid=0, the user is broadcast to the channel
* @param data The pointer to the sent data.
* @param length The length of the sent data, max 1024.
* @param connection The RtcConnection object.
* @return
* - 0: Success.
* - < 0: Failure.
*/
virtual int sendMediaControlMessageEx(uid_t uid, const char *data, size_t length, const RtcConnection& connection) = 0;

/** Adds a watermark image to the local video.
This method adds a PNG watermark image to the local video in a live broadcast. Once the watermark image is added, all the audience in the channel (CDN audience included),
Expand Down
2 changes: 2 additions & 0 deletions example/lib/examples/advanced/index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import 'package:agora_rtc_engine_example/examples/advanced/spatial_audio_with_me
import 'package:agora_rtc_engine_example/examples/advanced/start_direct_cdn_streaming/start_direct_cdn_streaming.dart';
import 'package:agora_rtc_engine_example/examples/advanced/start_local_video_transcoder/start_local_video_transcoder.dart';
import 'package:agora_rtc_engine_example/examples/advanced/stream_message/stream_message.dart';
import 'package:agora_rtc_engine_example/examples/advanced/stream_rdt_message/stream_rdt_message.dart';
import 'package:agora_rtc_engine_example/examples/advanced/take_snapshot/take_snapshot.dart';
import 'package:flutter/foundation.dart';

Expand Down Expand Up @@ -53,6 +54,7 @@ final advanced = [
'widget': const SetVideoEncoderConfiguration()
},
{'name': 'StreamMessage', 'widget': const StreamMessage()},
if (!kIsWeb) {'name': 'StreamRdtMessage', 'widget': const StreamRdtMessage()},
if (!kIsWeb) {'name': 'VoiceChanger', 'widget': const VoiceChanger()},
if (!kIsWeb)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class _State extends State<PictureInPicture> with WidgetsBindingObserver {
@override
Future<void> didChangeAppLifecycleState(AppLifecycleState state) async {
super.didChangeAppLifecycleState(state);
if(Platform.isAndroid){
if (Platform.isAndroid) {
return;
}
if (state == AppLifecycleState.paused) {
Expand All @@ -70,7 +70,7 @@ class _State extends State<PictureInPicture> with WidgetsBindingObserver {

@override
Future<void> dispose() async {
if(Platform.isIOS){
if (Platform.isIOS) {
await _engine.stopPip();
}
WidgetsBinding.instance.removeObserver(this);
Expand Down Expand Up @@ -206,7 +206,7 @@ class _State extends State<PictureInPicture> with WidgetsBindingObserver {
}

Future<void> _leaveChannel() async {
if(Platform.isIOS){
if (Platform.isIOS) {
await _engine.stopPip();
}
await _engine.leaveChannel();
Expand Down
Loading

0 comments on commit 458316d

Please sign in to comment.