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/camerabin2 | |
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/camerabin2')
-rw-r--r-- | gst/camerabin2/gstwrappercamerabinsrc.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c index 1e3d3989a..06d60b589 100644 --- a/gst/camerabin2/gstwrappercamerabinsrc.c +++ b/gst/camerabin2/gstwrappercamerabinsrc.c @@ -205,6 +205,8 @@ gst_wrapper_camera_bin_src_imgsrc_probe (GstPad * pad, GstPadProbeInfo * info, g_mutex_lock (&camerasrc->capturing_mutex); if (self->image_capture_count > 0) { + GstSample *sample; + GstCaps *caps; ret = GST_PAD_PROBE_OK; self->image_capture_count--; @@ -212,7 +214,11 @@ gst_wrapper_camera_bin_src_imgsrc_probe (GstPad * pad, GstPadProbeInfo * info, /* TODO This can likely be optimized if the viewfinder caps is the same as * the preview caps, avoiding another scaling of the same buffer. */ GST_DEBUG_OBJECT (self, "Posting preview for image"); - gst_base_camera_src_post_preview (camerasrc, buffer); + caps = gst_pad_get_current_caps (pad); + sample = gst_sample_new (buffer, caps, NULL, NULL); + gst_base_camera_src_post_preview (camerasrc, sample); + gst_caps_unref (caps); + gst_sample_unref (sample); if (self->image_capture_count == 0) { gst_base_camera_src_finish_capture (camerasrc); @@ -251,6 +257,8 @@ gst_wrapper_camera_bin_src_vidsrc_probe (GstPad * pad, GstPadProbeInfo * info, } else if (self->video_rec_status == GST_VIDEO_RECORDING_STATUS_STARTING) { GstClockTime ts; GstSegment segment; + GstCaps *caps; + GstSample *sample; GST_DEBUG_OBJECT (self, "Starting video recording"); self->video_rec_status = GST_VIDEO_RECORDING_STATUS_RUNNING; @@ -264,7 +272,11 @@ gst_wrapper_camera_bin_src_vidsrc_probe (GstPad * pad, GstPadProbeInfo * info, /* post preview */ GST_DEBUG_OBJECT (self, "Posting preview for video"); - gst_base_camera_src_post_preview (camerasrc, buffer); + caps = gst_pad_get_current_caps (pad); + sample = gst_sample_new (buffer, caps, NULL, NULL); + gst_base_camera_src_post_preview (camerasrc, sample); + gst_caps_unref (caps); + gst_sample_unref (sample); ret = GST_PAD_PROBE_OK; } else if (self->video_rec_status == GST_VIDEO_RECORDING_STATUS_FINISHING) { |