Commit 5704069c authored by David Schleef's avatar David Schleef

Convert to new caps

Original commit message from CVS:
Convert to new caps
parent 3caad1a9
......@@ -2140,74 +2140,50 @@ gst_matroska_demux_video_caps (GstMatroskaTrackVideoContext *videocontext,
}
if (caps != NULL) {
GstCaps2 *one;
GstPropsEntry *fps = NULL;
GstPropsEntry *width = NULL, *height = NULL;
GstPropsEntry *pixel_width = NULL, *pixel_height = NULL;
int i;
GstStructure *structure;
for (one = caps; one != NULL; one = one->next) {
for (i=0;i<gst_caps2_get_n_structures(caps);i++){
structure = gst_caps2_get_nth_cap (caps, i);
if (videocontext != NULL) {
if (videocontext->pixel_width > 0 &&
videocontext->pixel_height > 0) {
gint w = videocontext->pixel_width;
gint h = videocontext->pixel_height;
width = gst_props_entry_new ("width",
G_TYPE_INT (w));
height = gst_props_entry_new ("height",
G_TYPE_INT (h));
gst_structure_set (structure,
"width", G_TYPE_INT, w,
"height", G_TYPE_INT, h, NULL);
}
if (videocontext->display_width > 0 &&
videocontext->display_height > 0) {
gint w = 100 * videocontext->display_width / videocontext->pixel_width;
gint h = 100 * videocontext->display_height / videocontext->pixel_height;
pixel_width = gst_props_entry_new ("pixel_width",
G_TYPE_INT (w));
pixel_height = gst_props_entry_new ("pixel_height",
G_TYPE_INT (h));
gst_structure_set (structure,
"pixel_width", G_TYPE_INT, w,
"pixel_height", G_TYPE_INT, h,
NULL);
}
if (context->default_duration > 0) {
gfloat framerate = 1. * GST_SECOND / context->default_duration;
fps = gst_props_entry_new ("framerate",
G_TYPE_DOUBLE (framerate));
gst_structure_set (structure,
"framerate", G_TYPE_DOUBLE, framerate, NULL);
} else {
/* sort of a hack to get most codecs to support,
* even if the default_duration is missing */
fps = gst_props_entry_new ("framerate", G_TYPE_DOUBLE (25.));
gst_structure_set (structure,
"framerate", G_TYPE_DOUBLE, 25.0, NULL);
}
} else {
width = gst_props_entry_new ("width",
G_TYPE_INT_RANGE (16, 4096));
height = gst_props_entry_new ("height",
G_TYPE_INT_RANGE (16, 4096));
pixel_width = gst_props_entry_new ("pixel_width",
G_TYPE_INT_RANGE (0, 255));
pixel_height = gst_props_entry_new ("pixel_height",
G_TYPE_INT_RANGE (0, 255));
fps = gst_props_entry_new ("framerate",
G_TYPE_DOUBLE_RANGE (0, G_MAXFLOAT));
}
if (one->properties == NULL) {
one->properties = gst_props_empty_new ();
}
if (width != NULL && height != NULL) {
gst_props_add_entry (one->properties, width);
gst_props_add_entry (one->properties, height);
}
if (pixel_width != NULL && pixel_height != NULL) {
gst_props_add_entry (one->properties, pixel_width);
gst_props_add_entry (one->properties, pixel_height);
}
if (fps != NULL) {
gst_props_add_entry (one->properties, fps);
gst_structure_set (structure,
"width", GST_TYPE_INT_RANGE, 16, 4096,
"height", GST_TYPE_INT_RANGE, 16, 4096,
"pixel_width", GST_TYPE_INT_RANGE, 0, 255,
"pixel_height", GST_TYPE_INT_RANGE, 0, 255,
"framerate", GST_TYPE_DOUBLE_RANGE, 0, G_MAXDOUBLE,
NULL);
}
}
}
......@@ -2223,53 +2199,34 @@ gst_matroskademux_acm_caps (guint16 codec_id,
switch (codec_id) {
case GST_RIFF_WAVE_FORMAT_MPEGL3: /* mp3 */
caps = gst_caps2_new_simple ("matroskademux_acm_audio_src_mp3",
"audio/mpeg",
"layer", G_TYPE_INT (3));
caps = gst_caps2_new_simple ("audio/mpeg",
"layer", G_TYPE_INT, 3, NULL);
break;
case GST_RIFF_WAVE_FORMAT_MPEGL12: /* mp1 or mp2 */
caps = gst_caps2_new_simple ("matroskademux_acm_audio_src_mp12",
"audio/mpeg",
"layer", G_TYPE_INT (2));
caps = gst_caps2_new_simple ("audio/mpeg",
"layer", G_TYPE_INT, 2, NULL);
break;
case GST_RIFF_WAVE_FORMAT_PCM: /* PCM/wav */ {
GstPropsEntry *width = NULL, *depth = NULL, *signedness = NULL;
if (auds != NULL) {
gint ba = GUINT16_FROM_LE (auds->blockalign);
gint ch = GUINT16_FROM_LE (auds->channels);
gint ws = GUINT16_FROM_LE (auds->size);
width = gst_props_entry_new ("width",
G_TYPE_INT (ba * 8 / ch));
depth = gst_props_entry_new ("depth",
G_TYPE_INT (ws));
signedness = gst_props_entry_new ("signed",
G_TYPE_BOOLEAN (ws != 8));
caps = gst_caps2_new_simple ("audio/x-raw-int",
"endianness", G_TYPE_INT, G_LITTLE_ENDIAN,
"width", G_TYPE_INT, ba * 8 / ch,
"depth", G_TYPE_INT, ws,
"signed", G_TYPE_BOOLEAN, ws != 8, NULL);
} else {
signedness = gst_props_entry_new ("signed",
GST_PROPS_LIST (
G_TYPE_BOOLEAN (TRUE),
G_TYPE_BOOLEAN (FALSE)));
width = gst_props_entry_new ("width",
GST_PROPS_LIST (
G_TYPE_INT (8),
G_TYPE_INT (16)));
depth = gst_props_entry_new ("depth",
GST_PROPS_LIST (
G_TYPE_INT (8),
G_TYPE_INT (16)));
caps = gst_caps2_from_string ("audio/x-raw-int, "
"endianness = (int) LITTLE_ENDIAN, "
"signed = (int) { TRUE, FALSE }, "
"depth = (int) { 8, 16 }, "
"width = (int) { 8, 16 }");
}
caps = gst_caps2_new_simple ("matroskademux_acm_audio_src_pcm",
"audio/x-raw-int",
"endianness",
G_TYPE_INT (G_LITTLE_ENDIAN));
gst_props_add_entry (caps->properties, width);
gst_props_add_entry (caps->properties, depth);
gst_props_add_entry (caps->properties, signedness);
}
break;
......@@ -2278,9 +2235,7 @@ gst_matroskademux_acm_caps (guint16 codec_id,
g_warning ("invalid depth (%d) of mulaw audio, overwriting.",
auds->size);
}
caps = gst_caps2_new_simple ("matroskademux_acm_audio_src",
"audio/x-mulaw",
NULL);
caps = gst_caps2_new_simple ("audio/x-mulaw", NULL);
break;
case GST_RIFF_WAVE_FORMAT_ALAW:
......@@ -2288,9 +2243,7 @@ gst_matroskademux_acm_caps (guint16 codec_id,
g_warning ("invalid depth (%d) of alaw audio, overwriting.",
auds->size);
}
caps = gst_caps2_new_simple ("matroskademux_acm_audio_src",
"audio/x-alaw",
NULL);
caps = gst_caps2_new_simple ("audio/x-alaw", NULL);
break;
case GST_RIFF_WAVE_FORMAT_VORBIS1: /* ogg/vorbis mode 1 */
......@@ -2299,20 +2252,17 @@ gst_matroskademux_acm_caps (guint16 codec_id,
case GST_RIFF_WAVE_FORMAT_VORBIS1PLUS: /* ogg/vorbis mode 1+ */
case GST_RIFF_WAVE_FORMAT_VORBIS2PLUS: /* ogg/vorbis mode 2+ */
case GST_RIFF_WAVE_FORMAT_VORBIS3PLUS: /* ogg/vorbis mode 3+ */
caps = gst_caps2_new_simple ("matroskademux_acm_audio_src_vorbis",
"audio/x-vorbis",
NULL);
caps = gst_caps2_new_simple ("audio/x-vorbis", NULL);
break;
case GST_RIFF_WAVE_FORMAT_A52:
caps = gst_caps2_new_simple ("matroskademux_acm_audio_src_ac3",
"audio/x-ac3",
NULL);
caps = gst_caps2_new_simple ("audio/x-ac3", NULL);
break;
default:
GST_WARNING ("matroskademux: unkown ACM audio format 0x%04x",
codec_id);
return NULL;
break;
}
......@@ -2343,15 +2293,13 @@ gst_matroska_demux_audio_caps (GstMatroskaTrackAudioContext *audiocontext,
else
g_assert (0);
caps = gst_caps2_new_simple ("matroskademux_mpeg1-l1",
"audio/mpeg",
"mpegversion", G_TYPE_INT (1),
"systemstream", G_TYPE_BOOLEAN (FALSE),
"layer", G_TYPE_INT (layer));
caps = gst_caps2_new_simple ("audio/mpeg",
"mpegversion", G_TYPE_INT, 1,
"systemstream", G_TYPE_BOOLEAN, FALSE,
"layer", G_TYPE_INT, layer, NULL);
} else if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_AUDIO_PCM_INT_BE) ||
!strcmp (codec_id, GST_MATROSKA_CODEC_ID_AUDIO_PCM_INT_LE)) {
gint endianness = -1;
GstPropsEntry *depth, *width, *sign;
if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_AUDIO_PCM_INT_BE))
endianness = G_BIG_ENDIAN;
......@@ -2361,57 +2309,33 @@ gst_matroska_demux_audio_caps (GstMatroskaTrackAudioContext *audiocontext,
g_assert (0);
if (context != NULL) {
width = gst_props_entry_new ("width",
G_TYPE_INT (audiocontext->bitdepth));
depth = gst_props_entry_new ("depth",
G_TYPE_INT (audiocontext->bitdepth));
sign = gst_props_entry_new ("signed",
G_TYPE_BOOLEAN (audiocontext->bitdepth == 8));
caps = gst_caps2_new_simple ("audio/x-raw-int",
"width", G_TYPE_INT, audiocontext->bitdepth,
"depth", G_TYPE_INT, audiocontext->bitdepth,
"signed", G_TYPE_BOOLEAN, audiocontext->bitdepth == 8, NULL);
} else {
width = gst_props_entry_new ("width", GST_PROPS_LIST (
G_TYPE_INT (8),
G_TYPE_INT (16)));
depth = gst_props_entry_new ("depth", GST_PROPS_LIST (
G_TYPE_INT (8),
G_TYPE_INT (16)));
sign = gst_props_entry_new ("signed", GST_PROPS_LIST (
G_TYPE_BOOLEAN (TRUE),
G_TYPE_BOOLEAN (FALSE)));
caps = gst_caps2_from_string ("audio/x-raw-int, "
"signed = (int) { TRUE, FALSE }, "
"depth = (int) { 8, 16 }, "
"width = (int) { 8, 16 }");
}
caps = gst_caps2_new_simple ("matroskademux_audio_raw",
"audio/x-raw-int",
"endianness", G_TYPE_INT (endianness));
gst_props_add_entry (caps->properties, width);
gst_props_add_entry (caps->properties, depth);
gst_props_add_entry (caps->properties, sign);
gst_caps2_set_simple (caps, "endianness", G_TYPE_INT, endianness, NULL);
} else if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_AUDIO_PCM_FLOAT)) {
GstPropsEntry *width;
caps = gst_caps2_new_simple ("audio/x-raw-float",
"endianness", G_TYPE_INT, G_BYTE_ORDER,
"buffer-frames", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL);
if (audiocontext != NULL) {
width = gst_props_entry_new ("width",
G_TYPE_INT (audiocontext->bitdepth));
gst_caps2_set_simple (caps,
"width", G_TYPE_INT, audiocontext->bitdepth, NULL);
} else {
width = gst_props_entry_new ("width", GST_PROPS_LIST (
G_TYPE_INT (32),
G_TYPE_INT (64)));
gst_caps2_set_simple (caps,
"width", GST_TYPE_INT_RANGE, 32, 64, NULL);
}
caps = gst_caps2_new_simple ("matroskademux_audio_float",
"audio/x-raw-float",
"endianness", G_TYPE_INT (G_BYTE_ORDER),
"buffer-frames", G_TYPE_INT_RANGE (1, G_MAXINT));
gst_props_add_entry (caps->properties, width);
} else if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_AUDIO_AC3) ||
!strcmp (codec_id, GST_MATROSKA_CODEC_ID_AUDIO_DTS)) {
caps = gst_caps2_new_simple ("matroskademux_audio_ac3/dts",
"audio/x-ac3",
NULL);
caps = gst_caps2_new_simple ("audio/x-ac3", NULL);
} else if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_AUDIO_VORBIS)) {
caps = gst_caps2_new_simple ("matroskademux_audio_vorbis",
"audio/x-vorbis",
NULL);
caps = gst_caps2_new_simple ("audio/x-vorbis", NULL);
} else if (!strcmp (codec_id, GST_MATROSKA_CODEC_ID_AUDIO_ACM)) {
gst_riff_strf_auds *auds = NULL;
......@@ -2443,42 +2367,34 @@ gst_matroska_demux_audio_caps (GstMatroskaTrackAudioContext *audiocontext,
else
g_assert (0);
caps = gst_caps2_new_simple ("matroska_demux_aac_mpeg2",
"audio/mpeg",
"mpegversion", G_TYPE_INT (mpegversion),
"systemstream", G_TYPE_BOOLEAN (FALSE));
caps = gst_caps2_new_simple ("audio/mpeg",
"mpegversion", G_TYPE_INT, mpegversion,
"systemstream", G_TYPE_BOOLEAN, FALSE, NULL);
} else {
GST_WARNING ("Unknown codec '%s', cannot build Caps",
codec_id);
return NULL;
}
if (caps != NULL) {
GstCaps2 *one;
GstPropsEntry *chans = NULL, *rate = NULL;
GstStructure *structure;
int i;
for (one = caps; one != NULL; one = one->next) {
for (i=0; i<gst_caps2_get_n_structures(caps); i++){
structure = gst_caps2_get_nth_cap (caps, i);
if (audiocontext != NULL) {
if (audiocontext->samplerate > 0 &&
audiocontext->channels > 0) {
chans = gst_props_entry_new ("channels",
G_TYPE_INT (audiocontext->channels));
rate = gst_props_entry_new ("rate",
G_TYPE_INT (audiocontext->samplerate));
gst_structure_set (structure,
"channels", G_TYPE_INT, audiocontext->channels,
"rate", G_TYPE_INT, audiocontext->samplerate,
NULL);
}
} else {
chans = gst_props_entry_new ("channels",
G_TYPE_INT_RANGE (1, 6));
rate = gst_props_entry_new ("rate",
G_TYPE_INT_RANGE (4000, 96000));
}
if (caps->properties == NULL) {
caps->properties = gst_props_empty_new ();
}
if (chans != NULL && rate != NULL) {
gst_props_add_entry (caps->properties, chans);
gst_props_add_entry (caps->properties, rate);
gst_structure_set (structure,
"channels", GST_TYPE_INT_RANGE, 1, 6,
"rate", GST_TYPE_INT_RANGE, 4000, 96000,
NULL);
}
}
}
......@@ -2630,17 +2546,18 @@ gst_matroska_demux_plugin_init (GstPlugin *plugin)
return FALSE;
/* video src template */
videosrccaps = gst_caps2_new_empty ();
for (i = 0; video_id[i] != NULL; i++) {
temp = gst_matroska_demux_video_caps (NULL, video_id[i], NULL, 0);
videosrccaps = gst_caps_append (videosrccaps, temp);
gst_caps2_append (videosrccaps, temp);
}
for (i = 0; video_fourcc[i] != 0; i++) {
temp = gst_matroska_demux_vfw_caps (video_fourcc[i], NULL);
videosrccaps = gst_caps_append (videosrccaps, temp);
gst_caps2_append (videosrccaps, temp);
}
for (i = 0; complex_id[i] != NULL; i++) {
temp = gst_matroska_demux_complex_caps (NULL, video_id[i], NULL, 0);
videosrccaps = gst_caps_append (videosrccaps, temp);
gst_caps2_append (videosrccaps, temp);
}
videosrctempl = gst_pad_template_new ("video_%02d",
GST_PAD_SRC,
......@@ -2650,11 +2567,11 @@ gst_matroska_demux_plugin_init (GstPlugin *plugin)
/* audio src template */
for (i = 0; audio_id[i] != NULL; i++) {
temp = gst_matroska_demux_audio_caps (NULL, audio_id[i], NULL, 0);
audiosrccaps = gst_caps_append (audiosrccaps, temp);
gst_caps2_append (audiosrccaps, temp);
}
for (i = 0; audio_tag[i] != 0; i++) {
temp = gst_matroskademux_acm_caps (audio_tag[i], NULL);
audiosrccaps = gst_caps_append (audiosrccaps, temp);
gst_caps2_append (audiosrccaps, temp);
}
audiosrctempl = gst_pad_template_new ("audio_%02d",
GST_PAD_SRC,
......@@ -2664,7 +2581,7 @@ gst_matroska_demux_plugin_init (GstPlugin *plugin)
/* subtitle src template */
for (i = 0; subtitle_id[i] != NULL; i++) {
temp = gst_matroska_demux_subtitle_caps (NULL, subtitle_id[i], NULL, 0);
subtitlesrccaps = gst_caps_append (subtitlesrccaps, temp);
gst_caps2_append (subtitlesrccaps, temp);
}
subtitlesrctempl = gst_pad_template_new ("subtitle_%02d",
GST_PAD_SRC,
......
......@@ -32,31 +32,21 @@ static GstElementDetails median_details = {
"Wim Taymans <wim.taymans@chello.be>"
};
GST_PAD_TEMPLATE_FACTORY (median_src_factory,
static GstStaticPadTemplate median_src_factory =
GST_STATIC_PAD_TEMPLATE (
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
gst_caps_new (
"median_src",
"video/x-raw-yuv",
GST_VIDEO_YUV_PAD_TEMPLATE_PROPS (
GST_PROPS_FOURCC (GST_STR_FOURCC ("I420"))
)
)
)
GST_STATIC_CAPS (GST_VIDEO_YUV_PAD_TEMPLATE_CAPS ("I420"))
);
GST_PAD_TEMPLATE_FACTORY (median_sink_factory,
static GstStaticPadTemplate median_sink_factory =
GST_STATIC_PAD_TEMPLATE (
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
gst_caps_new (
"median_src",
"video/x-raw-yuv",
GST_VIDEO_YUV_PAD_TEMPLATE_PROPS (
GST_PROPS_FOURCC (GST_STR_FOURCC ("I420"))
)
)
)
GST_STATIC_CAPS (GST_VIDEO_YUV_PAD_TEMPLATE_CAPS ("I420"))
);
/* Median signals and args */
......@@ -115,9 +105,9 @@ gst_median_base_init (GstMedianClass *klass)
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
GST_PAD_TEMPLATE_GET (median_sink_factory));
gst_static_pad_template_get (&median_sink_factory));
gst_element_class_add_pad_template (element_class,
GST_PAD_TEMPLATE_GET (median_src_factory));
gst_static_pad_template_get (&median_src_factory));
gst_element_class_set_details (element_class, &median_details);
}
......@@ -147,32 +137,32 @@ gst_median_class_init (GstMedianClass *klass)
}
static gboolean
gst_median_sinkconnect (GstPad *pad, GstCaps *caps)
gst_median_sinkconnect (GstPad *pad, const GstCaps2 *caps)
{
GstMedian *filter;
GstStructure *structure;
filter = GST_MEDIAN (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, "width", &filter->width);
gst_caps_get_int (caps, "height", &filter->height);
gst_structure_get_int (structure, "width", &filter->width);
gst_structure_get_int (structure, "height", &filter->height);
/* forward to the next plugin */
return gst_pad_try_set_caps(filter->srcpad, gst_caps_copy_1(caps));
return gst_pad_try_set_caps(filter->srcpad, caps);
}
void gst_median_init (GstMedian *median)
{
median->sinkpad = gst_pad_new_from_template (
GST_PAD_TEMPLATE_GET (median_sink_factory), "sink");
gst_static_pad_template_get (&median_sink_factory), "sink");
gst_pad_set_link_function (median->sinkpad, gst_median_sinkconnect);
gst_pad_set_chain_function (median->sinkpad, gst_median_chain);
gst_element_add_pad (GST_ELEMENT (median), median->sinkpad);
median->srcpad = gst_pad_new_from_template (
GST_PAD_TEMPLATE_GET (median_src_factory), "src");
gst_static_pad_template_get (&median_src_factory), "src");
gst_element_add_pad (GST_ELEMENT (median), median->srcpad);
median->filtersize = 5;
......
......@@ -23,6 +23,7 @@
#include <gst/gst.h>
#include <gst/video/video.h>
#include <gst/audio/audio.h>
#include "monoscope.h"
#define GST_TYPE_MONOSCOPE (gst_monoscope_get_type())
......@@ -46,7 +47,7 @@ struct _GstMonoscope {
gint16 datain[512];
/* video state */
gfloat fps;
gdouble fps;
gint width;
gint height;
gboolean first_buffer;
......@@ -81,41 +82,21 @@ enum {
/* FILL ME */
};
GST_PAD_TEMPLATE_FACTORY (src_template,
static GstStaticPadTemplate src_template =
GST_STATIC_PAD_TEMPLATE (
"src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_CAPS_NEW (
"monoscopesrc",
"video/x-raw-rgb",
"bpp", GST_PROPS_INT (32),
"depth", GST_PROPS_INT (32),
"endianness", GST_PROPS_INT (G_BIG_ENDIAN),
"red_mask", GST_PROPS_INT (R_MASK_32),
"green_mask", GST_PROPS_INT (G_MASK_32),
"blue_mask", GST_PROPS_INT (B_MASK_32),
"width", GST_PROPS_INT_RANGE (16, 4096),
"height", GST_PROPS_INT_RANGE (16, 4096),
"framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT)
)
)
GST_STATIC_CAPS (GST_VIDEO_RGB_PAD_TEMPLATE_CAPS_32)
);
GST_PAD_TEMPLATE_FACTORY (sink_template,
"sink", /* the name of the pads */
GST_PAD_SINK, /* type of the pad */
GST_PAD_ALWAYS, /* ALWAYS/SOMETIMES */
GST_CAPS_NEW (
"monoscopesink", /* the name of the caps */
"audio/x-raw-int", /* the mime type of the caps */
/* Properties follow: */
"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 (8000, 96000),
"channels", GST_PROPS_INT (1)
)
)
static GstStaticPadTemplate sink_template =
GST_STATIC_PAD_TEMPLATE (
"sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
GST_STATIC_CAPS (GST_AUDIO_INT_STANDARD_PAD_TEMPLATE_CAPS)
);
static void gst_monoscope_class_init (GstMonoscopeClass *klass);
......@@ -125,9 +106,9 @@ static void gst_monoscope_init (GstMonoscope *monoscope);
static void gst_monoscope_chain (GstPad *pad, GstData *_data);
static GstPadLinkReturn
gst_monoscope_sinkconnect (GstPad *pad, GstCaps *caps);
gst_monoscope_sinkconnect (GstPad *pad, const GstCaps2 *caps);
static GstPadLinkReturn
gst_monoscope_srcconnect (GstPad *pad, GstCaps *caps);
gst_monoscope_srcconnect (GstPad *pad, const GstCaps2 *caps);
static GstElementClass *parent_class = NULL;
......@@ -159,9 +140,9 @@ gst_monoscope_base_init (GstMonoscopeClass *klass)
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
gst_element_class_add_pad_template (element_class,
GST_PAD_TEMPLATE_GET (src_template));
gst_static_pad_template_get (&src_template));
gst_element_class_add_pad_template (element_class,
GST_PAD_TEMPLATE_GET (sink_template));
gst_static_pad_template_get (&sink_template));
gst_element_class_set_details (element_class, &gst_monoscope_details);
}
......@@ -182,9 +163,9 @@ gst_monoscope_init (GstMonoscope *monoscope)
{
/* create the sink and src pads */
monoscope->sinkpad = gst_pad_new_from_template (
GST_PAD_TEMPLATE_GET (sink_template ), "sink");
gst_static_pad_template_get (&sink_template ), "sink");
monoscope->srcpad = gst_pad_new_from_template (
GST_PAD_TEMPLATE_GET (src_template ), "src");
gst_static_pad_template_get (&src_template ), "src");
gst_element_add_pad (GST_ELEMENT (monoscope), monoscope->sinkpad);
gst_element_add_pad (GST_ELEMENT (monoscope), monoscope->srcpad);
......@@ -203,55 +184,45 @@ gst_monoscope_init (GstMonoscope *monoscope)
}
static GstPadLinkReturn
gst_monoscope_sinkconnect (GstPad *pad, GstCaps *caps)
gst_monoscope_sinkconnect (GstPad *pad, const GstCaps2 *caps)
{