Comments (15)
I was able to reproduce this. There were two problems. The first is that we were trying to use a YUV shader with an RGB texture, which caused the graphical corruption and occasional crash. The second is that we were using default frame output settings, which converted the YUVY frame to NV12.
from sdl.
yes, indeed something gets fixed. Previous SDL3 version didn't work on macosx for me with an external camera, and now that's ok.
from sdl.
Bisecting (again)...
from sdl.
It is quite difficult to bisect testcamera
, I tried to pinpoint which commit started causing this problem, but due to various failures in some older commits (SIGABRT crash, compilation errors etc), I couldn't do that reliably.
from sdl.
I ran testcamera on an Intel MacBook 2019, running macOS 14.5, and it worked with no issues.
Does everything except testcamera work? If so, what are the inputs and outputs to the CoreMediaFormatToSDL()
function?
from sdl.
Just to be clear, this is happening if you explicitly use the software renderer and not OpenGL or Metal?
from sdl.
Yes, tested testdrawchessboard
and testgeometry
, both run without any issues.
I've hooked up a printf() just under CoreMediaFormatToSDL()
in GatherCameraSpecs
function, it prints out these formats:
SDL_PIXELFORMAT_YUY2
SDL_PIXELFORMAT_UYVY
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_YUY2
SDL_PIXELFORMAT_UYVY
SDL_PIXELFORMAT_NV12
SDL_PIXELFORMAT_YUY2
SDL_PIXELFORMAT_UYVY
SDL_PIXELFORMAT_NV12
from sdl.
Just to be clear, this is happening if you explicitly use the software renderer and not OpenGL or Metal?
Let me check, one moment
from sdl.
Just to be clear, this is happening if you explicitly use the software renderer and not OpenGL or Metal?
Yup, that's it!
SDL_RENDER_DRIVER
software and opengl works as intended, Metal is broken.
Texture renders correctly now (when it comes to the display itself, the color space of the camera is a different issue that I was originally going to report):
from sdl.
testdrawchessboard
and testgeometry
both work OK on this laptop, in all three video backends (metal, gl, software).
from sdl.
Yes, tested
testdrawchessboard
andtestgeometry
, both run without any issues. I've hooked up a printf() just underCoreMediaFormatToSDL()
inGatherCameraSpecs
function, it prints out these formats: SDL_PIXELFORMAT_YUY2 SDL_PIXELFORMAT_UYVY SDL_PIXELFORMAT_NV12 SDL_PIXELFORMAT_YUY2 SDL_PIXELFORMAT_UYVY SDL_PIXELFORMAT_NV12 SDL_PIXELFORMAT_YUY2 SDL_PIXELFORMAT_UYVY SDL_PIXELFORMAT_NV12
Do you know which of these formats is actually used when you're getting frames from the camera?
from sdl.
Do you know which of these formats is actually used when you're getting frames from the camera?
SDL_PIXELFORMAT_UYVY
, grabbed from next_frame
just below SDL_AcquireCameraFrame()
from sdl.
SDL_PIXELFORMAT_UYVY
The Metal renderer doesn't support this format, so it's something in the fallback code (GetClosestSupportedFormat or something down the line from that in SDL_CreateTextureWithProperties) that's probably blowing up.
from sdl.
Yeah, I tested with testyuv --uyvy and it worked with the metal renderer, so this needs more investigation.
from sdl.
which converted the YUVY frame to NV12.
Oh, I think Sylvain mentioned something about how Apple was giving NV12 data when you ask for YUVY data in the original pull request...! Mystery solved!
from sdl.
Related Issues (20)
- SDL2 SDL_Keycode returns characters in current keyboard layout HOT 2
- SDL3 doesn't statically link without SDL_STATIC_PIC flag on Ubuntu 24.04
- SDL3 static link fail when making a shared object without SDL_STATIC_PIC HOT 4
- SDL_ReadU32LE vs SDL_SwapLE32: location of LE suffix is inconsistent HOT 2
- There is no `SDL_ReadS8` HOT 1
- [email protected]
- `SDL_SetRelativeMouseMode` in `SDL_EVENT_MOUSE_BUTTON_DOWN` blocks until the button is released HOT 1
- Hint for using RawInput for mouse? HOT 10
- Inconsitent types for SDL_KeyCode HOT 1
- [Question][SDL3/testffmpeg] How can do 'SDL_RenderFillRect' on video frame? HOT 4
- [SDL2] Unable to make EGL context current (call to eglMakeCurrent failed, reporting an error of EGL_BAD_ACCESS) HOT 7
- Is possible to make SDL one header file and one source file? HOT 3
- Turn SDL_GLContext into an opaque type HOT 3
- CFString Memory Leak caused by call to Mix_OpenAudio
- Random numbers HOT 3
- Set gain value in audio streams HOT 1
- Issues with multiple opengl contexts on iOS
- [emscripten] SDL_WindowID=0 when relasing mouse button outside the canvas
- Is it right use the same value for the left right rumble in SDL/src/joystick/hidapi/SDL_hidapi_switch.c HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdl.