mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
rpicamsrc: Add annotation-mode and annotation-text properties
This commit is contained in:
parent
39d212df57
commit
ed22d5cc4e
3 changed files with 41 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
|||
#include "interface/mmal/util/mmal_util_params.h"
|
||||
#include "interface/mmal/mmal_parameters_camera.h"
|
||||
#include "RaspiCamControl.h"
|
||||
|
||||
typedef enum {
|
||||
GST_RPI_CAM_SRC_EXPOSURE_MODE_OFF = MMAL_PARAM_EXPOSUREMODE_OFF,
|
||||
|
@ -77,3 +78,16 @@ typedef enum {
|
|||
GST_RPI_CAM_SRC_DRC_LEVEL_HIGH = MMAL_PARAMETER_DRC_STRENGTH_HIGH
|
||||
} GstRpiCamSrcDRCLevel;
|
||||
|
||||
typedef enum /*< flags >*/ {
|
||||
GST_RPI_CAM_SRC_ANNOTATION_MODE_CUSTOM_TEXT = ANNOTATE_USER_TEXT,
|
||||
GST_RPI_CAM_SRC_ANNOTATION_MODE_TEXT = ANNOTATE_APP_TEXT,
|
||||
GST_RPI_CAM_SRC_ANNOTATION_MODE_DATE = ANNOTATE_DATE_TEXT,
|
||||
GST_RPI_CAM_SRC_ANNOTATION_MODE_TIME = ANNOTATE_TIME_TEXT,
|
||||
GST_RPI_CAM_SRC_ANNOTATION_MODE_SHUTTER_SETTINGS = ANNOTATE_SHUTTER_SETTINGS,
|
||||
GST_RPI_CAM_SRC_ANNOTATION_MODE_CAF_SETTINGS = ANNOTATE_CAF_SETTINGS,
|
||||
GST_RPI_CAM_SRC_ANNOTATION_MODE_GAIN_SETTINGS = ANNOTATE_GAIN_SETTINGS,
|
||||
GST_RPI_CAM_SRC_ANNOTATION_MODE_LENS_SETTINGS = ANNOTATE_LENS_SETTINGS,
|
||||
GST_RPI_CAM_SRC_ANNOTATION_MODE_MOTION_SETTINGS = ANNOTATE_MOTION_SETTINGS,
|
||||
GST_RPI_CAM_SRC_ANNOTATION_MODE_FRAME_NUMBER = ANNOTATE_FRAME_NUMBER,
|
||||
GST_RPI_CAM_SRC_ANNOTATION_MODE_BLACK_BACKGROUND = ANNOTATE_BLACK_BACKGROUND
|
||||
} GstRpiCamSrcAnnotationMode;
|
||||
|
|
|
@ -125,7 +125,7 @@ enum
|
|||
PROP_SENSOR_MODE,
|
||||
PROP_DRC,
|
||||
PROP_ANNOTATION_MODE,
|
||||
PROP_ANNOTATION_STRING
|
||||
PROP_ANNOTATION_TEXT
|
||||
};
|
||||
|
||||
#define CAMERA_DEFAULT 0
|
||||
|
@ -394,6 +394,16 @@ gst_rpi_cam_src_class_init (GstRpiCamSrcClass * klass)
|
|||
gst_rpi_cam_src_sensor_mode_get_type (),
|
||||
GST_RPI_CAM_SRC_SENSOR_MODE_AUTOMATIC,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
g_object_class_install_property (gobject_class, PROP_ANNOTATION_MODE,
|
||||
g_param_spec_flags ("annotation-mode", "Annotation Mode",
|
||||
"Flags to control annotation of the output video",
|
||||
GST_RPI_CAM_TYPE_RPI_CAM_SRC_ANNOTATION_MODE, 0,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
g_object_class_install_property (gobject_class, PROP_ANNOTATION_TEXT,
|
||||
g_param_spec_string ("annotation-text", "Annotation Text",
|
||||
"Text string to annotate onto video when annotation-mode flags include 'custom-text'",
|
||||
NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
gst_element_class_set_static_metadata (gstelement_class,
|
||||
"Raspberry Pi Camera Source", "Source/Video",
|
||||
"Raspberry Pi camera module source", "Jan Schmidt <jan@centricular.com>");
|
||||
|
@ -539,6 +549,14 @@ gst_rpi_cam_src_set_property (GObject * object, guint prop_id,
|
|||
case PROP_SENSOR_MODE:
|
||||
src->capture_config.sensor_mode = g_value_get_enum (value);
|
||||
break;
|
||||
case PROP_ANNOTATION_MODE:
|
||||
src->capture_config.camera_parameters.enable_annotate = g_value_get_flags (value);
|
||||
break;
|
||||
case PROP_ANNOTATION_TEXT:
|
||||
strncpy (src->capture_config.camera_parameters.annotate_string,
|
||||
g_value_get_string (value), MMAL_CAMERA_ANNOTATE_MAX_TEXT_LEN_V2);
|
||||
src->capture_config.camera_parameters.annotate_string[MMAL_CAMERA_ANNOTATE_MAX_TEXT_LEN_V2 - 1] = '\0';
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
|
@ -659,6 +677,12 @@ gst_rpi_cam_src_get_property (GObject * object, guint prop_id,
|
|||
case PROP_SENSOR_MODE:
|
||||
g_value_set_enum (value, src->capture_config.sensor_mode);
|
||||
break;
|
||||
case PROP_ANNOTATION_MODE:
|
||||
g_value_set_flags (value, src->capture_config.camera_parameters.enable_annotate);
|
||||
break;
|
||||
case PROP_ANNOTATION_TEXT:
|
||||
g_value_set_string (value, src->capture_config.camera_parameters.annotate_string);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* GStreamer
|
||||
* Copyright (C) 2013 Jan Schmidt <jan@centricular.com>
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
|
@ -74,7 +74,7 @@ struct _GstRpiCamSrc
|
|||
gboolean started;
|
||||
};
|
||||
|
||||
struct _GstRpiCamSrcClass
|
||||
struct _GstRpiCamSrcClass
|
||||
{
|
||||
GstPushSrcClass parent_class;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue