From: Jeongmo Yang Date: Fri, 10 Jan 2025 07:15:03 +0000 (+0900) Subject: base:cameracontrol: Add new interface for switching device X-Git-Tag: accepted/tizen/unified/20250530.090449~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bbd44081c365b937fbfb84c421c14ff77861af30;p=platform%2Fupstream%2Fgstreamer.git base:cameracontrol: Add new interface for switching device [Version] 1.24.11-11 [Issue Type] New feature Change-Id: I5bfc58601f9938421850e022959482473dd439e9 Signed-off-by: Jeongmo Yang --- diff --git a/packaging/gstreamer.spec b/packaging/gstreamer.spec index a9d3915337..2e757fe234 100644 --- a/packaging/gstreamer.spec +++ b/packaging/gstreamer.spec @@ -61,7 +61,7 @@ Name: %{_name} Version: 1.24.11 -Release: 10 +Release: 11 Summary: Streaming-Media Framework Runtime License: LGPL-2.0+ Group: Multimedia/Framework diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/cameracontrol.c b/subprojects/gst-plugins-base/gst-libs/gst/video/cameracontrol.c index 62c41db594..12ec5a341e 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/cameracontrol.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/cameracontrol.c @@ -796,6 +796,20 @@ gboolean gst_camera_control_get_extra_preview_gop_interval(GstCameraControl *con return FALSE; } +gboolean gst_camera_control_switch_device(GstCameraControl *control, int device) +{ + GstCameraControlInterface *iface; + + g_return_val_if_fail(GST_IS_CAMERA_CONTROL(control), FALSE); + + iface = GST_CAMERA_CONTROL_GET_INTERFACE(control); + + if (iface->switch_device) + return iface->switch_device(control, device); + + 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/subprojects/gst-plugins-base/gst-libs/gst/video/cameracontrol.h b/subprojects/gst-plugins-base/gst-libs/gst/video/cameracontrol.h index b87170f97f..85e7c98717 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/cameracontrol.h +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/cameracontrol.h @@ -405,6 +405,7 @@ struct _GstCameraControlInterface { gboolean (*get_extra_preview_bitrate) (GstCameraControl *control, int stream_id, int *bitrate); gboolean (*set_extra_preview_gop_interval) (GstCameraControl *control, int stream_id, int interval); gboolean (*get_extra_preview_gop_interval) (GstCameraControl *control, int stream_id, int *interval); + gboolean (*switch_device) (GstCameraControl *control, gint device); /* signals */ void (* value_changed) (GstCameraControl *control, GstCameraControlChannel *channel, gint value); @@ -551,6 +552,9 @@ gboolean gst_camera_control_set_extra_preview_gop_interval (GstCameraControl * GST_VIDEO_API gboolean gst_camera_control_get_extra_preview_gop_interval (GstCameraControl *control, int stream_id, int *interval); +GST_VIDEO_API +gboolean gst_camera_control_switch_device (GstCameraControl *control, int device); + /* trigger signal */ GST_VIDEO_API void gst_camera_control_value_changed (GstCameraControl *control, GstCameraControlChannel *control_channel, gint value);