Merge branch 'master' into 0.11
[platform/upstream/gstreamer.git] / tests / examples / seek / seek.c
index d79209c..7df277d 100644 (file)
@@ -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);