iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->list_channels) {
+ if (iface->list_channels)
return iface->list_channels(control);
- }
return NULL;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->set_value) {
+ if (iface->set_value)
return iface->set_value(control, control_channel, value);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->get_value) {
+ if (iface->get_value)
return iface->get_value(control, control_channel, value);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->set_exposure) {
+ if (iface->set_exposure)
return iface->set_exposure(control, type, value1, value2);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->get_exposure) {
+ if (iface->get_exposure)
return iface->get_exposure(control, type, value1, value2);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->set_capture_mode) {
+ if (iface->set_capture_mode)
return iface->set_capture_mode(control, type, value);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->get_capture_mode) {
+ if (iface->get_capture_mode)
return iface->get_capture_mode(control, type, value);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->set_strobe) {
+ if (iface->set_strobe)
return iface->set_strobe(control, type, value);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->get_strobe) {
+ if (iface->get_strobe)
return iface->get_strobe(control, type, value);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->set_detect) {
+ if (iface->set_detect)
return iface->set_detect(control, type, value);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->get_detect) {
+ if (iface->get_detect)
return iface->get_detect(control, type, value);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->set_zoom) {
+ if (iface->set_zoom)
return iface->set_zoom(control, type, value);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->get_zoom) {
+ if (iface->get_zoom)
return iface->get_zoom(control, type, value);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->set_focus) {
+ if (iface->set_focus)
return iface->set_focus(control, mode, range);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->get_focus) {
+ if (iface->get_focus)
return iface->get_focus(control, mode, range);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->start_auto_focus) {
+ if (iface->start_auto_focus)
return iface->start_auto_focus(control);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->stop_auto_focus) {
+ if (iface->stop_auto_focus)
return iface->stop_auto_focus(control);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->set_focus_level) {
+ if (iface->set_focus_level)
return iface->set_focus_level(control, manual_level);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->get_focus_level) {
+ if (iface->get_focus_level)
return iface->get_focus_level(control, manual_level);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->set_auto_focus_area) {
+ if (iface->set_auto_focus_area)
return iface->set_auto_focus_area(control, rect);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->get_auto_focus_area) {
+ if (iface->get_auto_focus_area)
return iface->get_auto_focus_area(control, rect);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->set_wdr) {
+ if (iface->set_wdr)
return iface->set_wdr(control, value);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->get_wdr) {
+ if (iface->get_wdr)
return iface->get_wdr(control, value);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->set_ahs) {
+ if (iface->set_ahs)
return iface->set_ahs(control, value);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->get_ahs) {
+ if (iface->get_ahs)
return iface->get_ahs(control, value);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->set_part_color) {
+ if (iface->set_part_color)
return iface->set_part_color(control, type, value);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->get_part_color) {
+ if (iface->get_part_color)
return iface->get_part_color(control, type, value);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->get_exif_info) {
+ if (iface->get_exif_info)
return iface->get_exif_info(control, info);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->get_basic_dev_info) {
+ if (iface->get_basic_dev_info)
return iface->get_basic_dev_info(control, dev_id, info);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->get_misc_dev_info) {
- return iface->get_misc_dev_info( control, dev_id, info );
- }
+ if (iface->get_misc_dev_info)
+ return iface->get_misc_dev_info(control, dev_id, info);
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->get_extra_dev_info) {
+ if (iface->get_extra_dev_info)
return iface->get_extra_dev_info(control, dev_id, info);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->set_capture_command) {
+ if (iface->set_capture_command)
iface->set_capture_command(control, cmd);
- }
return;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->set_record_command) {
+ if (iface->set_record_command)
iface->set_record_command(control, cmd);
- }
return;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->start_face_zoom) {
+ if (iface->start_face_zoom)
return iface->start_face_zoom(control, x, y, zoom_level);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->stop_face_zoom) {
+ if (iface->stop_face_zoom)
return iface->stop_face_zoom(control);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->set_ae_lock) {
+ if (iface->set_ae_lock)
return iface->set_ae_lock(control, lock);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->get_ae_lock) {
+ if (iface->get_ae_lock)
return iface->get_ae_lock(control, lock);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->set_awb_lock) {
+ if (iface->set_awb_lock)
return iface->set_awb_lock(control, lock);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->get_awb_lock) {
+ if (iface->get_awb_lock)
return iface->get_awb_lock(control, lock);
- }
return FALSE;
}
iface = GST_CAMERA_CONTROL_GET_INTERFACE(control);
- if (iface->set_user_buffer_fd) {
+ if (iface->set_user_buffer_fd)
return iface->set_user_buffer_fd(control, fds, number);
- }
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_set_extra_preview_stream_format(GstCameraControl *control, int stream_id, GstCameraControlImageFormat img_fmt, int width, int height, int fps)
+{
+ 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_stream_format)
+ return iface->set_extra_preview_stream_format(control, stream_id, img_fmt, width, height, fps);
+
+ return FALSE;
+}
+
+gboolean gst_camera_control_get_extra_preview_stream_format(GstCameraControl *control, int stream_id, GstCameraControlImageFormat *img_fmt, int *width, int *height, int *fps)
+{
+ 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_stream_format)
+ return iface->get_extra_preview_stream_format(control, stream_id, img_fmt, width, height, fps);
return FALSE;
}
GST_CAMERA_CONTROL_RECORD_COMMAND_STOP
} GstCameraControlRecordCommand;
+typedef enum
+{
+ /* YUV */
+ GST_CAMERA_CONTROL_IMAGE_FORMAT_NV12,
+ GST_CAMERA_CONTROL_IMAGE_FORMAT_NV21,
+ GST_CAMERA_CONTROL_IMAGE_FORMAT_I420,
+ GST_CAMERA_CONTROL_IMAGE_FORMAT_YV12,
+ GST_CAMERA_CONTROL_IMAGE_FORMAT_YUYV,
+ GST_CAMERA_CONTROL_IMAGE_FORMAT_UYVY,
+
+ /* RGB */
+ GST_CAMERA_CONTROL_IMAGE_FORMAT_BGRA,
+ GST_CAMERA_CONTROL_IMAGE_FORMAT_ARGB,
+
+ /* ENCODED */
+ GST_CAMERA_CONTROL_IMAGE_FORMAT_JPEG,
+ GST_CAMERA_CONTROL_IMAGE_FORMAT_H264,
+ GST_CAMERA_CONTROL_IMAGE_FORMAT_MJPEG,
+ GST_CAMERA_CONTROL_IMAGE_FORMAT_VP8,
+ GST_CAMERA_CONTROL_IMAGE_FORMAT_VP9
+} GstCameraControlImageFormat;
+
+
/////////////////////////////////
// For Query functionalities //
// For Querying capabilities //
gboolean (*set_awb_lock) (GstCameraControl *control, gboolean lock);
gboolean (*get_awb_lock) (GstCameraControl *control, gboolean *lock);
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);
/* signals */
void (* value_changed) (GstCameraControl *control, GstCameraControlChannel *channel, gint value);
GST_VIDEO_API
gboolean gst_camera_control_set_user_buffer_fd (GstCameraControl *control, int *fds, int number);
+GST_VIDEO_API
+gboolean gst_camera_control_set_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_get_extra_preview_stream_format (GstCameraControl *control, int stream_id, GstCameraControlImageFormat *img_fmt, int *width, int *height, int *fps);
+
/* trigger signal */
GST_VIDEO_API
void gst_camera_control_value_changed (GstCameraControl *control, GstCameraControlChannel *control_channel, gint value);