Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
WinterPu committed Jun 14, 2024
2 parents af43dea + abf5fd6 commit e4ffe9a
Show file tree
Hide file tree
Showing 195 changed files with 7,938 additions and 6,297 deletions.
4 changes: 2 additions & 2 deletions .github/ci/build/build_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ echo "[Unreal CI] copying Mac ..."
MAC_DST_PATH="$PLUGIN_PATH/Mac/Release"
mkdir -p $MAC_DST_PATH
rm -f MAC_DST_PATH/*
cp -PRf $MAC_SRC_PATH/Agora_*/libs/*.xcframework/macos-arm64_x86_64/*framework "$MAC_DST_PATH"
cp -PRfa $MAC_SRC_PATH/Agora_*/libs/*.xcframework/macos-arm64_x86_64/*framework "$MAC_DST_PATH"

echo "[Unreal CI] copying Win x86 ..."
WINx86_DST_PATH="$PLUGIN_PATH/Win/Release/"
Expand All @@ -132,7 +132,7 @@ cd $CI_DIR/temp
# Zip Package
#--------------------------------------

zip -r "$PLUGIN_NAME".zip $PLUGIN_NAME
zip -ry "$PLUGIN_NAME".zip $PLUGIN_NAME

#--------------------------------------
# Copy to $CI_DIR/output
Expand Down
3 changes: 2 additions & 1 deletion Agora-Unreal-SDK-Blueprint-Example/AgoraBPExample.uproject
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"AdditionalDependencies": [
"Engine",
"AgoraPlugin",
"CoreUObject"
"CoreUObject",
"UMG"
]
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,5 @@ bAllowHighDPIInGameMode=True

[/Script/IOSRuntimeSettings.IOSRuntimeSettings]
AdditionalPlistData=<key>NSCameraUsageDescription</key><string>AgoraVideoCall</string><key>NSMicrophoneUsageDescription</key><string>AgoraVideoCall</string>
bEnableBackgroundFetch=True

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12 changes: 12 additions & 0 deletions Agora-Unreal-SDK-Blueprint-Example/MacRATrust.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

## Resolving Trusted Execution Problems
### 1. 'XXXX.framework' can't be opened because Apple cannot check it for malicious software.
### 2. 'AppXXX is damaged and can’t be opened. You should move it to the Trash'

PathToYourProject="/DragYourProjectFolderHere"

for file in $(ls "${PathToYourProject}/Plugins/AgoraPlugin/Source/ThirdParty/AgoraPluginLibrary/Mac/Release");
do
sudo xattr -r -d com.apple.quarantine "${PathToYourProject}/Plugins/AgoraPlugin/Source/ThirdParty/AgoraPluginLibrary/Mac/Release/${file}"
done
17 changes: 14 additions & 3 deletions Agora-Unreal-SDK-Blueprint-Example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ Double click to open *Contents/Info.plist* in XCode, then click **Information Pr

![privacy_plist](./DocImages/PrivacyPlist.gif)

Notice: For UE5, the method mentioned above may fail. Therefore, you should add permissions to the info.plist template. The path would be:
```
/Users/Shared/Epic Games/<YourUE5Ver>/Engine/Source/Runtime/Launch/Resources/Mac
```

If you are editing with Xcode, you can just open the plist file with a text editor and paste the following XML snippet into it:
```xml
<key>NSCameraUsageDescription</key>
Expand Down Expand Up @@ -221,11 +226,17 @@ bOverrideBuildEnvironment = true;
AdditionalCompilerArguments = "-Wno-unused-but-set-variable";
```

### When opening the project on MacOS, there are blocking errors on framework. How to quickly get over this?
### When opening the project on macOS, you may encounter blocking errors related to frameworks or receive notifications that the app is damaged.How to quickly get over this?

![framework](./DocImages/Framework.png)

Mac's Gatekeeper blocks unsigned frameworks and you have to unblock them one by one. If your environment is safe, you can temporarily allow Apps to run from Anywhere. See this checkbox in System Preferences:
![Security_Privacy](./DocImages/SecurityPrivacy.png)
Even on older versions of macOS, you may encounter the following error message: **"AppXXX is damaged and can’t be opened. You should move it to the Trash."**

This error occurs because Mac's Gatekeeper blocks unsigned frameworks.

To resolve issues related to trusted execution, you can run the script **MacRATrust.sh** located in the project folder. **Remember to replace the value of "PathToYourProject" with your project path in this script.**

Alternatively, you can manually unlock the application by allowing the target framework in the **Privacy & Security** tab of your Mac's **System Preferences**.


### What should I do for the error "failed to load because module 'AgoraPlugin' could not be loaded" ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public AgoraBPExample(ReadOnlyTargetRules Target) : base(Target)
PrivateDependencyModuleNames.AddRange(new string[] { });

// Uncomment if you are using Slate UI
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });

// Uncomment if you are using online features
// PrivateDependencyModuleNames.Add("OnlineSubsystem");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Fill out your copyright notice in the Description page of Project Settings.


#include "CustomTileView.h"


#pragma region CustomTileView


UCustomTileView::UCustomTileView(const FObjectInitializer& Initializer) :Super(Initializer)
{
BarThickness = FVector2D(50, 50);
}

TSharedRef<STableViewBase> UCustomTileView::RebuildListWidget()
{
auto TileViewRef = ConstructTileView<STileView>();
auto CustomTileViewRef = StaticCastSharedRef<SCustomListView<UObject*>>(TileViewRef);

CustomTileViewRef->UpdateScrollBarThickness(BarThickness);
return CustomTileViewRef;
}


#pragma endregion
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Components/TileView.h"
#include "CustomTileView.generated.h"


#pragma region CustomTileView
// To change the scroll bar thickness of the tile view.

UCLASS()
class AGORABPEXAMPLE_API UCustomTileView : public UTileView
{
GENERATED_BODY()

UCustomTileView(const FObjectInitializer& Initializer);

protected:
virtual TSharedRef<STableViewBase> RebuildListWidget() override;

public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Style", meta = (DisplayName = "Scroll Bar Thickness"))
FVector2D BarThickness;
};


template <typename ItemType>
class AGORABPEXAMPLE_API SCustomListView : public STileView<ItemType>
{
public:

// It doesn't work
//void SetScrollBarThickness(const FVector2D& Vec2)
//{
// if (ScrollBar.IsValid())
// {
// ScrollBar->SetThickness(Vec2);
// }
//}

void UpdateScrollBarThickness(const FVector2D& Vec2)
{
if (STableViewBase::ScrollBar.IsValid())
{
TSharedPtr<SWidget> SBarParentWidgetPtr = STableViewBase::ScrollBar->GetParentWidget();
auto ScrollBarBox = StaticCastSharedPtr<SBox>(SBarParentWidgetPtr);

ScrollBarBox->SetWidthOverride(FOptionalSize(Vec2.X));
STableViewBase::ScrollBar->SetThickness(Vec2);
}
}
};

#pragma endregion
8 changes: 0 additions & 8 deletions Agora-Unreal-SDK-CPP-Example/AgoraExample.uproject
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@
"UMG",
"CoreUObject"
]
},
{
"Name": "MyShaderLibrary",
"Type": "Runtime",
"LoadingPhase": "PostConfigInit",
"AdditionalDependencies": [
"Engine"
]
}
]
}
5 changes: 4 additions & 1 deletion Agora-Unreal-SDK-CPP-Example/Config/DefaultEngine.ini
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ bEnableUniversalAPK=True
bBundleABISplit=True
bBundleLanguageSplit=True
bBundleDensitySplit=True
+ExtraApplicationNodeTags=android:usesCleartextTraffic="True"
ExtraApplicationSettings=
ExtraActivitySettings=
+ExtraPermissions=android.permission.WRITE_EXTERNAL_STORAGE
Expand Down Expand Up @@ -147,6 +148,8 @@ IconPortalPath=(Path="")

[/Script/IOSRuntimeSettings.IOSRuntimeSettings]
AdditionalPlistData=<key>NSCameraUsageDescription</key><string>AgoraVideoCall</string><key>NSMicrophoneUsageDescription</key><string>AgoraVideoCall</string>
bEnableBackgroundFetch=True
bDisableHTTPS=True

[/Script/UnrealEd.CookerSettings]
bCookOnTheFlyForLaunchOn=False
Expand All @@ -159,7 +162,7 @@ bAllowHighDPIInGameMode=True
Compiler=Default
-TargetedRHIs=PCD3D_SM5
+TargetedRHIs=PCD3D_SM5
DefaultGraphicsRHI=DefaultGraphicsRHI_Default
DefaultGraphicsRHI=DefaultGraphicsRHI_DX11
MinimumOSVersion=MSOS_Vista
AudioSampleRate=48000
AudioCallbackBufferFrameSize=1024
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion Agora-Unreal-SDK-CPP-Example/IOS ScreenShare Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Delete all the original implementations or add your own implementations.

@implemetation SampleHandler

#end
@end
```

6. Build Your App
Expand Down
12 changes: 12 additions & 0 deletions Agora-Unreal-SDK-CPP-Example/MacRATrust.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

## Resolving Trusted Execution Problems
### 1. 'XXXX.framework' can't be opened because Apple cannot check it for malicious software.
### 2. 'AppXXX is damaged and can’t be opened. You should move it to the Trash'

PathToYourProject="/DragYourProjectFolderHere"

for file in $(ls "${PathToYourProject}/Plugins/AgoraPlugin/Source/ThirdParty/AgoraPluginLibrary/Mac/Release");
do
sudo xattr -r -d com.apple.quarantine "${PathToYourProject}/Plugins/AgoraPlugin/Source/ThirdParty/AgoraPluginLibrary/Mac/Release/${file}"
done
18 changes: 14 additions & 4 deletions Agora-Unreal-SDK-CPP-Example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ This project contains different ways for integrating the Agora Unreal SDK APIs i
- VirtualBackground
- VoiceChanger
- MusicPlayer
- RenderWithYUV
- MediaPlayerWithCustomDataProvide
- WriteBackVideoRawData
- AudioSpectrum
Expand Down Expand Up @@ -192,6 +191,11 @@ Double click to open *Contents/Info.plist* in XCode, then click **Information Pr

![privacy_plist](./DocImages/PrivacyPlist.gif)

Notice: For UE5, it would be better to add permissions to info.plist template, the path would be:
```
/Users/Shared/Epic Games/<YourUE5Ver>/Engine/Source/Runtime/Launch/Resources/Mac
```

If you are editing with Xcode, you can just open the plist file with a text editor and paste the following XML snippet into it:
```xml
<key>NSCameraUsageDescription</key>
Expand Down Expand Up @@ -292,11 +296,17 @@ bOverrideBuildEnvironment = true;
AdditionalCompilerArguments = "-Wno-unused-but-set-variable";
```

### When opening the project on MacOS, there are blocking errors on framework. How to quickly get over this?
### When opening the project on macOS, you may encounter blocking errors related to frameworks or receive notifications that the app is damaged.How to quickly get over this?

![framework](./DocImages/Framework.png)

Mac's Gatekeeper blocks unsigned frameworks and you have to unblock them one by one. If your environment is safe, you can temporarily allow Apps to run from Anywhere. See this checkbox in System Preferences:
![Security_Privacy](./DocImages/SecurityPrivacy.png)
Even on older versions of macOS, you may encounter the following error message: **"AppXXX is damaged and can’t be opened. You should move it to the Trash."**

This error occurs because Mac's Gatekeeper blocks unsigned frameworks.

To resolve issues related to trusted execution, you can run the script **MacRATrust.sh** located in the project folder. **Remember to replace the value of "PathToYourProject" with your project path in this script.**

Alternatively, you can manually unlock the application by allowing the target framework in the **Privacy & Security** tab of your Mac's **System Preferences**.


### What should I do for the error "failed to load because module 'AgoraPlugin' could not be loaded" ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// Sets default values
AAgoraActor::AAgoraActor()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;

}
Expand All @@ -16,7 +16,7 @@ AAgoraActor::AAgoraActor()
void AAgoraActor::BeginPlay()
{
Super::BeginPlay();
if (VideoWidget==nullptr)
if (VideoWidget == nullptr)
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "please set VideoWidget in AgoraActor");
return;
Expand All @@ -36,7 +36,7 @@ void AAgoraActor::BeginPlay()

}

if (APP_ID == "YOUR_APPID" || APP_ID=="")
if (APP_ID == "YOUR_APPID" || APP_ID == "")
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, "please input your APP_ID");
return;
Expand Down
8 changes: 4 additions & 4 deletions Agora-Unreal-SDK-CPP-Example/Source/AgoraExample/AgoraActor.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ UCLASS()
class AGORAEXAMPLE_API AAgoraActor : public AActor
{
GENERATED_BODY()
public:

public:
// Sets default values for this actor's properties
AAgoraActor();
UPROPERTY(EditAnywhere, Category = "Agora|Widget")
Expand All @@ -31,12 +31,12 @@ class AGORAEXAMPLE_API AAgoraActor : public AActor

UPROPERTY(EditAnywhere, Category = "Agora|LoadConfig")
bool bLoadConfig = true;

protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;

public:
public:
// Called every frame
virtual void Tick(float DeltaTime) override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public AgoraExample(ReadOnlyTargetRules Target) : base(Target)
"RHI",
"HTTP",
"AudioMixer",
"MyShaderLibrary",

// For JoinChannelWithToken
"HTTP",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,3 @@ void UAgoraGameInstanceWithConsoleFunc::SetRtcEngineParam(FString Param)

UE_LOG(LogTemp, Warning, TEXT("--- Cmd:%s exec:%d"), *FString(FUNCTION_MACRO), (int32)ret);
}

void UAgoraGameInstanceWithConsoleFunc::DumpAudioFrame()
{
agora::rtc::IRtcEngine* RtcEngineProxy = agora::rtc::ue::createAgoraRtcEngine();

//RtcEngineProxy->setParameters("{\"che.audio.start.predump\":\"true\"}");
int ret = RtcEngineProxy->setParameters("{\"che.audio.frame_dump\":{\"location\":\"all\",\"action\":\"start\",\"max_size_bytes\":\"120000000\",\"uuid\":\"123456789\",\"duration\":\"1200000\"}}");

UE_LOG(LogTemp, Warning, TEXT("--- Cmd:%s exec:%d"), *FString(FUNCTION_MACRO), (int32)ret);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,4 @@ class AGORAEXAMPLE_API UAgoraGameInstanceWithConsoleFunc : public UGameInstance

UFUNCTION(Exec)
void SetRtcEngineParam(FString Param);

UFUNCTION(Exec)
void DumpAudioFrame();
};
Loading

0 comments on commit e4ffe9a

Please sign in to comment.