endif
if USE_SDL
-SDL_DIR=sdl
+#SDL_DIR=sdl
+SDL_DIR=
else
SDL_DIR=
endif
/* create the sink and src pads */
a52dec->sinkpad = gst_pad_new_from_template (GST_PADTEMPLATE_GET (sink_factory), "sink");
gst_element_add_pad (GST_ELEMENT (a52dec), a52dec->sinkpad);
- gst_pad_set_caps (a52dec->sinkpad, gst_pad_get_padtemplate_caps (a52dec->sinkpad));
gst_element_set_loop_function ((GstElement *) a52dec, gst_a52dec_loop);
a52dec->srcpad = gst_pad_new_from_template (GST_PADTEMPLATE_GET (src_factory), "src");
{
GST_INFO (GST_CAT_PLUGIN_INFO, "a52dec: reneg channels:%d rate:%d\n", channels, rate);
- gst_pad_set_caps (pad, gst_caps_new ("a52dec_src_caps",
- "audio/raw",
- gst_props_new ("format", GST_PROPS_STRING ("int"),
- "law", GST_PROPS_INT (0),
- "endianness", GST_PROPS_INT (G_BYTE_ORDER),
- "signed", GST_PROPS_BOOLEAN (TRUE),
- "width", GST_PROPS_INT (16),
- "depth", GST_PROPS_INT (16),
- "channels", GST_PROPS_INT (channels),
- "rate", GST_PROPS_INT (rate), NULL)
- ));
+ gst_pad_try_set_caps (pad,
+ GST_CAPS_NEW ("a52dec_src_caps",
+ "audio/raw",
+ "format", GST_PROPS_STRING ("int"),
+ "law", GST_PROPS_INT (0),
+ "endianness", GST_PROPS_INT (G_BYTE_ORDER),
+ "signed", GST_PROPS_BOOLEAN (TRUE),
+ "width", GST_PROPS_INT (16),
+ "depth", GST_PROPS_INT (16),
+ "channels", GST_PROPS_INT (channels),
+ "rate", GST_PROPS_INT (rate))
+ );
}
static void
gstelement_class->change_state = gst_lame_change_state;
}
-static void
-gst_lame_newcaps (GstPad *pad, GstCaps *caps)
+static GstPadConnectReturn
+gst_lame_sinkconnect (GstPad *pad, GstCaps *caps)
{
GstLame *lame;
lame = GST_LAME (gst_pad_get_parent (pad));
+ if (!GST_CAPS_IS_FIXED (caps))
+ return GST_PAD_CONNECT_DELAYED;
+
lame->samplerate = gst_caps_get_int (caps, "rate");
lame->num_channels = gst_caps_get_int (caps, "channels");
gst_element_error (GST_ELEMENT (lame), "could not initialize encoder (wrong parameters?)");
lame->initialized = FALSE;
}
+ if (lame->initialized)
+ return GST_PAD_CONNECT_OK;
+
+ return GST_PAD_CONNECT_REFUSED;
}
static void
lame->sinkpad = gst_pad_new_from_template (GST_PADTEMPLATE_GET (gst_lame_sink_factory), "sink");
gst_element_add_pad (GST_ELEMENT (lame), lame->sinkpad);
gst_pad_set_chain_function (lame->sinkpad, gst_lame_chain);
- gst_pad_set_newcaps_function (lame->sinkpad, gst_lame_newcaps);
+ gst_pad_set_connect_function (lame->sinkpad, gst_lame_sinkconnect);
lame->srcpad = gst_pad_new_from_template (GST_PADTEMPLATE_GET (gst_lame_src_factory), "src");
gst_element_add_pad (GST_ELEMENT (lame), lame->srcpad);
- gst_pad_set_caps (lame->srcpad, gst_pad_get_padtemplate_caps (lame->srcpad));
GST_DEBUG (0, "setting up lame encoder\n");
lame->lgf = lame_init ();
mad->sinkpad = gst_pad_new_from_template(
GST_PADTEMPLATE_GET (mad_sink_template_factory), "sink");
gst_element_add_pad(GST_ELEMENT(mad),mad->sinkpad);
- gst_pad_set_caps (mad->sinkpad, gst_pad_get_padtemplate_caps (mad->sinkpad));
gst_pad_set_chain_function (mad->sinkpad, GST_DEBUG_FUNCPTR(gst_mad_chain));
mad->srcpad = gst_pad_new_from_template(
}
}
if (GST_PAD_CAPS (mad->srcpad) == NULL) {
- gst_pad_set_caps (mad->srcpad,
+ gst_pad_try_set_caps (mad->srcpad,
gst_caps_new (
"mad_src",
"audio/raw",
NULL)));
}
- if (GST_PAD_CONNECTED (mad->srcpad))
+ if (GST_PAD_IS_CONNECTED (mad->srcpad))
gst_pad_push (mad->srcpad, outbuffer);
else
gst_buffer_unref (outbuffer);
mpeg2dec->width = width;
mpeg2dec->height = height;
- gst_pad_set_caps (mpeg2dec->srcpad,
+ gst_pad_try_set_caps (mpeg2dec->srcpad,
gst_caps_new (
"mpeg2dec_caps",
"video/raw",
if (siddec->tune->load (siddec->tune_buffer, siddec->tune_len)) {
if (sidEmuInitializeSong (*siddec->engine, *siddec->tune, siddec->tune_number)) {
- gst_pad_set_caps (siddec->srcpad,
+ gst_pad_try_set_caps (siddec->srcpad,
GST_CAPS_NEW (
"siddec_src",
"audio/raw",
outbuf = gst_buffer_create_sub(ac3parse->partialbuf,offset,bpf);
offset += bpf;
- if (ac3parse->skip == 0 && GST_PAD_CONNECTED(ac3parse->srcpad)) {
+ if (ac3parse->skip == 0 && GST_PAD_IS_CONNECTED(ac3parse->srcpad)) {
GST_DEBUG (0,"ac3parse: pushing buffer of %d bytes\n",GST_BUFFER_SIZE(outbuf));
gst_pad_push(ac3parse->srcpad,outbuf);
}
gst_mp3parse_init (GstMPEGAudioParse *mp3parse)
{
mp3parse->sinkpad = gst_pad_new_from_template(sink_temp, "sink");
- //gst_pad_set_caps(mp3parse->sinkpad, gst_pad_get_padtemplate_caps (mp3parse->sinkpad));
gst_element_add_pad(GST_ELEMENT(mp3parse),mp3parse->sinkpad);
#if 1 // set this to one to use the old chaining code
*/
if (outpad && *outpad == NULL) {
*outpad = gst_pad_new_from_template (newtemp, name);
- gst_pad_set_caps (*outpad, gst_pad_get_padtemplate_caps (*outpad));
+ gst_pad_try_set_caps (*outpad, gst_pad_get_padtemplate_caps (*outpad));
gst_element_add_pad (GST_ELEMENT (mpeg_demux), (*outpad));
}
else {
}
/* create the buffer and send it off to the Other Side */
- if (GST_PAD_CONNECTED(*outpad) && datalen > 0) {
+ if (GST_PAD_IS_CONNECTED(*outpad) && datalen > 0) {
/* if this is part of the buffer, create a subbuffer */
GST_DEBUG (0,"mpeg_demux::parse_packet: creating subbuffer len %d\n", datalen);
if (newtemp) {
/* create the pad and add it to self */
(*outpad) = gst_pad_new_from_template (newtemp, name);
- gst_pad_set_caps((*outpad), gst_pad_get_padtemplate_caps (*outpad));
+ gst_pad_try_set_caps ((*outpad), gst_pad_get_padtemplate_caps (*outpad));
gst_element_add_pad(GST_ELEMENT(mpeg_demux),(*outpad));
}
else {
}
/* create the buffer and send it off to the Other Side */
- if (GST_PAD_CONNECTED(*outpad)) {
+ if (GST_PAD_IS_CONNECTED(*outpad)) {
/* if this is part of the buffer, create a subbuffer */
GST_DEBUG (0,"mpeg_demux: creating subbuffer len %d\n", datalen);
for (i=0;i<NUM_PRIVATE_1_PADS;i++)
{
pad = mpeg_demux->private_1_pad[i];
- if (pad && GST_PAD_CONNECTED(pad))
+ if (pad && GST_PAD_IS_CONNECTED(pad))
(*fun) (pad, user_data);
}
for (i=0;i<NUM_SUBTITLE_PADS;i++)
{
pad = mpeg_demux->subtitle_pad[i];
- if (pad && GST_PAD_CONNECTED(pad))
+ if (pad && GST_PAD_IS_CONNECTED(pad))
(*fun) (pad, user_data);
}
pad = mpeg_demux->private_2_pad;
- if (pad && GST_PAD_CONNECTED(pad))
+ if (pad && GST_PAD_IS_CONNECTED(pad))
(*fun) (pad, user_data);
for (i=0;i<NUM_VIDEO_PADS;i++)
{
pad = mpeg_demux->video_pad[i];
- if (pad && GST_PAD_CONNECTED(pad))
+ if (pad && GST_PAD_IS_CONNECTED(pad))
(*fun) (pad, user_data);
}
for (i=0;i<NUM_AUDIO_PADS;i++)
{
pad = mpeg_demux->audio_pad[i];
- if (pad && GST_PAD_CONNECTED(pad))
+ if (pad && GST_PAD_IS_CONNECTED(pad))
(*fun) (pad, user_data);
}
}
if (!GST_PAD_CAPS (mpeg_parse->srcpad)) {
gboolean mpeg2 = GST_MPEG_PACKETIZE_IS_MPEG2 (mpeg_parse->packetize);
- gst_pad_set_caps (mpeg_parse->srcpad,
+ gst_pad_try_set_caps (mpeg_parse->srcpad,
GST_CAPS_NEW (
"mpeg_parse_src",
"video/mpeg",