mirror of
https://github.com/cemu-project/Cemu.git
synced 2026-04-17 13:51:30 -06:00
30 lines
825 B
C++
30 lines
825 B
C++
#pragma once
|
|
|
|
namespace CameraManager
|
|
{
|
|
constexpr uint32 CAMERA_WIDTH = 640;
|
|
constexpr uint32 CAMERA_HEIGHT = 480;
|
|
constexpr uint32 CAMERA_PITCH = 768;
|
|
|
|
constexpr uint32 CAMERA_NV12_BUFFER_SIZE = (CAMERA_HEIGHT * CAMERA_PITCH * 3) >> 1;
|
|
constexpr uint32 CAMERA_RGB_BUFFER_SIZE = CAMERA_HEIGHT * CAMERA_WIDTH * 3;
|
|
|
|
struct DeviceInfo
|
|
{
|
|
std::string uniqueId;
|
|
std::string name;
|
|
};
|
|
|
|
void Open();
|
|
void Close();
|
|
|
|
void FillNV12Buffer(std::span<uint8, CAMERA_NV12_BUFFER_SIZE> nv12Buffer);
|
|
void FillRGBBuffer(std::span<uint8, CAMERA_RGB_BUFFER_SIZE> rgbBuffer);
|
|
|
|
void SetDevice(uint32 deviceNo);
|
|
void ResetDevice();
|
|
std::vector<DeviceInfo> EnumerateDevices();
|
|
void SaveDevice();
|
|
std::optional<uint32> GetCurrentDevice();
|
|
} // namespace CameraManager
|