summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2002-03-03 00:53:25 +0000
committerAndy Wingo <wingo@pobox.com>2002-03-03 00:53:25 +0000
commitc66bc3fa01dd9bba96e62bc9b1b68064a4ca6dfe (patch)
tree7b6155c7c098662e522d0505265b366a7dbcbedf
parent6d56f8adabd2f1e4784a624afe189713de18aa56 (diff)
downloadgstreamer-plugins-base-c66bc3fa01dd9bba96e62bc9b1b68064a4ca6dfe.tar.gz
get up-to-date with the gst_caps_debug api improved capsnego in mad improved capsnego in adder improved capsnego in i...
Original commit message from CVS: * get up-to-date with the gst_caps_debug api * improved capsnego in mad * improved capsnego in adder * improved capsnego in intfloat plugins * unbroke capsnego in stereomono plugins * fix cothread stack allocation within the main thread in new cothreads
m---------common0
-rw-r--r--gst/adder/gstadder.c26
-rw-r--r--sys/v4l/gstv4lsrc.c2
-rwxr-xr-xtools/gst-launch-ext1
4 files changed, 24 insertions, 5 deletions
diff --git a/common b/common
-Subproject 7b9a18016ec2fe74c23382856a0f480da259f97
+Subproject 2adced54d821c7870fd4d9e5e19482418a64c93
diff --git a/gst/adder/gstadder.c b/gst/adder/gstadder.c
index 617b2e0b4..119c71f8e 100644
--- a/gst/adder/gstadder.c
+++ b/gst/adder/gstadder.c
@@ -153,11 +153,13 @@ gst_adder_parse_caps (GstAdder *adder, GstCaps *caps)
adder->law = gst_caps_get_int (caps, "law");
adder->endianness = gst_caps_get_int (caps, "endianness");
adder->is_signed = gst_caps_get_int (caps, "signed");
+ adder->channels = gst_caps_get_int (caps, "channels");
} else if (strcmp (format, "float") == 0) {
adder->format = GST_ADDER_FORMAT_FLOAT;
adder->layout = gst_caps_get_string (caps, "layout");
adder->intercept = gst_caps_get_float (caps, "intercept");
adder->slope = gst_caps_get_float (caps, "slope");
+ adder->channels = gst_caps_get_int (caps, "channels");
}
} else {
/* otherwise, a previously-connected pad has set all the values. we should
@@ -165,11 +167,13 @@ gst_adder_parse_caps (GstAdder *adder, GstCaps *caps)
if (strcmp (format, "int") == 0) {
if ((adder->format != GST_ADDER_FORMAT_INT) ||
(adder->width != gst_caps_get_int (caps, "width")) ||
+ (adder->channels != gst_caps_get_int (caps, "channels")) ||
(adder->is_signed != gst_caps_get_int (caps, "signed"))) {
return FALSE;
}
} else if (strcmp (format, "float") == 0) {
- if (adder->format != GST_ADDER_FORMAT_FLOAT) {
+ if ((adder->format != GST_ADDER_FORMAT_FLOAT) ||
+ (adder->channels != gst_caps_get_int (caps, "channels"))) {
return FALSE;
}
} else {
@@ -184,7 +188,8 @@ static GstPadConnectReturn
gst_adder_connect (GstPad *pad, GstCaps *caps)
{
GstAdder *adder;
- GList *sinkpads;
+ GList *sinkpads, *remove = NULL;
+ GSList *channels;
GstPad *p;
g_return_val_if_fail (caps != NULL, GST_PAD_CONNECT_REFUSED);
@@ -205,11 +210,26 @@ gst_adder_connect (GstPad *pad, GstCaps *caps)
GST_DEBUG (0, "caps mismatch; disconnecting and removing pad %s:%s (peer %s:%s)\n",
GST_DEBUG_PAD_NAME (p), GST_DEBUG_PAD_NAME (GST_PAD_PEER (p)));
gst_pad_disconnect (GST_PAD (GST_PAD_PEER (p)), p);
- gst_element_remove_pad (GST_ELEMENT (adder), p);
+ remove = g_list_prepend (remove, p);
}
}
sinkpads = g_list_next (sinkpads);
}
+ while (remove) {
+ gst_element_remove_pad (GST_ELEMENT (adder), GST_PAD_CAST (remove->data));
+ restart:
+ channels = adder->input_channels;
+ while (channels) {
+ GstAdderInputChannel *channel = (GstAdderInputChannel*) channels->data;
+ if (channel->sinkpad == GST_PAD_CAST (remove->data)) {
+ gst_bytestream_destroy (channel->bytestream);
+ adder->input_channels = g_slist_remove_link (adder->input_channels, channels);
+ goto restart;
+ }
+ channels = g_slist_next (channels);
+ }
+ remove = g_list_next (remove);
+ }
return GST_PAD_CONNECT_OK;
} else {
return GST_PAD_CONNECT_REFUSED;
diff --git a/sys/v4l/gstv4lsrc.c b/sys/v4l/gstv4lsrc.c
index 3a07c13d8..f711f4256 100644
--- a/sys/v4l/gstv4lsrc.c
+++ b/sys/v4l/gstv4lsrc.c
@@ -320,7 +320,7 @@ gst_v4lsrc_srcconnect (GstPad *pad,
"height", GST_PROPS_INT(v4lsrc->height),
NULL ) );
- gst_caps_debug (newcaps);
+ gst_caps_debug (newcaps, "new caps to set on v4lsrc's src pad");
if (!gst_pad_try_set_caps(v4lsrc->srcpad, newcaps))
continue;
diff --git a/tools/gst-launch-ext b/tools/gst-launch-ext
index 8f41244b5..a12b13cea 100755
--- a/tools/gst-launch-ext
+++ b/tools/gst-launch-ext
@@ -87,7 +87,6 @@ read_config ();
"vob", "mpegdemux video_00! { queue ! mpeg2dec ! $cfg{VIDEOSINK} } mpegdemux0.audio_00! { queue ! a52dec ! $cfg{AUDIOSINK} }",
"wav", "wavparse ! $cfg{AUDIOSINK}",
"fli", "flxdec ! colorspace ! $cfg{VIDEOSINK}"
-
);
if ($cfg{VISUALIZER}) {