mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-20 21:16:04 +00:00
Make sure the output settings match the camera device format
This commit is contained in:
parent
876f10795f
commit
463984ec20
1 changed files with 5 additions and 1 deletions
|
|
@ -308,7 +308,11 @@ static int COREMEDIA_OpenDevice(SDL_CameraDevice *device, const SDL_CameraSpec *
|
|||
return SDL_SetError("Cannot create AVCaptureVideoDataOutput");
|
||||
}
|
||||
|
||||
output.videoSettings = @{};
|
||||
output.videoSettings = @{
|
||||
(id)kCVPixelBufferWidthKey : @(spec->width),
|
||||
(id)kCVPixelBufferHeightKey : @(spec->height),
|
||||
(id)kCVPixelBufferPixelFormatTypeKey : @(CMFormatDescriptionGetMediaSubType([spec_format formatDescription]))
|
||||
};
|
||||
|
||||
char threadname[64];
|
||||
SDL_GetCameraThreadName(device, threadname, sizeof (threadname));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue