This commit is contained in:
2024-08-13 11:32:51 +02:00
parent ca4ab01f77
commit 106c8e8403
3 changed files with 11 additions and 7 deletions

View File

@ -1,5 +1,4 @@
#include "./sdl_video_frame_stream2.hpp"
#include "SDL3/SDL_pixels.h"
#include <chrono>
#include <cstdint>
@ -41,9 +40,12 @@ SDLVideoCameraContent::SDLVideoCameraContent(void) {
{
SDL_CameraSpec spec {
// FORCE a diffrent pixel format
SDL_PIXELFORMAT_RGBA8888,
//SDL_COLORSPACE_SRGB,
SDL_COLORSPACE_UNKNOWN,
//SDL_PIXELFORMAT_RGBA8888,
//SDL_PIXELFORMAT_UNKNOWN,
SDL_PIXELFORMAT_IYUV,
SDL_COLORSPACE_SRGB,
//SDL_COLORSPACE_UNKNOWN,
//1280, 720,
//640, 360,

View File

@ -28,11 +28,12 @@ struct SDLVideoFrame {
SDLVideoFrame(const SDLVideoFrame& other) {
timestampNS = other.timestampNS;
if (static_cast<bool>(other.surface)) {
// TODO: use SDL_DuplicateSurface()
surface = {
SDL_CreateSurface(
other.surface->w,
other.surface->h,
SDL_PIXELFORMAT_RGBA8888 // meh
other.surface->format
),
&SDL_DestroySurface
};