{
GstElement *pipeline, *sink;
gint width, height;
- GstBuffer *buffer;
+ GstSample *sample;
gchar *descr;
GError *error = NULL;
GdkPixbuf *pixbuf;
/* get the preroll buffer from appsink, this block untils appsink really
* prerolls */
- g_signal_emit_by_name (sink, "pull-preroll", &buffer, NULL);
+ g_signal_emit_by_name (sink, "pull-preroll", &sample, NULL);
/* if we have a buffer now, convert it to a pixbuf. It's possible that we
* don't have a buffer because we went EOS right away or had an error. */
- if (buffer) {
+ if (sample) {
GstCaps *caps;
GstStructure *s;
* 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, get buffer caps somehow */
- caps = NULL;
+ sample_caps = gst_sample_get_caps (sample);
if (!caps) {
g_print ("could not get snapshot format\n");
exit (-1);
/* save the pixbuf */
gdk_pixbuf_save (pixbuf, "snapshot.png", "png", &error, NULL);
gst_buffer_unmap (buffer, &map);
-
- /* save the pixbuf */
- gdk_pixbuf_save (pixbuf, "snapshot.png", "png", &error, NULL);
} else {
g_print ("could not make snapshot\n");
}