static gchar *image_filename;
static gchar *video_filename;
-static GstBuffer *preview_buffer;
+static GstSample *preview_sample;
static gchar *preview_filename;
static GstCaps *preview_caps;
static GstTagList *tags_found;
GST_INFO ("image captured");
} else if (st && gst_structure_has_name (st,
GST_BASE_CAMERA_SRC_PREVIEW_MESSAGE_NAME)) {
- GstBuffer *buf;
+ GstSample *sample;
const GValue *value;
- value = gst_structure_get_value (st, "buffer");
+ value = gst_structure_get_value (st, "sample");
fail_unless (value != NULL);
- buf = gst_value_get_buffer (value);
+ sample = gst_value_get_sample (value);
- if (preview_buffer)
- gst_buffer_unref (preview_buffer);
- preview_buffer = gst_buffer_ref (buf);
+ if (preview_sample)
+ gst_sample_unref (preview_sample);
+ preview_sample = gst_sample_ref (sample);
g_free (preview_filename);
preview_filename = g_strdup (gst_structure_get_string (st, "location"));
}
{
gchar *prev_filename = NULL;
- if (!preview_buffer && camera) {
+ if (!preview_sample && camera) {
GstMessage *msg = wait_for_element_message (camera,
GST_BASE_CAMERA_SRC_PREVIEW_MESSAGE_NAME, GST_CLOCK_TIME_NONE);
fail_unless (msg != NULL);
gst_message_unref (msg);
}
- fail_unless (preview_buffer != NULL);
+ fail_unless (preview_sample != NULL);
if (filename) {
if (index >= 0) {
prev_filename = g_strdup_printf (filename, index);
fail_unless (strcmp (preview_filename, prev_filename) == 0);
}
if (preview_caps) {
- /* TODO porting
- fail_unless (GST_BUFFER_CAPS (preview_buffer) != NULL);
- fail_unless (gst_caps_can_intersect (GST_BUFFER_CAPS (preview_buffer),
- preview_caps));
- */
+ fail_unless (gst_sample_get_caps (preview_sample) != NULL);
+ fail_unless (gst_caps_can_intersect (gst_sample_get_caps (preview_sample),
+ preview_caps));
}
g_free (prev_filename);
}
gst_caps_unref (preview_caps);
preview_caps = NULL;
- if (preview_buffer)
- gst_buffer_unref (preview_buffer);
- preview_buffer = NULL;
+ if (preview_sample)
+ gst_sample_unref (preview_sample);
+ preview_sample = NULL;
g_free (preview_filename);
preview_filename = NULL;
const GstStructure *st = gst_message_get_structure (msg);
if (gst_structure_has_name (st,
GST_BASE_CAMERA_SRC_PREVIEW_MESSAGE_NAME)) {
- GstBuffer *buf;
+ GstSample *sample;
const GValue *value;
- value = gst_structure_get_value (st, "buffer");
+ value = gst_structure_get_value (st, "sample");
fail_unless (value != NULL);
- buf = gst_value_get_buffer (value);
+ sample = gst_value_get_sample (value);
- if (preview_buffer)
- gst_buffer_unref (preview_buffer);
- preview_buffer = gst_buffer_ref (buf);
+ if (preview_sample)
+ gst_sample_unref (preview_sample);
+ preview_sample = gst_sample_ref (sample);
g_free (preview_filename);
preview_filename =
g_strdup (gst_structure_get_string (st, "location"));
check_preview_image (camera, image_filename, i);
remove_file (image_filename, i);
- if (preview_buffer)
- gst_buffer_unref (preview_buffer);
- preview_buffer = NULL;
+ if (preview_sample)
+ gst_sample_unref (preview_sample);
+ preview_sample = NULL;
gst_caps_replace (&preview_caps, NULL);
}