mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-05 10:12:20 +00:00
timeline-pipeline: update for new gst_buffer_map() API
This commit is contained in:
parent
8bf47d9112
commit
c69ea5652d
1 changed files with 9 additions and 10 deletions
|
@ -814,13 +814,12 @@ gboolean
|
||||||
ges_timeline_pipeline_save_thumbnail (GESTimelinePipeline * self, int width, int
|
ges_timeline_pipeline_save_thumbnail (GESTimelinePipeline * self, int width, int
|
||||||
height, const gchar * format, const gchar * location)
|
height, const gchar * format, const gchar * location)
|
||||||
{
|
{
|
||||||
|
GstMapInfo map_info;
|
||||||
GstBuffer *b;
|
GstBuffer *b;
|
||||||
GstSample *sample;
|
GstSample *sample;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
gboolean res = TRUE;
|
gboolean res = TRUE;
|
||||||
gpointer data;
|
|
||||||
gsize size;
|
|
||||||
|
|
||||||
caps = gst_caps_from_string (format);
|
caps = gst_caps_from_string (format);
|
||||||
|
|
||||||
|
@ -836,17 +835,17 @@ ges_timeline_pipeline_save_thumbnail (GESTimelinePipeline * self, int width, int
|
||||||
}
|
}
|
||||||
|
|
||||||
b = gst_sample_get_buffer (sample);
|
b = gst_sample_get_buffer (sample);
|
||||||
data = gst_buffer_map (b, &size, NULL, GST_MAP_READ);
|
if (gst_buffer_map (b, &map_info, GST_MAP_READ)) {
|
||||||
|
|
||||||
/* FIXME : Use standard glib methods */
|
/* FIXME : Use standard glib methods */
|
||||||
fp = fopen (location, "w+");
|
fp = fopen (location, "w+");
|
||||||
if (!fwrite (data, size, 1, fp) || ferror (fp)) {
|
if (!fwrite (map_info.data, map_info.size, 1, fp) || ferror (fp)) {
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
}
|
}
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
|
}
|
||||||
|
|
||||||
gst_caps_unref (caps);
|
gst_caps_unref (caps);
|
||||||
gst_buffer_unmap (b, data, size);
|
gst_buffer_unmap (b, &map_info);
|
||||||
gst_buffer_unref (b);
|
gst_buffer_unref (b);
|
||||||
gst_sample_unref (sample);
|
gst_sample_unref (sample);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue