Skip to content

Commit 8e6b459

Browse files
author
WinterPu
committed
bugfix: fix compilation error
1 parent 545551d commit 8e6b459

File tree

5 files changed

+217
-5
lines changed

5 files changed

+217
-5
lines changed

renders/utility/blueprint_special/bptype_data_makeup.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,42 @@ export const map_class_initialization: {
2828
IRtcEngine: {
2929
NativePtr: `AgoraUERtcEngine::Get()`,
3030
Inst: `
31+
static UAgoraBPuRtcEngine* Instance;
3132
`,
3233
InitDecl: `
34+
void InitInstance();
35+
void UninitInstance();
36+
37+
UFUNCTION(BlueprintPure, Category = "Agora|IRtcEngine")
38+
static UAgoraBPuRtcEngine* GetAgoraRtcEngine();
3339
`,
3440
InitImpl: `
41+
42+
void UAgoraBPuRtcEngine::InitInstance()
43+
{
44+
// UserRtcEventHandler.Reset();
45+
// UserRtcEventHandlerEx.Reset();
46+
// UserScreenCaptureSourceList.Reset();
47+
}
48+
49+
void UAgoraBPuRtcEngine::UninitInstance()
50+
{
51+
// UserRtcEventHandler.Reset();
52+
// UserRtcEventHandlerEx.Reset();
53+
// UserScreenCaptureSourceList.Reset();
54+
}
55+
56+
UAgoraBPuRtcEngine* UAgoraBPuRtcEngine::Instance = nullptr;
57+
UAgoraBPuRtcEngine* UAgoraBPuRtcEngine::GetAgoraRtcEngine()
58+
{
59+
if (Instance == nullptr)
60+
{
61+
Instance = NewObject<UAgoraBPuRtcEngine>();
62+
Instance->AddToRoot();
63+
Instance->InitInstance();
64+
}
65+
return Instance;
66+
}
3567
`,
3668
},
3769
IAudioDeviceManager: {
Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
import {
2+
ClazzMethodReplacedContext_,
3+
rc_empty_data,
4+
} from './bptype_data_replaced/helper';
5+
6+
export const map_clazz_method_replaced_context: {
7+
[key: string]: ClazzMethodReplacedContext_;
8+
} = {
9+
'agora::media::IMediaEngine.pushVideoFrame': {
10+
...rc_empty_data,
11+
doReplceImpl: true,
12+
impl: `
13+
int UAgoraBPuMediaEngine::PushVideoFrame(TArray<FUABT_ExternalVideoFrame> & frame, int64 videoTrackId)
14+
{
15+
// Need to be optimized
16+
int FinalReturnResult = AGORA_UE_ERR_CODE(ERROR_NULLPTR);
17+
18+
// // Convert UEBP to CppType
19+
// base::ExternalVideoFrame* Raw_frame = nullptr; UABT::New_CustomRawDataArray<base::ExternalVideoFrame, FUABT_ExternalVideoFrame>(Raw_frame,frame, 1);
20+
21+
// unsigned int Raw_videoTrackId = videoTrackId;
22+
23+
// // Call Native Method
24+
25+
// auto ret = _NativePtr->pushVideoFrame(Raw_frame, Raw_videoTrackId);
26+
27+
// // Free Data if neeeded
28+
// UABT::Free_CustomRawDataArray<base::ExternalVideoFrame, FUABT_ExternalVideoFrame>(Raw_frame, 1);
29+
30+
// int ReturnVal = ret;
31+
// FinalReturnResult = ReturnVal;
32+
33+
// Need to be optimized
34+
return FinalReturnResult;
35+
}
36+
`,
37+
},
38+
39+
'agora::rtc::IRtcEngine.getScreenCaptureSources': {
40+
...rc_empty_data,
41+
doReplceImpl: true,
42+
impl: `
43+
UAgoraBPuScreenCaptureSourceList * UAgoraBPuRtcEngine::GetScreenCaptureSources(const FUABT_SIZE & thumbSize, const FUABT_SIZE & iconSize, const bool & includeScreen)
44+
{
45+
// Need to be optimized
46+
UAgoraBPuScreenCaptureSourceList * FinalReturnResult = nullptr;
47+
48+
49+
// #if defined(_WIN32) || (defined(__APPLE__) && TARGET_OS_MAC && !TARGET_OS_IPHONE)
50+
51+
// // Convert UEBP to CppType
52+
// agora::rtc::SIZE Raw_thumbSize = thumbSize.CreateRawData();
53+
54+
// agora::rtc::SIZE Raw_iconSize = iconSize.CreateRawData();
55+
56+
// bool Raw_includeScreen = includeScreen;
57+
58+
// // Call Native Method
59+
60+
// auto ret = AgoraUERtcEngine::Get()->getScreenCaptureSources(Raw_thumbSize, Raw_iconSize, Raw_includeScreen);
61+
62+
// // Free Data if neeeded
63+
// thumbSize.FreeRawData(Raw_thumbSize);
64+
65+
// iconSize.FreeRawData(Raw_iconSize);
66+
67+
68+
69+
70+
// UAgoraBPuScreenCaptureSourceList * ReturnVal = ret;
71+
// FinalReturnResult = ReturnVal;
72+
73+
74+
75+
// #endif
76+
77+
// Need to be optimized
78+
return FinalReturnResult;
79+
80+
}
81+
`,
82+
},
83+
84+
'agora::rtc::IMediaPlayer.setPlayerOptionInInt': {
85+
...rc_empty_data,
86+
doReplceImpl: true,
87+
impl: `
88+
int UAgoraBPuMediaPlayer::SetPlayerOptionInInt(const FString & key, int value)
89+
{
90+
// Need to be optimized
91+
int FinalReturnResult = AGORA_UE_ERR_CODE(ERROR_NULLPTR);
92+
93+
94+
95+
96+
// Convert UEBP to CppType
97+
std::string Raw_key = TCHAR_TO_UTF8(*key);
98+
int Raw_value = value;
99+
100+
// Call Native Method
101+
102+
// REPLACE_REPLACE!!!
103+
auto ret = _NativePtr->setPlayerOption(Raw_key.c_str(), Raw_value);
104+
105+
// Free Data if neeeded
106+
107+
108+
int ReturnVal = ret;
109+
FinalReturnResult = ReturnVal;
110+
111+
// Need to be optimized
112+
return FinalReturnResult;
113+
114+
}
115+
`,
116+
},
117+
118+
'agora::rtc::IMediaPlayer.setPlayerOptionInString': {
119+
...rc_empty_data,
120+
doReplceImpl: true,
121+
impl: `
122+
int UAgoraBPuMediaPlayer::SetPlayerOptionInString(const FString & key, const FString & value)
123+
{
124+
// Need to be optimized
125+
int FinalReturnResult = AGORA_UE_ERR_CODE(ERROR_NULLPTR);
126+
127+
// Convert UEBP to CppType
128+
std::string Raw_key = TCHAR_TO_UTF8(*key);
129+
std::string Raw_value = TCHAR_TO_UTF8(*value);
130+
131+
// Call Native Method
132+
133+
auto ret = _NativePtr->setPlayerOption(Raw_key.c_str(), Raw_value.c_str());
134+
135+
// Free Data if neeeded
136+
137+
138+
int ReturnVal = ret;
139+
FinalReturnResult = ReturnVal;
140+
141+
// Need to be optimized
142+
return FinalReturnResult;
143+
144+
}
145+
`,
146+
},
147+
148+
'agora::rtc::IMusicPlayer.openWithSongCode': {
149+
...rc_empty_data,
150+
doReplceImpl: true,
151+
impl: `
152+
int UAgoraBPuMusicPlayer::OpenWithSongCode(int64 songCode, int64 startPos)
153+
{
154+
// Need to be optimized
155+
int FinalReturnResult = AGORA_UE_ERR_CODE(ERROR_NULLPTR);
156+
157+
158+
159+
160+
// Convert UEBP to CppType
161+
int64_t Raw_songCode = songCode;
162+
int64_t Raw_startPos = startPos;
163+
164+
// Call Native Method
165+
166+
auto ret = _NativePtr->open(Raw_songCode, Raw_startPos);
167+
168+
// Free Data if neeeded
169+
170+
171+
int ReturnVal = ret;
172+
FinalReturnResult = ReturnVal;
173+
174+
175+
// Need to be optimized
176+
return FinalReturnResult;
177+
178+
}
179+
`,
180+
},
181+
};

renders/utility/blueprint_special/bptype_data_replaced/agora_data/IAudioDeviceManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const map_data: {
4141
`,
4242
},
4343

44-
//TBD(WinterPu)
44+
//TBD(WinterPu)
4545
// Custom Header Error
4646
'agora::rtc::IAudioDeviceManager.enumerateRecordingDevices': {
4747
...rc_empty_data,

renders/utility/blueprint_special/bptype_data_replaced/agora_data/IRtcEngine.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,6 @@ export const map_data: {
778778
`,
779779
},
780780

781-
782781
'agora::rtc::IRtcEngine.takeSnapshotWithConfigEx': {
783782
...rc_empty_data,
784783
doReplceImpl: true,
@@ -814,4 +813,4 @@ export const map_data: {
814813
}
815814
`,
816815
},
817-
};
816+
};

templates/bpplugin/bpenum_filecontent.mustache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace agora{
4040
namespace UABTEnum{
4141
{{{user_data.macro_scope_start}}}
4242
inline {{{fullName}}} ToRawValue({{{user_data.bpNodeName}}} Val){
43-
{{{fullName}}} Result;
43+
{{{fullName}}} Result = static_cast<{{{fullName}}}>(0);
4444
{{#enum_constants}}
4545
{{#user_data.isFirst}}
4646
if ( Val == {{{parent.user_data.bpNodeName}}}::{{{name}}} ){ Result = {{{fullName}}}; }
@@ -52,7 +52,7 @@ namespace agora{
5252
return Result;
5353
}
5454
inline {{{user_data.bpNodeName}}} WrapWithUE({{{fullName}}} Val){
55-
{{{user_data.bpNodeName}}} Result;
55+
{{{user_data.bpNodeName}}} Result = static_cast<{{{user_data.bpNodeName}}}>(0);
5656
{{#enum_constants}}
5757
{{#user_data.isFirst}}
5858
if ( Val == {{{fullName}}} ){ Result = {{{parent.user_data.bpNodeName}}}::{{{name}}}; }

0 commit comments

Comments
 (0)