diff --git a/Makefile b/Makefile index 656403d..69a6812 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.SILENT: +# .SILENT: DEPENDFILE=.depend VERSION=0.1 diff --git a/configuration.cc b/configuration.cc index d908ee6..2e4638f 100644 --- a/configuration.cc +++ b/configuration.cc @@ -20,6 +20,7 @@ Configuration::Configuration() { runasdaemon = 0; vdev_iomode = DEFAULT_VDEV_IOMODE; vdev_device = DEFAULT_VDEV_DEVICE; + vdev_format = ""; ssl_key = DEFAULT_SSL_KEY; ssl_cert = DEFAULT_SSL_CERT; initflags = 0; @@ -52,6 +53,7 @@ int Configuration::PrintConfig() { jp.AddObject("vdev-device", vdev_device); jp.AddObject("vdev-height", vdev_height); jp.AddObject("vdev-width", vdev_width); + jp.AddObject("vdev-format", vdev_format); jp.AddObject("web-height", web_height); jp.AddObject("web-width", web_width); @@ -91,6 +93,7 @@ int Configuration::LoadFile(std::string fn) { if (jp.GetValueInt("web-width", &i)) web_width = i; if (jp.GetValueString("vdev-device", &s)) vdev_device = s; + if (jp.GetValueString("vdev-format", &s)) vdev_format = s; if (jp.GetValueInt("vdev-iomode", &i)) vdev_iomode = i; if (jp.GetValueInt("vdev-height", &i)) vdev_height = i; if (jp.GetValueInt("vdev-width", &i)) vdev_width = i; @@ -157,6 +160,13 @@ int Configuration::LoadArgs(int argc, char **argv) { else ErrorExit("missing iomode parameter", -1); } + if (strcmp(argv[i], "-vdevformat") == 0) { + if (++i < argc) { + vdev_format = argv[i]; + } + else + ErrorExit("missing device parameter", -1); + } if (strcmp(argv[i], "-vdevdevice") == 0) { if (++i < argc) { vdev_device = argv[i]; @@ -199,6 +209,7 @@ void Configuration::Help() { printf (" -vdeviomode INT IOMode to read the video data, 0-read, 1-MMap\n"); printf (" -vdevdevice FILE Device File i.e. /dev/video2\n"); printf (" -vdevsize INT INT define video input resolution\n"); + printf (" -vdevformat FORMAT 4 Char Format code - see v4l2 documentation (videodev2.h)\n"); printf ("\n"); printf (" -config FILE load this configfile\n"); printf (" -dump_config print the config file\n"); diff --git a/configuration.h b/configuration.h index 95b0ecb..4749c6a 100644 --- a/configuration.h +++ b/configuration.h @@ -41,6 +41,7 @@ public: int vdev_width; int vdev_iomode; std::string vdev_device; + std::string vdev_format; Configuration(); ~Configuration(); diff --git a/convert.cc b/convert.cc index b741350..a29f08a 100644 --- a/convert.cc +++ b/convert.cc @@ -28,6 +28,7 @@ uint32_t convert_pixelformats [] = { V4L2_PIX_FMT_UYVY, V4L2_PIX_FMT_SGRBG16, V4L2_PIX_FMT_SGRBG8, + V4L2_PIX_FMT_SRGGB10P, 0 }; @@ -217,6 +218,13 @@ int Convert (ConvertData *cdata, VideoFrame *dest, unsigned char *ptrsrc, int sr yd++; } break; + + case (V4L2_PIX_FMT_SRGGB10P): + if (debayer_mode == 0) + debayer_rggb10packed_simple ((uint16_t *)ptrsrc, srcw, srch, ptrdst, srcw, srch); + else + debayer_rggb10packet_bilinear ((uint16_t *)ptrsrc, srcw, srch, ptrdst, srcw, srch); + break; case (V4L2_PIX_FMT_SGRBG16): if (debayer_mode == 0) diff --git a/debayer.cc b/debayer.cc index fdcc03c..67a6d03 100644 --- a/debayer.cc +++ b/debayer.cc @@ -364,3 +364,15 @@ void debayer_grbg8_bilinear (uint8_t * src, int src_w, int src_h, b = LE; STORE8; } + +void debayer_rggb10packet_simple (uint16_t * src, int src_w, int src_h, + uint8_t * dst, int dst_w, int dst_h) { +}; + + +void debayer_rggb10packet_bilinear (uint8_t * src, int src_w, int src_h, + uint8_t * dst, int dst_w, int dst_h) { + +}; + + diff --git a/debayer.h b/debayer.h index 2621019..22c8ed6 100644 --- a/debayer.h +++ b/debayer.h @@ -5,12 +5,17 @@ void debayer_grbg16_simple (uint16_t * src, int src_w, int src_h, uint8_t * dst, int dst_w, int dst_h); +void debayer_grbg16_bilinear (uint16_t * src, int src_w, int src_h, + uint8_t * dst, int dst_w, int dst_h); + void debayer_grbg8_simple (uint8_t * src, int src_w, int src_h, uint8_t * dst, int dst_w, int dst_h); +void debayer_grbg8_bilinear (uint8_t * src, int src_w, int src_h, + uint8_t * dst, int dst_w, int dst_h); -void debayer_grbg16_bilinear (uint16_t * src, int src_w, int src_h, +void debayer_rggb10packet_simple (uint16_t * src, int src_w, int src_h, uint8_t * dst, int dst_w, int dst_h); -void debayer_grbg8_bilinear (uint8_t * src, int src_w, int src_h, +void debayer_rggb10packet_bilinear (uint8_t * src, int src_w, int src_h, uint8_t * dst, int dst_w, int dst_h); #endif