return object_type;
}
+
static void
gst_gdk_animation_class_init (gpointer g_class, gpointer class_data)
{
anim_class->get_size = gst_gdk_animation_get_size;
anim_class->get_iter = gst_gdk_animation_get_iter;
}
+
static void
gst_gdk_animation_finalize (GObject * object)
{
gst_gdk_animation_iter_on_currently_loading_frame;
anim_iter_class->advance = gst_gdk_animation_iter_advance;
}
+
static void
gst_gdk_animation_iter_init (GTypeInstance * instance, gpointer g_class)
{
iter->buffers = g_queue_new ();
iter->eos = FALSE;
}
+
static void
gst_gdk_animation_iter_finalize (GObject * object)
{
}
G_OBJECT_CLASS (iter_parent_class)->finalize (object);
}
+
static void
got_handoff (GstElement * fakesink, GstBuffer * buffer, GstPad * pad,
GstGdkAnimationIter * iter)
} while (last == g_queue_peek_tail (iter->buffers));
return last != g_queue_peek_tail (iter->buffers);
}
+
static void
pixbuf_destroy_notify (guchar * pixels, gpointer data)
{
GST_LOG ("unreffing buffer %p because pixbuf was destroyed", data);
gst_data_unref (GST_DATA (data));
}
+
static void
gst_gdk_animation_iter_create_pixbuf (GstGdkAnimationIter * iter)
{
GST_LOG_OBJECT (iter, "created pixbuf %p from buffer %p (refcount %d)",
iter->pixbuf, buf, GST_DATA_REFCOUNT_VALUE (buf));
}
+
static GdkPixbufAnimationIter *
gst_gdk_animation_get_iter (GdkPixbufAnimation * anim,
const GTimeVal * start_time)
return TRUE;
}
+
static GdkPixbuf *
gst_gdk_animation_get_static_image (GdkPixbufAnimation * animation)
{
gst_data_unref (GST_DATA (buf));
}
/* now we do evil stuff, be sure to get rid of the iterator afterwards */
- if (!gst_element_send_event (gst_bin_get_by_name (GST_BIN (iter->
- pipeline), "sink"),
+ if (!gst_element_send_event (gst_bin_get_by_name (GST_BIN
+ (iter->pipeline), "sink"),
gst_event_new_seek (GST_FORMAT_TIME | GST_SEEK_METHOD_SET |
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE, offset))) {
GST_INFO_OBJECT (ani, "seeking didn't work. Using next image");
if (GST_VIDEO_INFO_FORMAT (&filter->info) == GST_VIDEO_FORMAT_UNKNOWN) {
GstVideoInfo info;
GstVideoFormat fmt;
+ GList *l;
GST_DEBUG ("Set size to %dx%d", width, height);
gst_caps_unref (caps);
gst_gdk_pixbuf_dec_setup_pool (filter, &info);
+
+ for (l = filter->pending_events; l; l = l->next)
+ gst_pad_push_event (filter->srcpad, l->data);
+ g_list_free (filter->pending_events);
+ filter->pending_events = NULL;
}
ret = gst_buffer_pool_acquire_buffer (filter->pool, &outbuf, NULL);
}
}
break;
- case GST_EVENT_SEGMENT:
case GST_EVENT_FLUSH_STOP:
+ g_list_free_full (pixbuf->pending_events,
+ (GDestroyNotify) gst_event_unref);
+ pixbuf->pending_events = NULL;
+ /* Fall through */
+ case GST_EVENT_SEGMENT:
if (pixbuf->pixbuf_loader != NULL) {
gdk_pixbuf_loader_close (pixbuf->pixbuf_loader, NULL);
g_object_unref (G_OBJECT (pixbuf->pixbuf_loader));
break;
}
if (forward) {
- ret = gst_pad_event_default (pad, parent, event);
+ if (!gst_pad_has_current_caps (pixbuf->srcpad) &&
+ GST_EVENT_IS_SERIALIZED (event)
+ && GST_EVENT_TYPE (event) > GST_EVENT_CAPS
+ && GST_EVENT_TYPE (event) != GST_EVENT_FLUSH_STOP
+ && GST_EVENT_TYPE (event) != GST_EVENT_EOS) {
+ ret = TRUE;
+ pixbuf->pending_events = g_list_prepend (pixbuf->pending_events, event);
+ } else {
+ ret = gst_pad_event_default (pad, parent, event);
+ }
} else {
gst_event_unref (event);
}
gst_buffer_pool_set_active (dec->pool, FALSE);
gst_object_replace ((GstObject **) & dec->pool, NULL);
}
+ g_list_free_full (dec->pending_events, (GDestroyNotify) gst_event_unref);
+ dec->pending_events = NULL;
break;
default:
break;