Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SDL_AcquireCameraFrame as SDL_Texture 0-copy texture. #9826

Open
1bsyl opened this issue May 17, 2024 · 1 comment
Open

Add SDL_AcquireCameraFrame as SDL_Texture 0-copy texture. #9826

1bsyl opened this issue May 17, 2024 · 1 comment
Assignees
Milestone

Comments

@1bsyl
Copy link
Contributor

1bsyl commented May 17, 2024

Currently the Camera API grabs software frames, but it's possible to get 0-copy textures instead. Which is faster if you only want to render the frames.

suggestion is to add:

SDL_Texture * SDL_AcquireCameraFrame0Copy(
       SDL_Camera *camera, 
       Uint64 *timestampNS, 
       SDL_Renderer *renderer);

So that return value is a 0-copy texture for the SDL_Renderer.
( some example to use 0-copy textures with cameras: #8565
testffmpeg.c also shows 0-copy textures creations and update. )

@slouken
Copy link
Collaborator

slouken commented May 17, 2024

I would probably return properties that can be used to create a texture or interop with some other display mechanism, rather than tie it directly to an SDL renderer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants