summaryrefslogtreecommitdiffstats
path: root/ext/gdk_pixbuf/gst_loader.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@gnome.org>2003-11-05 03:24:54 +0000
committerBenjamin Otte <otte@gnome.org>2003-11-05 03:24:54 +0000
commit8468a02e24fa79adc1b396b56e661a3887dfcb52 (patch)
treeb392b760891b093f8d6d9ce74eba551bd93de653 /ext/gdk_pixbuf/gst_loader.c
parentbbd6c00598bb1e533011c85ba59cb8f9e0413ab9 (diff)
add initial version of gdkpixbuf loader for gtk that is capable of loading AVI and mpeg videos as GdkPixbufAnimation....
Original commit message from CVS: add initial version of gdkpixbuf loader for gtk that is capable of loading AVI and mpeg videos as GdkPixbufAnimation. I'm not sure if such a thing would be useful or too much trouble, so I'll throw it at enough testers to figure it out ;) We might want to disable it by defualt though in the future. (Currently there is not even a configure switch implemented to disable it.) This includes a fix to not use GError in gstgdkpixbuf's typefind function and to only return GST_TYPE_FIND_MINIMUM when doing typefinding via gdk as this breaks quite a bit with the GStreamer loader installed.
Diffstat (limited to 'ext/gdk_pixbuf/gst_loader.c')
-rw-r--r--ext/gdk_pixbuf/gst_loader.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/ext/gdk_pixbuf/gst_loader.c b/ext/gdk_pixbuf/gst_loader.c
new file mode 100644
index 00000000..3eb859e1
--- /dev/null
+++ b/ext/gdk_pixbuf/gst_loader.c
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2003 Benjamin Otte <in7y118@public.uni-hamburg.de>
+ *
+ * gst_loader.c: Load GStreamer videos as gdkpixbufs
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "gstgdkanimation.h"
+#include <stdio.h>
+
+static GdkPixbufAnimation *
+gst_loader_load_animation (FILE *f, GError **error)
+{
+ return gst_gdk_animation_new_from_file (f, error);
+}
+void
+fill_vtable (GdkPixbufModule *module)
+{
+ if (gst_init_check (0, NULL)) {
+ module->load_animation = gst_loader_load_animation;
+ }
+}
+void
+fill_info (GdkPixbufFormat *info)
+{
+ static GdkPixbufModulePattern signature[] = {
+ { "RIFF AVI ", " xxxx ", 100 },
+ { "\000\000\001\272", "", 100 },
+ { NULL, NULL, 0 }
+ };
+
+ static gchar *mime_types[] = {
+ "video/avi",
+ "video/mpeg",
+ NULL
+ };
+
+ static gchar *extensions[] = {
+ "avi",
+ "mpeg", "mpe", "mpg",
+ NULL
+ };
+
+ info->name = "GStreamer";
+ info->signature = signature;
+ info->description = "GStreamer supported video";
+ info->mime_types = mime_types;
+ info->extensions = extensions;
+ info->flags = 0;
+}