From 185dab87ae64a67ed922fbb62a0d636a6a5604f5 Mon Sep 17 00:00:00 2001 From: littleGnAl Date: Tue, 16 Jan 2024 13:59:57 +0800 Subject: [PATCH] ++ --- .../generated/event_ids_mapping.dart | 570 ++++++++++++++++++ .../renderers/event_ids_mapping_renderer.ts | 85 +++ tool/terra/renderers/utils.ts | 7 + 3 files changed, 662 insertions(+) create mode 100644 test_shard/fake_test_app/integration_test/generated/event_ids_mapping.dart create mode 100644 tool/terra/renderers/event_ids_mapping_renderer.ts create mode 100644 tool/terra/renderers/utils.ts diff --git a/test_shard/fake_test_app/integration_test/generated/event_ids_mapping.dart b/test_shard/fake_test_app/integration_test/generated/event_ids_mapping.dart new file mode 100644 index 000000000..98b326425 --- /dev/null +++ b/test_shard/fake_test_app/integration_test/generated/event_ids_mapping.dart @@ -0,0 +1,570 @@ +/// Event Ids mapping of iris api id. +const eventIdsMapping = { + "PacketObserver_onSendAudioPacket": [ + "PacketObserver_onSendAudioPacket_4ad95e3" + ], + "PacketObserver_onSendVideoPacket": [ + "PacketObserver_onSendVideoPacket_4ad95e3" + ], + "PacketObserver_onReceiveAudioPacket": [ + "PacketObserver_onReceiveAudioPacket_4ad95e3" + ], + "PacketObserver_onReceiveVideoPacket": [ + "PacketObserver_onReceiveVideoPacket_4ad95e3" + ], + "AudioEncodedFrameObserver_onRecordAudioEncodedFrame": [ + "AudioEncodedFrameObserver_onRecordAudioEncodedFrame_d930ddc" + ], + "AudioEncodedFrameObserver_onPlaybackAudioEncodedFrame": [ + "AudioEncodedFrameObserver_onPlaybackAudioEncodedFrame_d930ddc" + ], + "AudioEncodedFrameObserver_onMixedAudioEncodedFrame": [ + "AudioEncodedFrameObserver_onMixedAudioEncodedFrame_d930ddc" + ], + "LicenseCallback_onCertificateRequired": [ + "LicenseCallback_onCertificateRequired" + ], + "LicenseCallback_onLicenseRequest": ["LicenseCallback_onLicenseRequest"], + "LicenseCallback_onLicenseValidated": ["LicenseCallback_onLicenseValidated"], + "LicenseCallback_onLicenseError": ["LicenseCallback_onLicenseError_46f8ab7"], + "VideoFrameObserver_onFrame": ["VideoFrameObserver_onFrame_d715140"], + "VideoFrameObserver_isExternal": [ + "VideoFrameObserver_isExternal", + "VideoFrameObserver_isExternal" + ], + "VideoFrameObserver_getVideoFormatPreference": [ + "VideoFrameObserver_getVideoFormatPreference", + "VideoFrameObserver_getVideoFormatPreference" + ], + "AudioPcmFrameSink_onFrame": ["AudioPcmFrameSink_onFrame_95f515a"], + "AudioFrameObserverBase_onRecordAudioFrame": [ + "AudioFrameObserver_onRecordAudioFrame_4c8de15" + ], + "AudioFrameObserverBase_onPlaybackAudioFrame": [ + "AudioFrameObserver_onPlaybackAudioFrame_4c8de15" + ], + "AudioFrameObserverBase_onMixedAudioFrame": [ + "AudioFrameObserver_onMixedAudioFrame_4c8de15" + ], + "AudioFrameObserverBase_onEarMonitoringAudioFrame": [ + "AudioFrameObserver_onEarMonitoringAudioFrame_5405a47" + ], + "AudioFrameObserverBase_onPlaybackAudioFrameBeforeMixing": [ + "AudioFrameObserver_onPlaybackAudioFrameBeforeMixing_9215cc7" + ], + "AudioFrameObserverBase_getObservedAudioFramePosition": [ + "AudioFrameObserver_getObservedAudioFramePosition" + ], + "AudioFrameObserverBase_getPlaybackAudioParams": [ + "AudioFrameObserver_getPlaybackAudioParams" + ], + "AudioFrameObserverBase_getRecordAudioParams": [ + "AudioFrameObserver_getRecordAudioParams" + ], + "AudioFrameObserverBase_getMixedAudioParams": [ + "AudioFrameObserver_getMixedAudioParams" + ], + "AudioFrameObserverBase_getEarMonitoringAudioParams": [ + "AudioFrameObserver_getEarMonitoringAudioParams" + ], + "AudioFrameObserver_onPlaybackAudioFrameBeforeMixing": [ + "AudioFrameObserver_onPlaybackAudioFrameBeforeMixing_85ec0fc", + "AudioFrameObserver_onPlaybackAudioFrameBeforeMixing_9215cc7" + ], + "AudioFrameObserver_onRecordAudioFrame": [ + "AudioFrameObserver_onRecordAudioFrame_4c8de15" + ], + "AudioFrameObserver_onPlaybackAudioFrame": [ + "AudioFrameObserver_onPlaybackAudioFrame_4c8de15" + ], + "AudioFrameObserver_onMixedAudioFrame": [ + "AudioFrameObserver_onMixedAudioFrame_4c8de15" + ], + "AudioFrameObserver_onEarMonitoringAudioFrame": [ + "AudioFrameObserver_onEarMonitoringAudioFrame_5405a47" + ], + "AudioFrameObserver_getObservedAudioFramePosition": [ + "AudioFrameObserver_getObservedAudioFramePosition" + ], + "AudioFrameObserver_getPlaybackAudioParams": [ + "AudioFrameObserver_getPlaybackAudioParams" + ], + "AudioFrameObserver_getRecordAudioParams": [ + "AudioFrameObserver_getRecordAudioParams" + ], + "AudioFrameObserver_getMixedAudioParams": [ + "AudioFrameObserver_getMixedAudioParams" + ], + "AudioFrameObserver_getEarMonitoringAudioParams": [ + "AudioFrameObserver_getEarMonitoringAudioParams" + ], + "AudioSpectrumObserver_onLocalAudioSpectrum": [ + "AudioSpectrumObserver_onLocalAudioSpectrum_5822fed" + ], + "AudioSpectrumObserver_onRemoteAudioSpectrum": [ + "AudioSpectrumObserver_onRemoteAudioSpectrum_8ea2cde" + ], + "VideoEncodedFrameObserver_onEncodedVideoFrameReceived": [ + "VideoEncodedFrameObserver_onEncodedVideoFrameReceived_6922697" + ], + "VideoFrameObserver_onCaptureVideoFrame": [ + "VideoFrameObserver_onCaptureVideoFrame_1673590" + ], + "VideoFrameObserver_onPreEncodeVideoFrame": [ + "VideoFrameObserver_onPreEncodeVideoFrame_1673590" + ], + "VideoFrameObserver_onMediaPlayerVideoFrame": [ + "VideoFrameObserver_onMediaPlayerVideoFrame_e648e2c" + ], + "VideoFrameObserver_onRenderVideoFrame": [ + "VideoFrameObserver_onRenderVideoFrame_43dcf82" + ], + "VideoFrameObserver_onTranscodedVideoFrame": [ + "VideoFrameObserver_onTranscodedVideoFrame_27754d8" + ], + "VideoFrameObserver_getVideoFrameProcessMode": [ + "VideoFrameObserver_getVideoFrameProcessMode" + ], + "VideoFrameObserver_getRotationApplied": [ + "VideoFrameObserver_getRotationApplied" + ], + "VideoFrameObserver_getMirrorApplied": [ + "VideoFrameObserver_getMirrorApplied" + ], + "VideoFrameObserver_getObservedFramePosition": [ + "VideoFrameObserver_getObservedFramePosition" + ], + "MediaRecorderObserver_onRecorderStateChanged": [ + "MediaRecorderObserver_onRecorderStateChanged_c38849f" + ], + "MediaRecorderObserver_onRecorderInfoUpdated": [ + "MediaRecorderObserver_onRecorderInfoUpdated_64fa74a" + ], + "MediaPlayerCustomDataProvider_onReadData": [ + "MediaPlayerCustomDataProvider_onReadData_6e75338" + ], + "MediaPlayerCustomDataProvider_onSeek": [ + "MediaPlayerCustomDataProvider_onSeek_624d569" + ], + "H265TranscoderObserver_onEnableTranscode": [ + "H265TranscoderObserver_onEnableTranscode_6ba6646" + ], + "H265TranscoderObserver_onQueryChannel": [ + "H265TranscoderObserver_onQueryChannel_31ba3df" + ], + "H265TranscoderObserver_onTriggerTranscode": [ + "H265TranscoderObserver_onTriggerTranscode_6ba6646" + ], + "MediaPlayerSourceObserver_onPlayerSourceStateChanged": [ + "MediaPlayerSourceObserver_onPlayerSourceStateChanged_7fb38f1" + ], + "MediaPlayerSourceObserver_onPositionChanged": [ + "MediaPlayerSourceObserver_onPositionChanged_303b92e" + ], + "MediaPlayerSourceObserver_onPlayerEvent": [ + "MediaPlayerSourceObserver_onPlayerEvent_50f16fa" + ], + "MediaPlayerSourceObserver_onMetaData": [ + "MediaPlayerSourceObserver_onMetaData_469a01b" + ], + "MediaPlayerSourceObserver_onPlayBufferUpdated": [ + "MediaPlayerSourceObserver_onPlayBufferUpdated_f631116" + ], + "MediaPlayerSourceObserver_onPreloadEvent": [ + "MediaPlayerSourceObserver_onPreloadEvent_a1e3596" + ], + "MediaPlayerSourceObserver_onCompleted": [ + "MediaPlayerSourceObserver_onCompleted" + ], + "MediaPlayerSourceObserver_onAgoraCDNTokenWillExpire": [ + "MediaPlayerSourceObserver_onAgoraCDNTokenWillExpire" + ], + "MediaPlayerSourceObserver_onPlayerSrcInfoChanged": [ + "MediaPlayerSourceObserver_onPlayerSrcInfoChanged_54f3e5a" + ], + "MediaPlayerSourceObserver_onPlayerInfoUpdated": [ + "MediaPlayerSourceObserver_onPlayerInfoUpdated_0e902a8" + ], + "MediaPlayerSourceObserver_onPlayerCacheStats": [ + "MediaPlayerSourceObserver_onPlayerCacheStats_0145940" + ], + "MediaPlayerSourceObserver_onPlayerPlaybackStats": [ + "MediaPlayerSourceObserver_onPlayerPlaybackStats_ffa466f" + ], + "MediaPlayerSourceObserver_onAudioVolumeIndication": [ + "MediaPlayerSourceObserver_onAudioVolumeIndication_46f8ab7" + ], + "MediaStreamingSourceObserver_onStateChanged": [ + "MediaStreamingSourceObserver_onStateChanged_245f90c" + ], + "MediaStreamingSourceObserver_onOpenDone": [ + "MediaStreamingSourceObserver_onOpenDone_2dddc98" + ], + "MediaStreamingSourceObserver_onSeekDone": [ + "MediaStreamingSourceObserver_onSeekDone_2dddc98" + ], + "MediaStreamingSourceObserver_onEofOnce": [ + "MediaStreamingSourceObserver_onEofOnce_303b92e" + ], + "MediaStreamingSourceObserver_onProgress": [ + "MediaStreamingSourceObserver_onProgress_f631116" + ], + "MediaStreamingSourceObserver_onMetaData": [ + "MediaStreamingSourceObserver_onMetaData_469a01b" + ], + "MusicContentCenterEventHandler_onMusicChartsResult": [ + "MusicContentCenterEventHandler_onMusicChartsResult_fb18135" + ], + "MusicContentCenterEventHandler_onMusicCollectionResult": [ + "MusicContentCenterEventHandler_onMusicCollectionResult_c30c2e6" + ], + "MusicContentCenterEventHandler_onLyricResult": [ + "MusicContentCenterEventHandler_onLyricResult_9ad9c90" + ], + "MusicContentCenterEventHandler_onSongSimpleInfoResult": [ + "MusicContentCenterEventHandler_onSongSimpleInfoResult_9ad9c90" + ], + "MusicContentCenterEventHandler_onPreLoadEvent": [ + "MusicContentCenterEventHandler_onPreLoadEvent_20170bc" + ], + "RtcEngineEventHandler_onJoinChannelSuccess": [ + "RtcEngineEventHandler_onJoinChannelSuccess_ee6b011", + "RtcEngineEventHandler_onJoinChannelSuccess_263e4cd" + ], + "RtcEngineEventHandler_onRejoinChannelSuccess": [ + "RtcEngineEventHandler_onRejoinChannelSuccess_ee6b011", + "RtcEngineEventHandler_onRejoinChannelSuccess_263e4cd" + ], + "RtcEngineEventHandler_onProxyConnected": [ + "RtcEngineEventHandler_onProxyConnected_9f89fd0" + ], + "RtcEngineEventHandler_onError": ["RtcEngineEventHandler_onError_aaa1a08"], + "RtcEngineEventHandler_onAudioQuality": [ + "RtcEngineEventHandler_onAudioQuality_072650c", + "RtcEngineEventHandler_onAudioQuality_ec43b47" + ], + "RtcEngineEventHandler_onLastmileProbeResult": [ + "RtcEngineEventHandler_onLastmileProbeResult_42b5843" + ], + "RtcEngineEventHandler_onAudioVolumeIndication": [ + "RtcEngineEventHandler_onAudioVolumeIndication_72e3b37", + "RtcEngineEventHandler_onAudioVolumeIndication_d29adad" + ], + "RtcEngineEventHandler_onLeaveChannel": [ + "RtcEngineEventHandler_onLeaveChannel_40ef426", + "RtcEngineEventHandler_onLeaveChannel_c8e730d" + ], + "RtcEngineEventHandler_onRtcStats": [ + "RtcEngineEventHandler_onRtcStats_40ef426", + "RtcEngineEventHandler_onRtcStats_c8e730d" + ], + "RtcEngineEventHandler_onAudioDeviceStateChanged": [ + "RtcEngineEventHandler_onAudioDeviceStateChanged_043d4e0" + ], + "RtcEngineEventHandler_onAudioMixingPositionChanged": [ + "RtcEngineEventHandler_onAudioMixingPositionChanged_f631116" + ], + "RtcEngineEventHandler_onAudioMixingFinished": [ + "RtcEngineEventHandler_onAudioMixingFinished" + ], + "RtcEngineEventHandler_onAudioEffectFinished": [ + "RtcEngineEventHandler_onAudioEffectFinished_46f8ab7" + ], + "RtcEngineEventHandler_onVideoDeviceStateChanged": [ + "RtcEngineEventHandler_onVideoDeviceStateChanged_043d4e0" + ], + "RtcEngineEventHandler_onNetworkQuality": [ + "RtcEngineEventHandler_onNetworkQuality_11121ee", + "RtcEngineEventHandler_onNetworkQuality_69f3a52" + ], + "RtcEngineEventHandler_onIntraRequestReceived": [ + "RtcEngineEventHandler_onIntraRequestReceived", + "RtcEngineEventHandler_onIntraRequestReceived_c81e1a4" + ], + "RtcEngineEventHandler_onUplinkNetworkInfoUpdated": [ + "RtcEngineEventHandler_onUplinkNetworkInfoUpdated_cbb1856" + ], + "RtcEngineEventHandler_onDownlinkNetworkInfoUpdated": [ + "RtcEngineEventHandler_onDownlinkNetworkInfoUpdated_e9d5bd9" + ], + "RtcEngineEventHandler_onLastmileQuality": [ + "RtcEngineEventHandler_onLastmileQuality_544f910" + ], + "RtcEngineEventHandler_onFirstLocalVideoFrame": [ + "RtcEngineEventHandler_onFirstLocalVideoFrame_ebdfd19" + ], + "RtcEngineEventHandler_onFirstLocalVideoFramePublished": [ + "RtcEngineEventHandler_onFirstLocalVideoFramePublished_2ad83d8" + ], + "RtcEngineEventHandler_onFirstRemoteVideoDecoded": [ + "RtcEngineEventHandler_onFirstRemoteVideoDecoded_58b686c", + "RtcEngineEventHandler_onFirstRemoteVideoDecoded_a68170a" + ], + "RtcEngineEventHandler_onVideoSizeChanged": [ + "RtcEngineEventHandler_onVideoSizeChanged_5f7d8e3", + "RtcEngineEventHandler_onVideoSizeChanged_99bf45c" + ], + "RtcEngineEventHandler_onLocalVideoStateChanged": [ + "RtcEngineEventHandler_onLocalVideoStateChanged_a44228a" + ], + "RtcEngineEventHandler_onRemoteVideoStateChanged": [ + "RtcEngineEventHandler_onRemoteVideoStateChanged_815ab69", + "RtcEngineEventHandler_onRemoteVideoStateChanged_a14e9d1" + ], + "RtcEngineEventHandler_onFirstRemoteVideoFrame": [ + "RtcEngineEventHandler_onFirstRemoteVideoFrame_58b686c", + "RtcEngineEventHandler_onFirstRemoteVideoFrame_a68170a" + ], + "RtcEngineEventHandler_onUserJoined": [ + "RtcEngineEventHandler_onUserJoined_88641bf", + "RtcEngineEventHandler_onUserJoined_c5499bd" + ], + "RtcEngineEventHandler_onUserOffline": [ + "RtcEngineEventHandler_onUserOffline_eb1e059", + "RtcEngineEventHandler_onUserOffline_0a32aac" + ], + "RtcEngineEventHandler_onUserMuteAudio": [ + "RtcEngineEventHandler_onUserMuteAudio_dbdc15a", + "RtcEngineEventHandler_onUserMuteAudio_0aac2fe" + ], + "RtcEngineEventHandler_onUserMuteVideo": [ + "RtcEngineEventHandler_onUserMuteVideo_dbdc15a", + "RtcEngineEventHandler_onUserMuteVideo_0aac2fe" + ], + "RtcEngineEventHandler_onUserEnableVideo": [ + "RtcEngineEventHandler_onUserEnableVideo_dbdc15a", + "RtcEngineEventHandler_onUserEnableVideo_0aac2fe" + ], + "RtcEngineEventHandler_onUserStateChanged": [ + "RtcEngineEventHandler_onUserStateChanged_c63723e", + "RtcEngineEventHandler_onUserStateChanged_65f95a7" + ], + "RtcEngineEventHandler_onUserEnableLocalVideo": [ + "RtcEngineEventHandler_onUserEnableLocalVideo_dbdc15a", + "RtcEngineEventHandler_onUserEnableLocalVideo_0aac2fe" + ], + "RtcEngineEventHandler_onRemoteAudioStats": [ + "RtcEngineEventHandler_onRemoteAudioStats_4aba4cc", + "RtcEngineEventHandler_onRemoteAudioStats_ffbde06" + ], + "RtcEngineEventHandler_onLocalAudioStats": [ + "RtcEngineEventHandler_onLocalAudioStats_8fcb8ec", + "RtcEngineEventHandler_onLocalAudioStats_5657f05" + ], + "RtcEngineEventHandler_onLocalVideoStats": [ + "RtcEngineEventHandler_onLocalVideoStats_baa96c8" + ], + "RtcEngineEventHandler_onRemoteVideoStats": [ + "RtcEngineEventHandler_onRemoteVideoStats_e271890", + "RtcEngineEventHandler_onRemoteVideoStats_2f43a70" + ], + "RtcEngineEventHandler_onCameraReady": [ + "RtcEngineEventHandler_onCameraReady" + ], + "RtcEngineEventHandler_onCameraFocusAreaChanged": [ + "RtcEngineEventHandler_onCameraFocusAreaChanged_41c5354" + ], + "RtcEngineEventHandler_onCameraExposureAreaChanged": [ + "RtcEngineEventHandler_onCameraExposureAreaChanged_41c5354" + ], + "RtcEngineEventHandler_onFacePositionChanged": [ + "RtcEngineEventHandler_onFacePositionChanged_e56adf2" + ], + "RtcEngineEventHandler_onVideoStopped": [ + "RtcEngineEventHandler_onVideoStopped" + ], + "RtcEngineEventHandler_onAudioMixingStateChanged": [ + "RtcEngineEventHandler_onAudioMixingStateChanged_fd2c0a6" + ], + "RtcEngineEventHandler_onRhythmPlayerStateChanged": [ + "RtcEngineEventHandler_onRhythmPlayerStateChanged_09360d2" + ], + "RtcEngineEventHandler_onConnectionLost": [ + "RtcEngineEventHandler_onConnectionLost", + "RtcEngineEventHandler_onConnectionLost_c81e1a4" + ], + "RtcEngineEventHandler_onConnectionInterrupted": [ + "RtcEngineEventHandler_onConnectionInterrupted", + "RtcEngineEventHandler_onConnectionInterrupted_c81e1a4" + ], + "RtcEngineEventHandler_onConnectionBanned": [ + "RtcEngineEventHandler_onConnectionBanned", + "RtcEngineEventHandler_onConnectionBanned_c81e1a4" + ], + "RtcEngineEventHandler_onStreamMessage": [ + "RtcEngineEventHandler_onStreamMessage_da5a528", + "RtcEngineEventHandler_onStreamMessage_b73072b" + ], + "RtcEngineEventHandler_onStreamMessageError": [ + "RtcEngineEventHandler_onStreamMessageError_c9b2329", + "RtcEngineEventHandler_onStreamMessageError_e5c4666" + ], + "RtcEngineEventHandler_onRequestToken": [ + "RtcEngineEventHandler_onRequestToken", + "RtcEngineEventHandler_onRequestToken_c81e1a4" + ], + "RtcEngineEventHandler_onTokenPrivilegeWillExpire": [ + "RtcEngineEventHandler_onTokenPrivilegeWillExpire_3a2037f", + "RtcEngineEventHandler_onTokenPrivilegeWillExpire_8225ea3" + ], + "RtcEngineEventHandler_onLicenseValidationFailure": [ + "RtcEngineEventHandler_onLicenseValidationFailure_4518fcc", + "RtcEngineEventHandler_onLicenseValidationFailure_5dfd95e" + ], + "RtcEngineEventHandler_onFirstLocalAudioFramePublished": [ + "RtcEngineEventHandler_onFirstLocalAudioFramePublished_46f8ab7", + "RtcEngineEventHandler_onFirstLocalAudioFramePublished_263e4cd" + ], + "RtcEngineEventHandler_onFirstRemoteAudioDecoded": [ + "RtcEngineEventHandler_onFirstRemoteAudioDecoded_88641bf", + "RtcEngineEventHandler_onFirstRemoteAudioDecoded_c5499bd" + ], + "RtcEngineEventHandler_onFirstRemoteAudioFrame": [ + "RtcEngineEventHandler_onFirstRemoteAudioFrame_88641bf", + "RtcEngineEventHandler_onFirstRemoteAudioFrame_c5499bd" + ], + "RtcEngineEventHandler_onLocalAudioStateChanged": [ + "RtcEngineEventHandler_onLocalAudioStateChanged_f33d789", + "RtcEngineEventHandler_onLocalAudioStateChanged_13b6c02" + ], + "RtcEngineEventHandler_onRemoteAudioStateChanged": [ + "RtcEngineEventHandler_onRemoteAudioStateChanged_f1532dd", + "RtcEngineEventHandler_onRemoteAudioStateChanged_056772e" + ], + "RtcEngineEventHandler_onActiveSpeaker": [ + "RtcEngineEventHandler_onActiveSpeaker_c8d091a", + "RtcEngineEventHandler_onActiveSpeaker_dd67adc" + ], + "RtcEngineEventHandler_onContentInspectResult": [ + "RtcEngineEventHandler_onContentInspectResult_ba185c8" + ], + "RtcEngineEventHandler_onSnapshotTaken": [ + "RtcEngineEventHandler_onSnapshotTaken_c495bf6", + "RtcEngineEventHandler_onSnapshotTaken_5a6a693" + ], + "RtcEngineEventHandler_onClientRoleChanged": [ + "RtcEngineEventHandler_onClientRoleChanged_938fb25", + "RtcEngineEventHandler_onClientRoleChanged_2acaf10" + ], + "RtcEngineEventHandler_onClientRoleChangeFailed": [ + "RtcEngineEventHandler_onClientRoleChangeFailed_386f862", + "RtcEngineEventHandler_onClientRoleChangeFailed_5a3af5b" + ], + "RtcEngineEventHandler_onAudioDeviceVolumeChanged": [ + "RtcEngineEventHandler_onAudioDeviceVolumeChanged_55ab726" + ], + "RtcEngineEventHandler_onRtmpStreamingStateChanged": [ + "RtcEngineEventHandler_onRtmpStreamingStateChanged_1f07503" + ], + "RtcEngineEventHandler_onRtmpStreamingEvent": [ + "RtcEngineEventHandler_onRtmpStreamingEvent_2e48ef5" + ], + "RtcEngineEventHandler_onTranscodingUpdated": [ + "RtcEngineEventHandler_onTranscodingUpdated" + ], + "RtcEngineEventHandler_onAudioRoutingChanged": [ + "RtcEngineEventHandler_onAudioRoutingChanged_46f8ab7" + ], + "RtcEngineEventHandler_onChannelMediaRelayStateChanged": [ + "RtcEngineEventHandler_onChannelMediaRelayStateChanged_e0e2b0a" + ], + "RtcEngineEventHandler_onLocalPublishFallbackToAudioOnly": [ + "RtcEngineEventHandler_onLocalPublishFallbackToAudioOnly_5039d15" + ], + "RtcEngineEventHandler_onRemoteSubscribeFallbackToAudioOnly": [ + "RtcEngineEventHandler_onRemoteSubscribeFallbackToAudioOnly_dbdc15a" + ], + "RtcEngineEventHandler_onRemoteAudioTransportStats": [ + "RtcEngineEventHandler_onRemoteAudioTransportStats_bd01ada", + "RtcEngineEventHandler_onRemoteAudioTransportStats_527a345" + ], + "RtcEngineEventHandler_onRemoteVideoTransportStats": [ + "RtcEngineEventHandler_onRemoteVideoTransportStats_bd01ada", + "RtcEngineEventHandler_onRemoteVideoTransportStats_527a345" + ], + "RtcEngineEventHandler_onConnectionStateChanged": [ + "RtcEngineEventHandler_onConnectionStateChanged_ec7c9c0", + "RtcEngineEventHandler_onConnectionStateChanged_4075a9c" + ], + "RtcEngineEventHandler_onWlAccMessage": [ + "RtcEngineEventHandler_onWlAccMessage_333465b", + "RtcEngineEventHandler_onWlAccMessage_2b9068e" + ], + "RtcEngineEventHandler_onWlAccStats": [ + "RtcEngineEventHandler_onWlAccStats_94ee38e", + "RtcEngineEventHandler_onWlAccStats_b162607" + ], + "RtcEngineEventHandler_onNetworkTypeChanged": [ + "RtcEngineEventHandler_onNetworkTypeChanged_e85a70d", + "RtcEngineEventHandler_onNetworkTypeChanged_388fd6f" + ], + "RtcEngineEventHandler_onEncryptionError": [ + "RtcEngineEventHandler_onEncryptionError_a0d1b74", + "RtcEngineEventHandler_onEncryptionError_e7a65fe" + ], + "RtcEngineEventHandler_onPermissionError": [ + "RtcEngineEventHandler_onPermissionError_f37c62b" + ], + "RtcEngineEventHandler_onLocalUserRegistered": [ + "RtcEngineEventHandler_onLocalUserRegistered_1922dd1" + ], + "RtcEngineEventHandler_onUserInfoUpdated": [ + "RtcEngineEventHandler_onUserInfoUpdated_2120245" + ], + "RtcEngineEventHandler_onUserAccountUpdated": [ + "RtcEngineEventHandler_onUserAccountUpdated_1922dd1", + "RtcEngineEventHandler_onUserAccountUpdated_de1c015" + ], + "RtcEngineEventHandler_onVideoRenderingTracingResult": [ + "RtcEngineEventHandler_onVideoRenderingTracingResult_76e2449", + "RtcEngineEventHandler_onVideoRenderingTracingResult_813c0f4" + ], + "RtcEngineEventHandler_onLocalVideoTranscoderError": [ + "RtcEngineEventHandler_onLocalVideoTranscoderError_83e3a9c" + ], + "RtcEngineEventHandler_onUploadLogResult": [ + "RtcEngineEventHandler_onUploadLogResult_eef29d2", + "RtcEngineEventHandler_onUploadLogResult_3115804" + ], + "RtcEngineEventHandler_onAudioSubscribeStateChanged": [ + "RtcEngineEventHandler_onAudioSubscribeStateChanged_e0ec28e" + ], + "RtcEngineEventHandler_onVideoSubscribeStateChanged": [ + "RtcEngineEventHandler_onVideoSubscribeStateChanged_e0ec28e" + ], + "RtcEngineEventHandler_onAudioPublishStateChanged": [ + "RtcEngineEventHandler_onAudioPublishStateChanged_2c13a28" + ], + "RtcEngineEventHandler_onVideoPublishStateChanged": [ + "RtcEngineEventHandler_onVideoPublishStateChanged_5b45b6e" + ], + "RtcEngineEventHandler_onTranscodedStreamLayoutInfo": [ + "RtcEngineEventHandler_onTranscodedStreamLayoutInfo_3bfb91b", + "RtcEngineEventHandler_onTranscodedStreamLayoutInfo_48f6419" + ], + "RtcEngineEventHandler_onExtensionEvent": [ + "RtcEngineEventHandler_onExtensionEvent_062d13c" + ], + "RtcEngineEventHandler_onExtensionStarted": [ + "RtcEngineEventHandler_onExtensionStarted_ccad422" + ], + "RtcEngineEventHandler_onExtensionStopped": [ + "RtcEngineEventHandler_onExtensionStopped_ccad422" + ], + "RtcEngineEventHandler_onExtensionError": [ + "RtcEngineEventHandler_onExtensionError_bd3489b" + ], + "RtcEngineEventHandler_onSetRtmFlagResult": [ + "RtcEngineEventHandler_onSetRtmFlagResult_46f8ab7", + "RtcEngineEventHandler_onSetRtmFlagResult_263e4cd" + ], + "MetadataObserver_onMetadataReceived": [ + "MetadataObserver_onMetadataReceived_cb7661d" + ], + "DirectCdnStreamingEventHandler_onDirectCdnStreamingStateChanged": [ + "DirectCdnStreamingEventHandler_onDirectCdnStreamingStateChanged_40f1fa3" + ], + "DirectCdnStreamingEventHandler_onDirectCdnStreamingStats": [ + "DirectCdnStreamingEventHandler_onDirectCdnStreamingStats_d50595f" + ] +}; diff --git a/tool/terra/renderers/event_ids_mapping_renderer.ts b/tool/terra/renderers/event_ids_mapping_renderer.ts new file mode 100644 index 000000000..8b782e67d --- /dev/null +++ b/tool/terra/renderers/event_ids_mapping_renderer.ts @@ -0,0 +1,85 @@ +import { + CXXFile, + CXXTYPE, + CXXTerraNode, + Clazz, +} from "@agoraio-extensions/cxx-parser"; +import { + ParseResult, + RenderResult, + TerraContext, +} from "@agoraio-extensions/terra-core"; +import { irisApiId } from "@agoraio-extensions/terra_shared_configs"; +import { isCallbackClass } from "./utils"; + +const funcNeedCheckWithBaseClasses = [ + "agora::media::IAudioFrameObserver", + "agora::rtc::IRtcEngineEventHandlerEx", +]; +function isNeedCheckWithBaseClasses(clazz: Clazz): boolean { + return funcNeedCheckWithBaseClasses.includes(clazz.fullName); +} + +/// Event Ids mapping of iris api id. +// const eventIdsMapping = { +// "H265TranscoderObserver_onQueryChannel", +// ["H265TranscoderObserver_onQueryChannel_ppp"], +// }; + +export default function EventIdsMappingRenderer( + terraContext: TerraContext, + args: any, + parseResult: ParseResult +): RenderResult[] { + let cxxFiles = parseResult!.nodes as CXXFile[]; + let eventIdsMapping: Map = new Map(); + + cxxFiles.forEach((cxxFile: CXXFile) => { + cxxFile.nodes.forEach((node) => { + if (node.__TYPE == CXXTYPE.Clazz) { + let clazz = node as Clazz; + let needCheckWithBaseClasses = isNeedCheckWithBaseClasses(clazz); + clazz.methods.forEach((method) => { + if (isCallbackClass(clazz)) { + let key = `${clazz.name.replace("I", "")}_${method.name}`; + if (!eventIdsMapping.has(key)) { + eventIdsMapping.set(key, []); + } + eventIdsMapping.get(key)?.push(getIrisApiIdValue(method)); + } + }); + } + }); + }); + + let eventIdsMappingContents: string[] = []; + + eventIdsMapping.forEach((value, key) => { + eventIdsMappingContents.push( + `"${key}": [${value.map((it) => `"${it}"`).join(", ")}]` + ); + }); + + let output = ` + /// Event Ids mapping of iris api id. +const eventIdsMapping = { + ${eventIdsMappingContents.join(",\n")} +}; +`.trim(); + + return [ + { + file_name: + "test_shard/fake_test_app/integration_test/generated/event_ids_mapping.dart", + file_content: output, + }, + ]; +} + +export function getIrisApiIdKey(node: CXXTerraNode): string { + return node.user_data?.["IrisApiIdParser"]?.key ?? ""; +} + +export function getIrisApiIdValue(node: CXXTerraNode): string { + return node.user_data?.["IrisApiIdParser"]?.value ?? ""; +} diff --git a/tool/terra/renderers/utils.ts b/tool/terra/renderers/utils.ts new file mode 100644 index 000000000..3f6a5c64f --- /dev/null +++ b/tool/terra/renderers/utils.ts @@ -0,0 +1,7 @@ +import { Clazz } from "@agoraio-extensions/cxx-parser"; + +export function isCallbackClass(clazz: Clazz): boolean { + return new RegExp( + "(EventHandler|Observer|Provider|Sink|Callback|ObserverBase|EventHandlerEx)$" + ).test(clazz.name); + } \ No newline at end of file