Commit 93af709d authored by David Schleef's avatar David Schleef

Convert to caps

Original commit message from CVS:
Convert to caps
parent e6255c12
......@@ -329,7 +329,6 @@ gst_dvdec_init(GstDVDec *dvdec)
gst_element_set_loop_function (GST_ELEMENT (dvdec), gst_dvdec_loop);
dvdec->pool = NULL;
dvdec->length = 0;
dvdec->next_ts = 0LL;
dvdec->end_position = -1LL;
......@@ -833,23 +832,7 @@ gst_dvdec_loop (GstElement *element)
guint8 *outframe_ptrs[3];
gint outframe_pitches[3];
/* try to grab a pool */
if (!dvdec->pool) {
dvdec->pool = gst_pad_get_bufferpool (dvdec->videosrcpad);
}
outbuf = NULL;
/* try to get a buffer from the pool if we have one */
if (dvdec->pool) {
outbuf = gst_buffer_new_from_pool (dvdec->pool, 0, 0);
}
/* no buffer from pool, allocate one ourselves */
if (!outbuf) {
outbuf = gst_buffer_new ();
GST_BUFFER_SIZE (outbuf) = (720 * height) * dvdec->bpp;
GST_BUFFER_DATA (outbuf) = g_malloc (GST_BUFFER_SIZE (outbuf));
}
outbuf = gst_buffer_new_and_alloc ((720 * height) * dvdec->bpp);
outframe = GST_BUFFER_DATA (outbuf);
......@@ -900,9 +883,6 @@ gst_dvdec_change_state (GstElement *element)
case GST_STATE_PAUSED_TO_PLAYING:
break;
case GST_STATE_PLAYING_TO_PAUSED:
if (dvdec->pool)
gst_buffer_pool_unref (dvdec->pool);
dvdec->pool = NULL;
break;
case GST_STATE_PAUSED_TO_READY:
dv_decoder_free (dvdec->decoder);
......
......@@ -54,7 +54,6 @@ struct _GstDVDec {
gint quality;
GstByteStream *bs;
GstBufferPool *pool;
dv_color_space_t space;
gint bpp;
gboolean PAL;
......
......@@ -121,51 +121,40 @@ flacdec_get_type(void) {
return flacdec_type;
}
static GstCaps*
static GstCaps2*
flac_caps_factory (void)
{
return
gst_caps_new (
"flac_flac",
"audio/x-flac",
/*gst_props_new (
"rate", GST_PROPS_INT_RANGE (11025, 48000),
"channels", GST_PROPS_INT_RANGE (1, 2),
NULL)*/ NULL);
return gst_caps2_new_simple ("audio/x-flac", NULL);
/* "rate", GST_PROPS_INT_RANGE (11025, 48000),
* "channels", GST_PROPS_INT_RANGE (1, 2), */
}
static GstCaps*
static GstCaps2*
raw_caps_factory (void)
{
return
gst_caps_new (
"flac_raw",
"audio/x-raw-int",
gst_props_new (
"endianness", GST_PROPS_INT (G_BYTE_ORDER),
"signed", GST_PROPS_BOOLEAN (TRUE),
"width", GST_PROPS_INT (16),
"depth", GST_PROPS_INT (16),
"rate", GST_PROPS_INT_RANGE (11025, 48000),
"channels", GST_PROPS_INT_RANGE (1, 2),
NULL));
return gst_caps2_new_simple ("audio/x-raw-int",
"endianness", G_TYPE_INT, G_BYTE_ORDER,
"signed", G_TYPE_BOOLEAN, TRUE,
"width", G_TYPE_INT, 16,
"depth", G_TYPE_INT, 16,
"rate", GST_TYPE_INT_RANGE, 11025, 48000,
"channels", GST_TYPE_INT_RANGE, 1, 2,
NULL);
}
static void
gst_flacdec_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
GstCaps *raw_caps, *flac_caps;
GstCaps2 *raw_caps, *flac_caps;
raw_caps = raw_caps_factory ();
flac_caps = flac_caps_factory ();
sink_template = gst_pad_template_new ("sink", GST_PAD_SINK,
GST_PAD_ALWAYS,
flac_caps, NULL);
sink_template = gst_pad_template_new ("sink", GST_PAD_SINK,
GST_PAD_ALWAYS, flac_caps);
src_template = gst_pad_template_new ("src", GST_PAD_SRC,
GST_PAD_ALWAYS,
raw_caps, NULL);
GST_PAD_ALWAYS, raw_caps);
gst_element_class_add_pad_template (element_class, sink_template);
gst_element_class_add_pad_template (element_class, src_template);
gst_element_class_set_details (element_class, &flacdec_details);
......@@ -485,16 +474,14 @@ gst_flacdec_write (const FLAC__SeekableStreamDecoder *decoder,
if (!GST_PAD_CAPS (flacdec->srcpad)) {
gst_pad_try_set_caps (flacdec->srcpad,
GST_CAPS_NEW (
"flac_caps",
"audio/x-raw-int",
"endianness", GST_PROPS_INT (G_BYTE_ORDER),
"signed", GST_PROPS_BOOLEAN (TRUE),
"width", GST_PROPS_INT (depth),
"depth", GST_PROPS_INT (depth),
"rate", GST_PROPS_INT (frame->header.sample_rate),
"channels", GST_PROPS_INT (channels)
));
gst_caps2_new_simple ("audio/x-raw-int",
"endianness", G_TYPE_INT, G_BYTE_ORDER,
"signed", G_TYPE_BOOLEAN, TRUE,
"width", G_TYPE_INT, depth,
"depth", G_TYPE_INT, depth,
"rate", G_TYPE_INT, frame->header.sample_rate,
"channels", G_TYPE_INT, channels,
NULL));
flacdec->depth = depth;
flacdec->channels = channels;
......
......@@ -68,7 +68,7 @@ static void gst_flacenc_class_init (FlacEncClass *klass);
static void gst_flacenc_dispose (GObject *object);
static GstPadLinkReturn
gst_flacenc_sinkconnect (GstPad *pad, GstCaps *caps);
gst_flacenc_sinkconnect (GstPad *pad, const GstCaps2 *caps);
static void gst_flacenc_chain (GstPad *pad, GstData *_data);
static gboolean gst_flacenc_update_quality (FlacEnc *flacenc, gint quality);
......@@ -176,51 +176,42 @@ gst_flacenc_quality_get_type (void)
return qtype;
}
static GstCaps*
static GstCaps2*
flac_caps_factory (void)
{
return
gst_caps_new (
"flac_flac",
"audio/x-flac",
/* gst_props_new (
"rate", GST_PROPS_INT_RANGE (11025, 48000),
"channels", GST_PROPS_INT_RANGE (1, 2),
NULL) */NULL);
return gst_caps2_new_simple ("audio/x-flac", NULL);
/* "rate", GST_PROPS_INT_RANGE (11025, 48000),
* "channels", GST_PROPS_INT_RANGE (1, 2), */
}
static GstCaps*
static GstCaps2*
raw_caps_factory (void)
{
return
gst_caps_new (
"flac_raw",
"audio/x-raw-int",
gst_props_new (
"endianness", GST_PROPS_INT (G_BYTE_ORDER),
"signed", GST_PROPS_BOOLEAN (TRUE),
"width", GST_PROPS_INT (16),
"depth", GST_PROPS_INT (16),
"rate", GST_PROPS_INT_RANGE (11025, 48000),
"channels", GST_PROPS_INT_RANGE (1, 2),
NULL));
return gst_caps2_new_simple ("audio/x-raw-int",
"endianness", G_TYPE_INT, G_BYTE_ORDER,
"signed", G_TYPE_BOOLEAN, TRUE,
"width", G_TYPE_INT, 16,
"depth", G_TYPE_INT, 16,
"rate", GST_TYPE_INT_RANGE, 11025, 48000,
"channels", GST_TYPE_INT_RANGE, 1, 2,
NULL);
}
static void
gst_flacenc_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
GstCaps *raw_caps, *flac_caps;
GstCaps2 *raw_caps, *flac_caps;
raw_caps = raw_caps_factory ();
flac_caps = flac_caps_factory ();
sink_template = gst_pad_template_new ("sink", GST_PAD_SINK,
GST_PAD_ALWAYS,
raw_caps, NULL);
raw_caps);
src_template = gst_pad_template_new ("src", GST_PAD_SRC,
GST_PAD_ALWAYS,
flac_caps, NULL);
flac_caps);
gst_element_class_add_pad_template (element_class, sink_template);
gst_element_class_add_pad_template (element_class, src_template);
gst_element_class_set_details (element_class, &flacenc_details);
......@@ -354,24 +345,23 @@ gst_flacenc_dispose (GObject *object)
}
static GstPadLinkReturn
gst_flacenc_sinkconnect (GstPad *pad, GstCaps *caps)
gst_flacenc_sinkconnect (GstPad *pad, const GstCaps2 *caps)
{
GstPadLinkReturn ret;
FlacEnc *flacenc;
GstStructure *structure;
flacenc = GST_FLACENC (gst_pad_get_parent (pad));
if (!GST_CAPS_IS_FIXED (caps))
return GST_PAD_LINK_DELAYED;
structure = gst_caps2_get_nth_cap (caps, 0);
gst_caps_get_int (caps, "channels", &flacenc->channels);
gst_caps_get_int (caps, "depth", &flacenc->depth);
gst_caps_get_int (caps, "rate", &flacenc->sample_rate);
gst_structure_get_int (structure, "channels", &flacenc->channels);
gst_structure_get_int (structure, "depth", &flacenc->depth);
gst_structure_get_int (structure, "rate", &flacenc->sample_rate);
caps = GST_CAPS_NEW ("flacenc_srccaps",
"audio/x-flac",
"channels", GST_PROPS_INT (flacenc->channels),
"rate", GST_PROPS_INT (flacenc->sample_rate));
caps = gst_caps2_new_simple ("audio/x-flac",
"channels", G_TYPE_INT, flacenc->channels,
"rate", G_TYPE_INT, flacenc->sample_rate, NULL);
ret = gst_pad_try_set_caps (flacenc->srcpad, caps);
if (ret <= 0) {
return ret;
......
......@@ -100,32 +100,21 @@ enum {
/* FILL ME */
};
GST_PAD_TEMPLATE_FACTORY (flac_tag_src_template_factory,
static GstStaticPadTemplate flac_tag_src_template =
GST_STATIC_PAD_TEMPLATE (
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_CAPS_NEW (
"flac_tag_tag_src",
"audio/x-flac",
NULL
),
GST_CAPS_NEW (
"flac_tag_tag_src",
"application/x-gst-tags",
NULL
)
)
GST_PAD_TEMPLATE_FACTORY (flac_tag_sink_template_factory,
GST_STATIC_CAPS ("audio/x-flac; application/x-gst-tags")
);
static GstStaticPadTemplate flac_tag_sink_template =
GST_STATIC_PAD_TEMPLATE (
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_CAPS_NEW (
"flac_tag_data_sink",
"audio/x-flac",
NULL
)
)
GST_STATIC_CAPS ("audio/x-flac")
);
static void gst_flac_tag_base_init (gpointer g_class);
......@@ -181,9 +170,9 @@ gst_flac_tag_base_init (gpointer g_class)
gst_element_class_set_details (element_class, &gst_flac_tag_details);
gst_element_class_add_pad_template (element_class,
GST_PAD_TEMPLATE_GET (flac_tag_sink_template_factory));
gst_static_pad_template_get (&flac_tag_sink_template));
gst_element_class_add_pad_template (element_class,
GST_PAD_TEMPLATE_GET (flac_tag_src_template_factory));
gst_static_pad_template_get (&flac_tag_src_template));
}
......@@ -206,26 +195,21 @@ static gboolean
caps_nego (GstFlacTag *tag)
{
/* do caps nego */
GstCaps *caps;
capsnego:
caps = GST_CAPS_NEW ("flac_tag_data_src", "audio/x-flac", NULL);
GstCaps2 *caps;
caps = gst_caps2_new_simple ("audio/x-flac", NULL);
if (gst_pad_try_set_caps (tag->srcpad, caps) != GST_PAD_LINK_REFUSED) {
tag->only_output_tags = FALSE;
GST_LOG_OBJECT (tag, "normal operation, using audio/x-flac output");
} else {
if (gst_pad_try_set_caps (tag->srcpad,
GST_CAPS_NEW ("flac_tag_tag_src", "application/x-gst-tags", NULL))
if (gst_pad_try_set_caps (tag->srcpad, gst_caps2_new_simple (
"application/x-gst-tags", NULL))
!= GST_PAD_LINK_REFUSED) {
tag->only_output_tags = TRUE;
GST_LOG_OBJECT (tag, "fast operation, just outputting tags");
printf ("output tags only\n");
} else {
caps = gst_pad_template_get_caps (GST_PAD_TEMPLATE_GET (flac_tag_src_template_factory));
if (gst_pad_recover_caps_error (tag->srcpad, caps)) {
goto capsnego;
} else {
return FALSE;
}
return FALSE;
}
}
return TRUE;
......@@ -251,12 +235,12 @@ gst_flac_tag_init (GstFlacTag *tag)
{
/* create the sink and src pads */
tag->sinkpad = gst_pad_new_from_template(
GST_PAD_TEMPLATE_GET (flac_tag_sink_template_factory), "sink");
gst_static_pad_template_get (&flac_tag_sink_template), "sink");
gst_element_add_pad (GST_ELEMENT (tag), tag->sinkpad);
gst_pad_set_chain_function (tag->sinkpad, GST_DEBUG_FUNCPTR (gst_flac_tag_chain));
tag->srcpad = gst_pad_new_from_template(
GST_PAD_TEMPLATE_GET (flac_tag_src_template_factory), "src");
gst_static_pad_template_get (&flac_tag_src_template), "src");
gst_element_add_pad (GST_ELEMENT (tag), tag->srcpad);
tag->buffer = NULL;
......
......@@ -25,6 +25,7 @@
#endif
#include <gst/gst.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gst/video/video.h>
#include <string.h>
#include "gstgdkpixbuf.h"
......@@ -47,50 +48,39 @@ enum {
ARG_SILENT
};
GST_PAD_TEMPLATE_FACTORY (gst_gdk_pixbuf_sink_factory,
static GstStaticPadTemplate gst_gdk_pixbuf_sink_template =
GST_STATIC_PAD_TEMPLATE (
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_CAPS_NEW("gdk_pixbuf_sink", "image/png", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/jpeg", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/gif", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-icon", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "application/x-navi-animation", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-cmu-raster", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-sun-raster", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-pixmap", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/tiff", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-portable-anymap", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-portable-bitmap", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-portable-graymap", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-portable-pixmap", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/bmp", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-bmp", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-MS-bmp", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/vnd.wap.wbmp", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-bitmap", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-tga", NULL)
GST_STATIC_CAPS (
"image/png; "
"image/jpeg; "
"image/gif; "
"image/x-icon; "
"application/x-navi-animation; "
"image/x-cmu-raster; "
"image/x-sun-raster; "
"image/x-pixmap; "
"image/tiff; "
"image/x-portable-anymap; "
"image/x-portable-bitmap; "
"image/x-portable-graymap; "
"image/x-portable-pixmap; "
"image/bmp; "
"image/x-bmp; "
"image/x-MS-bmp; "
"image/vnd.wap.wbmp; "
"image/x-bitmap; "
"image/x-tga")
);
GST_PAD_TEMPLATE_FACTORY (gst_gdk_pixbuf_src_factory,
static GstStaticPadTemplate gst_gdk_pixbuf_src_template =
GST_STATIC_PAD_TEMPLATE (
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_CAPS_NEW(
"gdk_pixbuf_src",
"video/x-raw-rgb",
"width", GST_PROPS_INT_RANGE(1,INT_MAX),
"height", GST_PROPS_INT_RANGE(1,INT_MAX),
/* well, it's needed for connectivity but this
* doesn't really make sense... */
"framerate", GST_PROPS_FLOAT_RANGE(0, G_MAXFLOAT),
"bpp", GST_PROPS_INT(32),
"depth", GST_PROPS_INT(24),
"endianness", GST_PROPS_INT(G_BIG_ENDIAN),
"red_mask", GST_PROPS_INT(0x00ff0000),
"green_mask", GST_PROPS_INT(0x0000ff00),
"blue_mask", GST_PROPS_INT(0x000000ff)
)
GST_STATIC_CAPS (GST_VIDEO_RGB_PAD_TEMPLATE_CAPS_24)
);
static void gst_gdk_pixbuf_base_init (gpointer g_class);
......@@ -110,7 +100,7 @@ static void gst_gdk_pixbuf_type_find (GstTypeFind *tf, gpointer ignore);
static GstElementClass *parent_class = NULL;
static GstPadLinkReturn
gst_gdk_pixbuf_sink_link (GstPad *pad, GstCaps *caps)
gst_gdk_pixbuf_sink_link (GstPad *pad, const GstCaps2 *caps)
{
GstGdkPixbuf *filter;
......@@ -119,11 +109,6 @@ gst_gdk_pixbuf_sink_link (GstPad *pad, GstCaps *caps)
g_return_val_if_fail (GST_IS_GDK_PIXBUF (filter),
GST_PAD_LINK_REFUSED);
if (GST_CAPS_IS_FIXED (caps))
{
return GST_PAD_LINK_OK;
}
return GST_PAD_LINK_DELAYED;
}
......@@ -132,67 +117,40 @@ gst_gdk_pixbuf_sink_link (GstPad *pad, GstCaps *caps)
* These are just the formats that gdk-pixbuf is known to support.
* But maybe not -- it may have been compiled without an external
* library. */
static GstCaps *gst_gdk_pixbuf_get_capslist(void)
static GstCaps2 *gst_gdk_pixbuf_get_capslist(void)
{
GstCaps *capslist;
capslist = gst_caps_chain(
GST_CAPS_NEW("gdk_pixbuf_sink", "image/png", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/jpeg", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/gif", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-icon", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "application/x-navi-animation", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-cmu-raster", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-sun-raster", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-pixmap", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/tiff", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-portable-anymap", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-portable-bitmap", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-portable-graymap", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-portable-pixmap", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/bmp", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-bmp", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-MS-bmp", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/vnd.wap.wbmp", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-bitmap", NULL),
GST_CAPS_NEW("gdk_pixbuf_sink", "image/x-tga", NULL),
NULL);
return capslist;
return gst_caps2_copy (gst_static_caps_get (
&gst_gdk_pixbuf_sink_template.static_caps));
}
#else
static GstCaps *gst_gdk_pixbuf_get_capslist(void)
static GstCaps2 *gst_gdk_pixbuf_get_capslist(void)
{
GSList *slist;
GSList *slist0;
GdkPixbufFormat *pixbuf_format;
char **mimetypes;
char **mimetype;
static GstCaps *capslist = NULL;
if(capslist==NULL){
slist0 = gdk_pixbuf_get_formats();
for(slist = slist0;slist;slist=g_slist_next(slist)){
pixbuf_format = slist->data;
mimetypes = gdk_pixbuf_format_get_mime_types(pixbuf_format);
for(mimetype = mimetypes; *mimetype; mimetype++){
capslist = gst_caps_append(capslist, gst_caps_new("ack",*mimetype,NULL));
}
g_free(mimetypes);
}
gst_caps_ref(capslist);
gst_caps_sink(capslist);
g_slist_free(slist0);
GstCaps2 *capslist = NULL;
g_print("%s\n",gst_caps_to_string(capslist));
capslist = gst_caps2_new_empty ();
slist0 = gdk_pixbuf_get_formats();
for(slist = slist0;slist;slist=g_slist_next(slist)){
pixbuf_format = slist->data;
mimetypes = gdk_pixbuf_format_get_mime_types(pixbuf_format);
for(mimetype = mimetypes; *mimetype; mimetype++){
gst_caps2_append_cap (capslist,
gst_structure_new (*mimetype,NULL));
}
g_free(mimetypes);
}
g_slist_free(slist0);
return capslist;
}
#endif
static GstCaps *gst_gdk_pixbuf_sink_getcaps(GstPad *pad, GstCaps *caps)
static GstCaps2 *gst_gdk_pixbuf_sink_getcaps(GstPad *pad)
{
GstGdkPixbuf *filter;
......@@ -234,8 +192,10 @@ gst_gdk_pixbuf_base_init (gpointer g_class)
{
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (element_class, gst_gdk_pixbuf_src_factory ());
gst_element_class_add_pad_template (element_class, gst_gdk_pixbuf_sink_factory ());
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get( &gst_gdk_pixbuf_src_template));
gst_element_class_add_pad_template (element_class,
gst_static_pad_template_get( &gst_gdk_pixbuf_sink_template));
gst_element_class_set_details (element_class, &plugin_details);
}
......@@ -262,12 +222,12 @@ gst_gdk_pixbuf_class_init (GstGdkPixbufClass *klass)
static void
gst_gdk_pixbuf_init (GstGdkPixbuf *filter)
{
filter->sinkpad = gst_pad_new_from_template (gst_gdk_pixbuf_sink_factory (),
"sink");
filter->sinkpad = gst_pad_new_from_template (
gst_static_pad_template_get( &gst_gdk_pixbuf_sink_template), "sink");
gst_pad_set_link_function (filter->sinkpad, gst_gdk_pixbuf_sink_link);
gst_pad_set_getcaps_function (filter->sinkpad, gst_gdk_pixbuf_sink_getcaps);
filter->srcpad = gst_pad_new_from_template (gst_gdk_pixbuf_src_factory (),
"src");
filter->srcpad = gst_pad_new_from_template (
gst_static_pad_template_get( &gst_gdk_pixbuf_src_template), "src");
gst_element_add_pad (GST_ELEMENT (filter), filter->sinkpad);
gst_element_add_pad (GST_ELEMENT (filter), filter->srcpad);
......@@ -285,7 +245,7 @@ gst_gdk_pixbuf_chain (GstPad *pad, GstData *_data)
GstBuffer *outbuf;
GError *error = NULL;
g_print("gst_gdk_pixbuf_chain\n");
GST_DEBUG ("gst_gdk_pixbuf_chain");
g_return_if_fail (GST_IS_PAD (pad));
g_return_if_fail (buf != NULL);
......@@ -305,7 +265,7 @@ gst_gdk_pixbuf_chain (GstPad *pad, GstData *_data)
gdk_pixbuf_get_height(pixbuf));
if(filter->image_size == 0){
GstCaps *caps;
GstCaps2 *caps;
filter->width = gdk_pixbuf_get_width(pixbuf);
filter->height = gdk_pixbuf_get_height(pixbuf);
......@@ -313,9 +273,10 @@ gst_gdk_pixbuf_chain (GstPad *pad, GstData *_data)
filter->image_size = filter->rowstride * filter->height;
caps = gst_pad_get_caps(filter->srcpad);
gst_caps_set(caps, "width", GST_PROPS_INT(filter->width));
gst_caps_set(caps, "height", GST_PROPS_INT(filter->height));
gst_caps_set(caps, "framerate", GST_PROPS_FLOAT(0.));
gst_caps2_set_simple (caps,
"width", G_TYPE_INT, filter->width,
"height", G_TYPE_INT, filter->height,
"framerate", G_TYPE_DOUBLE, 0., NULL);
gst_pad_try_set_caps(filter->srcpad, caps);
}
......@@ -399,7 +360,7 @@ gst_gdk_pixbuf_type_find (GstTypeFind *tf, gpointer ignore)
gchar **mlist = gdk_pixbuf_format_get_mime_types(format);
gst_type_find_suggest (tf, GST_TYPE_FIND_MINIMUM,
gst_caps_new ("gdk_pixbuf_type_find", mlist[0], NULL));
gst_caps2_new_simple (mlist[0], NULL));
}
gdk_pixbuf_loader_close (pixbuf_loader, NULL);
......@@ -418,7 +379,8 @@ plugin_init (GstPlugin *plugin)
return FALSE;
gst_type_find_register (plugin, "image/*", GST_RANK_MARGINAL,
gst_gdk_pixbuf_type_find, NULL, GST_CAPS_ANY, NULL);