Stub for timestamp to fill in later
This commit is contained in:
@@ -230,5 +230,8 @@ opaque getCameraFormat : @& SDLCamera -> SDLIO CameraSpec
|
||||
|
||||
@[extern "sdl_acquire_camera_frame"]
|
||||
opaque acquireCameraFrame : (camera : @& SDLCamera) → SDLIO SDLSurface
|
||||
-- TODO: support returning the timestampNS too
|
||||
/- @[extern "sdl_acquire_camera_frame"] -/
|
||||
/- opaque acquireCameraFrame : (camera : @& SDLCamera) → SDLIO (SDLSurface × UInt64) -/
|
||||
|
||||
end SDL
|
||||
|
||||
@@ -497,8 +497,8 @@ uint32_t sdl_CameraSpec_get_framerate_denominator(lean_object* camera_spec_obj)
|
||||
|
||||
lean_obj_res sdl_acquire_camera_frame(lean_obj_arg camera_obj) {
|
||||
SDL_Camera* camera = (SDL_Camera*)lean_get_external_data(camera_obj);
|
||||
|
||||
SDL_Surface* frame = SDL_AcquireCameraFrame(camera, NULL);
|
||||
uint64_t timestamp = 0;
|
||||
SDL_Surface* frame = SDL_AcquireCameraFrame(camera, ×tamp);
|
||||
if (!frame) {
|
||||
return lean_io_result_mk_error(lean_mk_string(SDL_GetError()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user