diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-05-11 11:43:07 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-06-01 11:21:28 +0200 |
commit | b6788153161b4e07fbf3d42a2d8921ea049305d0 (patch) | |
tree | e1426174528937104937943ba5a133f965be3d59 /ext/gdk_pixbuf | |
parent | b6655a48b8aff80c9b8ba21491e9ca1572411f54 (diff) |
gdkpixbuf: Add a gdkpixbuf3 plugin that uses gdkpixbuf3
Diffstat (limited to 'ext/gdk_pixbuf')
-rw-r--r-- | ext/gdk_pixbuf/Makefile.am | 28 | ||||
-rw-r--r-- | ext/gdk_pixbuf/gstgdkpixbuf.c | 25 | ||||
-rw-r--r-- | ext/gdk_pixbuf/gstgdkpixbufsink.c | 7 | ||||
-rw-r--r-- | ext/gdk_pixbuf/pixbufscale.c | 23 |
4 files changed, 74 insertions, 9 deletions
diff --git a/ext/gdk_pixbuf/Makefile.am b/ext/gdk_pixbuf/Makefile.am index cf5265c2e..acd2c5efc 100644 --- a/ext/gdk_pixbuf/Makefile.am +++ b/ext/gdk_pixbuf/Makefile.am @@ -1,4 +1,13 @@ -plugin_LTLIBRARIES = libgstgdkpixbuf.la +plugin_LTLIBRARIES = + +if USE_GDK_PIXBUF +plugin_LTLIBRARIES += libgstgdkpixbuf.la + +endif + +if USE_GDK_PIXBUF3 +plugin_LTLIBRARIES += libgstgdkpixbuf3.la +endif libgstgdkpixbuf_la_SOURCES = gstgdkpixbuf.c gstgdkpixbufsink.c pixbufscale.c libgstgdkpixbuf_la_CFLAGS = \ @@ -12,8 +21,21 @@ libgstgdkpixbuf_la_LIBADD = \ libgstgdkpixbuf_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libgstgdkpixbuf_la_LIBTOOLFLAGS = --tag=disable-static +libgstgdkpixbuf3_la_SOURCES = gstgdkpixbuf.c gstgdkpixbufsink.c pixbufscale.c +libgstgdkpixbuf3_la_CFLAGS = \ + $(GST_PLUGINS_BASE_CFLAGS) \ + $(GST_BASE_CFLAGS) \ + $(GST_CFLAGS) $(GDK_PIXBUF3_CFLAGS) \ + -DGDK_PIXBUF3=1 +libgstgdkpixbuf3_la_LIBADD = \ + $(GST_PLUGINS_BASE_LIBS) -lgstvideo-$(GST_MAJORMINOR) \ + $(GST_BASE_LIBS) \ + $(GST_LIBS) $(GDK_PIXBUF3_LIBS) +libgstgdkpixbuf3_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) +libgstgdkpixbuf3_la_LIBTOOLFLAGS = --tag=disable-static + noinst_HEADERS = \ gstgdkpixbuf.h \ gstgdkpixbufsink.h \ - pixbufscale.h \ - gstgdkanimation.h + pixbufscale.h + diff --git a/ext/gdk_pixbuf/gstgdkpixbuf.c b/ext/gdk_pixbuf/gstgdkpixbuf.c index 1896eb441..81f3d5918 100644 --- a/ext/gdk_pixbuf/gstgdkpixbuf.c +++ b/ext/gdk_pixbuf/gstgdkpixbuf.c @@ -84,7 +84,14 @@ static gboolean gst_gdk_pixbuf_sink_event (GstPad * pad, GstEvent * event); static void gst_gdk_pixbuf_type_find (GstTypeFind * tf, gpointer ignore); #endif +#ifdef GDK_PIXBUF3 +typedef GstGdkPixbuf GstGdkPixbuf3; +typedef GstGdkPixbufClass GstGdkPixbuf3Class; + +GST_BOILERPLATE (GstGdkPixbuf3, gst_gdk_pixbuf, GstElement, GST_TYPE_ELEMENT); +#else GST_BOILERPLATE (GstGdkPixbuf, gst_gdk_pixbuf, GstElement, GST_TYPE_ELEMENT); +#endif static gboolean gst_gdk_pixbuf_sink_setcaps (GstPad * pad, GstCaps * caps) @@ -516,6 +523,16 @@ gst_gdk_pixbuf_type_find (GstTypeFind * tf, gpointer ignore) } #endif +#ifdef GDK_PIXBUF3 +#define PLUGIN_NAME "gdkpixbuf3" +#define GDKPIXBUFDEC "gdkpixbufdec3" +#define GDKPIXBUFSINK "gdkpixbufsink3" +#else +#define PLUGIN_NAME "gdkpixbuf" +#define GDKPIXBUFDEC "gdkpixbufdec" +#define GDKPIXBUFSINK "gdkpixbufsink" +#endif + /* entry point to initialize the plug-in * initialize the plug-in itself * register the element factories and pad templates @@ -524,10 +541,10 @@ gst_gdk_pixbuf_type_find (GstTypeFind * tf, gpointer ignore) static gboolean plugin_init (GstPlugin * plugin) { - GST_DEBUG_CATEGORY_INIT (gst_gdk_pixbuf_debug, "gdkpixbuf", 0, + GST_DEBUG_CATEGORY_INIT (gst_gdk_pixbuf_debug, PLUGIN_NAME, 0, "gdk pixbuf loader"); - if (!gst_element_register (plugin, "gdkpixbufdec", GST_RANK_MARGINAL, + if (!gst_element_register (plugin, GDKPIXBUFDEC, GST_RANK_MARGINAL, GST_TYPE_GDK_PIXBUF)) return FALSE; @@ -536,7 +553,7 @@ plugin_init (GstPlugin * plugin) gst_gdk_pixbuf_type_find, NULL, GST_CAPS_ANY, NULL); #endif - if (!gst_element_register (plugin, "gdkpixbufsink", GST_RANK_NONE, + if (!gst_element_register (plugin, GDKPIXBUFSINK, GST_RANK_NONE, GST_TYPE_GDK_PIXBUF_SINK)) return FALSE; @@ -552,6 +569,6 @@ plugin_init (GstPlugin * plugin) * so keep the name plugin_desc, or you cannot get your plug-in registered */ GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, - "gdkpixbuf", + PLUGIN_NAME, "GdkPixbuf-based image decoder, scaler and sink", plugin_init, VERSION, "LGPL", GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN) diff --git a/ext/gdk_pixbuf/gstgdkpixbufsink.c b/ext/gdk_pixbuf/gstgdkpixbufsink.c index 3258358a7..f17b72f09 100644 --- a/ext/gdk_pixbuf/gstgdkpixbufsink.c +++ b/ext/gdk_pixbuf/gstgdkpixbufsink.c @@ -109,9 +109,16 @@ enum PROP_LAST }; +#ifdef GDK_PIXBUF3 +typedef GstGdkPixbufSink GstGdkPixbufSink3; +typedef GstGdkPixbufSinkClass GstGdkPixbufSink3Class; +GST_BOILERPLATE (GstGdkPixbufSink3, gst_gdk_pixbuf_sink, GstVideoSink, + GST_TYPE_VIDEO_SINK); +#else GST_BOILERPLATE (GstGdkPixbufSink, gst_gdk_pixbuf_sink, GstVideoSink, GST_TYPE_VIDEO_SINK); +#endif static void gst_gdk_pixbuf_sink_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); diff --git a/ext/gdk_pixbuf/pixbufscale.c b/ext/gdk_pixbuf/pixbufscale.c index d8d980823..03063936b 100644 --- a/ext/gdk_pixbuf/pixbufscale.c +++ b/ext/gdk_pixbuf/pixbufscale.c @@ -81,8 +81,13 @@ gst_pixbufscale_method_get_type (void) }; if (!pixbufscale_method_type) { +#ifdef GDK_PIXBUF3 + pixbufscale_method_type = + g_enum_register_static ("GstPixbuf3ScaleMethod", pixbufscale_methods); +#else pixbufscale_method_type = g_enum_register_static ("GstPixbufScaleMethod", pixbufscale_methods); +#endif } return pixbufscale_method_type; } @@ -108,8 +113,16 @@ static gboolean gst_pixbufscale_handle_src_event (GstPad * pad, static gboolean parse_caps (GstCaps * caps, gint * width, gint * height); +#ifdef GDK_PIXBUF3 +typedef GstPixbufScale GstPixbufScale3; +typedef GstPixbufScaleClass GstPixbufScale3Class; + +GST_BOILERPLATE (GstPixbufScale3, gst_pixbufscale, GstBaseTransform, + GST_TYPE_BASE_TRANSFORM); +#else GST_BOILERPLATE (GstPixbufScale, gst_pixbufscale, GstBaseTransform, GST_TYPE_BASE_TRANSFORM); +#endif static void gst_pixbufscale_base_init (gpointer g_class) @@ -469,14 +482,20 @@ gst_pixbufscale_handle_src_event (GstPad * pad, GstEvent * event) return ret; } +#ifdef GDK_PIXBUF3 +#define GDKPIXBUFSCALE "gdkpixbufscale3" +#else +#define GDKPIXBUFSCALE "gdkpixbufscale" +#endif + gboolean pixbufscale_init (GstPlugin * plugin) { - if (!gst_element_register (plugin, "gdkpixbufscale", GST_RANK_NONE, + if (!gst_element_register (plugin, GDKPIXBUFSCALE, GST_RANK_NONE, GST_TYPE_PIXBUFSCALE)) return FALSE; - GST_DEBUG_CATEGORY_INIT (pixbufscale_debug, "gdkpixbufscale", 0, + GST_DEBUG_CATEGORY_INIT (pixbufscale_debug, GDKPIXBUFSCALE, 0, "pixbufscale element"); return TRUE; |