moonlight-qt/app/streaming/streamutils.h
Cameron Gutman 6f39d120cb Unify handling of DRM devices between DRM and VAAPI
SDL may not be able to give us a DRM FD for Vulkan windows.
2024-09-21 20:46:11 -05:00

45 lines
943 B
C++

#pragma once
#include <SDL.h>
// SDL_FRect wasn't added until 2.0.10
#if !SDL_VERSION_ATLEAST(2, 0, 10)
typedef struct SDL_FRect
{
float x;
float y;
float w;
float h;
} SDL_FRect;
#endif
class StreamUtils
{
public:
static
Uint32 getPlatformWindowFlags();
static
void scaleSourceToDestinationSurface(SDL_Rect* src, SDL_Rect* dst);
static
void screenSpaceToNormalizedDeviceCoords(SDL_FRect* rect, int viewportWidth, int viewportHeight);
static
void screenSpaceToNormalizedDeviceCoords(SDL_Rect* src, SDL_FRect* dst, int viewportWidth, int viewportHeight);
static
bool getNativeDesktopMode(int displayIndex, SDL_DisplayMode* mode, SDL_Rect* safeArea);
static
int getDisplayRefreshRate(SDL_Window* window);
static
bool hasFastAes();
static
int getDrmFdForWindow(SDL_Window* window, bool* needsClose);
static
int getDrmFd(bool preferRenderNode);
};