From b4cbaa7bf8eb44291180b56c73ad0d116f77f020 Mon Sep 17 00:00:00 2001 From: "U-INFINEON\\jahnst" Date: Sat, 11 Feb 2023 19:00:50 +0100 Subject: [PATCH] Compilation of dng class and videosdev-svbcam works now --- Makefile.config | 4 ++-- Makefile.rules.windows | 11 ++++++++++- ser.cc | 2 +- videodev-svbcam.h | 7 +++++++ windows.h | 9 +++++++-- 5 files changed, 27 insertions(+), 6 deletions(-) diff --git a/Makefile.config b/Makefile.config index 8b642f1..0100b89 100644 --- a/Makefile.config +++ b/Makefile.config @@ -3,8 +3,8 @@ # configurations should be made in here. # set one of these variables to 0 to disable the function. # -USE_SVBONY = 0 -USE_DNG = 0 +USE_SVBONY = 1 +USE_DNG = 1 USE_SER = 0 DEBUG_ANGLES = 1 diff --git a/Makefile.rules.windows b/Makefile.rules.windows index 53394b9..ab7a60b 100644 --- a/Makefile.rules.windows +++ b/Makefile.rules.windows @@ -3,10 +3,19 @@ include Makefile.config TARGET = $(APP).exe CPP = g++ -CPPFLAGS = -ggdb -Wall -O0 `pkg-config --cflags gtk+-3.0 gmodule-export-2.0` -Wl,--export-dynamic -DBUILD_WINDOWS=1 -Wdeprecated +CPPFLAGS = -ggdb -Wall -O0 `pkg-config --cflags gtk+-3.0 gmodule-export-2.0` -Wl,--export-dynamic -DBUILD_WINDOWS=1 -Wdeprecated -D_POSIX_C_SOURCE=200112L INCLUDES = LDFLAGS = -lws2_32 -ljpeg LIBS = `pkg-config --libs gtk+-3.0 gmodule-export-2.0` -L/usr/lib -mwindows OBJECTS := $(OBJECTS) windows.oo +# +# add makefile configuration for svbony cams +# +ifeq ($(USE_SVBONY),1) +CPPFLAGS := $(CPPFLAGS) -I/usr/local/include +LDFLAGS := $(LDFLAGS) -lSVBCameraSDK -L/usr/local/lib +OBJECTS := $(OBJECTS) videodev-svbcam.oo +endif +# diff --git a/ser.cc b/ser.cc index 70dab1c..6c4309e 100644 --- a/ser.cc +++ b/ser.cc @@ -51,7 +51,7 @@ SER::~SER() { if(!Reading) { int err; - long offset = (long)&header.FrameCount - (long)&header; + int64_t offset = (int64_t)&header.FrameCount - (int64_t)&header; header.FrameCount = FramePointer; /* goto file beginning */ diff --git a/videodev-svbcam.h b/videodev-svbcam.h index 47b62ad..a5e51da 100644 --- a/videodev-svbcam.h +++ b/videodev-svbcam.h @@ -10,17 +10,24 @@ #include #include #include +#ifndef BUILD_WINDOWS #include +#endif #include #include #include #include +#ifndef BUILD_WINDOWS #include #include +#endif #include #include +#ifdef BUILD_WINDOWS +#include "windows.h" +#endif #include "convert.h" #include "gui.h" diff --git a/windows.h b/windows.h index 25a92a6..0a26c9c 100644 --- a/windows.h +++ b/windows.h @@ -56,10 +56,15 @@ extern void strfromd (char* dest, int len, char *fmt,...); #define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */ #define V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */ #define V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */ -#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */ +#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */ #define V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */ #define V4L2_PIX_FMT_SGRBG16 v4l2_fourcc('G', 'R', '1', '6') /* 16 GRGR.. BGBG.. */ - +#define V4L2_PIX_FMT_SRGGB8 v4l2_fourcc('R', 'G', 'G', 'B') /* 8 RGRG.. GBGB.. */ +#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ +#define V4L2_PIX_FMT_SRGGB16 v4l2_fourcc('R', 'G', '1', '6') /* 16 RGRG.. GBGB.. */ +#define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */ +#define V4L2_PIX_FMT_SGBRG16 v4l2_fourcc('G', 'B', '1', '6') /* 16 GBGB.. RGRG.. */ +#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ #define v4l2_fourcc(a, b, c, d)\ ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24))