Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upgrade native sdk 4.3.2.10 #2135

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.5-build.4'
api 'io.agora.rtc:agora-special-full:4.3.2.6'
api 'io.agora.rtc:full-screen-sharing:4.3.2.6'
api 'io.agora.rtc:iris-rtc:4.3.2.10-build.1'
api 'io.agora.rtc:agora-special-full:4.3.2.10'
api 'io.agora.rtc:full-screen-sharing:4.3.2.10'
}
}

Expand Down
22 changes: 20 additions & 2 deletions android/src/main/cpp/third_party/include/agora_rtc/AgoraBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -4767,6 +4767,12 @@ enum AUDIO_TRACK_TYPE {
* Compare to mixable stream, you can have lower lantency using direct audio track.
*/
AUDIO_TRACK_DIRECT = 1,
/**
* 2: Extenal AEC reference audio track
* When all playback audio is handled outside SDK, but AEC is expected working.
* Used this track to push audio frame for AEC reference.
*/
AUDIO_TRACK_EXTERNAL_AEC_REFERENCE = 3,
};

/** The configuration of custom audio track
Expand All @@ -4778,9 +4784,21 @@ struct AudioTrackConfig {
* false: Do not enable local playback
*/
bool enableLocalPlayback;

/**
* Enable APM processing
* false: AUDIO_TRACK_DIRECT is default false
* true: AUDIO_TRACK_DIRECT would process by APM(AEC/ANS/AGC)
*/
bool enableAudioProcessing;
/**
* Only for direct audio track
* Send to encoder directly without any pipeline processing.
* false: default value, use default process and callback etc.
* true: ultra simple mode, neither APM or pipeline using.
*/
bool enableDirectPublish;
AudioTrackConfig()
: enableLocalPlayback(true) {}
: enableLocalPlayback(true),enableAudioProcessing(false),enableDirectPublish(false) {}
};

/**
Expand Down
140 changes: 72 additions & 68 deletions android/src/main/cpp/third_party/include/agora_rtc/AgoraMediaBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,74 +254,6 @@ enum MEDIA_SOURCE_TYPE {
*/
UNKNOWN_MEDIA_SOURCE = 100
};
/** Definition of contentinspect
*/
#define MAX_CONTENT_INSPECT_MODULE_COUNT 32
enum CONTENT_INSPECT_RESULT {
CONTENT_INSPECT_NEUTRAL = 1,
CONTENT_INSPECT_SEXY = 2,
CONTENT_INSPECT_PORN = 3,
};

enum CONTENT_INSPECT_TYPE {
/**
* (Default) content inspect type invalid
*/
CONTENT_INSPECT_INVALID = 0,
/**
* @deprecated
* Content inspect type moderation
*/
CONTENT_INSPECT_MODERATION __deprecated = 1,
/**
* Content inspect type supervise
*/
CONTENT_INSPECT_SUPERVISION = 2,
/**
* Content inspect type image moderation
*/
CONTENT_INSPECT_IMAGE_MODERATION = 3
};

struct ContentInspectModule {
/**
* The content inspect module type.
*/
CONTENT_INSPECT_TYPE type;
/**The content inspect frequency, default is 0 second.
* the frequency <= 0 is invalid.
*/
unsigned int interval;
ContentInspectModule() {
type = CONTENT_INSPECT_INVALID;
interval = 0;
}
};
/** Definition of ContentInspectConfig.
*/
struct ContentInspectConfig {
const char* extraInfo;
/**
* The specific server configuration for image moderation. Please contact technical support.
*/
const char* serverConfig;
/**The content inspect modules, max length of modules is 32.
* the content(snapshot of send video stream, image) can be used to max of 32 types functions.
*/
ContentInspectModule modules[MAX_CONTENT_INSPECT_MODULE_COUNT];
/**The content inspect module count.
*/
int moduleCount;
ContentInspectConfig& operator=(const ContentInspectConfig& rth)
{
extraInfo = rth.extraInfo;
serverConfig = rth.serverConfig;
moduleCount = rth.moduleCount;
memcpy(&modules, &rth.modules, MAX_CONTENT_INSPECT_MODULE_COUNT * sizeof(ContentInspectModule));
return *this;
}
ContentInspectConfig() :extraInfo(NULL), serverConfig(NULL), moduleCount(0){}
};

