rpicamsrc: meson: use gnome.glib_mkenums_simple() and fix build as Meson subproject

While at it also fix up the type defines, e.g.
GST_RPI_CAM_TYPE_RPI_CAM_SRC_EXPOSURE_MODE -> GST_RPI_CAM_SRC_TYPE_EXPOSURE_MODE
This commit is contained in:
Tim-Philipp Müller 2020-05-02 18:28:10 +00:00
parent 912ea0dceb
commit 1c25fe131d
2 changed files with 14 additions and 22 deletions

View file

@ -375,21 +375,21 @@ gst_rpi_cam_src_class_init (GstRpiCamSrcClass * klass)
g_object_class_install_property (gobject_class, PROP_EXPOSURE_MODE, g_object_class_install_property (gobject_class, PROP_EXPOSURE_MODE,
g_param_spec_enum ("exposure-mode", "Exposure Mode", g_param_spec_enum ("exposure-mode", "Exposure Mode",
"Camera exposure mode to use", "Camera exposure mode to use",
GST_RPI_CAM_TYPE_RPI_CAM_SRC_EXPOSURE_MODE, EXPOSURE_MODE_DEFAULT, GST_RPI_CAM_SRC_TYPE_EXPOSURE_MODE, EXPOSURE_MODE_DEFAULT,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_EXPOSURE_METERING_MODE, g_object_class_install_property (gobject_class, PROP_EXPOSURE_METERING_MODE,
g_param_spec_enum ("metering-mode", "Exposure Metering Mode", g_param_spec_enum ("metering-mode", "Exposure Metering Mode",
"Camera exposure metering mode to use", "Camera exposure metering mode to use",
GST_RPI_CAM_TYPE_RPI_CAM_SRC_EXPOSURE_METERING_MODE, GST_RPI_CAM_SRC_TYPE_EXPOSURE_METERING_MODE,
EXPOSURE_METERING_MODE_DEFAULT, EXPOSURE_METERING_MODE_DEFAULT,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_DRC, g_object_class_install_property (gobject_class, PROP_DRC,
g_param_spec_enum ("drc", "DRC level", "Dynamic Range Control level", g_param_spec_enum ("drc", "DRC level", "Dynamic Range Control level",
GST_RPI_CAM_TYPE_RPI_CAM_SRC_DRC_LEVEL, GST_RPI_CAM_SRC_DRC_LEVEL_OFF, GST_RPI_CAM_SRC_TYPE_DRC_LEVEL, GST_RPI_CAM_SRC_DRC_LEVEL_OFF,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_AWB_MODE, g_object_class_install_property (gobject_class, PROP_AWB_MODE,
g_param_spec_enum ("awb-mode", "Automatic White Balance Mode", g_param_spec_enum ("awb-mode", "Automatic White Balance Mode",
"White Balance mode", GST_RPI_CAM_TYPE_RPI_CAM_SRC_AWB_MODE, "White Balance mode", GST_RPI_CAM_SRC_TYPE_AWB_MODE,
GST_RPI_CAM_SRC_AWB_MODE_AUTO, GST_RPI_CAM_SRC_AWB_MODE_AUTO,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_AWB_GAIN_RED, g_object_class_install_property (gobject_class, PROP_AWB_GAIN_RED,
@ -403,7 +403,7 @@ gst_rpi_cam_src_class_init (GstRpiCamSrcClass * klass)
g_object_class_install_property (gobject_class, PROP_IMAGE_EFFECT, g_object_class_install_property (gobject_class, PROP_IMAGE_EFFECT,
g_param_spec_enum ("image-effect", "Image effect", g_param_spec_enum ("image-effect", "Image effect",
"Visual FX to apply to the image", "Visual FX to apply to the image",
GST_RPI_CAM_TYPE_RPI_CAM_SRC_IMAGE_EFFECT, GST_RPI_CAM_SRC_TYPE_IMAGE_EFFECT,
GST_RPI_CAM_SRC_IMAGEFX_NONE, GST_RPI_CAM_SRC_IMAGEFX_NONE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
#if 0 #if 0
@ -461,7 +461,7 @@ gst_rpi_cam_src_class_init (GstRpiCamSrcClass * klass)
g_object_class_install_property (gobject_class, PROP_ANNOTATION_MODE, g_object_class_install_property (gobject_class, PROP_ANNOTATION_MODE,
g_param_spec_flags ("annotation-mode", "Annotation Mode", g_param_spec_flags ("annotation-mode", "Annotation Mode",
"Flags to control annotation of the output video", "Flags to control annotation of the output video",
GST_RPI_CAM_TYPE_RPI_CAM_SRC_ANNOTATION_MODE, 0, GST_RPI_CAM_SRC_TYPE_ANNOTATION_MODE, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_ANNOTATION_TEXT, g_object_class_install_property (gobject_class, PROP_ANNOTATION_TEXT,
g_param_spec_string ("annotation-text", "Annotation Text", g_param_spec_string ("annotation-text", "Annotation Text",
@ -470,7 +470,7 @@ gst_rpi_cam_src_class_init (GstRpiCamSrcClass * klass)
g_object_class_install_property (gobject_class, PROP_INTRA_REFRESH_TYPE, g_object_class_install_property (gobject_class, PROP_INTRA_REFRESH_TYPE,
g_param_spec_enum ("intra-refresh-type", "Intra Refresh Type", g_param_spec_enum ("intra-refresh-type", "Intra Refresh Type",
"Type of Intra Refresh to use, -1 to disable intra refresh", "Type of Intra Refresh to use, -1 to disable intra refresh",
GST_RPI_CAM_TYPE_RPI_CAM_SRC_INTRA_REFRESH_TYPE, GST_RPI_CAM_SRC_TYPE_INTRA_REFRESH_TYPE,
GST_RPI_CAM_SRC_INTRA_REFRESH_TYPE_NONE, GST_RPI_CAM_SRC_INTRA_REFRESH_TYPE_NONE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
g_object_class_install_property (gobject_class, PROP_ANNOTATION_TEXT_SIZE, g_object_class_install_property (gobject_class, PROP_ANNOTATION_TEXT_SIZE,

View file

@ -7,24 +7,16 @@ rpicamsrc_sources = [
'RaspiCLI.c', 'RaspiCLI.c',
] ]
# This can be simplified once meson gets native support for glib-mkenums (soon) # glib-mkenums
glib_mkenums = find_program('glib-mkenums') gnome = import('gnome')
gstrpicam_enum_types_h = custom_target('gstrpicam-enum-types.h', enums = gnome.mkenums_simple('gstrpicam-enum-types',
output : 'gstrpicam-enum-types.h', sources: 'gstrpicam_types.h',
input : files('gstrpicam_types.h'), identifier_prefix: 'GstRpiCamSrc',
command : [glib_mkenums, '--template', meson.current_source_dir() + '/gstrpicam-enums-template.h', '@INPUT@'], symbol_prefix: 'gst_rpi_cam_src')
capture : true)
gstrpicam_enum_types_c = custom_target('gstrpicam-enum-types.c',
output : 'gstrpicam-enum-types.c',
input : files('gstrpicam_types.h'),
depends : [gstrpicam_enum_types_h],
command : [glib_mkenums, '--template', meson.current_source_dir() + '/gstrpicam-enums-template.c', '@INPUT@'],
capture : true)
library('gstrpicamsrc', library('gstrpicamsrc',
rpicamsrc_sources, gstrpicam_enum_types_h, gstrpicam_enum_types_c, rpicamsrc_sources, enums,
c_args : gst_rpicamsrc_args, c_args : gst_rpicamsrc_args,
include_directories : config_inc, include_directories : config_inc,
dependencies : [gst_dep, gstbase_dep, gstvideo_dep] + mmal_deps, dependencies : [gst_dep, gstbase_dep, gstvideo_dep] + mmal_deps,