iface->set_autofocus = NULL;
iface->set_config = NULL;
iface->get_config = NULL;
+ iface->set_format = NULL;
+ iface->get_format = NULL;
}
#define GST_PHOTOGRAPHY_FUNC_TEMPLATE(function_name, param_type) \
return ret;
}
+/**
+ * gst_photography_set_format:
+ * @photo: #GstPhotography interface of a #GstElement
+ * @op_mode: #GstOperationMode operation mode to set
+ * @op_mode_caps: #GstCaps containing the op_mode caps
+ *
+ * Set caps for given operation mode
+ *
+ * Returns: TRUE if operation mode was set successfully, otherwise FALSE.
+ */
+gboolean
+gst_photography_set_format (GstPhotography * photo,
+ GstOperationMode op_mode, GstCaps * op_mode_caps)
+{
+ GstPhotographyInterface *iface;
+ gboolean ret = FALSE;
+
+ g_return_val_if_fail (photo != NULL, FALSE);
+
+ iface = GST_PHOTOGRAPHY_GET_IFACE (photo);
+ if (iface->set_format) {
+ ret = iface->set_format (photo, op_mode, op_mode_caps);
+ }
+
+ return ret;
+}
+
+/**
+ * gst_photography_get_format:
+ * @photo: #GstPhotography interface of a #GstElement
+ * @op_mode: #GstOperationMode operation mode of which caps to get
+ *
+ * Get given operation mode mode caps
+ *
+ * Returns: A pointer to #GstCaps
+ */
+GstCaps *
+gst_photography_get_format (GstPhotography * photo, GstOperationMode op_mode)
+{
+ GstPhotographyInterface *iface;
+ GstCaps *ret;
+
+ g_return_val_if_fail (photo != NULL, NULL);
+
+ iface = GST_PHOTOGRAPHY_GET_IFACE (photo);
+ if (iface->get_format) {
+ ret = iface->get_format (photo, op_mode);
+ } else {
+ ret = NULL;
+ }
+ return ret;
+}
+
+
/* Photography class initialization stuff */
static void
gst_photography_iface_class_init (gpointer g_class)
GST_PHOTOGRAPHY_FOCUS_MODE_CONTINUOUS_EXTENDED,
} GstFocusMode;
+typedef enum {
+ GST_PHOTOGRAPHY_OPERATION_MODE_VIEWFINDER = 0,
+ GST_PHOTOGRAPHY_OPERATION_MODE_IMAGE_CAPTURE,
+ GST_PHOTOGRAPHY_OPERATION_MODE_PREVIEW,
+} GstOperationMode;
+
typedef struct
{
GstWhiteBalanceMode wb_mode;
* @set_config: vmethod to set all configuration parameters at once
* @get_config: vmethod to get all configuration parameters at once
* @get_image_capture_supported_caps: vmethod to get caps describing supported image capture formats
+ * @set_format: vmethod to set caps for given operation mode
+ * @get_format: vmethod to get current caps for given operation mode
*
* #GstPhotographyInterface interface.
*/
void (*set_autofocus) (GstPhotography * photo, gboolean on);
gboolean (*set_config) (GstPhotography * photo, GstPhotoSettings * config);
gboolean (*get_config) (GstPhotography * photo, GstPhotoSettings * config);
-
gboolean (*get_noise_reduction) (GstPhotography * photo,
GstPhotographyNoiseReduction * noise_reduction);
gboolean (*set_noise_reduction) (GstPhotography * photo,
GstPhotographyNoiseReduction noise_reduction);
+ gboolean (*set_format) (GstPhotography * photo,
+ GstOperationMode op_mode, GstCaps * op_mode_caps);
+ GstCaps * (*get_format) (GstPhotography * photo, GstOperationMode op_mode);
/*< private > */
gpointer _gst_reserved[GST_PADDING];
gboolean gst_photography_get_config (GstPhotography * photo,
GstPhotoSettings * config);
+gboolean gst_photography_set_format (GstPhotography * photo,
+ GstOperationMode op_mode, GstCaps * op_mode_caps);
+GstCaps * gst_photography_get_format (GstPhotography * photo,
+ GstOperationMode op_mode);
+
G_END_DECLS
#endif /* __GST_PHOTOGRAPHY_H__ */