namespace base {

Expand Down Expand Up @@ -916,6 +848,78 @@ enum VIDEO_MODULE_POSITION {

} // namespace base

/** Definition of contentinspect
*/
#define MAX_CONTENT_INSPECT_MODULE_COUNT 32
enum CONTENT_INSPECT_RESULT {
CONTENT_INSPECT_NEUTRAL = 1,
CONTENT_INSPECT_SEXY = 2,
CONTENT_INSPECT_PORN = 3,
};

enum CONTENT_INSPECT_TYPE {
/**
* (Default) content inspect type invalid
*/
CONTENT_INSPECT_INVALID = 0,
/**
* @deprecated
* Content inspect type moderation
*/
CONTENT_INSPECT_MODERATION __deprecated = 1,
/**
* Content inspect type supervise
*/
CONTENT_INSPECT_SUPERVISION = 2,
/**
* Content inspect type image moderation
*/
CONTENT_INSPECT_IMAGE_MODERATION = 3
};

struct ContentInspectModule {
/**
* The content inspect module type.
*/
CONTENT_INSPECT_TYPE type;
/**The content inspect frequency, default is 0 second.
* the frequency <= 0 is invalid.
*/
unsigned int interval;
/**
* The position of the video observation. See VIDEO_MODULE_POSITION.
*/
base::VIDEO_MODULE_POSITION position;
ContentInspectModule() {
type = CONTENT_INSPECT_INVALID;
interval = 0;
position = base::POSITION_PRE_ENCODER;
}
};
/** Definition of ContentInspectConfig.
*/
struct ContentInspectConfig {
const char* extraInfo;
/**
* The specific server configuration for image moderation. Please contact technical support.
*/
const char* serverConfig;
/**The content inspect modules, max length of modules is 32.
* the content(snapshot of send video stream, image) can be used to max of 32 types functions.
*/
ContentInspectModule modules[MAX_CONTENT_INSPECT_MODULE_COUNT];
/**The content inspect module count.
*/
int moduleCount;
ContentInspectConfig& operator=(const ContentInspectConfig& rth) {
extraInfo = rth.extraInfo;
serverConfig = rth.serverConfig;
moduleCount = rth.moduleCount;
memcpy(&modules, &rth.modules, MAX_CONTENT_INSPECT_MODULE_COUNT * sizeof(ContentInspectModule));
return *this;
}
ContentInspectConfig() : extraInfo(NULL), serverConfig(NULL), moduleCount(0) {}
};
/** Definition of SnapshotConfig.
*/
struct SnapshotConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,14 @@ enum AUDIO_MIXING_REASON_TYPE {
AUDIO_MIXING_REASON_TOO_FREQUENT_CALL = 702,
/** 703: The audio mixing file playback is interrupted. */
AUDIO_MIXING_REASON_INTERRUPTED_EOF = 703,
/** 715: The audio mixing file is played once. */
/** 721: The audio mixing file is played once. */
AUDIO_MIXING_REASON_ONE_LOOP_COMPLETED = 721,
/** 716: The audio mixing file is all played out. */
/** 723: The audio mixing file is all played out. */
AUDIO_MIXING_REASON_ALL_LOOPS_COMPLETED = 723,
/** 716: The audio mixing file stopped by user */
/** 724: The audio mixing file stopped by user */
AUDIO_MIXING_REASON_STOPPED_BY_USER = 724,
/** 726: The audio mixing playback has resumed by user */
AUDIO_MIXING_REASON_RESUMED_BY_USER = 726,
/** 0: The SDK can open the audio mixing file. */
AUDIO_MIXING_REASON_OK = 0,
};
Expand Down Expand Up @@ -436,6 +438,16 @@ struct RemoteAudioStats
*/
uint32_t plcCount;

/**
* The number of times the remote audio stream has experienced freezing.
*/
uint32_t frozenCntByCustom;

/**
* The total duration (ms) that the remote audio stream has been in a frozen state.
*/
uint32_t frozenTimeByCustom;

/**
* The total time (ms) when the remote user neither stops sending the audio
* stream nor disables the audio module after joining the channel.
Expand Down Expand Up @@ -476,6 +488,8 @@ struct RemoteAudioStats
mosValue(0),
frozenRateByCustomPlcCount(0),
plcCount(0),
frozenCntByCustom(0),
frozenTimeByCustom(0),
totalActiveTime(0),
publishDuration(0),
qoeQuality(0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2096,6 +2096,73 @@ class IRtcEngineEx : public IRtcEngine {
* @technical preview
*/
virtual int sendAudioMetadataEx(const RtcConnection& connection, const char* metadata, size_t length) = 0;

/** Preloads a specified audio effect.
*
* This method preloads only one specified audio effect into the memory each time
* it is called. To preload multiple audio effects, call this method multiple times.
*
* After preloading, you can call \ref IRtcEngine::playEffect "playEffect"
* to play the preloaded audio effect or call
* \ref IRtcEngine::playAllEffects "playAllEffects" to play all the preloaded
* audio effects.
*
* @note
* - To ensure smooth communication, limit the size of the audio effect file.
* - Agora recommends calling this method before joining the channel.
*
* @param connection The RtcConnection object.
* @param soundId The ID of the audio effect.
* @param filePath The absolute path of the local audio effect file or the URL
* of the online audio effect file. Supported audio formats: mp3, mp4, m4a, aac,
* 3gp, mkv, and wav.
*
* @return
* - 0: Success.
* - < 0: Failure.
*/
virtual int preloadEffectEx(const RtcConnection& connection, int soundId, const char* filePath, int startPos = 0) = 0;

/** Plays a specified audio effect.
*
*
* This method plays only one specified audio effect each time it is called.
* To play multiple audio effects, call this method multiple times.
*
* @note
* - Agora recommends playing no more than three audio effects at the same time.
* - The ID and file path of the audio effect in this method must be the same
* as that in the \ref IRtcEngine::preloadEffect "preloadEffect" method.
*
* @param connection The RtcConnection object.
* @param soundId The ID of the audio effect.
* @param filePath The absolute path of the local audio effect file or the URL
* of the online audio effect file. Supported audio formats: mp3, mp4, m4a, aac,
* 3gp, mkv, and wav.
* @param loopCount The number of times the audio effect loops:
* - `-1`: Play the audio effect in an indefinite loop until
* \ref IRtcEngine::stopEffect "stopEffect" or
* \ref IRtcEngine::stopAllEffects "stopAllEffects"
* - `0`: Play the audio effect once.
* - `1`: Play the audio effect twice.
* @param pitch The pitch of the audio effect. The value ranges between 0.5 and 2.0.
* The default value is `1.0` (original pitch). The lower the value, the lower the pitch.
* @param pan The spatial position of the audio effect. The value ranges between -1.0 and 1.0:
* - `-1.0`: The audio effect displays to the left.
* - `0.0`: The audio effect displays ahead.
* - `1.0`: The audio effect displays to the right.
* @param gain The volume of the audio effect. The value ranges between 0 and 100.
* The default value is `100` (original volume). The lower the value, the lower
* the volume of the audio effect.
* @param publish Sets whether to publish the audio effect to the remote:
* - true: Publish the audio effect to the remote.
* - false: (Default) Do not publish the audio effect to the remote.
*
* @return
* - 0: Success.
* - < 0: Failure.
*/
virtual int playEffectEx(const RtcConnection& connection, int soundId, const char* filePath, int loopCount, double pitch, double pan, int gain, bool publish = false, int startPos = 0) = 0;
};

} // namespace rtc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class PictureInPicture extends StatefulWidget {
State<StatefulWidget> createState() => _State();
}

