diff --git a/android/build.gradle b/android/build.gradle index 5a22b2215..cd3c74b3e 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -57,9 +57,9 @@ dependencies { if (isDev(project)) { implementation fileTree(dir: "libs", include: ["*.jar"]) } else { - api 'io.agora.rtc:iris-rtc:4.2.3-build.3' - api 'io.agora.rtc:full-sdk:4.2.3' - api 'io.agora.rtc:full-screen-sharing:4.2.3' + api 'io.agora.rtc:iris-rtc:4.2.6-build.3' + api 'io.agora.rtc:full-sdk:4.2.6' + api 'io.agora.rtc:full-screen-sharing:4.2.6' } } diff --git a/android/src/main/cpp/iris_rtc_rendering_android.cc b/android/src/main/cpp/iris_rtc_rendering_android.cc index 4ee9f9f65..8f1dc93cb 100644 --- a/android/src/main/cpp/iris_rtc_rendering_android.cc +++ b/android/src/main/cpp/iris_rtc_rendering_android.cc @@ -271,112 +271,215 @@ class RenderingOp { std::shared_ptr gl_context_; }; -class OESTextureRendering final : public RenderingOp { - public: - explicit OESTextureRendering(std::shared_ptr &gl_context) - : RenderingOp(gl_context) { - LOGCATD("Rendering with OESTextureRendering"); - shader_ = std::make_unique(vertex_shader_tex_oes_, - frag_shader_tex_oes_); - GLuint program = shader_->GetProgram(); +class Texture2DRendering final : public RenderingOp { +public: + explicit Texture2DRendering(std::shared_ptr &gl_context) + : RenderingOp(gl_context) { + LOGCATD("Rendering with Texture2DRendering"); + shader_ = std::make_unique(vertex_shader_tex_2d_, frag_shader_tex_2d_); + GLuint program = shader_->GetProgram(); + + aPositionLoc_ = glGetAttribLocation(program, "a_Position"); + texCoordLoc_ = glGetAttribLocation(program, "a_TexCoord"); + texSamplerLoc_ = glGetUniformLocation(program, "s_texture"); + texMatrixLoc_ = glGetUniformLocation(program, "u_texMatrix"); + } + ~Texture2DRendering() override { + LOGCATD("Destroy Texture2DRendering"); + shader_.reset(); + } - aPositionLoc_ = glGetAttribLocation(program, "a_Position"); - texCoordLoc_ = glGetAttribLocation(program, "a_TexCoord"); - texSamplerLoc_ = glGetUniformLocation(program, "s_texture"); - texMatrixLoc_ = glGetUniformLocation(program, "u_texMatrix"); - } - ~OESTextureRendering() override { - LOGCATD("Destroy OESTextureRendering"); - shader_.reset(); - } + void Rendering(const agora::media::base::VideoFrame *video_frame) final { + int textureId = video_frame->textureId; + const float *texMatrix = video_frame->matrix; - void Rendering(const agora::media::base::VideoFrame *video_frame) final { - int textureId = video_frame->textureId; - const float *texMatrix = video_frame->matrix; + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); + CHECK_GL_ERROR() + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); + CHECK_GL_ERROR() - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); - CHECK_GL_ERROR() - glClearColor(0.0f, 0.0f, 0.0f, 1.0f); - CHECK_GL_ERROR() - glViewport(0, 0, video_frame->width, video_frame->height); - CHECK_GL_ERROR() + // Bind 2D texture + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_2D, textureId); + glUniform1i(texSamplerLoc_, 0); - // Bind external oes texture - glActiveTexture(GL_TEXTURE0); - glBindTexture(GL_TEXTURE_EXTERNAL_OES, textureId); - glUniform1i(texSamplerLoc_, 0); + glVertexAttribPointer(aPositionLoc_, 2, GL_FLOAT, false, 0, vertices); + glEnableVertexAttribArray(aPositionLoc_); - glVertexAttribPointer(aPositionLoc_, 2, GL_FLOAT, false, 0, vertices); - glEnableVertexAttribArray(aPositionLoc_); + glVertexAttribPointer(texCoordLoc_, 2, GL_FLOAT, false, 0, texCoords); + glEnableVertexAttribArray(texCoordLoc_); - glVertexAttribPointer(texCoordLoc_, 2, GL_FLOAT, false, 0, texCoords); - glEnableVertexAttribArray(texCoordLoc_); + // Copy the texture transformation matrix over. + glUniformMatrix4fv(texMatrixLoc_, 1, GL_FALSE, texMatrix); - // Copy the texture transformation matrix over. - glUniformMatrix4fv(texMatrixLoc_, 1, GL_FALSE, texMatrix); + glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indices); - glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indices); + gl_context_->Swap(); - gl_context_->Swap(); + // Clean up + glDisableVertexAttribArray(aPositionLoc_); + glDisableVertexAttribArray(texCoordLoc_); + glBindTexture(GL_TEXTURE_2D, 0); + } - // Clean up - glDisableVertexAttribArray(aPositionLoc_); - glDisableVertexAttribArray(texCoordLoc_); - glBindTexture(GL_TEXTURE_EXTERNAL_OES, 0); - } + agora::media::base::VIDEO_PIXEL_FORMAT Format() final { + return agora::media::base::VIDEO_PIXEL_FORMAT::VIDEO_TEXTURE_2D; + } - agora::media::base::VIDEO_PIXEL_FORMAT Format() final { - return agora::media::base::VIDEO_PIXEL_FORMAT::VIDEO_TEXTURE_OES; - } +private: + const GLchar *vertex_shader_tex_2d_ = + "attribute vec4 a_Position;\n" + "attribute vec2 a_TexCoord;\n" + "varying vec2 v_TexCoord;\n" + "uniform mat4 u_texMatrix; \n" + "void main() {\n" + " gl_Position = a_Position;\n" + " vec2 tmpTexCoord = vec2(a_TexCoord.x, 1.0 - a_TexCoord.y);\n" + " v_TexCoord = (u_texMatrix * vec4(tmpTexCoord, 0, 1)).xy; \n" + "}\n"; + + const GLchar *frag_shader_tex_2d_ = + "precision mediump float;\n" + "varying vec2 v_TexCoord;\n" + "uniform sampler2D s_texture;\n" + "void main() {\n" + " gl_FragColor = texture2D(s_texture, v_TexCoord);\n" + "}\n"; + + // clang-format off + const GLfloat vertices[8] = { + -1.0f, 1.0f, + -1.0f, -1.0f, + 1.0f, -1.0f, + 1.0f, 1.0f + }; + + const GLfloat texCoords[8] = { + 0.0f, 0.0f, + 0.0f, 1.0f, + 1.0f, 1.0f, + 1.0f, 0.0f + }; + + const GLushort indices[6] = { + 0, 1, 2, + 0, 2, 3 + };// draw in this order: 0,1,2; 0,2,3 + + // clang-format on + + GLint aPositionLoc_; + GLint texCoordLoc_; + GLint texMatrixLoc_; + GLint texSamplerLoc_; + std::unique_ptr shader_; +}; - private: - const GLchar *vertex_shader_tex_oes_ = - "attribute vec4 a_Position;\n" - "attribute vec2 a_TexCoord;\n" - "varying vec2 v_TexCoord;\n" - "uniform mat4 u_texMatrix; \n" - "void main() {\n" - " gl_Position = a_Position;\n" - " vec2 tmpTexCoord = vec2(a_TexCoord.x, 1.0 - a_TexCoord.y);\n" - " v_TexCoord = (u_texMatrix * vec4(tmpTexCoord, 0, 1)).xy; \n" - "}\n"; - const GLchar *frag_shader_tex_oes_ = - "#extension GL_OES_EGL_image_external : require\n" - "precision mediump float;\n" - "varying vec2 v_TexCoord;\n" - "uniform samplerExternalOES s_texture;\n" - "void main() {\n" - " gl_FragColor = texture2D(s_texture, v_TexCoord);\n" - "}\n"; +class OESTextureRendering final : public RenderingOp { +public: + explicit OESTextureRendering(std::shared_ptr &gl_context) + : RenderingOp(gl_context) { + LOGCATE("Rendering with OESTextureRendering"); + shader_ = std::make_unique(vertex_shader_tex_oes_, + frag_shader_tex_oes_); + GLuint program = shader_->GetProgram(); + + aPositionLoc_ = glGetAttribLocation(program, "a_Position"); + texCoordLoc_ = glGetAttribLocation(program, "a_TexCoord"); + texSamplerLoc_ = glGetUniformLocation(program, "s_texture"); + texMatrixLoc_ = glGetUniformLocation(program, "u_texMatrix"); + } + ~OESTextureRendering() override { + LOGCATD("Destroy OESTextureRendering"); + shader_.reset(); + } - // clang-format off - const GLfloat vertices[8] = { - -1.0f, 1.0f, - -1.0f, -1.0f, - 1.0f, -1.0f, - 1.0f, 1.0f - }; + void Rendering(const agora::media::base::VideoFrame *video_frame) final { + int textureId = video_frame->textureId; + const float *texMatrix = video_frame->matrix; - const GLfloat texCoords[8] = { - 0.0f, 0.0f, - 0.0f, 1.0f, - 1.0f, 1.0f, - 1.0f, 0.0f - }; + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); + CHECK_GL_ERROR() + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); + CHECK_GL_ERROR() - const GLushort indices[6] = { - 0, 1, 2, - 0, 2, 3 - };// draw in this order: 0,1,2; 0,2,3 + // Bind external oes texture + glActiveTexture(GL_TEXTURE0); + glBindTexture(GL_TEXTURE_EXTERNAL_OES, textureId); + glUniform1i(texSamplerLoc_, 0); - // clang-format on + glVertexAttribPointer(aPositionLoc_, 2, GL_FLOAT, false, 0, vertices); + glEnableVertexAttribArray(aPositionLoc_); - GLint aPositionLoc_; - GLint texCoordLoc_; - GLint texMatrixLoc_; - GLint texSamplerLoc_; - std::unique_ptr shader_; + glVertexAttribPointer(texCoordLoc_, 2, GL_FLOAT, false, 0, texCoords); + glEnableVertexAttribArray(texCoordLoc_); + + // Copy the texture transformation matrix over. + glUniformMatrix4fv(texMatrixLoc_, 1, GL_FALSE, texMatrix); + + glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, indices); + + gl_context_->Swap(); + + // Clean up + glDisableVertexAttribArray(aPositionLoc_); + glDisableVertexAttribArray(texCoordLoc_); + glBindTexture(GL_TEXTURE_EXTERNAL_OES, 0); + } + + agora::media::base::VIDEO_PIXEL_FORMAT Format() final { + return agora::media::base::VIDEO_PIXEL_FORMAT::VIDEO_TEXTURE_OES; + } + +private: + const GLchar *vertex_shader_tex_oes_ = + "attribute vec4 a_Position;\n" + "attribute vec2 a_TexCoord;\n" + "varying vec2 v_TexCoord;\n" + "uniform mat4 u_texMatrix; \n" + "void main() {\n" + " gl_Position = a_Position;\n" + " vec2 tmpTexCoord = vec2(a_TexCoord.x, 1.0 - a_TexCoord.y);\n" + " v_TexCoord = (u_texMatrix * vec4(tmpTexCoord, 0, 1)).xy; \n" + "}\n"; + + const GLchar *frag_shader_tex_oes_ = + "#extension GL_OES_EGL_image_external : require\n" + "precision mediump float;\n" + "varying vec2 v_TexCoord;\n" + "uniform samplerExternalOES s_texture;\n" + "void main() {\n" + " gl_FragColor = texture2D(s_texture, v_TexCoord);\n" + "}\n"; + + // clang-format off + const GLfloat vertices[8] = { + -1.0f, 1.0f, + -1.0f, -1.0f, + 1.0f, -1.0f, + 1.0f, 1.0f + }; + + const GLfloat texCoords[8] = { + 0.0f, 0.0f, + 0.0f, 1.0f, + 1.0f, 1.0f, + 1.0f, 0.0f + }; + + const GLushort indices[6] = { + 0, 1, 2, + 0, 2, 3 + };// draw in this order: 0,1,2; 0,2,3 + + // clang-format on + + GLint aPositionLoc_; + GLint texCoordLoc_; + GLint texMatrixLoc_; + GLint texSamplerLoc_; + std::unique_ptr shader_; }; class YUVRendering final : public RenderingOp { @@ -637,7 +740,9 @@ class NativeTextureRenderer final } if (!rendering_op_) { - if (video_frame->type + if (video_frame->type == agora::media::base::VIDEO_PIXEL_FORMAT::VIDEO_TEXTURE_2D) { + rendering_op_ = std::make_unique(gl_context_); + } else if (video_frame->type == agora::media::base::VIDEO_PIXEL_FORMAT::VIDEO_TEXTURE_OES) { rendering_op_ = std::make_unique(gl_context_); } else if (video_frame->type diff --git a/android/src/main/cpp/third_party/include/agora_rtc/AgoraBase.h b/android/src/main/cpp/third_party/include/agora_rtc/AgoraBase.h index fec6b312c..81580b034 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/AgoraBase.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/AgoraBase.h @@ -731,6 +731,10 @@ enum ERROR_CODE_TYPE { * 1501: Video Device Module: The camera is not authorized. */ ERR_VDM_CAMERA_NOT_AUTHORIZED = 1501, + /** + * 2007: Audio Device Module: An error occurs in starting the application loopback. + */ + ERR_ADM_APPLICATION_LOOPBACK = 2007, }; enum LICENSE_ERROR_TYPE { @@ -2784,6 +2788,22 @@ enum LOCAL_VIDEO_STREAM_ERROR { LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_FAILURE = 21, /** 22: No permision to capture screen. */ LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_NO_PERMISSION = 22, + /** + * 23: The screen capture paused. + * + * Common scenarios for reporting this error code: + * - When the desktop switch to the secure desktop such as UAC dialog or the Winlogon desktop on + * Windows platform, the SDK reports this error code. + */ + LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_PAUSED = 23, + /** 24: The screen capture is resumed. */ + LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_RESUMED = 24, + /** 25: (Windows only) The local screen capture window is currently hidden and not visible on the desktop. */ + LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_HIDDEN = 25, + /** 26: (Windows only) The local screen capture window is recovered from its hidden state. */ + LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_HIDDEN = 26, + /** 27:(Windows only) The window is recovered from miniminzed */ + LOCAL_VIDEO_STREAM_ERROR_SCREEN_CAPTURE_WINDOW_RECOVER_FROM_MINIMIZED = 27, }; /** @@ -3776,10 +3796,6 @@ struct LocalTranscoderConfiguration { }; enum VIDEO_TRANSCODER_ERROR { - /** - * No error - */ - VT_ERR_OK = 0, /** * The video track of the video source is not started. */ @@ -3998,6 +4014,10 @@ enum CONNECTION_CHANGED_REASON_TYPE * 21: The connection is failed due to license validation failure. */ CONNECTION_CHANGED_LICENSE_VALIDATION_FAILURE = 21, + /** + * 22: The connection is failed due to certification verify failure. + */ + CONNECTION_CHANGED_CERTIFICATION_VERYFY_FAILURE = 22, }; /** @@ -4108,6 +4128,10 @@ enum NETWORK_TYPE { * 5: The network type is mobile 4G. */ NETWORK_TYPE_MOBILE_4G = 5, + /** + * 6: The network type is mobile 5G. + */ + NETWORK_TYPE_MOBILE_5G = 6, }; /** @@ -5268,7 +5292,7 @@ struct ChannelMediaRelayConfiguration { */ ChannelMediaInfo *destInfos; /** The number of destination channels. The default value is 0, and the value range is from 0 to - * 4. Ensure that the value of this parameter corresponds to the number of `ChannelMediaInfo` + * 6. Ensure that the value of this parameter corresponds to the number of `ChannelMediaInfo` * structs you define in `destInfo`. */ int destCount; diff --git a/android/src/main/cpp/third_party/include/agora_rtc/AgoraMediaBase.h b/android/src/main/cpp/third_party/include/agora_rtc/AgoraMediaBase.h index 5c82cd8c0..bd0a7b881 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/AgoraMediaBase.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/AgoraMediaBase.h @@ -261,13 +261,18 @@ enum CONTENT_INSPECT_TYPE { */ CONTENT_INSPECT_INVALID = 0, /** + * @deprecated * Content inspect type moderation */ -CONTENT_INSPECT_MODERATION = 1, +CONTENT_INSPECT_MODERATION __deprecated = 1, /** * Content inspect type supervise */ -CONTENT_INSPECT_SUPERVISION = 2 +CONTENT_INSPECT_SUPERVISION = 2, +/** + * Content inspect type image moderation + */ +CONTENT_INSPECT_IMAGE_MODERATION = 3 }; struct ContentInspectModule { @@ -288,7 +293,10 @@ struct ContentInspectModule { */ 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. */ @@ -299,11 +307,12 @@ struct ContentInspectConfig { 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), moduleCount(0){} + ContentInspectConfig() :extraInfo(NULL), serverConfig(NULL), moduleCount(0){} }; namespace base { @@ -496,6 +505,10 @@ enum VIDEO_PIXEL_FORMAT { * 16: I422. */ VIDEO_PIXEL_I422 = 16, + /** + * 17: ID3D11Texture2D, only support DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_TYPELESS, DXGI_FORMAT_NV12 texture format + */ + VIDEO_TEXTURE_ID3D11TEXTURE2D = 17, }; /** @@ -559,7 +572,9 @@ struct ExternalVideoFrame { textureId(0), metadata_buffer(NULL), metadata_size(0), - alphaBuffer(NULL){} + alphaBuffer(NULL), + d3d11_texture_2d(NULL), + texture_slice_index(0){} /** * The EGL context type. @@ -681,6 +696,16 @@ struct ExternalVideoFrame { * The default value is NULL */ uint8_t* alphaBuffer; + + /** + * [Windows Texture related parameter] The pointer of ID3D11Texture2D used by the video frame. + */ + void *d3d11_texture_2d; + + /** + * [Windows Texture related parameter] The index of ID3D11Texture2D array used by the video frame. + */ + int texture_slice_index; }; /** @@ -704,6 +729,7 @@ struct VideoFrame { metadata_size(0), sharedContext(0), textureId(0), + d3d11Texture2d(NULL), alphaBuffer(NULL), pixelBuffer(NULL){ memset(matrix, 0, sizeof(matrix)); @@ -777,6 +803,10 @@ struct VideoFrame { * [Texture related parameter], Texture ID used by the video frame. */ int textureId; + /** + * [Texture related parameter] The pointer of ID3D11Texture2D used by the video frame,for Windows only. + */ + void* d3d11Texture2d; /** * [Texture related parameter], Incoming 4 × 4 transformational matrix. */ @@ -894,14 +924,14 @@ class IAudioFrameObserverBase { */ int channels; /** - *The number of samples per channel in the audio frame. + * The sample rate */ int samplesPerSec; /** * The data buffer of the audio frame. When the audio frame uses a stereo channel, the data * buffer is interleaved. * - * Buffer data size: buffer = samples × channels × bytesPerSample. + * Buffer data size: buffer = samplesPerChannel × channels × bytesPerSample. */ void* buffer; /** diff --git a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraH265Transcoder.h b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraH265Transcoder.h index 82a2064d3..250d5ad82 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraH265Transcoder.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraH265Transcoder.h @@ -157,7 +157,7 @@ class IH265Transcoder: public RefCountInterface { /** * Register a IH265TranscoderObserver object. - * @param observer + * @param observer IH265TranscoderObserver. * @return * - 0: Success. * - <0: Failure. @@ -166,7 +166,7 @@ class IH265Transcoder: public RefCountInterface { /** * Unregister a IH265TranscoderObserver object. - * @param observer + * @param observer IH265TranscoderObserver. * @return * - 0: Success. * - <0: Failure. diff --git a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMusicContentCenter.h b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMusicContentCenter.h index 9936562b6..1889bbdea 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMusicContentCenter.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraMusicContentCenter.h @@ -70,6 +70,10 @@ typedef enum * 6: Music decryption error. Please contact technical support */ kMusicContentCenterStatusErrMusicDecryption = 6, + /** + * 7: Http internal error. Please retry later. + */ + kMusicContentCenterStatusErrHttpInternalError = 7, } MusicContentCenterStatusCode; typedef struct @@ -258,7 +262,7 @@ class IMusicContentCenterEventHandler { * * @param requestId The request id is same as that returned by getSongSimpleInfo. * @param songCode Song code - * @param simpleinfo The metadata of the music. + * @param simpleInfo The metadata of the music. * @param errorCode The status of the request. See MusicContentCenterStatusCode */ virtual void onSongSimpleInfoResult(const char* requestId, int64_t songCode, const char* simpleInfo, MusicContentCenterStatusCode errorCode) = 0; @@ -295,13 +299,17 @@ struct MusicContentCenterConfiguration { * The max number which the music content center caches cannot exceed 50. */ int32_t maxCacheSize; + /** + * @technical preview + */ + const char* mccDomain; /** * Event handler to get callback result. */ IMusicContentCenterEventHandler* eventHandler; - MusicContentCenterConfiguration():appId(nullptr),token(nullptr),eventHandler(nullptr),mccUid(0),maxCacheSize(10){} - MusicContentCenterConfiguration(const char*appid,const char* token,int64_t id,IMusicContentCenterEventHandler* handler,int32_t maxSize = 10): - appId(appid),token(token),mccUid(id),eventHandler(handler),maxCacheSize(maxSize){} + MusicContentCenterConfiguration():appId(nullptr),token(nullptr),eventHandler(nullptr),mccUid(0),maxCacheSize(10), mccDomain(nullptr){} + MusicContentCenterConfiguration(const char*appid,const char* token,int64_t id,IMusicContentCenterEventHandler* handler,int32_t maxSize = 10, const char* apiurl = nullptr): + appId(appid),token(token),mccUid(id),eventHandler(handler),maxCacheSize(maxSize), mccDomain(apiurl){} }; class IMusicPlayer : public IMediaPlayer { diff --git a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRtcEngine.h b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRtcEngine.h index 01dd7599d..a54f24395 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRtcEngine.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRtcEngine.h @@ -1394,6 +1394,11 @@ enum PROXY_TYPE { HTTPS_PROXY_TYPE = 6, }; +enum FeatureType { + VIDEO_VIRTUAL_BACKGROUND = 1, + VIDEO_BEAUTY_EFFECT = 2, +}; + /** * The options for leaving a channel. */ @@ -3522,7 +3527,7 @@ class IRtcEngine : public agora::base::IEngineBase { /** * Queries the capacity of the current device codec. * - * @param codec_info An array of the codec cap information: CodecCapInfo. + * @param codecInfo An array of the codec cap information: CodecCapInfo. * @param size The array size. * @return * 0: Success. @@ -3563,12 +3568,10 @@ class IRtcEngine : public agora::base::IEngineBase { * @return * - 0: Success. * - < 0: Failure. - * - -2: The parameter is invalid. For example, the token is invalid or the uid parameter is not set - * to an integer. You need to pass in a valid parameter and join the channel again. * - -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine * object before calling this method. * - -102: The channel name is invalid. You need to pass in a valid channel name in channelId to - * rejoin the channel. + * preload the channel again. */ virtual int preloadChannel(const char* token, const char* channelId, uid_t uid) = 0; @@ -3605,12 +3608,12 @@ class IRtcEngine : public agora::base::IEngineBase { * @return * - 0: Success. * - < 0: Failure. - * - -2: The parameter is invalid. For example, the token is invalid or the userAccount parameter is empty. - * You need to pass in a valid parameter and join the channel again. + * - -2: The parameter is invalid. For example, the userAccount parameter is empty. + * You need to pass in a valid parameter and preload the channel again. * - -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine * object before calling this method. * - -102: The channel name is invalid. You need to pass in a valid channel name in channelId to - * rejoin the channel. + * preload the channel again. */ virtual int preloadChannel(const char* token, const char* channelId, const char* userAccount) = 0; @@ -3629,8 +3632,7 @@ class IRtcEngine : public agora::base::IEngineBase { * @return * - 0: Success. * - < 0: Failure. - * - -2: The parameter is invalid. For example, the token is invalid or the uid parameter is not set - * to an integer. You need to pass in a valid parameter and join the channel again. + * - -2: The token is invalid. You need to pass in a valid token and update the token again. * - -7: The IRtcEngine object has not been initialized. You need to initialize the IRtcEngine * object before calling this method. */ @@ -4867,7 +4869,7 @@ class IRtcEngine : public agora::base::IEngineBase { /** * Creates a media recorder object and return its pointer. * - * @param connection The RtcConnection object. It contains user ID and channel name of user. + * @param info The RecorderStreamInfo object. It contains user ID and channel name of user. * * @return * - The pointer to \ref rtc::IMediaRecorder "IMediaRecorder", @@ -5947,7 +5949,7 @@ class IRtcEngine : public agora::base::IEngineBase { * - 0: Success. * - < 0: Failure. */ - virtual int enableDualStreamMode(bool enabled) = 0; + virtual int enableDualStreamMode(bool enabled) __deprecated = 0; /** * Enables or disables the dual video stream mode. @@ -5967,7 +5969,7 @@ class IRtcEngine : public agora::base::IEngineBase { * - 0: Success. * - < 0: Failure. */ - virtual int enableDualStreamMode(bool enabled, const SimulcastStreamConfig& streamConfig) = 0; + virtual int enableDualStreamMode(bool enabled, const SimulcastStreamConfig& streamConfig) __deprecated = 0; /** @@ -6715,7 +6717,7 @@ class IRtcEngine : public agora::base::IEngineBase { * - 0: Success. * - < 0: Failure. */ - virtual int setCameraExposureFactor(float value) = 0; + virtual int setCameraExposureFactor(float factor) = 0; #if defined(__APPLE__) /** @@ -8291,6 +8293,16 @@ class IRtcEngine : public agora::base::IEngineBase { */ virtual uint64_t getNtpWallTimeInMs() = 0; + /** + * @brief Whether the target feature is available for the device. + * @since v4.2.0 + * @param type The feature type. See FeatureType. + * @return + * - true: available. + * - false: not available. + */ + virtual bool isFeatureAvailableOnDevice(FeatureType type) = 0; + }; class AAudioDeviceManager : public agora::util::AutoPtr { diff --git a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRtcEngineEx.h b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRtcEngineEx.h index 9d270b5af..32690cffe 100644 --- a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRtcEngineEx.h +++ b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRtcEngineEx.h @@ -1913,6 +1913,18 @@ class IRtcEngineEx : public IRtcEngine { */ virtual int takeSnapshotEx(const RtcConnection& connection, uid_t uid, const char* filePath) = 0; + /** Enables video screenshot and upload with the connection ID. + @param enabled Whether to enable video screenshot and upload: + - `true`: Yes. + - `false`: No. + @param config The configuration for video screenshot and upload. + @param connection The connection information. See RtcConnection. + @return + - 0: Success. + - < 0: Failure. + */ + virtual int enableContentInspectEx(bool enabled, const media::ContentInspectConfig &config, const RtcConnection& connection) = 0; + /** @brief Start tracing media rendering events. @since v4.1.1 diff --git a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRtmClient.h b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRtmClient.h deleted file mode 100644 index 4640cbe25..000000000 --- a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraRtmClient.h +++ /dev/null @@ -1,537 +0,0 @@ -// Copyright (c) 2022 Agora.io. All rights reserved - -// This program is confidential and proprietary to Agora.io. -// And may not be copied, reproduced, modified, disclosed to others, published -// or used, in whole or in part, without the express prior written permission -// of Agora.io. - -#pragma once // NOLINT(build/header_guard) - -#include "IAgoraLog.h" -#include "IAgoraStreamChannel.h" -#include "AgoraBase.h" - -#ifndef OPTIONAL_ENUM_CLASS -#if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1800) -#define OPTIONAL_ENUM_CLASS enum class -#else -#define OPTIONAL_ENUM_CLASS enum -#endif -#endif - -namespace agora { -namespace rtm { -class IRtmEventHandler; - -/** - * Configurations for RTM Client. - */ -struct RtmConfig { - /** - * The App ID of your project. - */ - const char* appId; - - /** - * The ID of the user. - */ - const char* userId; - - /** - * The callbacks handler - */ - IRtmEventHandler* eventHandler; - - /** - * The config for customer set log path, log size and log level. - */ - commons::LogConfig logConfig; - - RtmConfig() : appId(nullptr), - userId(nullptr), - eventHandler(nullptr) {} -}; - -/** - * The information of a Topic. - */ -struct TopicInfo { - /** - * The name of the topic. - */ - const char* topic; - - /** - * The number of publisher in current topic. - */ - size_t numOfPublisher; - - /** - * The publisher's user ids in current topic. - */ - const char** publisherUserIds; - - /** - * The metaData of publisher in current topic. - */ - const char** publisherMetas; - - TopicInfo() : topic(NULL), - numOfPublisher(0), - publisherUserIds(NULL), - publisherMetas(NULL) {} -}; - -/** - * The error codes of rtm client. - */ -enum RTM_ERROR_CODE { - /** - * 10001: The topic already joined - */ - RTM_ERR_TOPIC_ALREADY_JOINED = 10001, - /** - * 10002: Exceed topic limiation when try to join new topic - */ - RTM_ERR_EXCEED_JOIN_TOPIC_LIMITATION = 10002, - /** - * 10003: Topic name is invalid - */ - RTM_ERR_INVALID_TOPIC_NAME = 10003, - /** - * 10004: Publish topic message failed - */ - RTM_ERR_PUBLISH_TOPIC_MESSAGE_FAILED = 10004, - /** - * 10005: Exceed topic limitation when try to subscribe new topic - */ - RTM_ERR_EXCEED_SUBSCRIBE_TOPIC_LIMITATION = 10005, - /** - * 10006: Exceed user limitation when try to subscribe new topic - */ - RTM_ERR_EXCEED_USER_LIMITATION = 10006, - /** - * 10007: Exceed channel limitation when try to join new channel - */ - RTM_ERR_EXCEED_CHANNEL_LIMITATION = 10007, - /** - * 10008: The channel already joined - */ - RTM_ERR_ALREADY_JOIN_CHANNEL = 10008, - /** - * 10009: Try to perform channel related operation before joining channel - */ - RTM_ERR_NOT_JOIN_CHANNEL = 10009, -}; - -/** - * Connection states between rtm sdk and agora server. - */ -enum RTM_CONNECTION_STATE { - /** - * 1: The SDK is disconnected with server. - */ - RTM_CONNECTION_STATE_DISCONNECTED = 1, - /** - * 2: The SDK is connecting to the server. - */ - RTM_CONNECTION_STATE_CONNECTING = 2, - /** - * 3: The SDK is connected to the server and has joined a channel. You can now publish or subscribe to - * a track in the channel. - */ - RTM_CONNECTION_STATE_CONNECTED = 3, - /** - * 4: The SDK keeps rejoining the channel after being disconnected from the channel, probably because of - * network issues. - */ - RTM_CONNECTION_STATE_RECONNECTING = 4, - /** - * 5: The SDK fails to connect to the server or join the channel. - */ - RTM_CONNECTION_STATE_FAILED = 5, -}; - -/** - * Reasons for connection state change. - */ -enum RTM_CONNECTION_CHANGE_REASON { - /** - * 0: The SDK is connecting to the server. - */ - RTM_CONNECTION_CHANGED_CONNECTING = 0, - /** - * 1: The SDK has joined the channel successfully. - */ - RTM_CONNECTION_CHANGED_JOIN_SUCCESS = 1, - /** - * 2: The connection between the SDK and the server is interrupted. - */ - RTM_CONNECTION_CHANGED_INTERRUPTED = 2, - /** - * 3: The connection between the SDK and the server is banned by the server. - */ - RTM_CONNECTION_CHANGED_BANNED_BY_SERVER = 3, - /** - * 4: The SDK fails to join the channel for more than 20 minutes and stops reconnecting to the channel. - */ - RTM_CONNECTION_CHANGED_JOIN_FAILED = 4, - /** - * 5: The SDK has left the channel. - */ - RTM_CONNECTION_CHANGED_LEAVE_CHANNEL = 5, - /** - * 6: The connection fails because the App ID is not valid. - */ - RTM_CONNECTION_CHANGED_INVALID_APP_ID = 6, - /** - * 7: The connection fails because the channel name is not valid. - */ - RTM_CONNECTION_CHANGED_INVALID_CHANNEL_NAME = 7, - /** - * 8: The connection fails because the token is not valid. - */ - RTM_CONNECTION_CHANGED_INVALID_TOKEN = 8, - /** - * 9: The connection fails because the token has expired. - */ - RTM_CONNECTION_CHANGED_TOKEN_EXPIRED = 9, - /** - * 10: The connection is rejected by the server. - */ - RTM_CONNECTION_CHANGED_REJECTED_BY_SERVER = 10, - /** - * 11: The connection changes to reconnecting because the SDK has set a proxy server. - */ - RTM_CONNECTION_CHANGED_SETTING_PROXY_SERVER = 11, - /** - * 12: When the connection state changes because the app has renewed the token. - */ - RTM_CONNECTION_CHANGED_RENEW_TOKEN = 12, - /** - * 13: The IP Address of the app has changed. A change in the network type or IP/Port changes the IP - * address of the app. - */ - RTM_CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED = 13, - /** - * 14: A timeout occurs for the keep-alive of the connection between the SDK and the server. - */ - RTM_CONNECTION_CHANGED_KEEP_ALIVE_TIMEOUT = 14, - /** - * 15: The SDK has rejoined the channel successfully. - */ - RTM_CONNECTION_CHANGED_REJOIN_SUCCESS = 15, - /** - * 16: The connection between the SDK and the server is lost. - */ - RTM_CONNECTION_CHANGED_LOST = 16, - /** - * 17: The change of connection state is caused by echo test. - */ - RTM_CONNECTION_CHANGED_ECHO_TEST = 17, - /** - * 18: The local IP Address is changed by user. - */ - RTM_CONNECTION_CHANGED_CLIENT_IP_ADDRESS_CHANGED_BY_USER = 18, - /** - * 19: The connection is failed due to join the same channel on another device with the same uid. - */ - RTM_CONNECTION_CHANGED_SAME_UID_LOGIN = 19, - /** - * 20: The connection is failed due to too many broadcasters in the channel. - */ - RTM_CONNECTION_CHANGED_TOO_MANY_BROADCASTERS = 20, -}; - -/** - * RTM channel type. - */ -enum RTM_CHANNEL_TYPE { - /** - * 0: Message channel. - */ - RTM_CHANNEL_TYPE_MESSAGE = 0, - /** - * 1: Stream channel. - */ - RTM_CHANNEL_TYPE_STREAM = 1, -}; - -/** - * RTM presence type. - */ -enum RTM_PRESENCE_TYPE { - /** - * 0: Triggered when remote user join channel - */ - RTM_PRESENCE_TYPE_REMOTE_JOIN_CHANNEL = 0, - /** - * 1: Triggered when remote leave join channel - */ - RTM_PRESENCE_TYPE_REMOTE_LEAVE_CHANNEL = 1, - /** - * 2: Triggered when remote user's connection timeout - */ - RTM_PRESENCE_TYPE_REMOTE_CONNECTION_TIMEOUT = 2, - /** - * 3: Triggered when remote user join a topic - */ - RTM_PRESENCE_TYPE_REMOTE_JOIN_TOPIC = 3, - /** - * 4: Triggered when remote user leave a topic - */ - RTM_PRESENCE_TYPE_REMOTE_LEAVE_TOPIC = 4, - /** - * 5: Triggered when local user join channel - */ - RTM_PRESENCE_TYPE_SELF_JOIN_CHANNEL = 5, -}; - -/** - * RTM error code occurs in stream channel. - */ -enum STREAM_CHANNEL_ERROR_CODE { - /** - * 0: No error occurs. - */ - STREAM_CHANNEL_ERROR_OK = 0, - /** - * 1: Triggered when subscribe user exceed limitation - */ - STREAM_CHANNEL_ERROR_EXCEED_LIMITATION = 1, - /** - * 2: Triggered when unsubscribe inexistent user - */ - STREAM_CHANNEL_ERROR_USER_NOT_EXIST = 2, -}; - -/** - * The IRtmEventHandler class. - * - * The SDK uses this class to send callback event notifications to the app, and the app inherits - * the methods in this class to retrieve these event notifications. - * - * All methods in this class have their default (empty) implementations, and the app can inherit - * only some of the required events instead of all. In the callback methods, the app should avoid - * time-consuming tasks or calling blocking APIs, otherwise the SDK may not work properly. - */ -class IRtmEventHandler { - public: - virtual ~IRtmEventHandler() {} - - struct MessageEvent { - /** - * Which channel type, RTM_CHANNEL_TYPE_STREAM or RTM_CHANNEL_TYPE_MESSAGE - */ - RTM_CHANNEL_TYPE channelType; - /** - * The channel which the message was published - */ - const char* channelName; - /** - * If the channelType is RTM_CHANNEL_TYPE_STREAM, which topic the message came from. only for RTM_CHANNEL_TYPE_STREAM - */ - const char* channelTopic; - /** - * The payload - */ - const char* message; - /** - * The payload length - */ - size_t messageLength; - /** - * The publisher - */ - const char* publisher; - - MessageEvent() : channelType(RTM_CHANNEL_TYPE_STREAM), - channelName(nullptr), - channelTopic(nullptr), - message(nullptr), - publisher(nullptr) {} - }; - - struct PresenceEvent { - /** - * Which channel type, RTM_CHANNEL_TYPE_STREAM or RTM_CHANNEL_TYPE_MESSAGE - */ - RTM_CHANNEL_TYPE channelType; - /** - * Indicate presence type - */ - RTM_PRESENCE_TYPE type; - /** - * The channel which the presence event was triggered - */ - const char* channelName; - /** - * Topic information array. - */ - TopicInfo* topicInfos; - /** - * The number of topicInfos. - */ - size_t topicInfoNumber; - /** - * The user who triggered this event. - */ - const char* userId; - - PresenceEvent() : channelType(RTM_CHANNEL_TYPE_STREAM), - type(RTM_PRESENCE_TYPE_REMOTE_JOIN_CHANNEL), - channelName(nullptr), - topicInfos(nullptr), - topicInfoNumber(0), - userId(nullptr) {} - }; - - /** - * Occurs when receive a message. - * - * @param event details of message event. - */ - virtual void onMessageEvent(MessageEvent& event) {} - - /** - * Occurs when remote user join/leave channel, join/leave topic or local user joined channel. - * - * note: - * When remote user join/leave channel will trigger this callback. - * When remote user(in same channel) joinTopic/destroy Topic will trigger this callback. - * When local user join channel will trigger this callback. - * - * For type(RTM_PRESENCE_TYPE_REMOTE_JOIN_CHANNEL/RTM_PRESENCE_TYPE_REMOTE_LEAVE_CHANNEL), - * valid field will be channelType/type/channelName/userId - * For type(RTM_PRESENCE_TYPE_REMOTE_JOIN_TOPIC/RTM_PRESENCE_TYPE_REMOTE_LEAVE_TOPIC) - * valid field will be channelType/type/channelName/topicInfos/topicInfoNumber - * For type(RTM_PRESENCE_TYPE_SELF_JOIN_CHANNEL) - * valid field will be channelType/type/channelName/topicInfos/topicInfoNumber/userId - * - * @param event details of presence event. - */ - virtual void onPresenceEvent(PresenceEvent& event) {} - - /** - * Occurs when user join a channel. - * - * @param channelName The Name of the channel. - * @param userId The id of the user. - * @param errorCode The error code. - */ - virtual void onJoinResult(const char* channelName, const char* userId, STREAM_CHANNEL_ERROR_CODE errorCode) {} - - /** - * Occurs when user leave a channel. - * - * @param channelName The Name of the channel. - * @param userId The id of the user. - * @param errorCode The error code. - */ - virtual void onLeaveResult(const char* channelName, const char* userId, STREAM_CHANNEL_ERROR_CODE errorCode) {} - - /** - * Occurs when user join topic. - * - * @param channelName The Name of the channel. - * @param userId The id of the user. - * @param topic The name of the topic. - * @param meta The meta of the topic. - * @param errorCode The error code. - */ - virtual void onJoinTopicResult(const char* channelName, const char* userId, const char* topic, const char* meta, STREAM_CHANNEL_ERROR_CODE errorCode) {} - - /** - * Occurs when user leave topic. - * - * @param channelName The Name of the channel. - * @param userId The id of the user. - * @param topic The name of the topic. - * @param meta The meta of the topic. - * @param errorCode The error code. - */ - virtual void onLeaveTopicResult(const char* channelName, const char* userId, const char* topic, const char* meta, STREAM_CHANNEL_ERROR_CODE errorCode) {} - - /** - * Occurs when user subscribe topic. - * - * @param channelName The Name of the channel. - * @param userId The id of the user. - * @param topic The name of the topic. - * @param succeedUsers The subscribed users. - * @param failedUser The failed to subscribe users. - * @param errorCode The error code. - */ - virtual void onTopicSubscribed(const char* channelName, const char* userId, const char* topic, UserList succeedUsers, UserList failedUsers, STREAM_CHANNEL_ERROR_CODE errorCode) {} - - /** - * Occurs when user unsubscribe topic. - * - * @param channelName The Name of the channel. - * @param userId The id of the user. - * @param topic The name of the topic. - * @param succeedUsers The unsubscribed users. - * @param failedUser The failed to unsubscribe users. - * @param errorCode The error code. - */ - virtual void onTopicUnsubscribed(const char* channelName, const char* userId, const char* topic, UserList succeedUsers, UserList failedUsers, STREAM_CHANNEL_ERROR_CODE errorCode) {} - - /** - * Occurs when the connection state changes between rtm sdk and agora service. - * - * @param channelName The Name of the channel. - * @param state The new connection state. - * @param reason The reason for the connection state change. - */ - virtual void onConnectionStateChange(const char* channelName, RTM_CONNECTION_STATE state, RTM_CONNECTION_CHANGE_REASON reason) {} -}; - -/** - * The IRtmClient class. - * - * This class provides the main methods that can be invoked by your app. - * - * IRtmClient is the basic interface class of the Agora RTM SDK. - * Creating an IRtmClient object and then calling the methods of - * this object enables you to use Agora RTM SDK's functionality. - */ -class IRtmClient { - public: - /** - * Initializes the rtm client instance. - * - * @param [in] config The configurations for RTM Client. - * @param [in] eventHandler . - * @return - * - 0: Success. - * - < 0: Failure. - */ - virtual int initialize(const RtmConfig& config) = 0; - /** - * Release the rtm client instance. - * - * @return - * - 0: Success. - * - < 0: Failure. - */ - virtual int release() = 0; - - /** - * Create a stream channel instance. - * - * @param [in] channelName The Name of the channel. - */ - virtual IStreamChannel* createStreamChannel(const char* channelName) = 0; - - protected: - virtual ~IRtmClient() {} -}; - -/** Creates the rtm client object and returns the pointer. - -* @return Pointer of the rtm client object. -*/ -AGORA_API IRtmClient* AGORA_CALL createAgoraRtmClient(); - -} // namespace rtm -} // namespace agora diff --git a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraStreamChannel.h b/android/src/main/cpp/third_party/include/agora_rtc/IAgoraStreamChannel.h deleted file mode 100644 index 118d23dbb..000000000 --- a/android/src/main/cpp/third_party/include/agora_rtc/IAgoraStreamChannel.h +++ /dev/null @@ -1,207 +0,0 @@ - -// Copyright (c) 2022 Agora.io. All rights reserved - -// This program is confidential and proprietary to Agora.io. -// And may not be copied, reproduced, modified, disclosed to others, published -// or used, in whole or in part, without the express prior written permission -// of Agora.io. - -#pragma once // NOLINT(build/header_guard) - -#include "AgoraBase.h" - -namespace agora { -namespace rtm { -/** - * The qos of rtm message. - */ -enum RTM_MESSAGE_QOS { - /** - * Will not ensure that messages arrive in order. - */ - RTM_MESSAGE_QOS_UNORDERED = 0, - /** - * Will ensure that messages arrive in order. - */ - RTM_MESSAGE_QOS_ORDERED = 1, -}; - -/** - * Join channel options. - */ -struct JoinChannelOptions { - /** - * Token used to join channel. - */ - const char* token; - - JoinChannelOptions() : token(NULL) {} -}; - -/** - * Create topic options. - */ -struct JoinTopicOptions { - /** - * The qos of rtm message. - */ - RTM_MESSAGE_QOS qos; - - /** - * The metaData of topic. - */ - const char* meta; - - /** - * The length of meta. - */ - size_t metaLength; - - JoinTopicOptions() : qos(RTM_MESSAGE_QOS_UNORDERED), meta(NULL), metaLength(0) {} -}; - -/** - * Topic options. - */ -struct TopicOptions { - /** - * The list of users to subscribe. - */ - const char** users; - /** - * The number of users. - */ - size_t userCount; - - TopicOptions() : users(NULL), userCount(0) {} -}; - -/** - * User list. - */ -struct UserList { - /** - * The list of users. - */ - const char** users; - /** - * The number of users. - */ - size_t userCount; - - UserList() : users(NULL), userCount(0) {} -}; - -/** - * The IStreamChannel class. - * - * This class provides the stream channel methods that can be invoked by your app. - */ -class IStreamChannel { - public: - /** - * Join the channel. - * - * @param [in] options join channel options. - * @return - * - 0: Success. - * - < 0: Failure. - */ - virtual int join(const JoinChannelOptions& options) = 0; - - /** - * Leave the channel. - * - * @return - * - 0: Success. - * - < 0: Failure. - */ - virtual int leave() = 0; - - /** - * Return the channel name of this stream channel. - * - * @return The channel name. - */ - virtual const char* getChannelName() = 0; - - /** - * Join a topic. - * - * @param [in] topic The name of the topic. - * @param [in] options The options of the topic. - * @return - * - 0: Success. - * - < 0: Failure. - */ - virtual int joinTopic(const char* topic, const JoinTopicOptions& options) = 0; - - /** - * Publish a message in the topic. - * - * @param [in] topic The name of the topic. - * @param [in] message The content of the message. - * @param [in] length The length of the message. - * @return - * - 0: Success. - * - < 0: Failure. - */ - virtual int publishTopicMessage(const char* topic, const char* message, size_t length) = 0; - - /** - * Leave the topic. - * - * @param [in] topic The name of the topic. - * @return - * - 0: Success. - * - < 0: Failure. - */ - virtual int leaveTopic(const char* topic) = 0; - - /** - * Subscribe a topic. - * - * @param [in] topic The name of the topic. - * @param [in] options The options of subscribe the topic. - * @return - * - 0: Success. - * - < 0: Failure. - */ - virtual int subscribeTopic(const char* topic, const TopicOptions& options) = 0; - - /** - * Unsubscribe a topic. - * - * @param [in] topic The name of the topic. - * @return - * - 0: Success. - * - < 0: Failure. - */ - virtual int unsubscribeTopic(const char* topic, const TopicOptions& options) = 0; - - /** - * Get subscribed user list - * - * @param [in] topic The name of the topic. - * @param [out] users The list of subscribed users. - * @return - * - 0: Success. - * - < 0: Failure. - */ - virtual int getSubscribedUserList(const char* topic, UserList* users) = 0; - - /** - * Release the stream channel instance. - * - * @return - * - 0: Success. - * - < 0: Failure. - */ - virtual int release() = 0; - - protected: - ~IStreamChannel() {} -}; - -} // namespace rtm -} // namespace agora diff --git a/android/src/main/cpp/third_party/include/iris/iris_base.h b/android/src/main/cpp/third_party/include/iris/iris_base.h index 0dbb1bb9f..373d1dd7a 100644 --- a/android/src/main/cpp/third_party/include/iris/iris_base.h +++ b/android/src/main/cpp/third_party/include/iris/iris_base.h @@ -32,17 +32,34 @@ typedef enum IrisAppType { } IrisAppType; typedef enum IrisLogLevel { - LOG_LEVEL_TRACE = 0, - LOG_LEVEL_DEBUG = 1, - LOG_LEVEL_INFO = 2, - LOG_LEVEL_WARN = 3, - LOG_LEVEL_ERROR = 4, - LOG_LEVEL_CRITICAL = 5, - LOG_LEVEL_OFF = 6, + levelTrace = 0, + levelDebug = 1, + levelInfo = 2, + levelWarn = 3, + levelErr = 4, + levelCritical = 5, + levelOff = 6, } IrisLogLevel; +typedef enum IrisError { + ERR_OK = 0, + ERR_FAILED = 1, + ERR_INVALID_ARGUMENT = 2, + ERR_NOT_INITIALIZED = 7, + + /*base from IRIS_VIDEO_PROCESS_ERR::ERR_NULL_POINTER=1*/ + ERR_NULL_POINTER = 1001, + ERR_SIZE_NOT_MATCHING = 1002, + ERR_BUFFER_EMPTY = 1005, + ERR_FRAM_TYPE_NOT_MATCHING = 10006 +} IrisError; + IRIS_API void enableUseJsonArray(bool enable); +void saveAppType(IrisAppType type); + +IrisAppType getAppType(); + IRIS_API void InitIrisLogger(const char *path, int maxSize, IrisLogLevel level); typedef struct EventParam { @@ -63,7 +80,11 @@ typedef struct IrisCEventHandler { Func_Event OnEvent; } IrisCEventHandler; -typedef void *IrisEventHandlerHandle; +typedef void *IrisHandle; +typedef IrisHandle IrisEventHandlerHandle; +typedef IrisHandle IrisVideoFrameBufferDelegateHandle; +typedef IrisHandle IrisVideoFrameBufferManagerPtr; +typedef IrisHandle IrisApiEnginePtr; EXTERN_C_LEAVE diff --git a/android/src/main/cpp/third_party/include/iris/iris_rtc_api_type.h b/android/src/main/cpp/third_party/include/iris/iris_rtc_api_type.h index 95230fbb5..6f768ff8e 100644 --- a/android/src/main/cpp/third_party/include/iris/iris_rtc_api_type.h +++ b/android/src/main/cpp/third_party/include/iris/iris_rtc_api_type.h @@ -250,6 +250,10 @@ "RtcEngine_setCameraAutoFocusFaceModeEnabled" #define FUNC_RTCENGINE_ISCAMERAEXPOSUREPOSITIONSUPPORTED \ "RtcEngine_isCameraExposurePositionSupported" +#define FUNC_RTCENGINE_ISCAMERAEXPOSURESUPPORTED \ + "RtcEngine_isCameraExposureSupported" +#define FUNC_RTCENGINE_SETCAMERAEXPOSUREFACTOR \ + "RtcEngine_setCameraExposureFactor" #define FUNC_RTCENGINE_SETCAMERAEXPOSUREPOSITION \ "RtcEngine_setCameraExposurePosition" #define FUNC_RTCENGINE_ISCAMERAAUTOEXPOSUREFACEMODESUPPORTED \ @@ -260,6 +264,8 @@ "RtcEngine_setDefaultAudioRouteToSpeakerphone" #define FUNC_RTCENGINE_SETENABLESPEAKERPHONE "RtcEngine_setEnableSpeakerphone" #define FUNC_RTCENGINE_ISSPEAKERPHONEENABLED "RtcEngine_isSpeakerphoneEnabled" +#define FUNC_RTCENGINE_SETROUTEINCOMMUNICATIONMODE \ + "RtcEngine_setRouteInCommunicationMode" #define FUNC_RTCENGINE_GETSCREENCAPTURESOURCES \ "RtcEngine_getScreenCaptureSources" #define FUNC_RTCENGINE_RELEASESCREENCAPTURESOURCES \ @@ -460,6 +466,12 @@ #define FUNC_RTCENGINE_STARTORUPDATECHANNELMEDIARELAY \ "RtcEngine_startOrUpdateChannelMediaRelay" #define FUNC_RTCENGINE_GETNTPWALLTIMEINMS "RtcEngine_getNtpWallTimeInMs" +#define FUNC_RTCENGINE_ISFEATUREAVAILABLEONDEVICE \ + "RtcEngine_isFeatureAvailableOnDevice" +#define FUNC_RTCENGINE_PRELOADCHANNEL "RtcEngine_preloadChannel" +#define FUNC_RTCENGINE_PRELOADCHANNEL2 "RtcEngine_preloadChannel2" +#define FUNC_RTCENGINE_UPDATEPRELOADCHANNELTOKEN \ + "RtcEngine_updatePreloadChannelToken" // class IRtcEngine end // class IMediaRecorder start @@ -852,6 +864,8 @@ "RtcEngineEx_enableWirelessAccelerate" #define FUNC_RTCENGINEEX_SETDUALSTREAMMODEEX "RtcEngineEx_setDualStreamModeEx" #define FUNC_RTCENGINEEX_TAKESNAPSHOTEX "RtcEngineEx_takeSnapshotEx" +#define FUNC_RTCENGINEEX_ENABLECONTENTINSPECTEX \ + "RtcEngineEx_enableContentInspectEx" #define FUNC_RTCENGINEEX_LEAVECHANNELEX2 "RtcEngineEx_leaveChannelEx2" #define FUNC_RTCENGINEEX_ADJUSTUSERPLAYBACKSIGNALVOLUMEEX \ "RtcEngineEx_adjustUserPlaybackSignalVolumeEx" @@ -907,11 +921,16 @@ "MusicContentCenter_getMusicCollectionByMusicChartId" #define FUNC_MUSICCONTENTCENTER_SEARCHMUSIC "MusicContentCenter_searchMusic" #define FUNC_MUSICCONTENTCENTER_PRELOAD "MusicContentCenter_preload" +#define FUNC_MUSICCONTENTCENTER_PRELOAD2 "MusicContentCenter_preload2" #define FUNC_MUSICCONTENTCENTER_ISPRELOADED "MusicContentCenter_isPreloaded" #define FUNC_MUSICCONTENTCENTER_GETLYRIC "MusicContentCenter_getLyric" #define FUNC_MUSICCONTENTCENTER_RENEWTOKEN "MusicContentCenter_renewToken" #define FUNC_MUSICCONTENTCENTER_REMOVECACHE "MusicContentCenter_removeCache" #define FUNC_MUSICCONTENTCENTER_GETCACHES "MusicContentCenter_getCaches" +#define FUNC_MUSICCONTENTCENTER_GETSONGSIMPLEINFO \ + "MusicContentCenter_getSongSimpleInfo" +#define FUNC_MUSICCONTENTCENTER_GETINTERNALSONGCODE \ + "MusicContentCenter_getInternalSongCode" // class IMusicContentCenter end // class IMusicPlayer start #define FUNC_MUSICPLAYER_OPEN "MusicPlayer_open" diff --git a/android/src/main/cpp/third_party/include/iris/iris_rtc_high_performance_c_api.h b/android/src/main/cpp/third_party/include/iris/iris_rtc_high_performance_c_api.h new file mode 100644 index 000000000..57937aa97 --- /dev/null +++ b/android/src/main/cpp/third_party/include/iris/iris_rtc_high_performance_c_api.h @@ -0,0 +1,100 @@ + +#pragma once + +#include "iris_rtc_base.h" +#include "iris_rtc_c_api.h" +EXTERN_C_ENTER + +struct IrisSpatialAudioZone { + //the zone id + int zoneSetId; + //zone center point + float position[3]; + //forward direction + float forward[3]; + //right direction + float right[3]; + //up direction + float up[3]; + //the forward side length of the zone + float forwardLength; + //tehe right side length of the zone + float rightLength; + //the up side length of the zone + float upLength; + //the audio attenuation of zone + float audioAttenuation; + + IrisSpatialAudioZone() = default; +}; + +IRIS_API int IRIS_CALL ILocalSpatialAudioEngine_SetMaxAudioRecvCount( + IrisApiEnginePtr enginePtr, int maxCount); + +IRIS_API int IRIS_CALL ILocalSpatialAudioEngine_SetAudioRecvRange( + IrisApiEnginePtr enginePtr, float range); + +IRIS_API int IRIS_CALL ILocalSpatialAudioEngine_SetDistanceUnit( + IrisApiEnginePtr enginePtr, float unit); + +IRIS_API int IRIS_CALL ILocalSpatialAudioEngine_UpdateSelfPosition( + IrisApiEnginePtr enginePtr, float positionX, float positionY, + float positionZ, float axisForwardX, float axisForwardY, float axisForwardZ, + float axisRightX, float axisRightY, float axisRightZ, float axisUpX, + float axisUpY, float axisUpZ); + +IRIS_API int IRIS_CALL ILocalSpatialAudioEngine_UpdateSelfPositionEx( + IrisApiEnginePtr enginePtr, float positionX, float positionY, + float positionZ, float axisForwardX, float axisForwardY, float axisForwardZ, + float axisRightX, float axisRightY, float axisRightZ, float axisUpX, + float axisUpY, float axisUpZ, char *channelId, unsigned int localUid); + +IRIS_API int IRIS_CALL ILocalSpatialAudioEngine_UpdatePlayerPositionInfo( + IrisApiEnginePtr enginePtr, int playerId, float positionX, float positionY, + float positionZ, float forwardX, float forwardY, float forwardZ); + +IRIS_API int IRIS_CALL ILocalSpatialAudioEngine_MuteLocalAudioStream( + IrisApiEnginePtr enginePtr, bool mute); + +IRIS_API int IRIS_CALL ILocalSpatialAudioEngine_MuteAllRemoteAudioStreams( + IrisApiEnginePtr enginePtr, bool mute); + +IRIS_API int IRIS_CALL ILocalSpatialAudioEngine_SetZones( + IrisApiEnginePtr enginePtr, IrisSpatialAudioZone *zones, + unsigned int zoneCount); + +IRIS_API int IRIS_CALL ILocalSpatialAudioEngine_SetPlayerAttenuation( + IrisApiEnginePtr enginePtr, int playerId, double attenuation, + bool forceSet); + +IRIS_API int IRIS_CALL ILocalSpatialAudioEngine_MuteRemoteAudioStream( + IrisApiEnginePtr enginePtr, unsigned int uid, bool mute); + +IRIS_API int IRIS_CALL ILocalSpatialAudioEngine_UpdateRemotePosition( + IrisApiEnginePtr enginePtr, unsigned int uid, float positionX, + float positionY, float positionZ, float forwardX, float forwardY, + float forwardZ); + +IRIS_API int IRIS_CALL ILocalSpatialAudioEngine_UpdateRemotePositionEx( + IrisApiEnginePtr enginePtr, unsigned int uid, float positionX, + float positionY, float positionZ, float forwardX, float forwardY, + float forwardZ, char *channelId, unsigned int localUid); + +IRIS_API int IRIS_CALL ILocalSpatialAudioEngine_RemoveRemotePosition( + IrisApiEnginePtr enginePtr, unsigned int uid); + +IRIS_API int IRIS_CALL ILocalSpatialAudioEngine_RemoveRemotePositionEx( + IrisApiEnginePtr enginePtr, unsigned int uid, char *channelId, + unsigned int localUid); + +IRIS_API int IRIS_CALL +ILocalSpatialAudioEngine_ClearRemotePositions(IrisApiEnginePtr enginePtr); + +IRIS_API int IRIS_CALL ILocalSpatialAudioEngine_ClearRemotePositionsEx( + IrisApiEnginePtr enginePtr, char *channelId, unsigned int localUid); + +IRIS_API int IRIS_CALL ILocalSpatialAudioEngine_SetRemoteAudioAttenuation( + IrisApiEnginePtr enginePtr, unsigned int uid, double attenuation, + bool forceSet); + +EXTERN_C_LEAVE diff --git a/android/src/main/java/io/agora/agora_rtc_ng/TextureRenderer.java b/android/src/main/java/io/agora/agora_rtc_ng/TextureRenderer.java index aa0797dd2..7c9a83401 100644 --- a/android/src/main/java/io/agora/agora_rtc_ng/TextureRenderer.java +++ b/android/src/main/java/io/agora/agora_rtc_ng/TextureRenderer.java @@ -5,9 +5,12 @@ import android.os.Looper; import android.view.Surface; +import androidx.annotation.NonNull; + import java.util.HashMap; import io.flutter.plugin.common.BinaryMessenger; +import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; import io.flutter.view.TextureRegistry; @@ -20,6 +23,9 @@ public class TextureRenderer { private SurfaceTexture flutterSurfaceTexture; private Surface renderSurface; + int width = 0; + int height = 0; + public TextureRenderer( TextureRegistry textureRegistry, BinaryMessenger binaryMessenger, @@ -35,8 +41,34 @@ public TextureRenderer( this.renderSurface = new Surface(this.flutterSurfaceTexture); - this.methodChannel = new MethodChannel(binaryMessenger, "agora_rtc_engine/texture_render_" + flutterTexture.id()); + this.methodChannel.setMethodCallHandler(new MethodChannel.MethodCallHandler() { + @Override + public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result result) { + if (call.method.equals("setSizeNative")) { + if (call.arguments() == null) { + result.success(false); + return; + } + + int width = 0; + int height = 0; + if (call.hasArgument("width")) { + width = call.argument("width"); + } + if (call.hasArgument("height")) { + height = call.argument("height"); + } + + startRendering(width, height); + + result.success(true); + return; + } + + result.notImplemented(); + } + }); this.irisRenderer = new IrisRenderer( irisRtcRenderingHandle, @@ -47,13 +79,6 @@ public TextureRenderer( this.irisRenderer.setCallback(new IrisRenderer.Callback() { @Override public void onSizeChanged(int width, int height) { - final SurfaceTexture st = TextureRenderer.this.flutterSurfaceTexture; - if (null == st) { - return; - } - - st.setDefaultBufferSize(width, height); - handler.post(() -> { methodChannel.invokeMethod( "onSizeChanged", @@ -64,7 +89,29 @@ public void onSizeChanged(int width, int height) { }); } }); - this.irisRenderer.startRenderingToSurface(renderSurface); + } + + private void startRendering(int width, int height) { + if (width == 0 && height == 0) { + return; + } + + final SurfaceTexture st = TextureRenderer.this.flutterSurfaceTexture; + if (null == st) { + return; + } + + if (this.width != width || this.height != height) { + st.setDefaultBufferSize(width, height); + + // Only call `irisRenderer.startRenderingToSurface` in the first time. + if (this.width == 0 && this.height == 0) { + this.irisRenderer.startRenderingToSurface(renderSurface); + } + + this.width = width; + this.height = height; + } } public long getTextureId() { @@ -72,6 +119,7 @@ public long getTextureId() { } public void dispose() { + this.methodChannel.setMethodCallHandler(null); irisRenderer.stopRenderingToSurface(); this.irisRenderer.setCallback(null); if (renderSurface != null) { diff --git a/example/macos/Runner.xcodeproj/project.pbxproj b/example/macos/Runner.xcodeproj/project.pbxproj index 2aa47b8b3..f6436d826 100644 --- a/example/macos/Runner.xcodeproj/project.pbxproj +++ b/example/macos/Runner.xcodeproj/project.pbxproj @@ -202,7 +202,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = ""; TargetAttributes = { 33CC10EC2044A3C60003C045 = { diff --git a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 24235fe5e..6cb8ade7e 100644 --- a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ Future _didUpdateWidget( covariant AgoraRtcRenderTexture oldWidget) async { - // For flutter texture rendering, only update the texture id and other state, and the - // Flutter framework will handle the rest. - _controller(widget.controller).updateController(oldWidget.controller); + if (!oldWidget.controller.isSame(widget.controller)) { + await oldWidget.controller.disposeRender(); + await _initialize(); + } else { + _controller(widget.controller).updateController(oldWidget.controller); + } } @override @@ -376,12 +381,23 @@ class _AgoraRtcRenderTextureState extends State return child; } + Future _setSizeNative(Size size, Offset position) async { + assert(defaultTargetPlatform == TargetPlatform.android); + // Call `SurfaceTexture.setDefaultBufferSize` on Android, or the video will be + // black screen + await methodChannel!.invokeMethod('setSizeNative', { + 'width': size.width.toInt(), + 'height': size.height.toInt(), + }); + } + @override Widget build(BuildContext context) { + Widget result = const SizedBox.expand(); + if (widget.controller.getTextureId() != kTextureNotInit) { - // Only handle render mode on macos at this time if (_height != 0 && _width != 0) { - Widget result = buildTexure(widget.controller.getTextureId()); + result = buildTexure(widget.controller.getTextureId()); final renderMode = widget.controller.canvas.renderMode ?? RenderModeType.renderModeHidden; @@ -404,11 +420,64 @@ class _AgoraRtcRenderTextureState extends State // Fit mode by default if does not need to handle render mode result = _applyRenderMode(RenderModeType.renderModeFit, result); } + } - return result; + // Only need to size in native side on Android + if (!kIsWeb && defaultTargetPlatform == TargetPlatform.android) { + result = _SizeChangedAwareWidget( + onChange: (size) { + _setSizeNative(size, Offset.zero); + }, + child: result, + ); } } - return Container(); + return result; + } +} + +typedef _OnWidgetSizeChange = void Function(Size size); + +class _SizeChangedAwareRenderObject extends RenderProxyBox { + Size? oldSize; + _OnWidgetSizeChange onChange; + + _SizeChangedAwareRenderObject(this.onChange); + + @override + void performLayout() { + super.performLayout(); + + Size newSize = child!.size; + if (oldSize == newSize) return; + + oldSize = newSize; + // Compatible with Flutter SDK 2.10.x + // ignore: invalid_null_aware_operator + SchedulerBinding.instance?.addPostFrameCallback((_) { + onChange(newSize); + }); + } +} + +class _SizeChangedAwareWidget extends SingleChildRenderObjectWidget { + final _OnWidgetSizeChange onChange; + + const _SizeChangedAwareWidget({ + Key? key, + required this.onChange, + required Widget child, + }) : super(key: key, child: child); + + @override + RenderObject createRenderObject(BuildContext context) { + return _SizeChangedAwareRenderObject(onChange); + } + + @override + void updateRenderObject(BuildContext context, + covariant _SizeChangedAwareRenderObject renderObject) { + renderObject.onChange = onChange; } } diff --git a/macos/agora_rtc_engine.podspec b/macos/agora_rtc_engine.podspec index a9a588a13..fa1847170 100644 --- a/macos/agora_rtc_engine.podspec +++ b/macos/agora_rtc_engine.podspec @@ -21,8 +21,8 @@ A new flutter plugin project. puts '[plugin_dev] Found .plugin_dev file, use vendored_frameworks instead.' s.vendored_frameworks = 'libs/*.framework' else - s.dependency 'AgoraRtcEngine_macOS', '4.2.3' - s.dependency 'AgoraIrisRTC_macOS', '4.2.3-build.4' + s.dependency 'AgoraRtcEngine_macOS', '4.2.6' + s.dependency 'AgoraIrisRTC_macOS', '4.2.6-build.3' end s.platform = :osx, '10.11' diff --git a/pubspec.yaml b/pubspec.yaml index 572d38165..14a5d376f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: agora_rtc_engine description: >- Flutter plugin of Agora RTC SDK, allow you to simply integrate Agora Video Calling or Live Video Streaming to your app with just a few lines of code. -version: 6.2.4 +version: 6.2.6 homepage: https://www.agora.io repository: https://github.com/AgoraIO-Extensions/Agora-Flutter-SDK/tree/main environment: diff --git a/scripts/artifacts_version.sh b/scripts/artifacts_version.sh index efeedd3e9..d6b6cc892 100644 --- a/scripts/artifacts_version.sh +++ b/scripts/artifacts_version.sh @@ -1,6 +1,6 @@ set -e -export IRIS_CDN_URL_ANDROID="https://download.agora.io/sdk/release/iris_4.2.3-build.3_DCG_Android_Video_20231012_0417.zip" -export IRIS_CDN_URL_IOS="https://download.agora.io/sdk/release/iris_4.2.3-build.4_DCG_iOS_Video_20231019_0355.zip" -export IRIS_CDN_URL_MACOS="https://download.agora.io/sdk/release/iris_4.2.3-build.4_DCG_Mac_Video_20231019_0355.zip" -export IRIS_CDN_URL_WINDOWS="https://download.agora.io/sdk/release/iris_4.2.3-build.3_DCG_Windows_Video_20231012_0417.zip" +export IRIS_CDN_URL_ANDROID="https://download.agora.io/sdk/release/iris_4.2.6-build.3_DCG_Android_Video_20231116_0243.zip" +export IRIS_CDN_URL_IOS="https://download.agora.io/sdk/release/iris_4.2.6-build.3_DCG_iOS_Video_20231116_0243.zip" +export IRIS_CDN_URL_MACOS="https://download.agora.io/sdk/release/iris_4.2.6-build.3_DCG_Mac_Video_20231116_0243.zip" +export IRIS_CDN_URL_WINDOWS="https://download.agora.io/sdk/release/iris_4.2.6-build.3_DCG_Windows_Video_20231116_0243.zip" diff --git a/scripts/build-iris-android.sh b/scripts/build-iris-android.sh index bdba02730..ecfd51c48 100644 --- a/scripts/build-iris-android.sh +++ b/scripts/build-iris-android.sh @@ -11,28 +11,32 @@ IRIS_TYPE="dcg" NATIVE_SDK_PATH_NAME=$3 # Agora_Native_SDK_for_Mac_rel.v3.8.201.2_39877_full_20220608_2158 SCRIPTS_PATH=$(dirname "$0") -bash $SCRIPTS_PATH/build-android-arch.sh $IRIS_PROJECT_PATH ALL $BUILD_TYPE +bash $IRIS_PROJECT_PATH/ci/build-android.sh buildALL $BUILD_TYPE + + # build/android/DCG/ALL_ARCHITECTURE/output/Debug + +IRIS_OUTPUT=${IRIS_PROJECT_PATH}/build/android/$IRIS_TYPE/ALL_ARCHITECTURE/output/$BUILD_TYPE for ABI in ${ABIS}; do echo "Copying $IRIS_PROJECT_PATH/build/android/$ABI/output/$IRIS_TYPE/$BUILD_TYPE/libAgoraRtcWrapper.so to $AGORA_FLUTTER_PROJECT_PATH/android/libs/$ABI/libAgoraRtcWrapper.so" # bash $IRIS_PROJECT_PATH/$IRIS_TYPE/ci/build-android.sh build $ABI $BUILD_TYPE mkdir -p "$AGORA_FLUTTER_PROJECT_PATH/android/libs/$ABI/" - - cp -RP "$IRIS_PROJECT_PATH/build/android/ALL_ARCHITECTURE/output/$IRIS_TYPE/$BUILD_TYPE/$ABI/libAgoraRtcWrapper.so" \ + + cp -RP "${IRIS_OUTPUT}/$ABI/libAgoraRtcWrapper.so" \ "$AGORA_FLUTTER_PROJECT_PATH/android/libs/$ABI/libAgoraRtcWrapper.so" if [ -f "${IRIS_PROJECT_PATH}/build/android/ALL_ARCHITECTURE/output/${IRIS_TYPE}/${BUILD_TYPE}/${ABI}/libIrisDebugger.so" ]; then mkdir -p ${AGORA_FLUTTER_PROJECT_PATH}/test_shard/iris_tester/android/libs/${ABI} - cp -RP "${IRIS_PROJECT_PATH}/build/android/ALL_ARCHITECTURE/output/${IRIS_TYPE}/${BUILD_TYPE}/${ABI}/libIrisDebugger.so" "${AGORA_FLUTTER_PROJECT_PATH}/test_shard/iris_tester/android/libs/${ABI}/libIrisDebugger.so" + cp -RP "${IRIS_OUTPUT}/$ABI/libIrisDebugger.so" "${AGORA_FLUTTER_PROJECT_PATH}/test_shard/iris_tester/android/libs/${ABI}/libIrisDebugger.so" fi done; # echo "Copying $IRIS_PROJECT_PATH/build/android/ALL_ARCHITECTURE/output/$IRIS_TYPE/$BUILD_TYPE/AgoraRtcWrapper.aar to $AGORA_FLUTTER_PROJECT_PATH/android/libs/AgoraRtcWrapper.aar" # cp -r "$IRIS_PROJECT_PATH/build/android/ALL_ARCHITECTURE/output/$IRIS_TYPE/$BUILD_TYPE/AgoraRtcWrapper.aar" "$AGORA_FLUTTER_PROJECT_PATH/android/libs/AgoraRtcWrapper.aar" -echo "Copying $IRIS_PROJECT_PATH/build/android/ALL_ARCHITECTURE/output/$IRIS_TYPE/$BUILD_TYPE/AgoraRtcWrapper.jar to $AGORA_FLUTTER_PROJECT_PATH/android/libs/AgoraRtcWrapper.jar" -cp -r "$IRIS_PROJECT_PATH/build/android/ALL_ARCHITECTURE/output/$IRIS_TYPE/$BUILD_TYPE/AgoraRtcWrapper.jar" "$AGORA_FLUTTER_PROJECT_PATH/android/libs/AgoraRtcWrapper.jar" +echo "Copying ${IRIS_OUTPUT}/AgoraRtcWrapper.jar to $AGORA_FLUTTER_PROJECT_PATH/android/libs/AgoraRtcWrapper.jar" +cp -r "${IRIS_OUTPUT}/AgoraRtcWrapper.jar" "$AGORA_FLUTTER_PROJECT_PATH/android/libs/AgoraRtcWrapper.jar" for ABI in ${ABIS}; do diff --git a/shared/darwin/TextureRenderer.mm b/shared/darwin/TextureRenderer.mm index a9fd3a604..9e1cd130a 100644 --- a/shared/darwin/TextureRenderer.mm +++ b/shared/darwin/TextureRenderer.mm @@ -36,13 +36,16 @@ void OnVideoFrameReceived(const void *videoFrame, return; } - CVPixelBufferRef _Nullable pixelBuffer = reinterpret_cast(vf->pixelBuffer); if (pixelBuffer) { if (resize) { - [renderer.channel invokeMethod:@"onSizeChanged" - arguments:@{@"width": @(vf->width), - @"height": @(vf->height)}]; + int tmpWidth = vf->width; + int tmpHeight = vf->height; + dispatch_async(dispatch_get_main_queue(), ^{ + [renderer.channel invokeMethod:@"onSizeChanged" + arguments:@{@"width": @(tmpWidth), + @"height": @(tmpHeight)}]; + }); } dispatch_semaphore_wait(renderer.lock, DISPATCH_TIME_FOREVER); diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index 979a049cc..42f4ff576 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -12,8 +12,8 @@ project(${PROJECT_NAME} LANGUAGES CXX) # not be changed set(PLUGIN_NAME "agora_rtc_engine_plugin") -set(IRIS_SDK_DOWNLOAD_URL "https://download.agora.io/sdk/release/iris_4.2.3-build.3_DCG_Windows_Video_20231012_0417.zip") -set(IRIS_SDK_DOWNLOAD_NAME "iris_4.2.3-build.3_DCG_Windows") +set(IRIS_SDK_DOWNLOAD_URL "https://download.agora.io/sdk/release/iris_4.2.6-build.3_DCG_Windows_Video_20231116_0243.zip") +set(IRIS_SDK_DOWNLOAD_NAME "iris_4.2.6-build.3_DCG_Windows") set(RTC_SDK_DOWNLOAD_NAME "Agora_Native_SDK_for_Windows_FULL") set(IRIS_SDK_VERSION "v3_6_2_fix.1")