Giter Club home page Giter Club logo

Comments (15)

slouken avatar slouken commented on September 13, 2024 1

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.

1bsyl avatar 1bsyl commented on September 13, 2024 1

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.

olekolek1000 avatar olekolek1000 commented on September 13, 2024

Bisecting (again)...

from sdl.

olekolek1000 avatar olekolek1000 commented on September 13, 2024

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.

slouken avatar slouken commented on September 13, 2024

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.

icculus avatar icculus commented on September 13, 2024

Just to be clear, this is happening if you explicitly use the software renderer and not OpenGL or Metal?

from sdl.

olekolek1000 avatar olekolek1000 commented on September 13, 2024

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.

olekolek1000 avatar olekolek1000 commented on September 13, 2024

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.

olekolek1000 avatar olekolek1000 commented on September 13, 2024

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):
Untitled

from sdl.

olekolek1000 avatar olekolek1000 commented on September 13, 2024

testdrawchessboard and testgeometry both work OK on this laptop, in all three video backends (metal, gl, software).

from sdl.

slouken avatar slouken commented on September 13, 2024

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

Do you know which of these formats is actually used when you're getting frames from the camera?

from sdl.

olekolek1000 avatar olekolek1000 commented on September 13, 2024

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.

icculus avatar icculus commented on September 13, 2024

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.

slouken avatar slouken commented on September 13, 2024

Yeah, I tested with testyuv --uyvy and it worked with the metal renderer, so this needs more investigation.

from sdl.

icculus avatar icculus commented on September 13, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.