Skip to content

Commit

Permalink
feat: Upgrade native sdk 4.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
littleGnAl committed Mar 19, 2024
1 parent d13024c commit 8e0b78e
Show file tree
Hide file tree
Showing 52 changed files with 1,765 additions and 91 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.0-build.2'
api 'io.agora.rtc:full-sdk:4.3.0'
api 'io.agora.rtc:full-screen-sharing:4.3.0'
api 'io.agora.rtc:iris-rtc:4.3.1-dev.6'
api 'io.agora.rtc:agora-full-preview:4.3.1-dev.6'
api 'io.agora.rtc:full-screen-sharing-special:4.3.1-dev.6'
}
}

Expand Down
90 changes: 82 additions & 8 deletions android/src/main/cpp/third_party/include/agora_rtc/AgoraBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -636,14 +636,19 @@ enum ERROR_CODE_TYPE {
*/
ERR_SET_CLIENT_ROLE_NOT_AUTHORIZED = 119,
/**
* 120: Decryption fails. The user may have tried to join the channel with a wrong
* 120: MediaStream decryption fails. The user may have tried to join the channel with a wrong
* password. Check your settings or try rejoining the channel.
*/
ERR_DECRYPTION_FAILED = 120,
/**
* 121: The user ID is invalid.
*/
ERR_INVALID_USER_ID = 121,
/**
* 122: DataStream decryption fails. The peer may have tried to join the channel with a wrong
* password, or did't enable datastream encryption
*/
ERR_DATASTREAM_DECRYPTION_FAILED = 122,
/**
* 123: The app is banned by the server.
*/
Expand Down Expand Up @@ -1567,7 +1572,8 @@ struct EncodedVideoFrameInfo {
trackId(0),
captureTimeMs(0),
decodeTimeMs(0),
streamType(VIDEO_STREAM_HIGH) {}
streamType(VIDEO_STREAM_HIGH),
presentationMs(-1) {}

EncodedVideoFrameInfo(const EncodedVideoFrameInfo& rhs)
: uid(rhs.uid),
Expand All @@ -1580,7 +1586,8 @@ struct EncodedVideoFrameInfo {
trackId(rhs.trackId),
captureTimeMs(rhs.captureTimeMs),
decodeTimeMs(rhs.decodeTimeMs),
streamType(rhs.streamType) {}
streamType(rhs.streamType),
presentationMs(rhs.presentationMs) {}

EncodedVideoFrameInfo& operator=(const EncodedVideoFrameInfo& rhs) {
if (this == &rhs) return *this;
Expand All @@ -1595,6 +1602,7 @@ struct EncodedVideoFrameInfo {
captureTimeMs = rhs.captureTimeMs;
decodeTimeMs = rhs.decodeTimeMs;
streamType = rhs.streamType;
presentationMs = rhs.presentationMs;
return *this;
}

Expand Down Expand Up @@ -1646,6 +1654,8 @@ struct EncodedVideoFrameInfo {
*/
VIDEO_STREAM_TYPE streamType;

// @technical preview
int64_t presentationMs;
};

/**
Expand Down Expand Up @@ -2639,6 +2649,27 @@ enum CAPTURE_BRIGHTNESS_LEVEL_TYPE {
CAPTURE_BRIGHTNESS_LEVEL_DARK = 2,
};

enum CAMERA_STABILIZATION_MODE {
/** The camera stabilization mode is disabled.
*/
CAMERA_STABILIZATION_MODE_OFF = -1,
/** device choose stabilization mode automatically.
*/
CAMERA_STABILIZATION_MODE_AUTO = 0,
/** stabilization mode level 1.
*/
CAMERA_STABILIZATION_MODE_LEVEL_1 = 1,
/** stabilization mode level 2.
*/
CAMERA_STABILIZATION_MODE_LEVEL_2 = 2,
/** stabilization mode level 3.
*/
CAMERA_STABILIZATION_MODE_LEVEL_3 = 3,
/** The maximum level of the camera stabilization mode.
*/
CAMERA_STABILIZATION_MODE_MAX_LEVEL = CAMERA_STABILIZATION_MODE_LEVEL_3,
};

/**
* Local audio states.
*/
Expand Down Expand Up @@ -2792,6 +2823,16 @@ enum LOCAL_VIDEO_STREAM_REASON {
* Check whether the ID of the video device is valid.
*/
LOCAL_VIDEO_STREAM_REASON_DEVICE_INVALID_ID = 10,
/**
* 14: (Android only) Video capture was interrupted, possibly due to the camera being occupied
* or some policy reasons such as background termination.
*/
LOCAL_VIDEO_STREAM_REASON_DEVICE_INTERRUPT = 14,
/**
* 15: (Android only) The device may need to be shut down and restarted to restore camera function,
* or there may be a persistent hardware problem.
*/
LOCAL_VIDEO_STREAM_REASON_DEVICE_FATAL_ERROR = 15,
/**
* 101: The current video capture device is unavailable due to excessive system pressure.
*/
Expand Down Expand Up @@ -2835,7 +2876,7 @@ enum LOCAL_VIDEO_STREAM_REASON {
LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_WINDOW_HIDDEN = 25,
/** 26: (Windows only) The local screen capture window is recovered from its hidden state. */
LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_HIDDEN = 26,
/** 27:(Windows only) The window is recovered from miniminzed */
/** 27: (Windows and macOS only) The window is recovered from miniminzed */
LOCAL_VIDEO_STREAM_REASON_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_MINIMIZED = 27,
/**
* 28: The screen capture paused.
Expand Down Expand Up @@ -2924,6 +2965,14 @@ enum REMOTE_AUDIO_STATE_REASON
* 7: The remote user leaves the channel.
*/
REMOTE_AUDIO_REASON_REMOTE_OFFLINE = 7,
/**
* 8: The local user does not receive any audio packet from remote user.
*/
REMOTE_AUDIO_REASON_NO_PACKET_RECEIVE = 8,
/**
* 9: The local user receives remote audio packet but fails to play.
*/
REMOTE_AUDIO_REASON_LOCAL_PLAY_FAILED = 9,
};

/**
Expand Down Expand Up @@ -4686,6 +4735,7 @@ enum VOICE_BEAUTIFIER_PRESET {
* - `ROOM_ACOUSTICS_PHONOGRAPH`
* - `ROOM_ACOUSTICS_SPACIAL`
* - `ROOM_ACOUSTICS_ETHEREAL`
* - `ROOM_ACOUSTICS_CHORUS`
* - `VOICE_CHANGER_EFFECT_UNCLE`
* - `VOICE_CHANGER_EFFECT_OLDMAN`
* - `VOICE_CHANGER_EFFECT_BOY`
Expand Down Expand Up @@ -4747,6 +4797,14 @@ enum AUDIO_EFFECT_PRESET {
* setting this enumerator.
*/
ROOM_ACOUSTICS_VIRTUAL_SURROUND_SOUND = 0x02010900,
/** The voice effect for chorus.
*
* @note: To achieve better audio effect quality, Agora recommends calling \ref
* IRtcEngine::setAudioProfile "setAudioProfile" and setting the `profile` parameter to
* `AUDIO_PROFILE_MUSIC_HIGH_QUALITY(4)` or `AUDIO_PROFILE_MUSIC_HIGH_QUALITY_STEREO(5)` before
* setting this enumerator.
*/
ROOM_ACOUSTICS_CHORUS = 0x02010D00,
/** A middle-aged man's voice.
*
* @note
Expand Down Expand Up @@ -5534,10 +5592,13 @@ struct EncryptionConfig {
* In this case, ensure that this parameter is not 0.
*/
uint8_t encryptionKdfSalt[32];

bool datastreamEncryptionEnabled;

EncryptionConfig()
: encryptionMode(AES_128_GCM2),
encryptionKey(OPTIONAL_NULLPTR)
encryptionKey(OPTIONAL_NULLPTR),
datastreamEncryptionEnabled(false)
{
memset(encryptionKdfSalt, 0, sizeof(encryptionKdfSalt));
}
Expand Down Expand Up @@ -5577,13 +5638,21 @@ enum ENCRYPTION_ERROR_TYPE {
*/
ENCRYPTION_ERROR_INTERNAL_FAILURE = 0,
/**
* 1: Decryption errors. Ensure that the receiver and the sender use the same encryption mode and key.
* 1: MediaStream decryption errors. Ensure that the receiver and the sender use the same encryption mode and key.
*/
ENCRYPTION_ERROR_DECRYPTION_FAILURE = 1,
/**
* 2: Encryption errors.
* 2: MediaStream encryption errors.
*/
ENCRYPTION_ERROR_ENCRYPTION_FAILURE = 2,
/**
* 3: DataStream decryption errors. Ensure that the receiver and the sender use the same encryption mode and key.
*/
ENCRYPTION_ERROR_DATASTREAM_DECRYPTION_FAILURE = 3,
/**
* 4: DataStream encryption errors.
*/
ENCRYPTION_ERROR_DATASTREAM_ENCRYPTION_FAILURE = 4,
};

enum UPLOAD_ERROR_REASON
Expand Down Expand Up @@ -5717,7 +5786,12 @@ enum EAR_MONITORING_FILTER_TYPE {
/**
* 4: Enable noise suppression to the in-ear monitor.
*/
EAR_MONITORING_FILTER_NOISE_SUPPRESSION = (1<<2)
EAR_MONITORING_FILTER_NOISE_SUPPRESSION = (1<<2),
/**
* 32768: Enable audio filters by reuse post-processing filter to the in-ear monitor.
* This bit is intended to be used in exclusive mode, which means, if this bit is set, all other bits will be disregarded.
*/
EAR_MONITORING_FILTER_REUSE_POST_PROCESSING_FILTER = (1<<15),
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ enum VIDEO_SOURCE_TYPE {
/** Video for fourth screen sharing.
*/
VIDEO_SOURCE_SCREEN_FOURTH = 14,
/** Video for voice drive.
*/
VIDEO_SOURCE_SPEECH_DRIVEN = 15,

VIDEO_SOURCE_UNKNOWN = 100
};
Expand Down Expand Up @@ -242,6 +245,10 @@ enum MEDIA_SOURCE_TYPE {
* 12: Video for transcoded.
*/
TRANSCODED_VIDEO_SOURCE = 12,
/**
* 13: Video for voice drive.
*/
SPEECH_DRIVEN_VIDEO_SOURCE = 13,
/**
* 100: Internal Usage only.
*/
Expand Down Expand Up @@ -510,6 +517,10 @@ enum VIDEO_PIXEL_FORMAT {
* 17: ID3D11Texture2D, only support DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_TYPELESS, DXGI_FORMAT_NV12 texture format
*/
VIDEO_TEXTURE_ID3D11TEXTURE2D = 17,
/**
* 18: I010. 10bit I420 data.
*/
VIDEO_PIXEL_I010 = 18,
};

/**
Expand Down Expand Up @@ -587,6 +598,7 @@ struct ExternalVideoFrame {
metadata_buffer(NULL),
metadata_size(0),
alphaBuffer(NULL),
fillAlphaBuffer(false),
d3d11_texture_2d(NULL),
texture_slice_index(0){}

Expand Down Expand Up @@ -705,11 +717,18 @@ struct ExternalVideoFrame {
*/
int metadata_size;
/**
* Indicates the output data of the portrait segmentation algorithm, which is consistent with the size of the video frame.
* The value range of each pixel is [0,255], where 0 represents the background; 255 represents the foreground (portrait).
* The default value is NULL
* Indicates the alpha channel of current frame, which is consistent with the dimension of the video frame.
* The value range of each pixel is [0,255], where 0 represents the background; 255 represents the foreground.
* The default value is NULL.
* @technical preview
*/
uint8_t* alphaBuffer;
/**
* Extract alphaBuffer from bgra or rgba data. Set it true if you do not explicitly specify the alphabuffer.
* The default value is false
* @technical preview
*/
bool fillAlphaBuffer;

/**
* [For Windows only] The pointer of ID3D11Texture2D used by the video frame.
Expand Down Expand Up @@ -827,9 +846,10 @@ struct VideoFrame {
*/
float matrix[16];
/**
* Indicates the output data of the portrait segmentation algorithm, which is consistent with the size of the video frame.
* The value range of each pixel is [0,255], where 0 represents the background; 255 represents the foreground (portrait).
* The default value is NULL
* Indicates the alpha channel of current frame, which is consistent with the dimension of the video frame.
* The value range of each pixel is [0,255], where 0 represents the background; 255 represents the foreground.
* The default value is NULL.
* @technical preview
*/
uint8_t* alphaBuffer;
/**
Expand Down Expand Up @@ -981,6 +1001,10 @@ class IAudioFrameObserverBase {
* The number of the audio track.
*/
int audioTrackNumber;
/**
* RTP timestamp of the first sample in the audio frame
*/
uint32_t rtpTimestamp;

AudioFrame() : type(FRAME_TYPE_PCM16),
samplesPerChannel(0),
Expand All @@ -991,7 +1015,8 @@ class IAudioFrameObserverBase {
renderTimeMs(0),
avsync_type(0),
presentationMs(0),
audioTrackNumber(0) {}
audioTrackNumber(0),
rtpTimestamp(0) {}
};

enum AUDIO_FRAME_POSITION {
Expand Down Expand Up @@ -1609,6 +1634,21 @@ struct MediaRecorderConfiguration {
MediaRecorderConfiguration() : storagePath(NULL), containerFormat(FORMAT_MP4), streamType(STREAM_TYPE_BOTH), maxDurationMs(120000), recorderInfoUpdateInterval(0) {}
MediaRecorderConfiguration(const char* path, MediaRecorderContainerFormat format, MediaRecorderStreamType type, int duration, int interval) : storagePath(path), containerFormat(format), streamType(type), maxDurationMs(duration), recorderInfoUpdateInterval(interval) {}
};

class IFaceInfoObserver {
public:
/**
* Occurs when the face info is received.
* @param outFaceInfo The output face info.
* @return
* - true: The face info is valid.
* - false: The face info is invalid.
*/
virtual bool onFaceInfo(const char* outFaceInfo) = 0;

virtual ~IFaceInfoObserver() {}
};

/**
* Information for the recording file.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,21 @@ class IMediaEngine {
* - < 0: Failure.
*/
virtual int registerVideoEncodedFrameObserver(IVideoEncodedFrameObserver* observer) = 0;

/**
* Registers a face info observer object.
*
* @note
* Ensure that you call this method before \ref IRtcEngine::joinChannel "joinChannel".
*
* @param observer A pointer to the face info observer object: IFaceInfoObserver.
*
* @return
* - 0: Success.
* - < 0: Failure.
*/
virtual int registerFaceInfoObserver(IFaceInfoObserver* observer) = 0;

/**
* Pushes the external audio data to the app.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@
/**
* set the video codec type, such as "H264", "JPEG"
*/
#define KEY_RTC_VIDEO_CODEC_TYPE "engine.video.codec_type"
#define KEY_RTC_VIDEO_MINOR_STREAM_CODEC_INDEX "engine.video.minor_stream_codec_index"
#define KEY_RTC_VIDEO_CODEC_INDEX "che.video.videoCodecIndex"
/**
Expand Down
Loading

0 comments on commit 8e0b78e

Please sign in to comment.