mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 10:25:33 +00:00
camerabin: use GstSample for the preview
This commit is contained in:
parent
759d62bafe
commit
cacdd29b5c
1 changed files with 6 additions and 6 deletions
|
@ -79,20 +79,20 @@ bus_callback (GstBus * bus, GstMessage * message, gpointer user_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_camerabin_preview_pipeline_new_buffer (GstAppSink * appsink,
|
gst_camerabin_preview_pipeline_new_sample (GstAppSink * appsink,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GstBuffer *buffer;
|
GstSample *sample;
|
||||||
GstStructure *s;
|
GstStructure *s;
|
||||||
GstMessage *msg;
|
GstMessage *msg;
|
||||||
GstCameraBinPreviewPipelineData *data;
|
GstCameraBinPreviewPipelineData *data;
|
||||||
|
|
||||||
data = user_data;
|
data = user_data;
|
||||||
|
|
||||||
buffer = gst_app_sink_pull_buffer (appsink);
|
sample = gst_app_sink_pull_sample (appsink);
|
||||||
s = gst_structure_new (GST_BASE_CAMERA_SRC_PREVIEW_MESSAGE_NAME,
|
s = gst_structure_new (GST_BASE_CAMERA_SRC_PREVIEW_MESSAGE_NAME,
|
||||||
"buffer", GST_TYPE_BUFFER, buffer, NULL);
|
"sample", GST_TYPE_SAMPLE, sample, NULL);
|
||||||
gst_buffer_unref (buffer);
|
gst_sample_unref (sample);
|
||||||
msg = gst_message_new_element (GST_OBJECT (data->element), s);
|
msg = gst_message_new_element (GST_OBJECT (data->element), s);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (data->element, "sending message with preview image");
|
GST_DEBUG_OBJECT (data->element, "sending message with preview image");
|
||||||
|
@ -181,7 +181,7 @@ gst_camerabin_create_preview_pipeline (GstElement * element,
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
callbacks.new_buffer = gst_camerabin_preview_pipeline_new_buffer;
|
callbacks.new_sample = gst_camerabin_preview_pipeline_new_sample;
|
||||||
gst_app_sink_set_callbacks ((GstAppSink *) data->appsink, &callbacks, data,
|
gst_app_sink_set_callbacks ((GstAppSink *) data->appsink, &callbacks, data,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue