From b0f1baa734d871e175827cb23300bd484190dd5c Mon Sep 17 00:00:00 2001 From: Jeongmo Yang Date: Wed, 1 Sep 2021 20:54:26 +0900 Subject: [PATCH] cameracontrol: Add new interface for extra preview bitrate [Version] 1.16.2-17 [Issue Type] New feature Change-Id: Iaace8d2d4814cb782809daf87905d4ec946664f8 Signed-off-by: Jeongmo Yang --- gst-libs/gst/video/cameracontrol.c | 28 ++++++++++++++++++++++++++++ gst-libs/gst/video/cameracontrol.h | 8 ++++++++ packaging/gst-plugins-base.spec | 2 +- 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/video/cameracontrol.c b/gst-libs/gst/video/cameracontrol.c index 7305922..2991b42 100644 --- a/gst-libs/gst/video/cameracontrol.c +++ b/gst-libs/gst/video/cameracontrol.c @@ -740,6 +740,34 @@ gboolean gst_camera_control_get_extra_preview_stream_format(GstCameraControl *co return FALSE; } +gboolean gst_camera_control_set_extra_preview_bitrate(GstCameraControl *control, int stream_id, int bitrate) +{ + GstCameraControlInterface *iface; + + g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE); + + iface = GST_CAMERA_CONTROL_GET_INTERFACE(control); + + if (iface->set_extra_preview_bitrate) + return iface->set_extra_preview_bitrate(control, stream_id, bitrate); + + return FALSE; +} + +gboolean gst_camera_control_get_extra_preview_bitrate(GstCameraControl *control, int stream_id, int *bitrate) +{ + GstCameraControlInterface *iface; + + g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE); + + iface = GST_CAMERA_CONTROL_GET_INTERFACE(control); + + if (iface->get_extra_preview_bitrate) + return iface->get_extra_preview_bitrate(control, stream_id, bitrate); + + return FALSE; +} + void gst_camera_control_value_changed(GstCameraControl *control, GstCameraControlChannel *control_channel, gint value) { g_signal_emit(G_OBJECT(control), gst_camera_control_signals[CONTROL_VALUE_CHANGED], 0, control_channel, value); diff --git a/gst-libs/gst/video/cameracontrol.h b/gst-libs/gst/video/cameracontrol.h index f900651..c9d364c 100644 --- a/gst-libs/gst/video/cameracontrol.h +++ b/gst-libs/gst/video/cameracontrol.h @@ -400,6 +400,8 @@ struct _GstCameraControlInterface { gboolean (*set_user_buffer_fd) (GstCameraControl *control, int *fds, int number); gboolean (*set_extra_preview_stream_format) (GstCameraControl *control, int stream_id, GstCameraControlImageFormat img_fmt, int width, int height, int fps); gboolean (*get_extra_preview_stream_format) (GstCameraControl *control, int stream_id, GstCameraControlImageFormat *img_fmt, int *width, int *height, int *fps); + gboolean (*set_extra_preview_bitrate) (GstCameraControl *control, int stream_id, int bitrate); + gboolean (*get_extra_preview_bitrate) (GstCameraControl *control, int stream_id, int *bitrate); /* signals */ void (* value_changed) (GstCameraControl *control, GstCameraControlChannel *channel, gint value); @@ -534,6 +536,12 @@ gboolean gst_camera_control_set_extra_preview_stream_format (GstCameraControl * GST_VIDEO_API gboolean gst_camera_control_get_extra_preview_stream_format (GstCameraControl *control, int stream_id, GstCameraControlImageFormat *img_fmt, int *width, int *height, int *fps); +GST_VIDEO_API +gboolean gst_camera_control_set_extra_preview_bitrate (GstCameraControl *control, int stream_id, int bitrate); + +GST_VIDEO_API +gboolean gst_camera_control_get_extra_preview_bitrate (GstCameraControl *control, int stream_id, int *bitrate); + /* trigger signal */ GST_VIDEO_API void gst_camera_control_value_changed (GstCameraControl *control, GstCameraControlChannel *control_channel, gint value); diff --git a/packaging/gst-plugins-base.spec b/packaging/gst-plugins-base.spec index 30d55e2..ef6a135 100644 --- a/packaging/gst-plugins-base.spec +++ b/packaging/gst-plugins-base.spec @@ -5,7 +5,7 @@ Name: gst-plugins-base Version: 1.16.2 -Release: 16 +Release: 17 License: LGPL-2.0+ Summary: GStreamer Streaming-Media Framework Plug-Ins Url: http://gstreamer.freedesktop.org/ -- 2.7.4