|
|
@ -210,7 +210,8 @@ static void gst_rpi_cam_src_finalize (GObject *object);
|
|
|
|
|
|
|
|
|
|
|
|
static void gst_rpi_cam_src_colorbalance_init (GstColorBalanceInterface *
|
|
|
|
static void gst_rpi_cam_src_colorbalance_init (GstColorBalanceInterface *
|
|
|
|
iface);
|
|
|
|
iface);
|
|
|
|
static void gst_rpi_cam_src_orientation_init (GstVideoOrientationInterface * iface);
|
|
|
|
static void gst_rpi_cam_src_orientation_init (GstVideoOrientationInterface *
|
|
|
|
|
|
|
|
iface);
|
|
|
|
#ifdef GST_RPI_CAM_SRC_ENABLE_VIDEO_DIRECTION
|
|
|
|
#ifdef GST_RPI_CAM_SRC_ENABLE_VIDEO_DIRECTION
|
|
|
|
static void gst_rpi_cam_src_direction_init (GstVideoDirectionInterface * iface);
|
|
|
|
static void gst_rpi_cam_src_direction_init (GstVideoDirectionInterface * iface);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -259,7 +260,8 @@ gst_rpi_cam_src_sensor_mode_get_type (void)
|
|
|
|
"2592x1944 4:3 1-15fps / 3240x2464 15fps w/ v.2 board",
|
|
|
|
"2592x1944 4:3 1-15fps / 3240x2464 15fps w/ v.2 board",
|
|
|
|
"2592x1944-fast"},
|
|
|
|
"2592x1944-fast"},
|
|
|
|
{C_ENUM (GST_RPI_CAM_SRC_SENSOR_MODE_2592x1944_SLOW),
|
|
|
|
{C_ENUM (GST_RPI_CAM_SRC_SENSOR_MODE_2592x1944_SLOW),
|
|
|
|
"2592x1944 4:3 0.1666-1fps / 3240x2464 15fps w/ v.2 board", "2592x1944-slow"},
|
|
|
|
"2592x1944 4:3 0.1666-1fps / 3240x2464 15fps w/ v.2 board",
|
|
|
|
|
|
|
|
"2592x1944-slow"},
|
|
|
|
{C_ENUM (GST_RPI_CAM_SRC_SENSOR_MODE_1296x972), "1296x972 4:3 1-42fps",
|
|
|
|
{C_ENUM (GST_RPI_CAM_SRC_SENSOR_MODE_1296x972), "1296x972 4:3 1-42fps",
|
|
|
|
"1296x972"},
|
|
|
|
"1296x972"},
|
|
|
|
{C_ENUM (GST_RPI_CAM_SRC_SENSOR_MODE_1296x730), "1296x730 16:9 1-49fps",
|
|
|
|
{C_ENUM (GST_RPI_CAM_SRC_SENSOR_MODE_1296x730), "1296x730 16:9 1-49fps",
|
|
|
@ -480,13 +482,16 @@ gst_rpi_cam_src_class_init (GstRpiCamSrcClass * klass)
|
|
|
|
"Set the size of annotation text (in pixels) (0 = Auto)", 0,
|
|
|
|
"Set the size of annotation text (in pixels) (0 = Auto)", 0,
|
|
|
|
G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
|
|
|
G_MAXINT, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
|
|
|
g_object_class_install_property (gobject_class, PROP_ANNOTATION_TEXT_COLOUR,
|
|
|
|
g_object_class_install_property (gobject_class, PROP_ANNOTATION_TEXT_COLOUR,
|
|
|
|
g_param_spec_int ("annotation-text-colour", "Annotation text colour (VUY)",
|
|
|
|
g_param_spec_int ("annotation-text-colour",
|
|
|
|
"Set the annotation text colour, as the integer corresponding to a VUY value eg 0x8080FF = 8421631, -1 for default", -1,
|
|
|
|
"Annotation text colour (VUY)",
|
|
|
|
G_MAXINT, -1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
|
|
|
"Set the annotation text colour, as the integer corresponding to a VUY value eg 0x8080FF = 8421631, -1 for default",
|
|
|
|
g_object_class_install_property (gobject_class, PROP_ANNOTATION_TEXT_BG_COLOUR,
|
|
|
|
-1, G_MAXINT, -1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
|
|
|
g_param_spec_int ("annotation-text-bg-colour", "Annotation text background colour (VUY)",
|
|
|
|
g_object_class_install_property (gobject_class,
|
|
|
|
"Set the annotation text background colour, as the integer corresponding to a VUY value eg 0x8080FF = 8421631, -1 for default", -1,
|
|
|
|
PROP_ANNOTATION_TEXT_BG_COLOUR,
|
|
|
|
G_MAXINT, -1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
|
|
|
g_param_spec_int ("annotation-text-bg-colour",
|
|
|
|
|
|
|
|
"Annotation text background colour (VUY)",
|
|
|
|
|
|
|
|
"Set the annotation text background colour, as the integer corresponding to a VUY value eg 0x8080FF = 8421631, -1 for default",
|
|
|
|
|
|
|
|
-1, G_MAXINT, -1, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
|
|
|
#ifdef GST_RPI_CAM_SRC_ENABLE_VIDEO_DIRECTION
|
|
|
|
#ifdef GST_RPI_CAM_SRC_ENABLE_VIDEO_DIRECTION
|
|
|
|
g_object_class_override_property (gobject_class, PROP_VIDEO_DIRECTION,
|
|
|
|
g_object_class_override_property (gobject_class, PROP_VIDEO_DIRECTION,
|
|
|
|
"video-direction");
|
|
|
|
"video-direction");
|
|
|
@ -651,7 +656,9 @@ gst_rpi_cam_src_colorbalance_get_balance_type (GstColorBalance * balance)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef GST_RPI_CAM_SRC_ENABLE_VIDEO_DIRECTION
|
|
|
|
#ifdef GST_RPI_CAM_SRC_ENABLE_VIDEO_DIRECTION
|
|
|
|
static void gst_rpi_cam_src_set_orientation (GstRpiCamSrc * src, GstVideoOrientationMethod orientation)
|
|
|
|
static void
|
|
|
|
|
|
|
|
gst_rpi_cam_src_set_orientation (GstRpiCamSrc * src,
|
|
|
|
|
|
|
|
GstVideoOrientationMethod orientation)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (orientation) {
|
|
|
|
switch (orientation) {
|
|
|
|
case GST_VIDEO_ORIENTATION_IDENTITY:
|
|
|
|
case GST_VIDEO_ORIENTATION_IDENTITY:
|
|
|
@ -732,7 +739,8 @@ gst_rpi_cam_src_colorbalance_init (GstColorBalanceInterface * iface)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
static gboolean
|
|
|
|
gst_rpi_cam_src_orientation_get_hflip (GstVideoOrientation * orientation, gboolean * flip)
|
|
|
|
gst_rpi_cam_src_orientation_get_hflip (GstVideoOrientation * orientation,
|
|
|
|
|
|
|
|
gboolean * flip)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
GstRpiCamSrc *src = GST_RPICAMSRC (orientation);
|
|
|
|
GstRpiCamSrc *src = GST_RPICAMSRC (orientation);
|
|
|
|
|
|
|
|
|
|
|
@ -747,7 +755,8 @@ gst_rpi_cam_src_orientation_get_hflip (GstVideoOrientation * orientation, gboole
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
static gboolean
|
|
|
|
gst_rpi_cam_src_orientation_get_vflip (GstVideoOrientation * orientation, gboolean * flip)
|
|
|
|
gst_rpi_cam_src_orientation_get_vflip (GstVideoOrientation * orientation,
|
|
|
|
|
|
|
|
gboolean * flip)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
GstRpiCamSrc *src = GST_RPICAMSRC (orientation);
|
|
|
|
GstRpiCamSrc *src = GST_RPICAMSRC (orientation);
|
|
|
|
|
|
|
|
|
|
|
@ -762,7 +771,8 @@ gst_rpi_cam_src_orientation_get_vflip (GstVideoOrientation * orientation, gboole
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
static gboolean
|
|
|
|
gst_rpi_cam_src_orientation_set_hflip (GstVideoOrientation * orientation, gboolean flip)
|
|
|
|
gst_rpi_cam_src_orientation_set_hflip (GstVideoOrientation * orientation,
|
|
|
|
|
|
|
|
gboolean flip)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
GstRpiCamSrc *src = GST_RPICAMSRC (orientation);
|
|
|
|
GstRpiCamSrc *src = GST_RPICAMSRC (orientation);
|
|
|
|
|
|
|
|
|
|
|
@ -779,7 +789,8 @@ gst_rpi_cam_src_orientation_set_hflip (GstVideoOrientation * orientation, gboole
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
static gboolean
|
|
|
|
gst_rpi_cam_src_orientation_set_vflip (GstVideoOrientation * orientation, gboolean flip)
|
|
|
|
gst_rpi_cam_src_orientation_set_vflip (GstVideoOrientation * orientation,
|
|
|
|
|
|
|
|
gboolean flip)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
GstRpiCamSrc *src = GST_RPICAMSRC (orientation);
|
|
|
|
GstRpiCamSrc *src = GST_RPICAMSRC (orientation);
|
|
|
|
|
|
|
|
|
|
|
@ -849,19 +860,23 @@ gst_rpi_cam_src_set_property (GObject * object, guint prop_id,
|
|
|
|
src->capture_config.change_flags |= PROP_CHANGE_PREVIEW;
|
|
|
|
src->capture_config.change_flags |= PROP_CHANGE_PREVIEW;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_PREVIEW_X:
|
|
|
|
case PROP_PREVIEW_X:
|
|
|
|
src->capture_config.preview_parameters.previewWindow.x = g_value_get_int (value);
|
|
|
|
src->capture_config.preview_parameters.previewWindow.x =
|
|
|
|
|
|
|
|
g_value_get_int (value);
|
|
|
|
src->capture_config.change_flags |= PROP_CHANGE_PREVIEW;
|
|
|
|
src->capture_config.change_flags |= PROP_CHANGE_PREVIEW;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_PREVIEW_Y:
|
|
|
|
case PROP_PREVIEW_Y:
|
|
|
|
src->capture_config.preview_parameters.previewWindow.y = g_value_get_int (value);
|
|
|
|
src->capture_config.preview_parameters.previewWindow.y =
|
|
|
|
|
|
|
|
g_value_get_int (value);
|
|
|
|
src->capture_config.change_flags |= PROP_CHANGE_PREVIEW;
|
|
|
|
src->capture_config.change_flags |= PROP_CHANGE_PREVIEW;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_PREVIEW_W:
|
|
|
|
case PROP_PREVIEW_W:
|
|
|
|
src->capture_config.preview_parameters.previewWindow.width = g_value_get_int (value);
|
|
|
|
src->capture_config.preview_parameters.previewWindow.width =
|
|
|
|
|
|
|
|
g_value_get_int (value);
|
|
|
|
src->capture_config.change_flags |= PROP_CHANGE_PREVIEW;
|
|
|
|
src->capture_config.change_flags |= PROP_CHANGE_PREVIEW;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_PREVIEW_H:
|
|
|
|
case PROP_PREVIEW_H:
|
|
|
|
src->capture_config.preview_parameters.previewWindow.height = g_value_get_int (value);
|
|
|
|
src->capture_config.preview_parameters.previewWindow.height =
|
|
|
|
|
|
|
|
g_value_get_int (value);
|
|
|
|
src->capture_config.change_flags |= PROP_CHANGE_PREVIEW;
|
|
|
|
src->capture_config.change_flags |= PROP_CHANGE_PREVIEW;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_SHARPNESS:
|
|
|
|
case PROP_SHARPNESS:
|
|
|
@ -990,18 +1005,18 @@ gst_rpi_cam_src_set_property (GObject * object, guint prop_id,
|
|
|
|
src->capture_config.change_flags |= PROP_CHANGE_ANNOTATION;
|
|
|
|
src->capture_config.change_flags |= PROP_CHANGE_ANNOTATION;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_ANNOTATION_TEXT_SIZE:
|
|
|
|
case PROP_ANNOTATION_TEXT_SIZE:
|
|
|
|
src->capture_config.
|
|
|
|
src->capture_config.camera_parameters.annotate_text_size =
|
|
|
|
camera_parameters.annotate_text_size = g_value_get_int (value);
|
|
|
|
g_value_get_int (value);
|
|
|
|
src->capture_config.change_flags |= PROP_CHANGE_ANNOTATION;
|
|
|
|
src->capture_config.change_flags |= PROP_CHANGE_ANNOTATION;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_ANNOTATION_TEXT_COLOUR:
|
|
|
|
case PROP_ANNOTATION_TEXT_COLOUR:
|
|
|
|
src->capture_config.
|
|
|
|
src->capture_config.camera_parameters.annotate_text_colour =
|
|
|
|
camera_parameters.annotate_text_colour = g_value_get_int (value);
|
|
|
|
g_value_get_int (value);
|
|
|
|
src->capture_config.change_flags |= PROP_CHANGE_ANNOTATION;
|
|
|
|
src->capture_config.change_flags |= PROP_CHANGE_ANNOTATION;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_ANNOTATION_TEXT_BG_COLOUR:
|
|
|
|
case PROP_ANNOTATION_TEXT_BG_COLOUR:
|
|
|
|
src->capture_config.
|
|
|
|
src->capture_config.camera_parameters.annotate_bg_colour =
|
|
|
|
camera_parameters.annotate_bg_colour = g_value_get_int (value);
|
|
|
|
g_value_get_int (value);
|
|
|
|
src->capture_config.change_flags |= PROP_CHANGE_ANNOTATION;
|
|
|
|
src->capture_config.change_flags |= PROP_CHANGE_ANNOTATION;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_INTRA_REFRESH_TYPE:
|
|
|
|
case PROP_INTRA_REFRESH_TYPE:
|
|
|
@ -1059,16 +1074,20 @@ gst_rpi_cam_src_get_property (GObject * object, guint prop_id,
|
|
|
|
g_value_set_int (value, src->capture_config.preview_parameters.opacity);
|
|
|
|
g_value_set_int (value, src->capture_config.preview_parameters.opacity);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_PREVIEW_X:
|
|
|
|
case PROP_PREVIEW_X:
|
|
|
|
g_value_set_int (value, src->capture_config.preview_parameters.previewWindow.x);
|
|
|
|
g_value_set_int (value,
|
|
|
|
|
|
|
|
src->capture_config.preview_parameters.previewWindow.x);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_PREVIEW_Y:
|
|
|
|
case PROP_PREVIEW_Y:
|
|
|
|
g_value_set_int (value, src->capture_config.preview_parameters.previewWindow.y);
|
|
|
|
g_value_set_int (value,
|
|
|
|
|
|
|
|
src->capture_config.preview_parameters.previewWindow.y);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_PREVIEW_W:
|
|
|
|
case PROP_PREVIEW_W:
|
|
|
|
g_value_set_int (value, src->capture_config.preview_parameters.previewWindow.width);
|
|
|
|
g_value_set_int (value,
|
|
|
|
|
|
|
|
src->capture_config.preview_parameters.previewWindow.width);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_PREVIEW_H:
|
|
|
|
case PROP_PREVIEW_H:
|
|
|
|
g_value_set_int (value, src->capture_config.preview_parameters.previewWindow.height);
|
|
|
|
g_value_set_int (value,
|
|
|
|
|
|
|
|
src->capture_config.preview_parameters.previewWindow.height);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_SHARPNESS:
|
|
|
|
case PROP_SHARPNESS:
|
|
|
|
g_value_set_int (value, src->capture_config.camera_parameters.sharpness);
|
|
|
|
g_value_set_int (value, src->capture_config.camera_parameters.sharpness);
|
|
|
@ -1087,7 +1106,7 @@ gst_rpi_cam_src_get_property (GObject * object, guint prop_id,
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_VIDEO_STABILISATION:
|
|
|
|
case PROP_VIDEO_STABILISATION:
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
! !(src->capture_config.camera_parameters.videoStabilisation));
|
|
|
|
src->capture_config.camera_parameters.videoStabilisation != 0);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_EXPOSURE_COMPENSATION:
|
|
|
|
case PROP_EXPOSURE_COMPENSATION:
|
|
|
|
g_value_set_int (value,
|
|
|
|
g_value_set_int (value,
|
|
|
@ -1121,11 +1140,11 @@ gst_rpi_cam_src_get_property (GObject * object, guint prop_id,
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_HFLIP:
|
|
|
|
case PROP_HFLIP:
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
! !(src->capture_config.camera_parameters.hflip));
|
|
|
|
src->capture_config.camera_parameters.hflip != 0);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_VFLIP:
|
|
|
|
case PROP_VFLIP:
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
g_value_set_boolean (value,
|
|
|
|
! !(src->capture_config.camera_parameters.vflip));
|
|
|
|
src->capture_config.camera_parameters.vflip != 0);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_ROI_X:
|
|
|
|
case PROP_ROI_X:
|
|
|
|
g_value_set_float (value, src->capture_config.camera_parameters.roi.x);
|
|
|
|
g_value_set_float (value, src->capture_config.camera_parameters.roi.x);
|
|
|
@ -1164,13 +1183,16 @@ gst_rpi_cam_src_get_property (GObject * object, guint prop_id,
|
|
|
|
src->capture_config.camera_parameters.annotate_string);
|
|
|
|
src->capture_config.camera_parameters.annotate_string);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_ANNOTATION_TEXT_SIZE:
|
|
|
|
case PROP_ANNOTATION_TEXT_SIZE:
|
|
|
|
g_value_set_int (value, src->capture_config.camera_parameters.annotate_text_size);
|
|
|
|
g_value_set_int (value,
|
|
|
|
|
|
|
|
src->capture_config.camera_parameters.annotate_text_size);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_ANNOTATION_TEXT_COLOUR:
|
|
|
|
case PROP_ANNOTATION_TEXT_COLOUR:
|
|
|
|
g_value_set_int (value, src->capture_config.camera_parameters.annotate_text_colour);
|
|
|
|
g_value_set_int (value,
|
|
|
|
|
|
|
|
src->capture_config.camera_parameters.annotate_text_colour);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_ANNOTATION_TEXT_BG_COLOUR:
|
|
|
|
case PROP_ANNOTATION_TEXT_BG_COLOUR:
|
|
|
|
g_value_set_int (value, src->capture_config.camera_parameters.annotate_bg_colour);
|
|
|
|
g_value_set_int (value,
|
|
|
|
|
|
|
|
src->capture_config.camera_parameters.annotate_bg_colour);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case PROP_INTRA_REFRESH_TYPE:
|
|
|
|
case PROP_INTRA_REFRESH_TYPE:
|
|
|
|
g_value_set_enum (value, src->capture_config.intra_refresh_type);
|
|
|
|
g_value_set_enum (value, src->capture_config.intra_refresh_type);
|
|
|
@ -1286,13 +1308,12 @@ gst_rpi_cam_src_get_caps (GstBaseSrc * bsrc, GstCaps * filter)
|
|
|
|
GstStructure *s = gst_caps_get_structure (caps, i);
|
|
|
|
GstStructure *s = gst_caps_get_structure (caps, i);
|
|
|
|
if (gst_structure_has_name (s, "video/x-h264")) {
|
|
|
|
if (gst_structure_has_name (s, "video/x-h264")) {
|
|
|
|
gst_caps_set_simple (caps, "width", GST_TYPE_INT_RANGE, 1, 1920, "height",
|
|
|
|
gst_caps_set_simple (caps, "width", GST_TYPE_INT_RANGE, 1, 1920, "height",
|
|
|
|
GST_TYPE_INT_RANGE, 1, 1080, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1,
|
|
|
|
GST_TYPE_INT_RANGE, 1, 1080, "framerate", GST_TYPE_FRACTION_RANGE, 0,
|
|
|
|
RPICAMSRC_MAX_FPS, 1, NULL);
|
|
|
|
1, RPICAMSRC_MAX_FPS, 1, NULL);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
gst_caps_set_simple (caps, "width", GST_TYPE_INT_RANGE, 1, 3240, "height",
|
|
|
|
gst_caps_set_simple (caps, "width", GST_TYPE_INT_RANGE, 1, 3240, "height",
|
|
|
|
GST_TYPE_INT_RANGE, 1, 2464, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1,
|
|
|
|
GST_TYPE_INT_RANGE, 1, 2464, "framerate", GST_TYPE_FRACTION_RANGE, 0,
|
|
|
|
RPICAMSRC_MAX_FPS, 1, NULL);
|
|
|
|
1, RPICAMSRC_MAX_FPS, 1, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
done:
|
|
|
|
done:
|
|
|
@ -1320,7 +1341,8 @@ gst_rpi_cam_src_set_caps (GstBaseSrc * bsrc, GstCaps * caps)
|
|
|
|
if (g_str_equal (profile_str, "baseline"))
|
|
|
|
if (g_str_equal (profile_str, "baseline"))
|
|
|
|
src->capture_config.profile = MMAL_VIDEO_PROFILE_H264_BASELINE;
|
|
|
|
src->capture_config.profile = MMAL_VIDEO_PROFILE_H264_BASELINE;
|
|
|
|
else if (g_str_equal (profile_str, "constrained-baseline"))
|
|
|
|
else if (g_str_equal (profile_str, "constrained-baseline"))
|
|
|
|
src->capture_config.profile = MMAL_VIDEO_PROFILE_H264_CONSTRAINED_BASELINE;
|
|
|
|
src->capture_config.profile =
|
|
|
|
|
|
|
|
MMAL_VIDEO_PROFILE_H264_CONSTRAINED_BASELINE;
|
|
|
|
else if (g_str_equal (profile_str, "main"))
|
|
|
|
else if (g_str_equal (profile_str, "main"))
|
|
|
|
src->capture_config.profile = MMAL_VIDEO_PROFILE_H264_MAIN;
|
|
|
|
src->capture_config.profile = MMAL_VIDEO_PROFILE_H264_MAIN;
|
|
|
|
else if (g_str_equal (profile_str, "high"))
|
|
|
|
else if (g_str_equal (profile_str, "high"))
|
|
|
@ -1328,15 +1350,13 @@ gst_rpi_cam_src_set_caps (GstBaseSrc * bsrc, GstCaps * caps)
|
|
|
|
else
|
|
|
|
else
|
|
|
|
g_warning ("Unknown profile string in rpicamsrc caps: %s", profile_str);
|
|
|
|
g_warning ("Unknown profile string in rpicamsrc caps: %s", profile_str);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (gst_structure_has_name (structure, "image/jpeg")) {
|
|
|
|
else if (gst_structure_has_name (structure, "image/jpeg")) {
|
|
|
|
|
|
|
|
#ifdef USE_JPEG_CODEC
|
|
|
|
#ifdef USE_JPEG_CODEC
|
|
|
|
src->capture_config.encoding = MMAL_ENCODING_JPEG;
|
|
|
|
src->capture_config.encoding = MMAL_ENCODING_JPEG;
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
src->capture_config.encoding = MMAL_ENCODING_MJPEG;
|
|
|
|
src->capture_config.encoding = MMAL_ENCODING_MJPEG;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else {
|
|
|
|
|
|
|
|
/* Raw caps */
|
|
|
|
/* Raw caps */
|
|
|
|
switch (GST_VIDEO_INFO_FORMAT (&info)) {
|
|
|
|
switch (GST_VIDEO_INFO_FORMAT (&info)) {
|
|
|
|
case GST_VIDEO_FORMAT_I420:
|
|
|
|
case GST_VIDEO_FORMAT_I420:
|
|
|
@ -1408,7 +1428,8 @@ gst_rpi_cam_src_create (GstPushSrc * parent, GstBuffer ** buf)
|
|
|
|
|
|
|
|
|
|
|
|
if (!src->started) {
|
|
|
|
if (!src->started) {
|
|
|
|
g_mutex_lock (&src->config_lock);
|
|
|
|
g_mutex_lock (&src->config_lock);
|
|
|
|
raspi_capture_update_config (src->capture_state, &src->capture_config, FALSE);
|
|
|
|
raspi_capture_update_config (src->capture_state, &src->capture_config,
|
|
|
|
|
|
|
|
FALSE);
|
|
|
|
src->capture_config.change_flags = 0;
|
|
|
|
src->capture_config.change_flags = 0;
|
|
|
|
g_mutex_unlock (&src->config_lock);
|
|
|
|
g_mutex_unlock (&src->config_lock);
|
|
|
|
|
|
|
|
|
|
|
@ -1425,7 +1446,8 @@ gst_rpi_cam_src_create (GstPushSrc * parent, GstBuffer ** buf)
|
|
|
|
|
|
|
|
|
|
|
|
g_mutex_lock (&src->config_lock);
|
|
|
|
g_mutex_lock (&src->config_lock);
|
|
|
|
if (src->capture_config.change_flags) {
|
|
|
|
if (src->capture_config.change_flags) {
|
|
|
|
raspi_capture_update_config (src->capture_state, &src->capture_config, TRUE);
|
|
|
|
raspi_capture_update_config (src->capture_state, &src->capture_config,
|
|
|
|
|
|
|
|
TRUE);
|
|
|
|
src->capture_config.change_flags = 0;
|
|
|
|
src->capture_config.change_flags = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
g_mutex_unlock (&src->config_lock);
|
|
|
|
g_mutex_unlock (&src->config_lock);
|
|
|
|