X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=tests%2Fexamples%2Fseek%2Fseek.c;h=7df277d0176d56e3743ba7d51ea0630f81f6b013;hb=bf08ca70200bee15b3acf6c55a5df4ddba87ef8e;hp=d79209ccbd90a480d46a4acf148d379bf56c5efc;hpb=7716358d045d90f43aecd7136a29c31f6ce75bdf;p=platform%2Fupstream%2Fgstreamer.git diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index d79209c..7df277d 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -2042,12 +2042,18 @@ shot_cb (GtkButton * button, gpointer data) gint width, height; GdkPixbuf *pixbuf; GError *error = NULL; + guint8 *data; + gsize size; /* get the snapshot buffer format now. We set the caps on the appsink so * that it can only be an rgb buffer. The only thing we have not specified * on the caps is the height, which is dependant on the pixel-aspect-ratio * of the source material */ +#if 0 caps = GST_BUFFER_CAPS (buffer); +#endif + /* FIXME, need to get the caps of the buffer somehow */ + caps = NULL; if (!caps) { g_warning ("could not get snapshot format\n"); goto done; @@ -2064,12 +2070,14 @@ shot_cb (GtkButton * button, gpointer data) /* create pixmap from buffer and save, gstreamer video buffers have a stride * that is rounded up to the nearest multiple of 4 */ - pixbuf = gdk_pixbuf_new_from_data (GST_BUFFER_DATA (buffer), + data = gst_buffer_map (buffer, &size, NULL, GST_MAP_READ); + pixbuf = gdk_pixbuf_new_from_data (data, GDK_COLORSPACE_RGB, FALSE, 8, width, height, GST_ROUND_UP_4 (width * 3), NULL, NULL); /* save the pixbuf */ gdk_pixbuf_save (pixbuf, "snapshot.png", "png", &error, NULL); + gst_buffer_unmap (buffer, data, size); done: gst_buffer_unref (buffer); @@ -2445,7 +2453,7 @@ static GstBusSyncReply bus_sync_handler (GstBus * bus, GstMessage * message, GstPipeline * data) { if ((GST_MESSAGE_TYPE (message) == GST_MESSAGE_ELEMENT) && - gst_structure_has_name (message->structure, "prepare-xwindow-id")) { + gst_message_has_name (message, "prepare-xwindow-id")) { GstElement *element = GST_ELEMENT (GST_MESSAGE_SRC (message)); g_print ("got prepare-xwindow-id, setting XID %lu\n", embed_xid);