Skip to content

Commit 42cb3ef

Browse files
author
xianing
committed
fix android mpk issues
1 parent 53cd27f commit 42cb3ef

6 files changed

Lines changed: 4132 additions & 1925 deletions

File tree

Android/APIExample/app/src/main/java/io/agora/api/example/examples/advanced/MediaPlayerKit.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -564,13 +564,15 @@ public void run() {
564564
@Override
565565
public void onDestroy() {
566566
super.onDestroy();
567-
/**leaveChannel and Destroy the RtcEngine instance*/
568-
agoraMediaPlayerKit.destroy();
569567
if (engine != null) {
570-
engine.leaveChannel();
568+
/**leaveChannel and Destroy the RtcEngine instance*/
569+
if (joined) {
570+
engine.leaveChannel();
571+
}
572+
agoraMediaPlayerKit.destroy();
573+
handler.post(RtcEngine::destroy);
574+
engine = null;
571575
}
572-
handler.post(RtcEngine::destroy);
573-
engine = null;
574576
}
575577

576578
}

Android/APIExample/lib-player-helper/src/main/cpp/include/AgoraBase.h

Lines changed: 37 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
#include <stdlib.h>
1414

1515
#if defined(_WIN32)
16+
#ifndef WIN32_LEAN_AND_MEAN
1617
#define WIN32_LEAN_AND_MEAN
18+
#endif
1719
#include <windows.h>
1820
#define AGORA_CALL __cdecl
1921
#if defined(AGORARTC_EXPORT)
@@ -38,6 +40,20 @@
3840
#define AGORA_CALL
3941
#endif
4042

43+
#ifdef __GNUC__
44+
#define AGORA_GCC_VERSION_AT_LEAST(x, y) (__GNUC__ > (x) || __GNUC__ == (x) && __GNUC_MINOR__ >= (y))
45+
#else
46+
#define AGORA_GCC_VERSION_AT_LEAST(x, y) 0
47+
#endif
48+
49+
#if AGORA_GCC_VERSION_AT_LEAST(3, 1)
50+
#define AGORA_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
51+
#elif defined(_MSC_VER)
52+
#define AGORA_DEPRECATED_ATTRIBUTE
53+
#else
54+
#define AGORA_DEPRECATED_ATTRIBUTE
55+
#endif
56+
4157
namespace agora {
4258
namespace util {
4359

@@ -220,6 +236,9 @@ enum WARN_CODE_TYPE {
220236
/** 1053: Audio Processing Module: A residual echo is detected, which may be caused by the belated scheduling of system threads or the signal overflow.
221237
*/
222238
WARN_APM_RESIDUAL_ECHO = 1053,
239+
/** 1054: Audio Processing Module: AI NS is closed, this can be triggered by manual settings or by performance detection modules.
240+
*/
241+
WARN_APM_AINS_CLOSED = 1054,
223242
/// @cond
224243
WARN_ADM_WIN_CORE_NO_RECORDING_DEVICE = 1322,
225244
/// @endcond
@@ -234,13 +253,13 @@ enum WARN_CODE_TYPE {
234253
* - Update the sound card drive.
235254
*/
236255
WARN_ADM_WIN_CORE_IMPROPER_CAPTURE_RELEASE = 1324,
237-
/** 1610: The origin resolution of the remote video is beyond the range where the super-resolution algorithm can be applied.
256+
/** 1610: The original resolution of the remote user's video is beyond the range where super resolution can be applied.
238257
*/
239258
WARN_SUPER_RESOLUTION_STREAM_OVER_LIMITATION = 1610,
240-
/** 1611: Another user is already using the super-resolution algorithm.
259+
/** 1611: Super resolution is already being used to boost another remote user's video.
241260
*/
242261
WARN_SUPER_RESOLUTION_USER_COUNT_OVER_LIMITATION = 1611,
243-
/** 1612: The device does not support the super-resolution algorithm.
262+
/** 1612: The device does not support using super resolution.
244263
*/
245264
WARN_SUPER_RESOLUTION_DEVICE_NOT_SUPPORTED = 1612,
246265
/// @cond
@@ -411,7 +430,6 @@ enum ERROR_CODE_TYPE {
411430
ERR_ENCRYPTED_STREAM_NOT_ALLOWED_PUBLISH = 130,
412431
/** 134: The user account is invalid. */
413432
ERR_INVALID_USER_ACCOUNT = 134,
414-
415433
/** 151: CDN related errors. Remove the original URL address and add a new one by calling the \ref agora::rtc::IRtcEngine::removePublishStreamUrl "removePublishStreamUrl" and \ref agora::rtc::IRtcEngine::addPublishStreamUrl "addPublishStreamUrl" methods.
416434
*/
417435
ERR_PUBLISH_STREAM_CDN_ERROR = 151,
@@ -436,16 +454,13 @@ enum ERROR_CODE_TYPE {
436454
*
437455
*/
438456
ERR_MODULE_NOT_FOUND = 157,
439-
/// @cond
440-
/** 158: The dynamical library for the super-resolution algorithm is not integrated.
441-
* When you call the \ref agora::rtc::IRtcEngine::enableRemoteSuperResolution "enableRemoteSuperResolution" method but
442-
* do not integrate the dynamical library for the super-resolution algorithm
443-
* into your project, the SDK reports this error code.
444-
*/
445-
ERR_MODULE_SUPER_RESOLUTION_NOT_FOUND = 158,
446-
/// @endcond
447457

448-
/** 160: The recording operation has been performed.
458+
/** 160: The client is already recording audio. To start a new recording,
459+
* call \ref agora::rtc::IRtcEngine::stopAudioRecording "stopAudioRecording" to stop
460+
* the current recording first, and then
461+
* call \ref agora::rtc::IRtcEngine::startAudioRecording(const AudioRecordingConfiguration&) "startAudioRecording".
462+
*
463+
* @since v3.4.0
449464
*/
450465
ERR_ALREADY_IN_RECORDING = 160,
451466

@@ -708,10 +723,11 @@ enum ERROR_CODE_TYPE {
708723
ERR_ADM_NO_PLAYOUT_DEVICE = 1360,
709724

710725
// VDM error code starts from 1500
711-
726+
/// @cond
712727
/** 1500: Video Device Module: There is no camera device.
713728
*/
714729
ERR_VDM_CAMERA_NO_DEVICE = 1500,
730+
/// @endcond
715731

716732
/** 1501: Video Device Module: The camera is unauthorized.
717733
*/
@@ -735,6 +751,12 @@ enum ERROR_CODE_TYPE {
735751
/** 1603: Video Device Module: An error occurs in setting the video encoder.
736752
*/
737753
ERR_VCM_ENCODER_SET_ERROR = 1603,
754+
/** 1735: (Windows only) The Windows Audio service is disabled. You need to
755+
* either enable the Windows Audio service or restart the device.
756+
*
757+
* @since v3.5.0
758+
*/
759+
ERR_ADM_WIN_CORE_SERVRE_SHUT_DOWN = 1735,
738760
};
739761

740762
/** Output log filter level. */
@@ -764,7 +786,7 @@ enum LOG_FILTER_TYPE {
764786
* @since v3.3.0
765787
*/
766788
enum class LOG_LEVEL {
767-
/** 0: Do not output any log. */
789+
/** 0x0000: Do not output any log. */
768790
LOG_LEVEL_NONE = 0x0000,
769791
/** 0x0001: (Default) Output logs of the FATAL, ERROR, WARN and INFO level. We recommend setting your log filter as this level.
770792
*/

0 commit comments

Comments
 (0)