#define GST_CAT_DEFAULT gst_camerasrc_debug
-static gboolean
-gst_camerasrc_photo_parse_capture_caps (GstCameraSrc * camerasrc,
- GstCaps * op_mode_caps);
-static gboolean
-gst_camerasrc_photo_parse_preview_caps (GstCameraSrc * camerasrc,
- GstCaps * op_mode_caps);
-
-
/*
*
*/
GstPhotoCaps
-gst_camerasrc_photo_get_capabilities (GstCameraSrc * camerasrc)
+gst_camerasrc_photo_get_capabilities (GstCameraSrc *camerasrc)
{
GstCameraSrcClass *bclass;
bclass = GST_CAMERA_SRC_GET_CLASS (camerasrc);
*
*/
gboolean
-gst_camerasrc_photo_prepare_for_capture (GstCameraSrc * camerasrc,
- GstPhotoCapturePrepared func, GstCaps * desired_caps, gpointer user_data)
+gst_camerasrc_photo_prepare_for_capture (GstCameraSrc *camerasrc,
+ GstPhotoCapturePrepared func,
+ GstCaps *desired_caps,
+ gpointer user_data)
{
GstCameraSrcClass *bclass;
- gboolean use_vf_caps = TRUE;
bclass = GST_CAMERA_SRC_GET_CLASS (camerasrc);
camerasrc->prep_func = func;
camerasrc->prep_udata = user_data;
- if (!camerasrc->capture_resolution_set) {
- if (desired_caps) {
- GstStructure *cstr;
-
- GST_DEBUG_OBJECT (camerasrc, "parsing capture caps");
-
- cstr = gst_caps_get_structure (desired_caps, 0);
-
- /* FIXME: Don't require FPS in capture caps */
- if (gst_structure_get_int (cstr, "width",
- (gint *) & camerasrc->capture_w) &&
- gst_structure_get_int (cstr, "height",
- (gint *) & camerasrc->capture_h) &&
- gst_structure_get_fraction (cstr, "framerate",
- (gint *) & camerasrc->capture_fps_n,
- (gint *) & camerasrc->capture_fps_d)) {
- if (gst_structure_has_field (cstr, "format")) {
- gst_structure_get_fourcc (cstr, "format", &camerasrc->capture_fourcc);
- } else {
- /* If color format is not set, use the viewfinder format then */
- GST_DEBUG_OBJECT (camerasrc, "using viewfinder color format");
- camerasrc->capture_fourcc = camerasrc->current_fourcc;
- }
- use_vf_caps = FALSE;
- }
- }
-
- if (use_vf_caps) {
- GST_DEBUG_OBJECT (camerasrc, "given caps inadequate, using VF caps");
-
- camerasrc->capture_w = camerasrc->current_w;
- camerasrc->capture_h = camerasrc->current_h;
- camerasrc->capture_fps_n = camerasrc->fps_n;
- camerasrc->capture_fps_d = camerasrc->fps_d;
- camerasrc->capture_fourcc = camerasrc->current_fourcc;
- }
- }
-
GST_DEBUG_OBJECT (camerasrc, "starting preparations for capture (%dx%d @ %f)",
camerasrc->capture_w, camerasrc->capture_h,
(gfloat) camerasrc->capture_fps_n / camerasrc->capture_fps_d);
*
*/
void
-gst_camerasrc_photo_ready_for_capture (GstCameraSrc * camerasrc,
- GstCaps * newcaps)
+gst_camerasrc_photo_ready_for_capture (GstCameraSrc *camerasrc,
+ GstCaps *newcaps)
{
GST_DEBUG_OBJECT (camerasrc, "prepare for capture is complete");
*
*/
gboolean
-gst_camerasrc_photo_set_ev_compensation (GstCameraSrc * camerasrc,
- gfloat ev_comp)
+gst_camerasrc_photo_set_ev_compensation (GstCameraSrc *camerasrc,
+ gfloat ev_comp)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
+ /* FIXME: Remove this artificial limit, let subclass handle it */
if (ev_comp >= -2.5 && ev_comp <= 2.5) {
bclass = GST_CAMERA_SRC_GET_CLASS (camerasrc);
+ GST_OBJECT_LOCK (camerasrc);
camerasrc->photoconf.ev_compensation = ev_comp;
+ GST_OBJECT_UNLOCK (camerasrc);
if (bclass->is_active (camerasrc)) {
ret = bclass->write_settings (camerasrc, &camerasrc->photoconf, FALSE);
}
GST_DEBUG_OBJECT (camerasrc, "set EV: %.2f, ret = %d", ev_comp, ret);
} else {
- GST_DEBUG_OBJECT (camerasrc,
- "requested ev compensation value out of range");
+ GST_DEBUG_OBJECT (camerasrc, "requested ev compensation value out of range");
ret = FALSE;
}
return ret;
*
*/
gboolean
-gst_camerasrc_photo_get_ev_compensation (GstCameraSrc * camerasrc,
- gfloat * ev_comp)
+gst_camerasrc_photo_get_ev_compensation (GstCameraSrc *camerasrc,
+ gfloat *ev_comp)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
if (bclass->is_active (camerasrc)) {
ret = bclass->read_settings (camerasrc, &camerasrc->photoconf);
}
+
+ GST_OBJECT_LOCK (camerasrc);
*ev_comp = camerasrc->photoconf.ev_compensation;
+ GST_OBJECT_UNLOCK (camerasrc);
+
GST_DEBUG_OBJECT (camerasrc, "got ev compensation: %.2f, ret = %d",
- *ev_comp, ret);
+ *ev_comp, ret);
return ret;
}
*
*/
gboolean
-gst_camerasrc_photo_set_iso_speed (GstCameraSrc * camerasrc, guint iso_speed)
+gst_camerasrc_photo_set_iso_speed (GstCameraSrc *camerasrc,
+ guint iso_speed)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
bclass = GST_CAMERA_SRC_GET_CLASS (camerasrc);
+ GST_OBJECT_LOCK (camerasrc);
camerasrc->photoconf.iso_speed = iso_speed;
+ GST_OBJECT_UNLOCK (camerasrc);
if (bclass->is_active (camerasrc)) {
- return bclass->write_settings (camerasrc, &camerasrc->photoconf, FALSE);
+ ret = bclass->write_settings (camerasrc, &camerasrc->photoconf, FALSE);
}
GST_DEBUG_OBJECT (camerasrc, "set ISO: %d, ret = %d", iso_speed, ret);
*
*/
gboolean
-gst_camerasrc_photo_get_iso_speed (GstCameraSrc * camerasrc, guint * iso_speed)
+gst_camerasrc_photo_get_iso_speed (GstCameraSrc *camerasrc,
+ guint *iso_speed)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
if (bclass->is_active (camerasrc)) {
ret = bclass->read_settings (camerasrc, &camerasrc->photoconf);
}
+
+ GST_OBJECT_LOCK (camerasrc);
*iso_speed = camerasrc->photoconf.iso_speed;
+ GST_OBJECT_UNLOCK (camerasrc);
+
GST_DEBUG_OBJECT (camerasrc, "got iso speed: %d, ret = %d", *iso_speed, ret);
return ret;
*
*/
gboolean
-gst_camerasrc_photo_set_aperture (GstCameraSrc * camerasrc, guint aperture)
+gst_camerasrc_photo_set_aperture (GstCameraSrc *camerasrc,
+ guint aperture)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
bclass = GST_CAMERA_SRC_GET_CLASS (camerasrc);
+ GST_OBJECT_LOCK (camerasrc);
camerasrc->photoconf.aperture = aperture;
+ GST_OBJECT_UNLOCK (camerasrc);
if (bclass->is_active (camerasrc)) {
ret = bclass->write_settings (camerasrc, &camerasrc->photoconf, FALSE);
*
*/
gboolean
-gst_camerasrc_photo_get_aperture (GstCameraSrc * camerasrc, guint * aperture)
+gst_camerasrc_photo_get_aperture (GstCameraSrc *camerasrc,
+ guint *aperture)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
if (bclass->is_active (camerasrc)) {
ret = bclass->read_settings (camerasrc, &camerasrc->photoconf);
}
+
+ GST_OBJECT_LOCK (camerasrc);
*aperture = camerasrc->photoconf.aperture;
+ GST_OBJECT_UNLOCK (camerasrc);
+
GST_DEBUG_OBJECT (camerasrc, "got aperture: %d, ret = %d", *aperture, ret);
return ret;
*
*/
gboolean
-gst_camerasrc_photo_set_exposure (GstCameraSrc * camerasrc, guint32 exposure)
+gst_camerasrc_photo_set_exposure (GstCameraSrc *camerasrc,
+ guint32 exposure)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
bclass = GST_CAMERA_SRC_GET_CLASS (camerasrc);
+ GST_OBJECT_LOCK (camerasrc);
camerasrc->photoconf.exposure = exposure;
+ GST_OBJECT_UNLOCK (camerasrc);
if (bclass->is_active (camerasrc)) {
ret = bclass->write_settings (camerasrc, &camerasrc->photoconf, FALSE);
*
*/
gboolean
-gst_camerasrc_photo_get_exposure (GstCameraSrc * camerasrc, guint32 * exposure)
+gst_camerasrc_photo_get_exposure (GstCameraSrc *camerasrc,
+ guint32 *exposure)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
if (bclass->is_active (camerasrc)) {
ret = bclass->read_settings (camerasrc, &camerasrc->photoconf);
}
+
+ GST_OBJECT_LOCK (camerasrc);
*exposure = camerasrc->photoconf.exposure;
+ GST_OBJECT_UNLOCK (camerasrc);
+
GST_DEBUG_OBJECT (camerasrc, "got exposure: %d, ret = %d", *exposure, ret);
return ret;
*
*/
gboolean
-gst_camerasrc_photo_set_wb_mode (GstCameraSrc * camerasrc,
- GstWhiteBalanceMode mode)
+gst_camerasrc_photo_set_wb_mode (GstCameraSrc *camerasrc,
+ GstWhiteBalanceMode mode)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
bclass = GST_CAMERA_SRC_GET_CLASS (camerasrc);
+ GST_OBJECT_LOCK (camerasrc);
camerasrc->photoconf.wb_mode = mode;
+ GST_OBJECT_UNLOCK (camerasrc);
if (bclass->is_active (camerasrc)) {
ret = bclass->write_settings (camerasrc, &camerasrc->photoconf, FALSE);
*
*/
gboolean
-gst_camerasrc_photo_get_wb_mode (GstCameraSrc * camerasrc,
- GstWhiteBalanceMode * mode)
+gst_camerasrc_photo_get_wb_mode (GstCameraSrc *camerasrc,
+ GstWhiteBalanceMode *mode)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
if (bclass->is_active (camerasrc)) {
ret = bclass->read_settings (camerasrc, &camerasrc->photoconf);
}
+
+ GST_OBJECT_LOCK (camerasrc);
*mode = camerasrc->photoconf.wb_mode;
+ GST_OBJECT_UNLOCK (camerasrc);
+
GST_DEBUG_OBJECT (camerasrc, "got AWB mode:%d, ret = %d", *mode, ret);
return ret;
*
*/
gboolean
-gst_camerasrc_photo_set_tone_mode (GstCameraSrc * camerasrc,
- GstColourToneMode mode)
+gst_camerasrc_photo_set_tone_mode (GstCameraSrc *camerasrc,
+ GstColourToneMode mode)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
bclass = GST_CAMERA_SRC_GET_CLASS (camerasrc);
+ GST_OBJECT_LOCK (camerasrc);
camerasrc->photoconf.tone_mode = mode;
+ GST_OBJECT_UNLOCK (camerasrc);
if (bclass->is_active (camerasrc)) {
ret = bclass->write_settings (camerasrc, &camerasrc->photoconf, FALSE);
*
*/
gboolean
-gst_camerasrc_photo_get_tone_mode (GstCameraSrc * camerasrc,
- GstColourToneMode * mode)
+gst_camerasrc_photo_get_tone_mode (GstCameraSrc *camerasrc,
+ GstColourToneMode *mode)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
if (bclass->is_active (camerasrc)) {
ret = bclass->read_settings (camerasrc, &camerasrc->photoconf);
}
+
+ GST_OBJECT_LOCK (camerasrc);
*mode = camerasrc->photoconf.tone_mode;
+ GST_OBJECT_UNLOCK (camerasrc);
+
GST_DEBUG_OBJECT (camerasrc, "got tone mode: %d, ret = %d", *mode, ret);
return ret;
*
*/
gboolean
-gst_camerasrc_photo_set_scene_mode (GstCameraSrc * camerasrc, GstSceneMode mode)
+gst_camerasrc_photo_set_scene_mode (GstCameraSrc *camerasrc,
+ GstSceneMode mode)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
bclass = GST_CAMERA_SRC_GET_CLASS (camerasrc);
+ GST_OBJECT_LOCK (camerasrc);
camerasrc->photoconf.scene_mode = mode;
+ GST_OBJECT_UNLOCK (camerasrc);
if (bclass->is_active (camerasrc)) {
ret = bclass->write_settings (camerasrc, &camerasrc->photoconf, TRUE);
+
if (ret) {
/* Read the changed parameters to local settings cache */
bclass->read_settings (camerasrc, &camerasrc->photoconf);
*
*/
gboolean
-gst_camerasrc_photo_get_scene_mode (GstCameraSrc * camerasrc,
- GstSceneMode * mode)
+gst_camerasrc_photo_get_scene_mode (GstCameraSrc *camerasrc,
+ GstSceneMode *mode)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
if (bclass->is_active (camerasrc)) {
ret = bclass->read_settings (camerasrc, &camerasrc->photoconf);
}
+
+ GST_OBJECT_LOCK (camerasrc);
*mode = camerasrc->photoconf.scene_mode;
+ GST_OBJECT_UNLOCK (camerasrc);
+
GST_DEBUG_OBJECT (camerasrc, "got scene mode: %d, ret = %d", *mode, ret);
return ret;
*
*/
gboolean
-gst_camerasrc_photo_set_flash_mode (GstCameraSrc * camerasrc, GstFlashMode mode)
+gst_camerasrc_photo_set_flash_mode (GstCameraSrc *camerasrc,
+ GstFlashMode mode)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
bclass = GST_CAMERA_SRC_GET_CLASS (camerasrc);
+ GST_OBJECT_LOCK (camerasrc);
camerasrc->photoconf.flash_mode = mode;
+ GST_OBJECT_UNLOCK (camerasrc);
if (bclass->is_active (camerasrc)) {
ret = bclass->write_settings (camerasrc, &camerasrc->photoconf, FALSE);
*
*/
gboolean
-gst_camerasrc_photo_get_flash_mode (GstCameraSrc * camerasrc,
- GstFlashMode * mode)
+gst_camerasrc_photo_get_flash_mode (GstCameraSrc *camerasrc,
+ GstFlashMode *mode)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
if (bclass->is_active (camerasrc)) {
ret = bclass->read_settings (camerasrc, &camerasrc->photoconf);
}
+
+ GST_OBJECT_LOCK (camerasrc);
*mode = camerasrc->photoconf.flash_mode;
+ GST_OBJECT_UNLOCK (camerasrc);
+
GST_DEBUG_OBJECT (camerasrc, "got flash mode: %d, ret = %d", *mode, ret);
return ret;
*
*/
gboolean
-gst_camerasrc_photo_set_zoom (GstCameraSrc * camerasrc, gfloat zoom)
+gst_camerasrc_photo_set_zoom (GstCameraSrc *camerasrc, gfloat zoom)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
bclass = GST_CAMERA_SRC_GET_CLASS (camerasrc);
+ GST_OBJECT_LOCK (camerasrc);
camerasrc->photoconf.zoom = zoom;
+ GST_OBJECT_UNLOCK (camerasrc);
GST_DEBUG_OBJECT (camerasrc, "setting zoom to %f", camerasrc->photoconf.zoom);
if (bclass->set_zoom) {
ret = bclass->set_zoom (camerasrc, camerasrc->photoconf.zoom);
- } else {
+ }
+ else {
/* FIXME: Check if the zoom is within known limits */
}
GST_DEBUG_OBJECT (camerasrc, "setting zoom %s", ret ? "success" : "failed");
*
*/
gboolean
-gst_camerasrc_photo_get_zoom (GstCameraSrc * camerasrc, gfloat * zoom)
+gst_camerasrc_photo_get_zoom (GstCameraSrc *camerasrc, gfloat *zoom)
{
+ GST_OBJECT_LOCK (camerasrc);
*zoom = camerasrc->photoconf.zoom;
+ GST_OBJECT_UNLOCK (camerasrc);
GST_DEBUG_OBJECT (camerasrc, "current zoom = %f", *zoom);
return TRUE;
*
*/
gboolean
-gst_camerasrc_photo_set_flicker_mode (GstCameraSrc * camerasrc,
- GstFlickerReductionMode mode)
+gst_camerasrc_photo_set_flicker_mode (GstCameraSrc *camerasrc,
+ GstFlickerReductionMode mode)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
bclass = GST_CAMERA_SRC_GET_CLASS (camerasrc);
+ GST_OBJECT_LOCK (camerasrc);
camerasrc->photoconf.flicker_mode = mode;
+ GST_OBJECT_UNLOCK (camerasrc);
if (bclass->is_active (camerasrc)) {
ret = bclass->write_settings (camerasrc, &camerasrc->photoconf, FALSE);
*
*/
gboolean
-gst_camerasrc_photo_get_flicker_mode (GstCameraSrc * camerasrc,
- GstFlickerReductionMode * mode)
+gst_camerasrc_photo_get_flicker_mode (GstCameraSrc *camerasrc,
+ GstFlickerReductionMode *mode)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
if (bclass->is_active (camerasrc)) {
ret = bclass->read_settings (camerasrc, &camerasrc->photoconf);
}
+
+ GST_OBJECT_LOCK (camerasrc);
*mode = camerasrc->photoconf.flicker_mode;
+ GST_OBJECT_UNLOCK (camerasrc);
+
GST_DEBUG_OBJECT (camerasrc, "got flicker mode: %d, ret = %d", *mode, ret);
return ret;
*
*/
gboolean
-gst_camerasrc_photo_set_focus_mode (GstCameraSrc * camerasrc, GstFocusMode mode)
+gst_camerasrc_photo_set_focus_mode (GstCameraSrc *camerasrc,
+ GstFocusMode mode)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
bclass = GST_CAMERA_SRC_GET_CLASS (camerasrc);
+ GST_OBJECT_LOCK (camerasrc);
camerasrc->photoconf.focus_mode = mode;
+ GST_OBJECT_UNLOCK (camerasrc);
if (bclass->is_active (camerasrc)) {
ret = bclass->write_settings (camerasrc, &camerasrc->photoconf, FALSE);
*
*/
gboolean
-gst_camerasrc_photo_get_focus_mode (GstCameraSrc * camerasrc,
- GstFocusMode * mode)
+gst_camerasrc_photo_get_focus_mode (GstCameraSrc *camerasrc,
+ GstFocusMode *mode)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
if (bclass->is_active (camerasrc)) {
ret = bclass->read_settings (camerasrc, &camerasrc->photoconf);
}
+
+ GST_OBJECT_LOCK (camerasrc);
*mode = camerasrc->photoconf.focus_mode;
+ GST_OBJECT_UNLOCK (camerasrc);
+
GST_DEBUG_OBJECT (camerasrc, "got focus mode: %d, ret = %d", *mode, ret);
return ret;
*
*/
void
-gst_camerasrc_photo_set_autofocus (GstCameraSrc * camerasrc, gboolean on)
+gst_camerasrc_photo_set_autofocus (GstCameraSrc *camerasrc,
+ gboolean on)
{
GST_DEBUG_OBJECT (camerasrc, "setting autofocus %s", on ? "ON" : "OFF");
if (on) {
camerasrc->requested_af_mode = AF_ON_REQUESTED;
- } else {
+ }
+ else {
camerasrc->requested_af_mode = AF_OFF_REQUESTED;
}
*
*/
gboolean
-gst_camerasrc_photo_set_config (GstCameraSrc * camerasrc,
- GstPhotoSettings * config)
+gst_camerasrc_photo_set_config (GstCameraSrc *camerasrc,
+ GstPhotoSettings * config)
{
GstCameraSrcClass *bclass;
gboolean ret = TRUE;
GST_DEBUG_OBJECT (camerasrc, "set config, ret = %d", ret);
if (ret) {
+ GST_OBJECT_LOCK (camerasrc);
memcpy (&camerasrc->photoconf, config, sizeof (GstPhotoSettings));
+ GST_OBJECT_UNLOCK (camerasrc);
}
return ret;
*
*/
gboolean
-gst_camerasrc_photo_get_config (GstCameraSrc * camerasrc,
- GstPhotoSettings * config)
+gst_camerasrc_photo_get_config (GstCameraSrc *camerasrc,
+ GstPhotoSettings * config)
{
+ GST_OBJECT_LOCK (camerasrc);
memcpy (config, &camerasrc->photoconf, sizeof (GstPhotoSettings));
+ GST_OBJECT_UNLOCK (camerasrc);
GST_DEBUG_OBJECT (camerasrc, "got config");
return TRUE;
*
*/
gboolean
-gst_camerasrc_photo_set_format (GstCameraSrc * camerasrc,
- GstOperationMode op_mode, GstCaps * op_mode_caps)
+gst_camerasrc_photo_set_format (GstCameraSrc *camerasrc,
+ GstOperationMode op_mode,
+ GstCaps * op_mode_caps)
{
gboolean ret = TRUE;
}
+
/*
*
*/
gboolean
-gst_camerasrc_photo_get_property (GstCameraSrc * camerasrc,
- guint prop_id, GValue * value)
+gst_camerasrc_photo_get_property (GstCameraSrc *camerasrc,
+ guint prop_id, GValue * value)
{
GstCameraSrcClass *bclass;
gboolean ret = FALSE;
ret = TRUE;
break;
}
- case PROP_NOISE_REDUCTION:
- {
- GstPhotographyNoiseReduction noise_reduction;
- GST_DEBUG_OBJECT (camerasrc, "==== GETTING PROP_NOISE_REDUCTION ====");
- if (gst_camerasrc_photo_get_noise_reduction (camerasrc, &noise_reduction)) {
- g_value_set_flags (value, noise_reduction);
- }
- ret = TRUE;
- break;
- }
case PROP_IMAGE_CAPTURE_CAPS:
{
GstCaps *caps;
{
GST_DEBUG_OBJECT (camerasrc, "==== GETTING PROP_AUTOFOCUS ====");
g_mutex_lock (camerasrc->af_lock);
- if (camerasrc->photo_capture_phase == GST_CAMERA_AUTOFOCUS ||
- camerasrc->requested_af_mode == AF_ON_REQUESTED) {
+ if (camerasrc->photo_capture_phase == GST_CAMERA_AUTOFOCUS ||
+ camerasrc->requested_af_mode == AF_ON_REQUESTED)
+ {
g_value_set_boolean (value, TRUE);
} else {
g_value_set_boolean (value, FALSE);
ret = TRUE;
break;
}
+ case PROP_NOISE_REDUCTION:
+ {
+ GstPhotographyNoiseReduction noise_reduction;
+ GST_DEBUG_OBJECT (camerasrc, "==== GETTING PROP_NOISE_REDUCTION ====");
+ if (gst_camerasrc_photo_get_noise_reduction (camerasrc, &noise_reduction)) {
+ g_value_set_flags (value, noise_reduction);
+ }
+ ret = TRUE;
+ break;
+ }
default:
break;
}
*
*/
gboolean
-gst_camerasrc_photo_set_property (GstCameraSrc * camerasrc,
- guint prop_id, const GValue * value)
+gst_camerasrc_photo_set_property (GstCameraSrc *camerasrc,
+ guint prop_id, const GValue * value)
{
gboolean ret = FALSE;
break;
case PROP_EV_COMP:
GST_DEBUG_OBJECT (camerasrc, "==== SETTING PROP_EV_COMP ====");
- gst_camerasrc_photo_set_ev_compensation (camerasrc,
- g_value_get_float (value));
+ gst_camerasrc_photo_set_ev_compensation (camerasrc, g_value_get_float (value));
ret = TRUE;
break;
case PROP_ISO_SPEED:
/*** Internal API ***/
-static gboolean
+gboolean
gst_camerasrc_photo_parse_capture_caps (GstCameraSrc * camerasrc,
GstCaps * op_mode_caps)
{
}
-static gboolean
-gst_camerasrc_photo_parse_preview_caps (GstCameraSrc * camerasrc,
- GstCaps * op_mode_caps)
+gboolean
+gst_camerasrc_photo_parse_preview_caps (GstCameraSrc *camerasrc,
+ GstCaps *op_mode_caps)
{
GstCameraSrcClass *bclass;
gboolean ret = FALSE;
* In this case resolution 0x0 will be given to subclass */
GST_DEBUG_OBJECT (camerasrc, "NULL caps received for preview image");
ret = TRUE;
- } else {
+ }
+ else {
GstStructure *cstr;
GST_DEBUG_OBJECT (camerasrc, "parsing preview caps");
/* FIXME: Use VF format if fourcc is not given */
if (gst_structure_get_fourcc (cstr, "format", &fourcc) &&
- gst_structure_get_int (cstr, "width", &tmp_w) &&
- gst_structure_get_int (cstr, "height", &tmp_h)) {
+ gst_structure_get_int (cstr, "width", &tmp_w) &&
+ gst_structure_get_int (cstr, "height", &tmp_h))
+ {
#if 0
/* check if the requested fourcc format is supported */
- GstCaps *s_caps = NULL;
- GstCaps *r_caps = NULL;
+ GstCaps * s_caps = NULL;
+ GstCaps * r_caps = NULL;
/* get camsrc sourcepad caps, because the pad has
* caps-template including supported formats */
gst_caps_unref (r_caps);
#endif
ret = TRUE;
- } else {
+ }
+ else {
GST_DEBUG_OBJECT (camerasrc, "Unable to parse given caps");
ret = FALSE;
}
* currently configured to be in use. If so, no need to set it again.
*/
if (ret && (camerasrc->preview_w != tmp_w || camerasrc->preview_h != tmp_h ||
- camerasrc->preview_fourcc != fourcc)) {
+ camerasrc->preview_fourcc != fourcc))
+ {
GST_DEBUG_OBJECT (camerasrc,
- "set preview width: %d, height: %d, format: %"
- GST_FOURCC_FORMAT, tmp_w, tmp_h, GST_FOURCC_ARGS (fourcc));
+ "set preview width: %d, height: %d, format: %"
+ GST_FOURCC_FORMAT, tmp_w, tmp_h, GST_FOURCC_ARGS (fourcc));
ret = bclass->set_capture (camerasrc,
GST_PHOTOGRAPHY_OPERATION_MODE_PREVIEW, FALSE,
- &fourcc, (guint *) & tmp_w, (guint *) & tmp_h, NULL, NULL);
+ &fourcc, (guint *) &tmp_w, (guint *) &tmp_h, NULL, NULL);
if (fourcc == 0) {
- /* Special case: preview image creation is canceled (NULL caps) */
+ /* Special case: preview image creation is canceled (NULL caps)*/
camerasrc->preview_resolution_set = FALSE;
ret = TRUE;
- } else {
+ }
+ else {
if (ret && op_mode_caps && GST_CAPS_REFCOUNT_VALUE (op_mode_caps) == 1) {
/* Write the assigned values back to the caps structure */
gst_caps_set_simple (op_mode_caps,
"width", G_TYPE_INT, tmp_w,
"height", G_TYPE_INT, tmp_h,
- "format", GST_TYPE_FOURCC, fourcc, NULL);
+ "format", GST_TYPE_FOURCC, fourcc,
+ NULL);
}
GST_DEBUG_OBJECT (camerasrc,
return ret;
}
+
+
+
+
+