2 * Copyright (C) 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __GST_LOADER_H__
21 #define __GST_LOADER_H__
24 #include <gdk-pixbuf/gdk-pixbuf.h>
25 #include <gdk-pixbuf/gdk-pixbuf-animation.h>
26 #include <gdk-pixbuf/gdk-pixbuf-io.h>
30 /* how many bytes we need to have available before we dare to start a new iteration */
31 #define GST_GDK_BUFFER_SIZE (102400)
32 /* how far behind we need to be before we attempt to seek */
33 #define GST_GDK_MAX_DELAY_TO_SEEK (GST_SECOND / 4)
34 #define GST_TYPE_GDK_ANIMATION (gst_gdk_animation_get_type())
35 #define GST_GDK_ANIMATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GDK_ANIMATION,GstGdkAnimation))
36 #define GST_GDK_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_GDK_ANIMATION,GstGdkAnimation))
37 #define GST_IS_GDK_ANIMATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GDK_ANIMATION))
38 #define GST_IS_GDK_ANIMATION_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GDK_ANIMATION))
39 typedef struct _GstGdkAnimation GstGdkAnimation;
40 typedef struct _GstGdkAnimationClass GstGdkAnimationClass;
42 typedef struct _GstGdkAnimationIter GstGdkAnimationIter;
43 typedef struct _GstGdkAnimationIterClass GstGdkAnimationIterClass;
45 struct _GstGdkAnimation
47 GdkPixbufAnimation parent;
49 /* name of temporary buffer file */
51 /* file descriptor to temporary file or 0 if we're done writing */
58 /* static image we use */
62 struct _GstGdkAnimationClass
64 GdkPixbufAnimationClass parent_class;
67 GType gst_gdk_animation_get_type (void);
69 GstGdkAnimation *gst_gdk_animation_new (GError ** error);
71 gboolean gst_gdk_animation_add_data (GstGdkAnimation * ani,
72 const guint8 * data, guint size);
73 void gst_gdk_animation_done_adding (GstGdkAnimation * ani);
76 #define GST_TYPE_GDK_ANIMATION_ITER (gst_gdk_animation_iter_get_type ())
77 #define GST_GDK_ANIMATION_ITER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GST_TYPE_GDK_ANIMATION_ITER, GstGdkAnimationIter))
78 #define GST_IS_GDK_ANIMATION_ITER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GST_TYPE_GDK_ANIMATION_ITER))
80 #define GST_GDK_ANIMATION_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GDK_ANIMATION_ITER, GstGdkAnimationIterClass))
81 #define GST_IS_GDK_ANIMATION_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GDK_ANIMATION_ITER))
82 #define GST_GDK_ANIMATION_ITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_GDK_ANIMATION_ITER, GstGdkAnimationIterClass))
84 struct _GstGdkAnimationIter
86 GdkPixbufAnimationIter parent;
92 /* timestamp of last buffer */
93 GstClockTime last_timestamp;
95 /* pipeline we're using */
100 /* current image and the buffers containing the data */
105 struct _GstGdkAnimationIterClass
107 GdkPixbufAnimationIterClass parent_class;
111 gst_gdk_animation_iter_get_type (void)
115 #endif /* __GST_GDK_ANIMATION_H__ */