diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2020-07-09 21:04:10 +0300 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2020-07-10 19:37:28 +0300 |
commit | b7c07b1a9502c603aa699b48765ca6ad7c272c34 (patch) | |
tree | 97c60d0ef4ad8541ff14a5bb545a3f5c2f45adae /sys | |
parent | b222ca1fc9a9b47195c7bce3057d0e7af56ae4f8 (diff) |
rpicamsrc: enable video orientation/direction unconditionally
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/667>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/rpicamsrc/gstrpicamsrc.c | 26 | ||||
-rw-r--r-- | sys/rpicamsrc/gstrpicamsrc.h | 6 |
2 files changed, 6 insertions, 26 deletions
diff --git a/sys/rpicamsrc/gstrpicamsrc.c b/sys/rpicamsrc/gstrpicamsrc.c index 71e257a36..7c20be244 100644 --- a/sys/rpicamsrc/gstrpicamsrc.c +++ b/sys/rpicamsrc/gstrpicamsrc.c @@ -135,9 +135,7 @@ enum PROP_ANNOTATION_TEXT_COLOUR, PROP_ANNOTATION_TEXT_BG_COLOUR, PROP_INTRA_REFRESH_TYPE, -#ifdef GST_RPI_CAM_SRC_ENABLE_VIDEO_DIRECTION PROP_VIDEO_DIRECTION, -#endif PROP_JPEG_QUALITY, PROP_USE_STC }; @@ -193,12 +191,6 @@ enum #define RAW_CAPS \ GST_VIDEO_CAPS_MAKE ("{ I420, RGB, BGR, RGBA }") /* FIXME: Map more raw formats */ -#ifdef GST_RPI_CAM_SRC_ENABLE_VIDEO_DIRECTION -#define gst_rpi_cam_src_reset_custom_orientation(src) { src->orientation = GST_VIDEO_ORIENTATION_CUSTOM; } -#else -#define gst_rpi_cam_src_reset_custom_orientation(src) { } -#endif - static GstStaticPadTemplate video_src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, @@ -212,9 +204,7 @@ static void gst_rpi_cam_src_colorbalance_init (GstColorBalanceInterface * iface); static void gst_rpi_cam_src_orientation_init (GstVideoOrientationInterface * iface); -#ifdef GST_RPI_CAM_SRC_ENABLE_VIDEO_DIRECTION static void gst_rpi_cam_src_direction_init (GstVideoDirectionInterface * iface); -#endif static void gst_rpi_cam_src_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); @@ -238,10 +228,8 @@ G_DEFINE_TYPE_WITH_CODE (GstRpiCamSrc, gst_rpi_cam_src, GST_TYPE_PUSH_SRC, G_IMPLEMENT_INTERFACE (GST_TYPE_COLOR_BALANCE, gst_rpi_cam_src_colorbalance_init); -#ifdef GST_RPI_CAM_SRC_ENABLE_VIDEO_DIRECTION G_IMPLEMENT_INTERFACE (GST_TYPE_VIDEO_DIRECTION, gst_rpi_cam_src_direction_init); -#endif G_IMPLEMENT_INTERFACE (GST_TYPE_VIDEO_ORIENTATION, gst_rpi_cam_src_orientation_init)); @@ -492,10 +480,8 @@ gst_rpi_cam_src_class_init (GstRpiCamSrcClass * klass) "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 g_object_class_override_property (gobject_class, PROP_VIDEO_DIRECTION, "video-direction"); -#endif g_object_class_install_property (gobject_class, PROP_USE_STC, g_param_spec_boolean ("use-stc", "Use System Time Clock", "Use the camera STC for timestamping buffers", TRUE, @@ -655,7 +641,12 @@ gst_rpi_cam_src_colorbalance_get_balance_type (GstColorBalance * balance) return GST_COLOR_BALANCE_HARDWARE; } -#ifdef GST_RPI_CAM_SRC_ENABLE_VIDEO_DIRECTION +static void +gst_rpi_cam_src_reset_custom_orientation (GstRpiCamSrc * src) +{ + src->orientation = GST_VIDEO_ORIENTATION_CUSTOM; +} + static void gst_rpi_cam_src_set_orientation (GstRpiCamSrc * src, GstVideoOrientationMethod orientation) @@ -727,7 +718,6 @@ gst_rpi_cam_src_direction_init (GstVideoDirectionInterface * iface) { /* We implement the video-direction property */ } -#endif static void gst_rpi_cam_src_colorbalance_init (GstColorBalanceInterface * iface) @@ -1023,11 +1013,9 @@ gst_rpi_cam_src_set_property (GObject * object, guint prop_id, src->capture_config.intra_refresh_type = g_value_get_enum (value); src->capture_config.change_flags |= PROP_CHANGE_ENCODING; break; -#ifdef GST_RPI_CAM_SRC_ENABLE_VIDEO_DIRECTION case PROP_VIDEO_DIRECTION: gst_rpi_cam_src_set_orientation (src, g_value_get_enum (value)); break; -#endif case PROP_USE_STC: src->capture_config.useSTC = g_value_get_boolean (value); break; @@ -1197,11 +1185,9 @@ gst_rpi_cam_src_get_property (GObject * object, guint prop_id, case PROP_INTRA_REFRESH_TYPE: g_value_set_enum (value, src->capture_config.intra_refresh_type); break; -#ifdef GST_RPI_CAM_SRC_ENABLE_VIDEO_DIRECTION case PROP_VIDEO_DIRECTION: g_value_set_enum (value, src->orientation); break; -#endif case PROP_USE_STC: g_value_set_boolean (value, src->capture_config.useSTC); break; diff --git a/sys/rpicamsrc/gstrpicamsrc.h b/sys/rpicamsrc/gstrpicamsrc.h index 68fdc1829..dea4cc44c 100644 --- a/sys/rpicamsrc/gstrpicamsrc.h +++ b/sys/rpicamsrc/gstrpicamsrc.h @@ -61,10 +61,6 @@ G_BEGIN_DECLS #define GST_IS_RPICAMSRC_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_RPICAMSRC)) -#if GST_CHECK_PLUGINS_BASE_VERSION(1, 9, 2) -#define GST_RPI_CAM_SRC_ENABLE_VIDEO_DIRECTION -#endif - typedef struct _GstRpiCamSrc GstRpiCamSrc; typedef struct _GstRpiCamSrcClass GstRpiCamSrcClass; @@ -83,9 +79,7 @@ struct _GstRpiCamSrc /* channels for interface */ GList *channels; -#ifdef GST_RPI_CAM_SRC_ENABLE_VIDEO_DIRECTION GstVideoOrientationMethod orientation; -#endif GstClockTime duration; }; |