mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
photo iface: Add caps object to preparation API for requested and actual capture format
Allow requesting of certain format with prepare_for_capture() and return the actual format in GstPhotoCapturePrepared callback.
This commit is contained in:
parent
0456f92b77
commit
617f34895c
2 changed files with 19 additions and 9 deletions
|
@ -325,22 +325,29 @@ gst_photography_get_capabilities (GstPhotography * photo)
|
||||||
* gst_photography_prepare_for_capture:
|
* gst_photography_prepare_for_capture:
|
||||||
* @photo: #GstPhotography interface of a #GstElement
|
* @photo: #GstPhotography interface of a #GstElement
|
||||||
* @func: callback that is called after capturing has been prepared
|
* @func: callback that is called after capturing has been prepared
|
||||||
|
* @caps: #GstCaps defining the desired format of the captured image
|
||||||
* @user_data: user data that will be passed to the callback @func
|
* @user_data: user data that will be passed to the callback @func
|
||||||
*
|
*
|
||||||
* Start preparations for capture. @func callback is called after
|
* Start preparations for capture. @func callback is called after
|
||||||
* preparations are done.
|
* preparations are done.
|
||||||
|
*
|
||||||
|
* Returns: TRUE if preparations were started (caps were OK), otherwise FALSE.
|
||||||
*/
|
*/
|
||||||
void
|
gboolean
|
||||||
gst_photography_prepare_for_capture (GstPhotography * photo,
|
gst_photography_prepare_for_capture (GstPhotography * photo,
|
||||||
GstPhotoCapturePrepared func, gpointer user_data)
|
GstPhotoCapturePrepared func, GstCaps * capture_caps, gpointer user_data)
|
||||||
{
|
{
|
||||||
GstPhotographyInterface *iface;
|
GstPhotographyInterface *iface;
|
||||||
g_return_if_fail (photo != NULL);
|
gboolean ret = TRUE;
|
||||||
|
|
||||||
|
g_return_val_if_fail (photo != NULL, FALSE);
|
||||||
|
|
||||||
iface = GST_PHOTOGRAPHY_GET_IFACE (photo);
|
iface = GST_PHOTOGRAPHY_GET_IFACE (photo);
|
||||||
if (iface->prepare_for_capture) {
|
if (iface->prepare_for_capture) {
|
||||||
iface->prepare_for_capture (photo, func, user_data);
|
ret = iface->prepare_for_capture (photo, func, capture_caps, user_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -143,11 +143,14 @@ typedef struct
|
||||||
/**
|
/**
|
||||||
* GstPhotoCapturePrepared:
|
* GstPhotoCapturePrepared:
|
||||||
* @data: user data that has been given, when registering the callback
|
* @data: user data that has been given, when registering the callback
|
||||||
|
* @configured_caps: #GstCaps defining the configured capture format.
|
||||||
|
* Ownership of these caps stays in the element.
|
||||||
*
|
*
|
||||||
* This callback will be called when the element has finished preparations
|
* This callback will be called when the element has finished preparations
|
||||||
* for photo capture.
|
* for photo capture.
|
||||||
*/
|
*/
|
||||||
typedef void (*GstPhotoCapturePrepared) (gpointer data);
|
typedef void (*GstPhotoCapturePrepared) (gpointer data,
|
||||||
|
const GstCaps *configured_caps);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstPhotographyInterface:
|
* GstPhotographyInterface:
|
||||||
|
@ -210,8 +213,8 @@ typedef struct _GstPhotographyInterface
|
||||||
gboolean (*set_zoom) (GstPhotography * photo, gfloat zoom);
|
gboolean (*set_zoom) (GstPhotography * photo, gfloat zoom);
|
||||||
|
|
||||||
GstPhotoCaps (*get_capabilities) (GstPhotography * photo);
|
GstPhotoCaps (*get_capabilities) (GstPhotography * photo);
|
||||||
void (*prepare_for_capture) (GstPhotography * photo,
|
gboolean (*prepare_for_capture) (GstPhotography * photo,
|
||||||
GstPhotoCapturePrepared func, gpointer user_data);
|
GstPhotoCapturePrepared func, GstCaps *capture_caps, gpointer user_data);
|
||||||
void (*set_autofocus) (GstPhotography * photo, gboolean on);
|
void (*set_autofocus) (GstPhotography * photo, gboolean on);
|
||||||
|
|
||||||
/*< private > */
|
/*< private > */
|
||||||
|
@ -257,8 +260,8 @@ gboolean gst_photography_set_zoom (GstPhotography * photo, gfloat zoom);
|
||||||
|
|
||||||
GstPhotoCaps gst_photography_get_capabilities (GstPhotography * photo);
|
GstPhotoCaps gst_photography_get_capabilities (GstPhotography * photo);
|
||||||
|
|
||||||
void gst_photography_prepare_for_capture (GstPhotography * photo,
|
gboolean gst_photography_prepare_for_capture (GstPhotography * photo,
|
||||||
GstPhotoCapturePrepared func, gpointer user_data);
|
GstPhotoCapturePrepared func, GstCaps *capture_caps, gpointer user_data);
|
||||||
|
|
||||||
void gst_photography_set_autofocus (GstPhotography * photo, gboolean on);
|
void gst_photography_set_autofocus (GstPhotography * photo, gboolean on);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue