another batch of connect->link fixes please let me know about issues and please refrain of making them yourself, so t...

Original commit message from CVS:
another batch of connect->link fixes
please let me know about issues
and please refrain of making them yourself, so that I don't spend double
the time resolving conflicts
This commit is contained in:
Thomas Vander Stichele 2003-01-10 10:22:01 +00:00
parent cc46630cb2
commit 45c7badc47
5 changed files with 22 additions and 22 deletions

2
common

@ -1 +1 @@
Subproject commit 86c508421de359776c4c2cb411a78c729330a250
Subproject commit 2a013c06fe9bf1379966cd12e6bf8c30915c5f12

View file

@ -241,7 +241,7 @@ gst_ffmpegdecall_init(GstFFMpegDecAll *ffmpegdec)
{
ffmpegdec->sinkpad = gst_pad_new_from_template(
GST_PAD_TEMPLATE_GET(sink_templ), "sink");
gst_pad_set_connect_function(ffmpegdec->sinkpad,
gst_pad_set_link_function(ffmpegdec->sinkpad,
gst_ffmpegdecall_connect);
gst_pad_set_chain_function(ffmpegdec->sinkpad,
gst_ffmpegdecall_chain);
@ -273,20 +273,20 @@ gst_ffmpegdecall_connect (GstPad *pad, GstCaps *caps)
AVCodec *plugin;
if (!GST_CAPS_IS_FIXED(caps))
return GST_PAD_CONNECT_DELAYED;
return GST_PAD_LINK_DELAYED;
avcodec_get_context_defaults(ffmpegdec->context);
if ((id = gst_ffmpeg_caps_to_codecid(caps, ffmpegdec->context)) == CODEC_ID_NONE) {
GST_DEBUG(GST_CAT_PLUGIN_INFO,
"Failed to find corresponding codecID");
return GST_PAD_CONNECT_REFUSED;
return GST_PAD_LINK_REFUSED;
}
if ((plugin = avcodec_find_decoder(id)) == NULL) {
GST_DEBUG(GST_CAT_PLUGIN_INFO,
"Failed to find an avdecoder for id=%d", id);
return GST_PAD_CONNECT_REFUSED;
return GST_PAD_LINK_REFUSED;
}
/* we dont send complete frames */
@ -296,10 +296,10 @@ gst_ffmpegdecall_connect (GstPad *pad, GstCaps *caps)
if (avcodec_open(ffmpegdec->context, plugin)) {
GST_DEBUG(GST_CAT_PLUGIN_INFO,
"Failed to open FFMPEG codec for id=%d", id);
return GST_PAD_CONNECT_REFUSED;
return GST_PAD_LINK_REFUSED;
}
return GST_PAD_CONNECT_OK;
return GST_PAD_LINK_OK;
}
static void

View file

@ -161,7 +161,7 @@ gst_ffmpegdec_sinkconnect (GstPad *pad, GstCaps *caps)
GstFFMpegDecClass *oclass = (GstFFMpegDecClass*)(G_OBJECT_GET_CLASS (ffmpegdec));
if (!GST_CAPS_IS_FIXED (caps))
return GST_PAD_CONNECT_DELAYED;
return GST_PAD_LINK_DELAYED;
if (gst_caps_has_property_typed (caps, "width", GST_PROPS_INT_TYPE))
gst_caps_get_int (caps, "width", &ffmpegdec->context->width);
@ -175,15 +175,15 @@ gst_ffmpegdec_sinkconnect (GstPad *pad, GstCaps *caps)
/*
if (avcodec_open (ffmpegdec->context, avcodec_find_encoder(CODEC_ID_MPEG1VIDEO)) <0 ) {
g_warning ("ffmpegdec: could not open codec");
return GST_PAD_CONNECT_REFUSED;
return GST_PAD_LINK_REFUSED;
}
*/
if (avcodec_open (ffmpegdec->context, oclass->in_plugin) < 0) {
g_warning ("ffmpegdec: could not open codec");
return GST_PAD_CONNECT_REFUSED;
return GST_PAD_LINK_REFUSED;
}
return GST_PAD_CONNECT_OK;
return GST_PAD_LINK_OK;
}
static void
@ -194,7 +194,7 @@ gst_ffmpegdec_init(GstFFMpegDec *ffmpegdec)
ffmpegdec->context = avcodec_alloc_context();
ffmpegdec->sinkpad = gst_pad_new_from_template (oclass->templ, "sink");
gst_pad_set_connect_function (ffmpegdec->sinkpad, gst_ffmpegdec_sinkconnect);
gst_pad_set_link_function (ffmpegdec->sinkpad, gst_ffmpegdec_sinkconnect);
if (oclass->in_plugin->type == CODEC_TYPE_VIDEO) {
ffmpegdec->srcpad = gst_pad_new_from_template (

View file

@ -231,7 +231,7 @@ gst_ffmpegenc_sinkconnect (GstPad *pad, GstCaps *caps)
GstFFMpegEncClass *oclass = (GstFFMpegEncClass*)(G_OBJECT_GET_CLASS(ffmpegenc));
if (!GST_CAPS_IS_FIXED (caps))
return GST_PAD_CONNECT_DELAYED;
return GST_PAD_LINK_DELAYED;
if (strstr (gst_caps_get_mime (caps), "audio/raw")) {
gst_caps_get_int (caps, "rate", &ffmpegenc->context->sample_rate);
@ -264,12 +264,12 @@ gst_ffmpegenc_sinkconnect (GstPad *pad, GstCaps *caps)
}
else {
g_warning ("ffmpegenc: invalid caps %s\n", gst_caps_get_mime (caps));
return GST_PAD_CONNECT_REFUSED;
return GST_PAD_LINK_REFUSED;
}
if (avcodec_open (ffmpegenc->context, oclass->in_plugin) < 0) {
g_warning ("ffmpegenc: could not open codec\n");
return GST_PAD_CONNECT_REFUSED;
return GST_PAD_LINK_REFUSED;
}
if (oclass->in_plugin->type == CODEC_TYPE_AUDIO) {
@ -277,7 +277,7 @@ gst_ffmpegenc_sinkconnect (GstPad *pad, GstCaps *caps)
ffmpegenc->context->channels);
ffmpegenc->buffer_pos = 0;
}
return GST_PAD_CONNECT_OK;
return GST_PAD_LINK_OK;
}
static void
@ -309,7 +309,7 @@ gst_ffmpegenc_init(GstFFMpegEnc *ffmpegenc)
ffmpegenc->context->sample_rate = -1;
}
gst_pad_set_connect_function (ffmpegenc->sinkpad, gst_ffmpegenc_sinkconnect);
gst_pad_set_link_function (ffmpegenc->sinkpad, gst_ffmpegenc_sinkconnect);
gst_element_add_pad (GST_ELEMENT (ffmpegenc), ffmpegenc->sinkpad);
ffmpegenc->srcpad = gst_pad_new_from_template (

View file

@ -164,7 +164,7 @@ gst_ffmpegmux_sinkconnect (GstPad *pad, GstCaps *caps)
GstFFMpegMuxClass *oclass = (GstFFMpegMuxClass*)(G_OBJECT_GET_CLASS (ffmpegmux));
if (!GST_CAPS_IS_FIXED (caps))
return GST_PAD_CONNECT_DELAYED;
return GST_PAD_LINK_DELAYED;
if (gst_caps_has_property_typed (caps, "width", GST_PROPS_INT_TYPE))
gst_caps_get_int (caps, "width", &ffmpegmux->context->width);
@ -178,14 +178,14 @@ gst_ffmpegmux_sinkconnect (GstPad *pad, GstCaps *caps)
/* FIXME bug in ffmpeg */
if (avcodec_open (ffmpegmux->context, avcodec_find_encoder(CODEC_ID_MPEG1VIDEO)) <0 ) {
g_warning ("ffmpegmux: could not open codec");
return GST_PAD_CONNECT_REFUSED;
return GST_PAD_LINK_REFUSED;
}
if (avcodec_open (ffmpegmux->context, oclass->in_plugin) < 0) {
g_warning ("ffmpegmux: could not open codec");
return GST_PAD_CONNECT_REFUSED;
return GST_PAD_LINK_REFUSED;
}
return GST_PAD_CONNECT_OK;
return GST_PAD_LINK_OK;
}
static void
@ -197,7 +197,7 @@ gst_ffmpegmux_init(GstFFMpegMux *ffmpegmux)
ffmpegmux->sinkpad = gst_pad_new_from_template (
GST_PAD_TEMPLATE_GET (gst_ffmpegmux_sink_factory), "sink");
gst_pad_set_connect_function (ffmpegmux->sinkpad, gst_ffmpegmux_sinkconnect);
gst_pad_set_link_function (ffmpegmux->sinkpad, gst_ffmpegmux_sinkconnect);
if (oclass->in_plugin->type == CODEC_TYPE_VIDEO) {
ffmpegmux->srcpad = gst_pad_new_from_template (