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>
31 /* how many bytes we need to have available before we dare to start a new iteration */
32 #define GST_GDK_BUFFER_SIZE (102400)
33 /* how far behind we need to be before we attempt to seek */
34 #define GST_GDK_MAX_DELAY_TO_SEEK (GST_SECOND / 4)
37 #define GST_TYPE_GDK_ANIMATION (gst_gdk_animation_get_type())
38 #define GST_GDK_ANIMATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GDK_ANIMATION,GstGdkAnimation))
39 #define GST_GDK_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_GDK_ANIMATION,GstGdkAnimationClass))
40 #define GST_IS_GDK_ANIMATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GDK_ANIMATION))
41 #define GST_IS_GDK_ANIMATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GDK_ANIMATION))
43 typedef struct _GstGdkAnimation GstGdkAnimation;
44 typedef struct _GstGdkAnimationClass GstGdkAnimationClass;
46 typedef struct _GstGdkAnimationIter GstGdkAnimationIter;
47 typedef struct _GstGdkAnimationIterClass GstGdkAnimationIterClass;
49 struct _GstGdkAnimation
51 GdkPixbufAnimation parent;
53 /* name of temporary buffer file */
54 gchar * temp_location;
55 /* file descriptor to temporary file or 0 if we're done writing */
62 /* static image we use */
66 struct _GstGdkAnimationClass
68 GdkPixbufAnimationClass parent_class;
71 GType gst_gdk_animation_get_type (void);
73 GstGdkAnimation * gst_gdk_animation_new (GError **error);
75 gboolean gst_gdk_animation_add_data (GstGdkAnimation * ani,
78 void gst_gdk_animation_done_adding (GstGdkAnimation * ani);
81 #define GST_TYPE_GDK_ANIMATION_ITER (gst_gdk_animation_iter_get_type ())
82 #define GST_GDK_ANIMATION_ITER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GST_TYPE_GDK_ANIMATION_ITER, GstGdkAnimationIter))
83 #define GST_IS_GDK_ANIMATION_ITER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GST_TYPE_GDK_ANIMATION_ITER))
85 #define GST_GDK_ANIMATION_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GDK_ANIMATION_ITER, GstGdkAnimationIterClass))
86 #define GST_IS_GDK_ANIMATION_ITER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GDK_ANIMATION_ITER))
87 #define GST_GDK_ANIMATION_ITER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_GDK_ANIMATION_ITER, GstGdkAnimationIterClass))
89 struct _GstGdkAnimationIter {
90 GdkPixbufAnimationIter parent;
93 GstGdkAnimation * ani;
96 /* timestamp of last buffer */
97 GstClockTime last_timestamp;
99 /* pipeline we're using */
100 GstElement * pipeline;
102 gboolean just_seeked;
104 /* current image and the buffers containing the data */
109 struct _GstGdkAnimationIterClass {
110 GdkPixbufAnimationIterClass parent_class;
113 GType gst_gdk_animation_iter_get_type (void) G_GNUC_CONST;
117 #endif /* __GST_GDK_ANIMATION_H__ */