class _State extends State<PictureInPicture> with WidgetsBindingObserver{
class _State extends State<PictureInPicture> with WidgetsBindingObserver {
late final RtcEngine _engine;

bool isJoined = false;
Expand Down Expand Up @@ -49,22 +49,18 @@ class _State extends State<PictureInPicture> with WidgetsBindingObserver{
@override
Future<void> didChangeAppLifecycleState(AppLifecycleState state) async {
super.didChangeAppLifecycleState(state);
if (state == AppLifecycleState.paused) {
if (state == AppLifecycleState.paused) {
print("应用进入后台");
await _remotePipControllers.entries.first.value.startPictureInPicture(
const PipOptions(
contentWidth: 150,
contentHeight: 300,
autoEnterPip: true));
const PipOptions(
contentWidth: 150, contentHeight: 300, autoEnterPip: true));
} else if (state == AppLifecycleState.resumed) {
print("应用从后台返回前台");
await _remotePipControllers.entries.first.value.stopPictureInPicture();
await Future.delayed(const Duration(milliseconds: 500));
await _remotePipControllers.entries.first.value.startPictureInPicture(
const PipOptions(
contentWidth: 150,
contentHeight: 300,
autoEnterPip: true));
await _remotePipControllers.entries.first.value.stopPictureInPicture();
await Future.delayed(const Duration(milliseconds: 500));
await _remotePipControllers.entries.first.value.startPictureInPicture(
const PipOptions(
contentWidth: 150, contentHeight: 300, autoEnterPip: true));
}
}

Expand Down Expand Up @@ -125,15 +121,11 @@ class _State extends State<PictureInPicture> with WidgetsBindingObserver{
canvas: VideoCanvas(uid: rUid),
connection: RtcConnection(channelId: _controller.text),
));


});
await Future.delayed(const Duration(milliseconds: 500));
await _remotePipControllers.entries.first.value.startPictureInPicture(
const PipOptions(
contentWidth: 150,
contentHeight: 300,
autoEnterPip: true));
await Future.delayed(const Duration(milliseconds: 500));
await _remotePipControllers.entries.first.value.startPictureInPicture(
const PipOptions(
contentWidth: 150, contentHeight: 300, autoEnterPip: true));
},
onUserOffline:
(RtcConnection connection, int rUid, UserOfflineReasonType reason) {
Expand Down
Loading
Loading