summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>2011-02-01 11:19:53 -0300
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>2011-02-03 19:09:20 -0300
commit48b05a3002f48faffdaabfbf3997b2bdda273aaf (patch)
tree6850855cbadfb42dfd2838833b1329bf2435c1e0
parent1a62d9374b228dc5bd3fb8c7da2212ceb5506430 (diff)
wrappercamerabinsrc: Fix preview messages
Image previews where being posted in sync with the buffers timestamps, this makes no sense as previews should be posted ASAP. Also adds some debugging messages.
-rw-r--r--gst/camerabin2/camerabingeneral.c2
-rw-r--r--gst/camerabin2/gstwrappercamerabinsrc.c19
2 files changed, 17 insertions, 4 deletions
diff --git a/gst/camerabin2/camerabingeneral.c b/gst/camerabin2/camerabingeneral.c
index 26edc12d0..2f5bd05b1 100644
--- a/gst/camerabin2/camerabingeneral.c
+++ b/gst/camerabin2/camerabingeneral.c
@@ -375,6 +375,8 @@ gst_camerabin_create_preview_pipeline (GstElement * element,
gst_app_sink_set_callbacks ((GstAppSink *) data->appsink, &callbacks, data,
NULL);
+ g_object_set (data->appsink, "sync", FALSE, NULL);
+
data->element = element;
data->filter = filter;
diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c
index 0f2e6090a..bfe8c47da 100644
--- a/gst/camerabin2/gstwrappercamerabinsrc.c
+++ b/gst/camerabin2/gstwrappercamerabinsrc.c
@@ -115,9 +115,13 @@ gst_wrapper_camera_bin_src_set_property (GObject * object,
case PROP_PREVIEW_CAPS:
gst_caps_replace (&self->preview_caps,
(GstCaps *) gst_value_get_caps (value));
- if (self->preview_pipeline)
+ if (self->preview_pipeline) {
+ GST_DEBUG_OBJECT (self,
+ "Setting preview pipeline caps %" GST_PTR_FORMAT,
+ self->preview_caps);
gst_camerabin_preview_set_caps (self->preview_pipeline,
(GstCaps *) gst_value_get_caps (value));
+ }
break;
case PROP_PREVIEW_FILTER:
if (self->preview_filter)
@@ -236,8 +240,10 @@ gst_wrapper_camera_bin_src_imgsrc_probe (GstPad * pad, GstBuffer * buffer,
/* post preview */
/* TODO This can likely be optimized if the viewfinder caps is the same as
* the preview caps, avoiding another scaling of the same buffer. */
- if (self->post_previews)
+ if (self->post_previews) {
+ GST_DEBUG_OBJECT (self, "Posting preview for image");
gst_camerabin_preview_pipeline_post (self->preview_pipeline, buffer);
+ }
if (self->image_capture_count == 0) {
gst_base_camera_src_finish_capture (camerasrc);
@@ -285,8 +291,10 @@ gst_wrapper_camera_bin_src_vidsrc_probe (GstPad * pad, GstBuffer * buffer,
self->video_rec_status = GST_VIDEO_RECORDING_STATUS_RUNNING;
/* post preview */
- if (self->post_previews)
+ if (self->post_previews) {
+ GST_DEBUG_OBJECT (self, "Posting preview for video");
gst_camerabin_preview_pipeline_post (self->preview_pipeline, buffer);
+ }
ret = TRUE;
} else if (self->video_rec_status == GST_VIDEO_RECORDING_STATUS_FINISHING) {
@@ -504,8 +512,11 @@ gst_wrapper_camera_bin_src_construct_pipeline (GstBaseCameraSrc * bcamsrc)
g_assert (self->preview_pipeline != NULL);
self->preview_filter_changed = FALSE;
- if (self->preview_caps)
+ if (self->preview_caps) {
+ GST_DEBUG_OBJECT (self, "Setting preview pipeline caps %" GST_PTR_FORMAT,
+ self->preview_caps);
gst_camerabin_preview_set_caps (self->preview_pipeline, self->preview_caps);
+ }
ret = TRUE;
self->elements_created = TRUE;