UpdateVideoInput (Unreal Engine)
- Declaration
static void UpdateVideoInput(FCavrnusVideoInputDevice Device);
- Description
Sets which camera the user wishes to use. Note that the FCavrnusVideoInputDevice
provided to this function can only be acquired by calling FetchVideoInputs to search for available cameras.
- Blueprint Sample
Sample is taken from WBP_AudioVideoWidget.uasset in the Plugin. VideoInputDeviceResponse is a Blueprint array of FCavrnusVideoInputDevice
instances that was provided earlier via Fetch Video Inputs.
WBP_AudioVideoWidget
- Code Sample
#include "CavrnusFunctionLibrary.h"
#include "Types/CavrnusVideoInputDevice.h"
void UClassName::OnVideoInputDeviceSelected(const FString& DeviceId)
{
// Member is TMap<FString, FCavrnusVideoInputDevice> VideoInputDeviceList
FCavrnusVideoInputDevice* InputDevice = VideoInputDeviceList.Find(DeviceId);
if (InputDevice)
{
UCavrnusFunctionLibrary::UpdateVideoInput(*InputDevice);
}
else
{
UE_LOG(LogTemp, Warning, TEXT("Selected Video Input Device not found: %s"), *DeviceId);
}
}