Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature: DNG raw image support for arv-viewer + 16 bit Bayer grayscale preview #790

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
7 changes: 7 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ gobject_dep = dependency ('gobject-2.0', required: true)
gio_dep = dependency ('gio-2.0', required: true)
xml2_dep = dependency ('libxml-2.0', required: true)
libz_dep = dependency ('zlib', required: true)
tiff_dep = dependency ('libtiff-4', required: get_option ('tiff'))
usb_dep = dependency ('libusb-1.0', required: get_option ('usb'))

aravis_public_dependencies = [glib_dep, gobject_dep, gio_dep]
Expand Down Expand Up @@ -107,9 +108,14 @@ viewer_deps = aravis_dependencies + [dependency ('gtk+-3.0', version: '>=3.12',
dependency ('gstreamer-base-1.0', required: viewer_option),
dependency ('gstreamer-app-1.0', required: viewer_option),
dependency ('gstreamer-video-1.0', required: viewer_option)]
if tiff_dep.found()
viewer_deps += tiff_dep
endif
subdir ('po', if_found: viewer_deps)
subdir ('viewer', if_found: viewer_deps)



gst_enabled = false
gst_option = get_option ('gst-plugin')
gst_deps = aravis_dependencies + [dependency ('gstreamer-base-1.0', required: gst_option),
Expand All @@ -136,6 +142,7 @@ summary (
'Viewer': viewer_enabled,
'GStreamer plugin': gst_enabled,
'USB support': usb_dep.found(),
'TIFF viewer support': tiff_dep.found(),
},
section: 'Options'
)
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
option('viewer', type: 'feature', value: 'auto', description : 'Build simple viewer')
option('gst-plugin', type: 'feature', value: 'auto', description : 'Build GStreamer plugin')
option('usb', type: 'feature', value: 'auto', description : 'Enable USB support')
option('tiff', type: 'feature', value: 'auto', description : 'Enable viewer TIFF support')
option('packet-socket', type: 'feature', value: 'auto', description : 'Enable packet socket support')

option('tests', type: 'boolean', value: true, description: 'Build tests')
Expand Down
201 changes: 198 additions & 3 deletions src/arvmisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,10 +720,205 @@ ArvGstCapsInfos arv_gst_caps_infos[] = {
"video/x-raw-bayer, format=(string)bggr, bpp=(int)8, depth=(int)8",
"video/x-raw-bayer", 8, 8, ARV_MAKE_FOURCC ('b','g','g','r')
},

/* Non 8bit bayer formats are not supported by gstreamer bayer plugin.
* This feature is discussed in bug https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/86 .*/

* This feature is discussed in bug https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/86 .
* This is a fallback for these bayer formats, displaying a grayscale image. */
{
ARV_PIXEL_FORMAT_BAYER_GR_10,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)grbg, bpp=(int)16, depth=(int)10",
"video/x-raw-gray", 16, 10, ARV_MAKE_FOURCC ('g','r','b','g')
},
{
ARV_PIXEL_FORMAT_BAYER_RG_10,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)rggb, bpp=(int)16, depth=(int)10",
"video/x-raw-gray", 16, 10, ARV_MAKE_FOURCC ('r','g','g','b')
},
{
ARV_PIXEL_FORMAT_BAYER_GB_10,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)gbrg, bpp=(int)16, depth=(int)10",
"video/x-raw-gray", 16, 10, ARV_MAKE_FOURCC ('g','b','r','g')
},
{
ARV_PIXEL_FORMAT_BAYER_BG_10,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-gray, format=(string)bggr, bpp=(int)16, depth=(int)10",
"video/x-raw-gray", 16, 10, ARV_MAKE_FOURCC ('b','g','g','r')
},
{
ARV_PIXEL_FORMAT_BAYER_GR_12,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)grbg, bpp=(int)16, depth=(int)12",
"video/x-raw-gray", 16, 12, ARV_MAKE_FOURCC ('g','r','b','g')
},
{
ARV_PIXEL_FORMAT_BAYER_RG_12,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)rggb, bpp=(int)16, depth=(int)12",
"video/x-raw-gray", 16, 12, ARV_MAKE_FOURCC ('r','g','g','b')
},
{
ARV_PIXEL_FORMAT_BAYER_GB_12,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)gbrg, bpp=(int)16, depth=(int)12",
"video/x-raw-gray", 16, 12, ARV_MAKE_FOURCC ('g','b','r','g')
},
{
ARV_PIXEL_FORMAT_BAYER_BG_12,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-gray, format=(string)bggr, bpp=(int)16, depth=(int)12",
"video/x-raw-gray", 16, 12, ARV_MAKE_FOURCC ('b','g','g','r')
},
{
ARV_PIXEL_FORMAT_BAYER_GR_16,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)grbg, bpp=(int)16, depth=(int)16",
"video/x-raw-gray", 16, 16, ARV_MAKE_FOURCC ('g','r','b','g')
},
{
ARV_PIXEL_FORMAT_BAYER_RG_16,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)rggb, bpp=(int)16, depth=(int)16",
"video/x-raw-gray", 16, 16, ARV_MAKE_FOURCC ('r','g','g','b')
},
{
ARV_PIXEL_FORMAT_BAYER_GB_16,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)gbrg, bpp=(int)16, depth=(int)16",
"video/x-raw-gray", 16, 16, ARV_MAKE_FOURCC ('g','b','r','g')
},
{
ARV_PIXEL_FORMAT_BAYER_BG_16,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-gray, format=(string)bggr, bpp=(int)16, depth=(int)16",
"video/x-raw-gray", 16, 16, ARV_MAKE_FOURCC ('b','g','g','r')
},
{
ARV_PIXEL_FORMAT_BAYER_GR_10P,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)grbg, bpp=(int)10, depth=(int)10",
"video/x-raw-gray", 10, 10, ARV_MAKE_FOURCC ('g','r','b','g')
},
{
ARV_PIXEL_FORMAT_BAYER_RG_10P,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)rggb, bpp=(int)10, depth=(int)10",
"video/x-raw-gray", 10, 10, ARV_MAKE_FOURCC ('r','g','g','b')
},
{
ARV_PIXEL_FORMAT_BAYER_GB_10P,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)gbrg, bpp=(int)10, depth=(int)10",
"video/x-raw-gray", 10, 10, ARV_MAKE_FOURCC ('g','b','r','g')
},
{
ARV_PIXEL_FORMAT_BAYER_BG_10P,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-gray, format=(string)bggr, bpp=(int)10, depth=(int)10",
"video/x-raw-gray", 10, 10, ARV_MAKE_FOURCC ('b','g','g','r')
},
{
ARV_PIXEL_FORMAT_BAYER_GR_12P,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)grbg, bpp=(int)12, depth=(int)12",
"video/x-raw-gray", 12, 12, ARV_MAKE_FOURCC ('g','r','b','g')
},
{
ARV_PIXEL_FORMAT_BAYER_RG_12P,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)rggb, bpp=(int)12, depth=(int)12",
"video/x-raw-gray", 12, 12, ARV_MAKE_FOURCC ('r','g','g','b')
},
{
ARV_PIXEL_FORMAT_BAYER_GB_12P,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)gbrg, bpp=(int)12, depth=(int)12",
"video/x-raw-gray", 12, 12, ARV_MAKE_FOURCC ('g','b','r','g')
},
{
ARV_PIXEL_FORMAT_BAYER_BG_12P,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-gray, format=(string)bggr, bpp=(int)12, depth=(int)12",
"video/x-raw-gray", 12, 12, ARV_MAKE_FOURCC ('b','g','g','r')
},
{
ARV_PIXEL_FORMAT_BAYER_GR_10_PACKED,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)grbg, bpp=(int)10, depth=(int)10",
"video/x-raw-gray", 10, 10, ARV_MAKE_FOURCC ('g','r','b','g')
},
{
ARV_PIXEL_FORMAT_BAYER_RG_10_PACKED,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)rggb, bpp=(int)10, depth=(int)10",
"video/x-raw-gray", 10, 10, ARV_MAKE_FOURCC ('r','g','g','b')
},
{
ARV_PIXEL_FORMAT_BAYER_GB_10_PACKED,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)gbrg, bpp=(int)10, depth=(int)10",
"video/x-raw-gray", 10, 10, ARV_MAKE_FOURCC ('g','b','r','g')
},
{
ARV_PIXEL_FORMAT_BAYER_BG_10_PACKED,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-gray, format=(string)bggr, bpp=(int)10, depth=(int)10",
"video/x-raw-gray", 10, 10, ARV_MAKE_FOURCC ('b','g','g','r')
},
{
ARV_PIXEL_FORMAT_BAYER_GR_12_PACKED,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)grbg, bpp=(int)12, depth=(int)12",
"video/x-raw-gray", 12, 12, ARV_MAKE_FOURCC ('g','r','b','g')
},
{
ARV_PIXEL_FORMAT_BAYER_RG_12_PACKED,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)rggb, bpp=(int)12, depth=(int)12",
"video/x-raw-gray", 12, 12, ARV_MAKE_FOURCC ('r','g','g','b')
},
{
ARV_PIXEL_FORMAT_BAYER_GB_12_PACKED,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-bayer, format=(string)gbrg, bpp=(int)12, depth=(int)12",
"video/x-raw-gray", 12, 12, ARV_MAKE_FOURCC ('g','b','r','g')
},
{
ARV_PIXEL_FORMAT_BAYER_BG_12_PACKED,
"video/x-raw, format=(string)GRAY16_LE",
"video/x-raw", "GRAY16_LE",
"video/x-raw-gray, format=(string)bggr, bpp=(int)12, depth=(int)12",
"video/x-raw-gray", 12, 12, ARV_MAKE_FOURCC ('b','g','g','r')
},
{
ARV_PIXEL_FORMAT_YUV_422_PACKED,
"video/x-raw, format=(string)UYVY",
Expand Down
Loading