camera: add support for V4L2_PIX_FMT_SBGGR10P

This commit is contained in:
Kamil Trzcinski
2023-02-22 11:41:34 +01:00
parent c9600d1253
commit 3bc447c772
5 changed files with 24 additions and 0 deletions

View File

@ -1,5 +1,7 @@
#include "fourcc.h"
#include <string.h>
fourcc_string fourcc_to_string(unsigned format)
{
fourcc_string fourcc;
@ -19,3 +21,17 @@ fourcc_string fourcc_to_string(unsigned format)
*ptr++ = 0;
return fourcc;
}
many_fourcc_string many_fourcc_to_string(unsigned formats[])
{
many_fourcc_string fourcc = {0};
for (int i = 0; formats[i]; i++) {
if (fourcc.buf[0]) {
strcat(fourcc.buf, ", ");
}
strcat(fourcc.buf, fourcc_to_string(formats[i]).buf);
}
return fourcc;
}

View File

@ -7,4 +7,9 @@ typedef struct {
char buf[10];
} fourcc_string;
typedef struct {
char buf[250];
} many_fourcc_string;
fourcc_string fourcc_to_string(unsigned format);
many_fourcc_string many_fourcc_to_string(unsigned formats[]);