Add bytesperline
This commit is contained in:
@ -64,7 +64,7 @@ void buffer_list_close(buffer_list_t *buf_list)
|
||||
free(buf_list);
|
||||
}
|
||||
|
||||
int buffer_list_set_format(buffer_list_t *buf_list, unsigned width, unsigned height, unsigned format)
|
||||
int buffer_list_set_format(buffer_list_t *buf_list, unsigned width, unsigned height, unsigned format, unsigned bytesperline)
|
||||
{
|
||||
struct v4l2_format *fmt = &buf_list->v4l2_format;
|
||||
|
||||
@ -120,9 +120,13 @@ retry:
|
||||
fourcc_to_string(fmt->fmt.pix.pixelformat).buf);
|
||||
}
|
||||
|
||||
E_LOG_INFO(buf_list, "Using: %ux%u/%s",
|
||||
fmt->fmt.pix.width, fmt->fmt.pix.height, fourcc_to_string(fmt->fmt.pix.pixelformat).buf);
|
||||
|
||||
E_LOG_INFO(
|
||||
buf_list,
|
||||
"Using: %ux%u/%s, bytesperline=%d",
|
||||
fmt->fmt.pix.width, fmt->fmt.pix.height,
|
||||
fourcc_to_string(fmt->fmt.pix.pixelformat).buf,
|
||||
fmt->fmt.pix.bytesperline
|
||||
);
|
||||
|
||||
buf_list->fmt_width = fmt->fmt.pix.width;
|
||||
buf_list->fmt_height = fmt->fmt.pix.height;
|
||||
|
@ -15,7 +15,7 @@ typedef struct buffer_list_s {
|
||||
bool do_dma;
|
||||
bool do_capture;
|
||||
|
||||
unsigned fmt_width, fmt_height, fmt_format;
|
||||
unsigned fmt_width, fmt_height, fmt_format, fmt_bytesperline;
|
||||
|
||||
bool streaming;
|
||||
int frames;
|
||||
@ -24,7 +24,7 @@ typedef struct buffer_list_s {
|
||||
buffer_list_t *buffer_list_open(const char *name, struct device_s *dev, unsigned type, bool do_mmap);
|
||||
void buffer_list_close(buffer_list_t *buf_list);
|
||||
|
||||
int buffer_list_set_format(buffer_list_t *buffer_list, unsigned width, unsigned height, unsigned format);
|
||||
int buffer_list_set_format(buffer_list_t *buffer_list, unsigned width, unsigned height, unsigned format, unsigned bytesperline);
|
||||
int buffer_list_request(buffer_list_t *buf_list, int nbufs);
|
||||
|
||||
int buffer_list_stream(buffer_list_t *buf_list, bool do_on);
|
||||
|
@ -49,7 +49,7 @@ void device_close(device_t *dev) {
|
||||
free(dev);
|
||||
}
|
||||
|
||||
int device_open_buffer_list(device_t *dev, bool do_capture, unsigned width, unsigned height, unsigned format, int nbufs)
|
||||
int device_open_buffer_list(device_t *dev, bool do_capture, unsigned width, unsigned height, unsigned format, unsigned bytesperline, int nbufs)
|
||||
{
|
||||
unsigned type;
|
||||
char name[64];
|
||||
@ -101,7 +101,7 @@ int device_open_buffer_list(device_t *dev, bool do_capture, unsigned width, unsi
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (buffer_list_set_format(*buf_list, width, height, format) < 0) {
|
||||
if (buffer_list_set_format(*buf_list, width, height, format, bytesperline) < 0) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,7 @@ typedef struct device_s {
|
||||
device_t *device_open(const char *name, const char *path);
|
||||
void device_close(device_t *device);
|
||||
|
||||
int device_open_buffer_list(device_t *dev, bool do_capture, unsigned width, unsigned height, unsigned format, int nbufs);
|
||||
int device_open_buffer_list(device_t *dev, bool do_capture, unsigned width, unsigned height, unsigned format, unsigned bytesperline, int nbufs);
|
||||
int device_consume_event(device_t *device);
|
||||
|
||||
int device_stream(device_t *dev, bool do_on);
|
||||
|
Reference in New Issue
Block a user