diff --git a/headers/rtc_4.3.0/custom_headers/CustomIAgoraMediaEngine.h b/headers/rtc_4.3.0/custom_headers/CustomIAgoraMediaEngine.h index aafbef7..c79eaf2 100644 --- a/headers/rtc_4.3.0/custom_headers/CustomIAgoraMediaEngine.h +++ b/headers/rtc_4.3.0/custom_headers/CustomIAgoraMediaEngine.h @@ -10,16 +10,22 @@ namespace ext { class IMediaEngine { // ----------------------------- 👇🏻new API👇🏻 ----------------------------- - // add for registerAudioFrameObserver - // virtual int registerAudioFrameObserver(IAudioFrameObserver* observer) = 0; + /** + * @iris_api_id: MediaEngine_unregisterAudioFrameObserver + * @source: virtual int registerAudioFrameObserver(IAudioFrameObserver* observer) = 0; + */ virtual int unregisterAudioFrameObserver(IAudioFrameObserver *observer) = 0; - // add for registerVideoFrameObserver - // virtual int registerVideoFrameObserver(IVideoFrameObserver* observer) = 0; + /** + * @iris_api_id: MediaEngine_unregisterVideoFrameObserver + * @source: virtual int registerVideoFrameObserver(IVideoFrameObserver* observer) = 0; + */ virtual int unregisterVideoFrameObserver(IVideoFrameObserver *observer) = 0; - // add for registerVideoEncodedFrameObserver - // virtual int registerVideoEncodedFrameObserver(IVideoEncodedFrameObserver* observer) = 0; + /** + * @iris_api_id: MediaEngine_unregisterVideoEncodedFrameObserver + * @source: virtual int registerVideoEncodedFrameObserver(IVideoEncodedFrameObserver* observer) = 0; + */ virtual int unregisterVideoEncodedFrameObserver(IVideoEncodedFrameObserver *observer) = 0; diff --git a/headers/rtc_4.3.0/custom_headers/CustomIAgoraMediaPlayer.h b/headers/rtc_4.3.0/custom_headers/CustomIAgoraMediaPlayer.h index da533ea..17cd047 100644 --- a/headers/rtc_4.3.0/custom_headers/CustomIAgoraMediaPlayer.h +++ b/headers/rtc_4.3.0/custom_headers/CustomIAgoraMediaPlayer.h @@ -15,14 +15,22 @@ class IMediaPlayerVideoFrameObserver { class IMediaPlayer { // ----------------------------- 👇🏻overload API👇🏻 ----------------------------- - // virtual int setPlayerOption(const char* key, int value) = 0; + /** + * @iris_api_id: MediaPlayer_setPlayerOption_4d05d29 + * @source: virtual int setPlayerOption(const char* key, int value) = 0; + */ virtual int setPlayerOptionInInt(const char *key, int value) = 0; - // virtual int setPlayerOption(const char* key, const char* value) = 0; + /** + * @iris_api_id: MediaPlayer_setPlayerOption_ccad422 + * @source: virtual int setPlayerOption(const char* key, char* value) = 0; + */ virtual int setPlayerOptionInString(const char *key, const char *value) = 0; - // virtual int registerAudioFrameObserver(media::IAudioPcmFrameSink* observer, - // RAW_AUDIO_FRAME_OP_MODE_TYPE mode) = 0; + /** + * @iris_api_id: MediaPlayer_registerAudioFrameObserver_a5b510b + * @source: virtual int registerAudioFrameObserver(media::IAudioPcmFrameSink* observer, RAW_AUDIO_FRAME_OP_MODE_TYPE mode) = 0; + */ virtual int registerAudioFrameObserver(media::IAudioPcmFrameSink* observer, RAW_AUDIO_FRAME_OP_MODE_TYPE mode = RAW_AUDIO_FRAME_OP_MODE_TYPE::RAW_AUDIO_FRAME_OP_MODE_READ_ONLY) = 0; @@ -31,11 +39,17 @@ class IMediaPlayer { // ----------------------------- 👇🏻rename API👇🏻 ----------------------------- - // virtual int registerVideoFrameObserver(media::base::IVideoFrameObserver* observer) = 0; + /** + * @iris_api_id: MediaPlayer_registerVideoFrameObserver_833bd8d + * @source: virtual int registerVideoFrameObserver(media::base::IVideoFrameObserver* observer) = 0; + */ virtual int registerVideoFrameObserver(IMediaPlayerVideoFrameObserver *observer) = 0; - // virtual int unregisterVideoFrameObserver(agora::media::base::IVideoFrameObserver* observer) = 0; + /** + * @iris_api_id: MediaPlayer_unregisterVideoFrameObserver_5165d4c + * @source: virtual int unregisterVideoFrameObserver(agora::media::base::IVideoFrameObserver* observer) = 0; + */ virtual int unregisterVideoFrameObserver(IMediaPlayerVideoFrameObserver *observer) = 0; diff --git a/headers/rtc_4.3.0/custom_headers/CustomIAgoraMusicContentCenter.h b/headers/rtc_4.3.0/custom_headers/CustomIAgoraMusicContentCenter.h index c531a62..b421097 100644 --- a/headers/rtc_4.3.0/custom_headers/CustomIAgoraMusicContentCenter.h +++ b/headers/rtc_4.3.0/custom_headers/CustomIAgoraMusicContentCenter.h @@ -9,7 +9,10 @@ namespace ext { class IMusicPlayer : public IMediaPlayer { // ----------------------------- 👇🏻overload API👇🏻 ----------------------------- - // virtual int open(int64_t songCode, int64_t startPos = 0) = 0; + /** + * @iris_api_id: MusicPlayer_open_303b92e + * @source: virtual int open(int64_t songCode, int64_t startPos = 0) = 0; + */ virtual int openWithSongCode(int64_t songCode, int64_t startPos = 0) = 0; // ----------------------------- 👆🏻overload API👆🏻 ----------------------------- @@ -17,12 +20,10 @@ class IMusicPlayer : public IMediaPlayer { class IMusicContentCenter { - // reason: keep - // virtual int preload(agora::util::AString& requestId, int64_t songCode) = 0; - // - // original: - // virtual int preload(int64_t songCode, const char* jsonOption) __deprecated = 0; - // virtual int preload(agora::util::AString& requestId, int64_t songCode) = 0; + /** + * @iris_api_id: MusicContentCenter_preload_d3baeab + * @source: virtual int preload(agora::util::AString& requestId, int64_t songCode) = 0; + */ virtual int preload(agora::util::AString& requestId, int64_t songCode) = 0; }; } // namespace ext diff --git a/headers/rtc_4.3.0/custom_headers/CustomIAgoraRtcEngine.h b/headers/rtc_4.3.0/custom_headers/CustomIAgoraRtcEngine.h index 01eee73..0dd2769 100644 --- a/headers/rtc_4.3.0/custom_headers/CustomIAgoraRtcEngine.h +++ b/headers/rtc_4.3.0/custom_headers/CustomIAgoraRtcEngine.h @@ -38,153 +38,242 @@ struct AudioDeviceInfo { class IRtcEngine { // ----------------------------- 👇🏻overload API👇🏻 ----------------------------- - // virtual int joinChannel(const char* token, const char* channelId, uid_t uid, - // const ChannelMediaOptions& options) = 0; + /** + * @iris_api_id: RtcEngine_joinChannel_cdbb747 + * @source: virtual int joinChannel(const char* token, const char* channelId, uid_t uid, const ChannelMediaOptions& options) = 0; + */ virtual int joinChannel(const char *token, const char *channelId, uid_t uid, const ChannelMediaOptions &options) = 0; - // virtual int leaveChannel(const LeaveChannelOptions& options) = 0; + /** + * @iris_api_id: RtcEngine_leaveChannel_2c0e3aa + * @source: virtual int leaveChannel(const LeaveChannelOptions& options) = 0; + */ virtual int leaveChannel(const LeaveChannelOptions *options = NULL) = 0; - // virtual int setClientRole(CLIENT_ROLE_TYPE role, const ClientRoleOptions& options) = 0; + /** + * @iris_api_id: RtcEngine_setClientRole_b46cc48 + * @source: virtual int setClientRole(CLIENT_ROLE_TYPE role, const ClientRoleOptions& options) = 0; + */ virtual int setClientRole(CLIENT_ROLE_TYPE role, const ClientRoleOptions *options = NULL) = 0; - // virtual int startEchoTest(const EchoTestConfiguration& config) = 0; + /** + * @iris_api_id: RtcEngine_startEchoTest_16140d7 + * @source: virtual int startEchoTest(const EchoTestConfiguration& config) = 0; + */ virtual int startEchoTest(const EchoTestConfiguration &config) = 0; - // virtual int startPreview(VIDEO_SOURCE_TYPE sourceType) = 0; + /** + * @iris_api_id: RtcEngine_startPreview_4fd718e + * @source: virtual int startPreview(VIDEO_SOURCE_TYPE sourceType) = 0; + */ virtual int startPreview(VIDEO_SOURCE_TYPE sourceType = VIDEO_SOURCE_TYPE::VIDEO_SOURCE_CAMERA_PRIMARY) = 0; - // virtual int stopPreview(VIDEO_SOURCE_TYPE sourceType) = 0; + /** + * @iris_api_id: RtcEngine_stopPreview_4fd718e + * @source: virtual int stopPreview(VIDEO_SOURCE_TYPE sourceType) = 0; + */ virtual int stopPreview(VIDEO_SOURCE_TYPE sourceType = VIDEO_SOURCE_TYPE::VIDEO_SOURCE_CAMERA_PRIMARY) = 0; - // virtual int setAudioProfile(AUDIO_PROFILE_TYPE profile, AUDIO_SCENARIO_TYPE scenario) __deprecated = 0; + /** + * @iris_api_id: RtcEngine_setAudioProfile_d944543 + * @source: virtual int setAudioProfile(AUDIO_PROFILE_TYPE profile, AUDIO_SCENARIO_TYPE scenario) __deprecated = 0; + */ virtual int setAudioProfile(AUDIO_PROFILE_TYPE profile, AUDIO_SCENARIO_TYPE scenario = AUDIO_SCENARIO_TYPE::AUDIO_SCENARIO_DEFAULT) = 0; - // virtual int startAudioRecording(const AudioRecordingConfiguration& config) = 0; + /** + * @iris_api_id: RtcEngine_startAudioRecording_e32bb3b + * @source: virtual int startAudioRecording(const AudioRecordingConfiguration& config) = 0; + */ virtual int startAudioRecording(const AudioRecordingConfiguration &config) = 0; - // virtual int startAudioMixing(const char* filePath, bool loopback, int cycle, int startPos) = 0; + /** + * @iris_api_id: RtcEngine_startAudioMixing_1ee1b1e + * @source: virtual int startAudioMixing(const char* filePath, bool loopback, int cycle, int startPos) = 0; + */ virtual int startAudioMixing(const char *filePath, bool loopback, int cycle, int startPos = 0) = 0; - // virtual int setLocalRenderMode(media::base::RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) = 0; + /** + * @iris_api_id: RtcEngine_setLocalRenderMode_cfb201b + * @source: virtual int setLocalRenderMode(media::base::RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode) = 0; + */ virtual int setLocalRenderMode(media::base::RENDER_MODE_TYPE renderMode, VIDEO_MIRROR_MODE_TYPE mirrorMode = VIDEO_MIRROR_MODE_TYPE::VIDEO_MIRROR_MODE_AUTO) = 0; - // virtual int enableDualStreamMode(bool enabled, const SimulcastStreamConfig& streamConfig) = 0; + /** + * @iris_api_id: RtcEngine_enableDualStreamMode_9822d8a + * @source: virtual int enableDualStreamMode(bool enabled, const SimulcastStreamConfig& streamConfig) = 0; + */ virtual int enableDualStreamMode(bool enabled, const SimulcastStreamConfig *streamConfig = NULL) = 0; - // virtual int setDualStreamMode(SIMULCAST_STREAM_MODE mode, - // const SimulcastStreamConfig& streamConfig) = 0; + /** + * @iris_api_id: RtcEngine_setDualStreamMode_b3a4f6c + * @source: virtual int setDualStreamMode(SIMULCAST_STREAM_MODE mode, const SimulcastStreamConfig& streamConfig) = 0; + */ virtual int setDualStreamMode(SIMULCAST_STREAM_MODE mode, const SimulcastStreamConfig *streamConfig = NULL) = 0; - // virtual int createDataStream(int* streamId, DataStreamConfig& config) = 0; + /** + * @iris_api_id: RtcEngine_createDataStream_5862815 + * @source: virtual int createDataStream(int* streamId, DataStreamConfig& config) = 0; + */ virtual int createDataStream(int *streamId, const DataStreamConfig &config) = 0; - // virtual int addVideoWatermark(const char* watermarkUrl, const WatermarkOptions& options) = 0; + /** + * @iris_api_id: RtcEngine_addVideoWatermark_7480410 + * @source: virtual int addVideoWatermark(const char* watermarkUrl, const WatermarkOptions& options) = 0; + */ virtual int addVideoWatermark(const char *watermarkUrl, const WatermarkOptions &options) = 0; - // virtual int joinChannelWithUserAccount(const char* token, const char* channelId, - // const char* userAccount, const ChannelMediaOptions& options) = 0; + /** + * @iris_api_id: RtcEngine_joinChannelWithUserAccount_4685af9 + * @source: virtual int joinChannelWithUserAccount(const char* token, const char* channelId, const char* userAccount, const ChannelMediaOptions& options) = 0; + */ virtual int joinChannelWithUserAccount(const char *token, const char *channelId, const char *userAccount, const ChannelMediaOptions *options = NULL) = 0; - // virtual int enableExtension(const char* provider, const char* extension, const ExtensionInfo& extensionInfo, bool enable = true) = 0; + /** + * @iris_api_id: RtcEngine_enableExtension_0b60a2c + * @source: virtual int enableExtension(const char* provider, const char* extension, const ExtensionInfo& extensionInfo, bool enable = true) = 0; + */ virtual int enableExtension(const char *provider, const char *extension, bool enable = true, agora::media::MEDIA_SOURCE_TYPE type = agora::media::UNKNOWN_MEDIA_SOURCE) = 0; - // virtual int setExtensionProperty( - // const char* provider, const char* extension, - // const char* key, const char* value, agora::media::MEDIA_SOURCE_TYPE type = agora::media::UNKNOWN_MEDIA_SOURCE) = 0; + /** + * @iris_api_id: RtcEngine_setExtensionProperty_520ac55 + * @source: virtual int setExtensionProperty(const char* provider, const char* extension, const char* key, const char* value, agora::media::MEDIA_SOURCE_TYPE type = agora::media::UNKNOWN_MEDIA_SOURCE) = 0; + */ virtual int setExtensionProperty(const char *provider, const char *extension, const char *key, const char *value, agora::media::MEDIA_SOURCE_TYPE type = agora::media::UNKNOWN_MEDIA_SOURCE) = 0; - // virtual int getExtensionProperty( - // const char* provider, const char* extension, - // const char* key, char* value, int buf_len, agora::media::MEDIA_SOURCE_TYPE type = agora::media::UNKNOWN_MEDIA_SOURCE) = 0; + /** + * @iris_api_id: RtcEngine_getExtensionProperty_38c9723 + * @source: virtual int getExtensionProperty(const char* provider, const char* extension, const char* key, char* value, int buf_len, agora::media::MEDIA_SOURCE_TYPE type = agora::media::UNKNOWN_MEDIA_SOURCE) = 0; + */ virtual int getExtensionProperty(const char *provider, const char *extension, const char *key, char *value, int buf_len, agora::media::MEDIA_SOURCE_TYPE type = agora::media::UNKNOWN_MEDIA_SOURCE) = 0; - // virtual int startScreenCapture(const ScreenCaptureParameters2& captureParams) = 0; + /** + * @iris_api_id: RtcEngine_startScreenCapture_270da41 + * @source: virtual int startScreenCapture(const ScreenCaptureParameters2& captureParams) = 0; + */ virtual int startScreenCapture(const ScreenCaptureParameters2 &captureParams) = 0; - // virtual int startScreenCapture(VIDEO_SOURCE_TYPE sourceType, const ScreenCaptureConfiguration& config) = 0; + /** + * @iris_api_id: RtcEngine_startScreenCapture_9ebb320 + * @source: virtual int startScreenCapture(VIDEO_SOURCE_TYPE sourceType, const ScreenCaptureConfiguration& config) = 0; + */ virtual int startScreenCaptureBySourceType( VIDEO_SOURCE_TYPE sourceType, const ScreenCaptureConfiguration &config) = 0; - // virtual int stopScreenCapture() = 0; + /** + * @iris_api_id: RtcEngine_stopScreenCapture + * @source: virtual int stopScreenCapture() = 0; + */ virtual int stopScreenCapture() = 0; - // virtual int stopScreenCapture(VIDEO_SOURCE_TYPE sourceType) = 0; + /** + * @iris_api_id: RtcEngine_stopScreenCapture_4fd718e + * @source: virtual int stopScreenCapture(VIDEO_SOURCE_TYPE sourceType) = 0; + */ virtual int stopScreenCaptureBySourceType(VIDEO_SOURCE_TYPE sourceType) = 0; - // AGORA_CPP_API static void release(bool sync = false); + /** + * @iris_api_id: RtcEngine_release + * @source: AGORA_CPP_API static void release(bool sync = false); + */ virtual void release(bool sync = false) = 0; // ----------------------------- 👆🏻overload API👆🏻 ----------------------------- // ----------------------------- 👇🏻rename API👇🏻 ----------------------------- - // virtual int startPreview() = 0; + /** + * @iris_api_id: RtcEngine_startPreview + * @source: virtual int startPreview() = 0; + */ virtual int startPreviewWithoutSourceType() = 0; - // virtual int queryInterface(INTERFACE_ID_TYPE iid, void** inter) = 0; + /** + * @iris_api_id: RtcEngine_queryInterface_257d192 + * @source: virtual int queryInterface(INTERFACE_ID_TYPE iid, void** inter) = 0; + */ // AGORA_IID_AUDIO_DEVICE_MANAGER = 1, virtual IAudioDeviceManager *getAudioDeviceManager() = 0; - // virtual int queryInterface(INTERFACE_ID_TYPE iid, void** inter) = 0; + /** + * @iris_api_id: RtcEngine_queryInterface_257d192 + * @source: virtual int queryInterface(INTERFACE_ID_TYPE iid, void** inter) = 0; + */ // AGORA_IID_VIDEO_DEVICE_MANAGER = 2, virtual IVideoDeviceManager *getVideoDeviceManager() = 0; - // virtual int queryInterface(INTERFACE_ID_TYPE iid, void** inter) = 0; + /** + * @iris_api_id: RtcEngine_queryInterface_257d192 + * @source: virtual int queryInterface(INTERFACE_ID_TYPE iid, void** inter) = 0; + */ // AGORA_IID_MUSIC_CONTENT_CENTER = 15, virtual IMusicContentCenter *getMusicContentCenter() = 0; - // virtual int queryInterface(INTERFACE_ID_TYPE iid, void** inter) = 0; + /** + * @iris_api_id: RtcEngine_queryInterface_257d192 + * @source: virtual int queryInterface(INTERFACE_ID_TYPE iid, void** inter) = 0; + */ // AGORA_IID_MEDIA_ENGINE = 4, virtual agora::media::IMediaEngine *getMediaEngine() = 0; - // virtual int queryInterface(INTERFACE_ID_TYPE iid, void** inter) = 0; + /** + * @iris_api_id: RtcEngine_queryInterface_257d192 + * @source: virtual int queryInterface(INTERFACE_ID_TYPE iid, void** inter) = 0; + */ // AGORA_IID_LOCAL_SPATIAL_AUDIO = 11, virtual ILocalSpatialAudioEngine *getLocalSpatialAudioEngine() = 0; - // virtual int queryInterface(INTERFACE_ID_TYPE iid, void** inter) = 0; + /** + * @iris_api_id: RtcEngine_queryInterface_257d192 + * @source: virtual int queryInterface(INTERFACE_ID_TYPE iid, void** inter) = 0; + */ // AGORA_IID_H265_TRANSCODER = 16, virtual IH265Transcoder *getH265Transcoder() = 0; - // virtual bool onReadyToSendMetadata(Metadata &metadata, VIDEO_SOURCE_TYPE source_type) = 0; + /** + * @iris_api_id: RtcEngine_sendMetaData + * @source: virtual bool onReadyToSendMetadata(Metadata &metadata, VIDEO_SOURCE_TYPE source_type) = 0; + */ virtual int sendMetaData(const IMetadataObserver::Metadata &metadata, VIDEO_SOURCE_TYPE source_type) = 0; - // virtual int getMaxMetadataSize() { return DEFAULT_METADATA_SIZE_IN_BYTE; } + /** + * @iris_api_id: RtcEngine_setMaxMetadataSize + * @source: virtual int getMaxMetadataSize() { return DEFAULT_METADATA_SIZE_IN_BYTE; } + */ virtual int setMaxMetadataSize(int size) = 0; // ----------------------------- 👆🏻rename API👆🏻 ----------------------------- @@ -200,25 +289,33 @@ class IRtcEngine { #endif + /** + * @iris_api_id: RtcEngine_unregisterAudioEncodedFrameObserver + * @source: virtual int registerAudioEncodedFrameObserver(const AudioEncodedFrameObserverConfig& config, IAudioEncodedFrameObserver *observer) = 0; + */ // add for registerAudioEncodedFrameObserver - // virtual int registerAudioEncodedFrameObserver(const AudioEncodedFrameObserverConfig& config, IAudioEncodedFrameObserver *observer) = 0; virtual int unregisterAudioEncodedFrameObserver(IAudioEncodedFrameObserver *observer) = 0; + /** + * @iris_api_id: RtcEngine_getNativeHandle + * @source: AGORA_API agora::rtc::IRtcEngine* AGORA_CALL createAgoraRtcEngine(); + */ // add for createAgoraRtcEngine - // AGORA_API agora::rtc::IRtcEngine* AGORA_CALL createAgoraRtcEngine(); virtual intptr_t getNativeHandle() = 0; // ----------------------------- 👆🏻new API👆🏻 ----------------------------- - // reason: keep - // original: - // virtual int preloadChannel(const char* token, const char* channelId, uid_t uid) = 0; + /** + * @iris_api_id: RtcEngine_preloadChannel_a0779eb + * @source: virtual int preloadChannel(const char* token, const char* channelId, uid_t uid) = 0; + */ virtual int preloadChannel(const char* token, const char* channelId, uid_t uid) = 0; - // reason: rename - // original: - // virtual int preloadChannel(const char* token, const char* channelId, const char* userAccount) = 0; + /** + * @iris_api_id: RtcEngine_preloadChannelWithUserAccount_0e4f59e + * @source: virtual int preloadChannel(const char* token, const char* channelId, const char* userAccount) = 0; + */ virtual int preloadChannelWithUserAccount(const char* token, const char* channelId, const char* userAccount) = 0; }; diff --git a/headers/rtc_4.3.0/custom_headers/CustomIAgoraRtcEngineEx.h b/headers/rtc_4.3.0/custom_headers/CustomIAgoraRtcEngineEx.h index 7aec9e5..5bc5265 100644 --- a/headers/rtc_4.3.0/custom_headers/CustomIAgoraRtcEngineEx.h +++ b/headers/rtc_4.3.0/custom_headers/CustomIAgoraRtcEngineEx.h @@ -10,11 +10,17 @@ namespace ext { class IRtcEngineEx { // ----------------------------- 👇🏻overload API👇🏻 ----------------------------- - // virtual int leaveChannelEx(const RtcConnection& connection, const LeaveChannelOptions& options) = 0; + /** + * @iris_api_id: RtcEngineEx_leaveChannelEx_b03ee9a + * @source: virtual int leaveChannelEx(const RtcConnection& connection, const LeaveChannelOptions& options) = 0; + */ virtual int leaveChannelEx(const RtcConnection &connection, const LeaveChannelOptions *options = NULL) = 0; - // virtual int createDataStreamEx(int* streamId, DataStreamConfig& config, const RtcConnection& connection) = 0; + /** + * @iris_api_id: RtcEngineEx_createDataStreamEx_9f641b6 + * @source: virtual int createDataStreamEx(int* streamId, DataStreamConfig& config, const RtcConnection& connection) = 0; + */ virtual int createDataStreamEx(int *streamId, DataStreamConfig &config, const RtcConnection &connection) = 0; diff --git a/headers/rtc_4.3.0/custom_headers/CustomIAudioDeviceManager.h b/headers/rtc_4.3.0/custom_headers/CustomIAudioDeviceManager.h index 27765f3..cb49f78 100644 --- a/headers/rtc_4.3.0/custom_headers/CustomIAudioDeviceManager.h +++ b/headers/rtc_4.3.0/custom_headers/CustomIAudioDeviceManager.h @@ -9,12 +9,16 @@ namespace ext { class IAudioDeviceManager { // ----------------------------- 👇🏻rename API👇🏻 ----------------------------- - // IAudioDeviceCollection - // virtual int getDefaultDevice(char deviceName[MAX_DEVICE_ID_LENGTH], char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + /** + * @iris_api_id: AudioDeviceManager_getPlaybackDefaultDevice + * @source: virtual int getDefaultDevice(char deviceName[MAX_DEVICE_ID_LENGTH], char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + */ virtual AudioDeviceInfo *getPlaybackDefaultDevice() = 0; - // IAudioDeviceCollection - // virtual int getDefaultDevice(char deviceName[MAX_DEVICE_ID_LENGTH], char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + /** + * @iris_api_id: AudioDeviceManager_getRecordingDefaultDevice + * @source: virtual int getDefaultDevice(char deviceName[MAX_DEVICE_ID_LENGTH], char deviceId[MAX_DEVICE_ID_LENGTH]) = 0; + */ virtual AudioDeviceInfo *getRecordingDefaultDevice() = 0; // ----------------------------- 👆🏻rename API👆🏻 ----------------------------- diff --git a/src/__tests__/parsers/add_node_parser.test.ts b/src/__tests__/parsers/add_node_parser.test.ts index 0b334bd..f3a0ef0 100644 --- a/src/__tests__/parsers/add_node_parser.test.ts +++ b/src/__tests__/parsers/add_node_parser.test.ts @@ -263,6 +263,8 @@ describe('AddNodeParser', () => { { __TYPE: 'MemberFunction', name: 'getCount', + comment: + '@iris_api_id: MediaEngine_IScreenCaptureSourceList @source: getCount', parameters: [ { __TYPE: 'Variable', @@ -273,6 +275,8 @@ describe('AddNodeParser', () => { { __TYPE: 'MemberFunction', name: 'getCount', + comment: + '@iris_api_id: MediaEngine_IScreenCaptureSourceList @source: getCount', parameters: [ { __TYPE: 'Variable', @@ -295,6 +299,8 @@ describe('AddNodeParser', () => { { __TYPE: 'MemberFunction', name: 'getCount', + comment: + '@iris_api_id: MediaEngine_IScreenCaptureSourceList @source: getCount', parameters: [ { __TYPE: 'Variable', @@ -319,6 +325,7 @@ describe('AddNodeParser', () => { const clazz = (result?.nodes[0] as CXXFile).nodes[0] as Clazz; expect(clazz.methods.length).toBe(1); expect(clazz.methods[0].name).toBe('getCount'); + expect(clazz.methods[0].comment).toBe(''); expect(clazz.methods[0].parameters[0].name).toBe('c'); }); }); diff --git a/src/parsers/add_node_parser.ts b/src/parsers/add_node_parser.ts index 6b63ed2..4d7f89e 100644 --- a/src/parsers/add_node_parser.ts +++ b/src/parsers/add_node_parser.ts @@ -9,7 +9,16 @@ import { } from '@agoraio-extensions/cxx-parser'; import { ParseResult, TerraContext } from '@agoraio-extensions/terra-core'; -import { generateNodes } from '../utils/parser_utils'; +import { irisApiId } from '../utils'; +import { + CommentAction, + CommentConfig, + CommentConfigKey, + generateNodes, + getConfigsFromComments, +} from '../utils/parser_utils'; + +import { IrisApiIdParserUserData } from './iris_api_id_parser'; export type AddNodeParserArgs = CXXParserConfigs & { customHeaderFileNamePrefix?: string; @@ -63,10 +72,23 @@ export const AddNodeParser = ( } (customNode as Clazz).methods.forEach((customMethod) => { - // find method which has same name - const foundMethodIndex = foundClass.methods.findIndex( - (it) => it.name === customMethod.name - ); + let configs: CommentConfig[] = getConfigsFromComments(customMethod); + let foundMethodIndex = -1; + let irisApiIdValue = ''; + for (let config of configs) { + switch (config.key) { + case CommentConfigKey.SOURCE: + // find method which has same name + foundMethodIndex = foundClass.methods.findIndex( + (it) => it.name === customMethod.name + ); + break; + case CommentConfigKey.IRIS_API_ID: + // get iris api id from comment key IRIS_API_ID + irisApiIdValue = config.value; + break; + } + } if (foundMethodIndex == -1) { // add method if not found foundClass.methods.push(customMethod); @@ -74,6 +96,13 @@ export const AddNodeParser = ( } // mark method as custom + // iris use nativeSDK origin cpp api signature, so we need call applyIrisApiId to add iris api id by foundClass.methods[foundMethodIndex] + customMethod.user_data ??= {}; + (customMethod.user_data as IrisApiIdParserUserData).IrisApiIdParser = { + key: '', + value: irisApiIdValue, + }; + customMethod.user_data = { ...customMethod.user_data, AddNodeParser: foundClass.methods[foundMethodIndex], diff --git a/src/utils/parser_utils.ts b/src/utils/parser_utils.ts index 91edfdb..80585c2 100644 --- a/src/utils/parser_utils.ts +++ b/src/utils/parser_utils.ts @@ -1,4 +1,8 @@ -import { CXXParser, CXXParserConfigs } from '@agoraio-extensions/cxx-parser'; +import { + CXXParser, + CXXParserConfigs, + CXXTerraNode, +} from '@agoraio-extensions/cxx-parser'; import { ParseResult, TerraContext, @@ -35,3 +39,30 @@ export function getConfigs(args: BaseParserArgs, terraContext: TerraContext) { } return configs; } + +export enum CommentConfigKey { + SOURCE = 'source', + ACTION = 'action', + IRIS_API_ID = 'iris_api_id', +} + +export enum CommentAction { + ADD = 'add', + REPLACE = 'replace', + REMOVE = 'remove', +} + +export type CommentConfig = { key: CommentConfigKey; value: string }; + +export const getConfigsFromComments = (node: CXXTerraNode) => { + const regex = /@(\w+):(.+?)(?=@|$)/gs; + const matches = [...node.comment.matchAll(regex)]; + const configs: CommentConfig[] = matches.map((match) => { + return { + key: match[1] as CommentConfigKey, + value: match[2].trim(), + }; + }); + node.comment = ''; + return configs; +};