forked from lit-robotics/libcamera-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathframebuffer_allocator.cpp
35 lines (25 loc) · 1.09 KB
/
framebuffer_allocator.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "framebuffer_allocator.h"
#include <libcamera/libcamera.h>
extern "C" {
libcamera_framebuffer_allocator_t *libcamera_framebuffer_allocator_create(libcamera_camera_t *cam) {
return new libcamera::FrameBufferAllocator(*cam);
}
void libcamera_framebuffer_allocator_destroy(libcamera_framebuffer_allocator_t *alloc) {
delete alloc;
}
int libcamera_framebuffer_allocator_allocate(libcamera_framebuffer_allocator_t *alloc, libcamera_stream_t *stream) {
return alloc->allocate(stream);
}
int libcamera_framebuffer_allocator_free(libcamera_framebuffer_allocator_t *alloc, libcamera_stream_t *stream) {
return alloc->free(stream);
}
const libcamera_framebuffer_list_t *libcamera_framebuffer_allocator_buffers(libcamera_framebuffer_allocator_t *alloc, libcamera_stream_t *stream) {
return &alloc->buffers(stream);
}
size_t libcamera_framebuffer_list_size(const libcamera_framebuffer_list_t *list) {
return list->size();
}
const libcamera_framebuffer_t *libcamera_framebuffer_list_get(const libcamera_framebuffer_list_t *list, size_t index) {
return list->at(index).get();
}
}