diff options
author | Thiago Santos <thiago.sousa.santos@collabora.com> | 2012-07-29 00:53:29 -0300 |
---|---|---|
committer | Thiago Santos <thiago.sousa.santos@collabora.com> | 2012-07-29 00:53:29 -0300 |
commit | 0a831613a8adb4cb2f3de32980913493dd5accc8 (patch) | |
tree | bb85b744f14d36f442eb6fc1ff46586cbbd7605f /gst-libs | |
parent | 8b36de8b413673c7c381e92ccdefc9f655475770 (diff) | |
download | gstreamer-plugins-bad-0a831613a8adb4cb2f3de32980913493dd5accc8.tar.gz |
camerabin: update preview buffer pushing
need to pass a GstSample to the utilitary preview buffer post functions
as a GstBuffer doesn't have caps anymore. The GstSample has the GstCaps
and it is used to inform the preview's pipeline about the format of the
input, before it gets converted to the user's requested output format.
Diffstat (limited to 'gst-libs')
4 files changed, 10 insertions, 9 deletions
diff --git a/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c b/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c index 199bf081d..8a584b55b 100644 --- a/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c +++ b/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.c @@ -556,10 +556,10 @@ gst_base_camera_src_init (GstBaseCameraSrc * self) } void -gst_base_camera_src_post_preview (GstBaseCameraSrc * self, GstBuffer * buf) +gst_base_camera_src_post_preview (GstBaseCameraSrc * self, GstSample * sample) { if (self->post_preview) { - gst_camerabin_preview_pipeline_post (self->preview_pipeline, buf); + gst_camerabin_preview_pipeline_post (self->preview_pipeline, sample); } else { GST_DEBUG_OBJECT (self, "Previews not enabled, not posting"); } diff --git a/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.h b/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.h index 31e077f98..d4979f56f 100644 --- a/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.h +++ b/gst-libs/gst/basecamerabinsrc/gstbasecamerasrc.h @@ -136,7 +136,7 @@ void gst_base_camera_src_setup_preview (GstBaseCameraSrc * self, GstCaps * previ void gst_base_camera_src_finish_capture (GstBaseCameraSrc *self); -void gst_base_camera_src_post_preview (GstBaseCameraSrc *self, GstBuffer * buf); +void gst_base_camera_src_post_preview (GstBaseCameraSrc *self, GstSample * sample); // XXX add methods to get/set img capture and vid capture caps.. #endif /* __GST_BASE_CAMERA_SRC_H__ */ diff --git a/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.c b/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.c index e4b95b897..d1c670bdd 100644 --- a/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.c +++ b/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.c @@ -249,20 +249,20 @@ gst_camerabin_destroy_preview_pipeline (GstCameraBinPreviewPipelineData * /** * gst_camerabin_preview_pipeline_post: * @preview: the #GstCameraBinPreviewPipelineData - * @buffer: the buffer to be posted as a preview + * @sample: the sample to be posted as a preview * - * Converts the @buffer to the desired format and posts the preview + * Converts the @sample to the desired format and posts the preview * message to the bus. * * Returns: %TRUE on success */ gboolean gst_camerabin_preview_pipeline_post (GstCameraBinPreviewPipelineData * preview, - GstBuffer * buffer) + GstSample * sample) { g_return_val_if_fail (preview != NULL, FALSE); g_return_val_if_fail (preview->pipeline != NULL, FALSE); - g_return_val_if_fail (buffer, FALSE); + g_return_val_if_fail (sample, FALSE); g_mutex_lock (&preview->processing_lock); g_return_val_if_fail (preview->pipeline != NULL, FALSE); @@ -277,8 +277,9 @@ gst_camerabin_preview_pipeline_post (GstCameraBinPreviewPipelineData * preview, preview->processing++; + g_object_set (preview->appsrc, "caps", gst_sample_get_caps (sample), NULL); gst_app_src_push_buffer ((GstAppSrc *) preview->appsrc, - gst_buffer_ref (buffer)); + gst_buffer_ref (gst_sample_get_buffer (sample))); g_mutex_unlock (&preview->processing_lock); diff --git a/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.h b/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.h index fba274cbc..6627cf66c 100644 --- a/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.h +++ b/gst-libs/gst/basecamerabinsrc/gstcamerabinpreview.h @@ -49,7 +49,7 @@ typedef struct GstCameraBinPreviewPipelineData *gst_camerabin_create_preview_pipeline (GstElement * element, GstElement * filter); void gst_camerabin_destroy_preview_pipeline (GstCameraBinPreviewPipelineData * preview); -gboolean gst_camerabin_preview_pipeline_post (GstCameraBinPreviewPipelineData * preview, GstBuffer * buffer); +gboolean gst_camerabin_preview_pipeline_post (GstCameraBinPreviewPipelineData * preview, GstSample * sample); void gst_camerabin_preview_set_caps (GstCameraBinPreviewPipelineData * preview, GstCaps * caps); gboolean gst_camerabin_preview_set_filter (GstCameraBinPreviewPipelineData * preview, GstElement * filter); |