replaced gst-plugins 0.8.9 with 0.8.10

also added new patch for adder element to specify caps
see http://bugs.campware.org/view.php?id=1229
and http://bugzilla.gnome.org/show_bug.cgi?id=314146
This commit is contained in:
maroy 2005-08-26 10:36:25 +00:00
parent 67d444bf4f
commit f0e84a099d
5 changed files with 296 additions and 6 deletions

View file

@ -22,7 +22,7 @@
#
#
# Author : $Author: maroy $
# Version : $Revision: 1.2 $
# Version : $Revision: 1.3 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/tools/gstreamer/gstreamer-0.8.10/bin/prepare.sh,v $
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
@ -30,7 +30,7 @@
# To read more about gstreamer, see http://gstreamer.freedesktop.org/
#-------------------------------------------------------------------------------
product=gstreamer-0.8.10
plugins=gst-plugins-0.8.9
plugins=gst-plugins-0.8.10
reldir=`dirname $0`/..
basedir=`cd ${reldir}; pwd;`
@ -65,9 +65,9 @@ cd ${tmpdir}
if [ ! -d $plugins ]; then
tar xfj ${plugins_tar}
cd ${plugins}
# see bug report at http://bugzilla.gnome.org/show_bug.cgi?id=305658
# see bug report at http://bugzilla.gnome.org/show_bug.cgi?id=314146
# for details on the following patch
patch -p1 < ${etcdir}/adder-fix.patch
#patch -p1 < ${etcdir}/adder-caps-property.patch
# see bug report at http://bugzilla.gnome.org/show_bug.cgi?id=309218
# for details on the following patch
patch -p1 < ${etcdir}/adder-duration-fix.patch

View file

@ -21,7 +21,7 @@
#
#
# Author : $Author: maroy $
# Version : $Revision: 1.2 $
# Version : $Revision: 1.3 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/tools/gstreamer/gstreamer-0.8.10/etc/Makefile.in,v $
#-------------------------------------------------------------------------------
@ -51,7 +51,7 @@ TMP_DIR = ${BASE_DIR}/tmp
GSTREAMER_VERSION = gstreamer-0.8.10
GSTREAMER_DIR = ${TMP_DIR}/${GSTREAMER_VERSION}
GST_PLUGINS_VERSION = gst-plugins-0.8.9
GST_PLUGINS_VERSION = gst-plugins-0.8.10
GST_PLUGINS_DIR = ${TMP_DIR}/${GST_PLUGINS_VERSION}
prefix=@prefix@

View file

@ -0,0 +1,290 @@
--- gst-plugins-0.8.10/gst/adder/gstadder.h 2005-05-17 10:41:43.000000000 +0200
+++ gst-plugins-0.8.10-livesupport/gst/adder/gstadder.h 2005-08-26 10:58:46.000000000 +0200
@@ -65,6 +65,8 @@
GstPad *srcpad;
+ GstCaps *caps;
+
/* keep track of the sinkpads */
guint numsinkpads;
GSList *input_channels;
--- gst-plugins-0.8.10/gst/adder/gstadder.c 2005-06-14 18:38:01.000000000 +0200
+++ gst-plugins-0.8.10-livesupport/gst/adder/gstadder.c 2005-08-26 12:07:30.000000000 +0200
@@ -64,7 +64,8 @@
{
ARG_0,
ARG_NUM_PADS,
- ARG_EOS
+ ARG_EOS,
+ ARG_CAPS
/* FILL ME */
};
@@ -86,6 +87,7 @@
static void gst_adder_class_init (GstAdderClass * klass);
static void gst_adder_init (GstAdder * adder);
+static void gst_adder_dispose (GObject * object);
static void gst_adder_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
@@ -101,6 +103,8 @@
/* we do need a loop function */
static void gst_adder_loop (GstElement * element);
+static void gst_adder_set_caps(GstAdder * adder,
+ const GstCaps * caps);
static GstCaps *gst_adder_get_caps (GstPad * pad);
static GstElementClass *parent_class = NULL;
@@ -131,13 +135,11 @@
static GstPadLinkReturn
gst_adder_link (GstPad * pad, const GstCaps * caps)
{
- GstAdder *adder;
- const char *media_type;
- const GList *pads;
- GstStructure *structure;
- GstPadLinkReturn ret;
- GstElement *element;
- const GSList *links;
+ GstAdder * adder;
+ const GList * pads;
+ GstPadLinkReturn ret;
+ GstElement * element;
+ GSList * links;
g_return_val_if_fail (caps != NULL, GST_PAD_LINK_REFUSED);
g_return_val_if_fail (pad != NULL, GST_PAD_LINK_REFUSED);
@@ -145,41 +147,42 @@
element = GST_PAD_PARENT (pad);
adder = GST_ADDER (element);
- pads = gst_element_get_pad_list (element);
- while (pads) {
- GstPad *otherpad = GST_PAD (pads->data);
-
- if (otherpad != pad) {
- ret = gst_pad_try_set_caps (otherpad, caps);
- if (ret == GST_PAD_LINK_REFUSED ||
- (otherpad == adder->srcpad && GST_PAD_LINK_FAILED (ret))) {
- return ret;
+ if (adder->caps != NULL) {
+ pads = gst_element_get_pad_list (element);
+ while (pads) {
+ GstPad *otherpad = GST_PAD (pads->data);
+
+ if (otherpad != pad) {
+ ret = gst_pad_try_set_caps (otherpad, adder->caps);
+ if (ret == GST_PAD_LINK_REFUSED ||
+ (otherpad == adder->srcpad && GST_PAD_LINK_FAILED (ret))) {
+ return ret;
+ }
}
+ pads = g_list_next (pads);
+ }
+ } else {
+ pads = gst_element_get_pad_list (element);
+ while (pads) {
+ GstPad *otherpad = GST_PAD (pads->data);
+
+ if (otherpad != pad) {
+ ret = gst_pad_try_set_caps (otherpad, caps);
+ if (ret == GST_PAD_LINK_REFUSED ||
+ (otherpad == adder->srcpad && GST_PAD_LINK_FAILED (ret))) {
+ return ret;
+ }
+ }
+ pads = g_list_next (pads);
}
- pads = g_list_next (pads);
- }
- structure = gst_caps_get_structure (caps, 0);
- media_type = gst_structure_get_name (structure);
- if (strcmp (media_type, "audio/x-raw-int") == 0) {
- GST_DEBUG ("parse_caps sets adder to format int");
- adder->format = GST_ADDER_FORMAT_INT;
- gst_structure_get_int (structure, "width", &adder->width);
- gst_structure_get_int (structure, "depth", &adder->depth);
- gst_structure_get_int (structure, "endianness", &adder->endianness);
- gst_structure_get_boolean (structure, "signed", &adder->is_signed);
- gst_structure_get_int (structure, "channels", &adder->channels);
- gst_structure_get_int (structure, "rate", &adder->rate);
- } else if (strcmp (media_type, "audio/x-raw-float") == 0) {
- GST_DEBUG ("parse_caps sets adder to format float");
- adder->format = GST_ADDER_FORMAT_FLOAT;
- gst_structure_get_int (structure, "width", &adder->width);
- gst_structure_get_int (structure, "channels", &adder->channels);
- gst_structure_get_int (structure, "rate", &adder->rate);
+ /* set our caps, if all try_set_caps succeeded */
+ gst_adder_set_caps(adder, caps);
+
}
for (links = adder->input_channels;
- links != NULL; links = g_slist_next (links)) {
+ links != NULL; links = g_slist_next (links)) {
GstAdderInputChannel *input = (GstAdderInputChannel *) links->data;
if (input->sinkpad == pad) {
@@ -200,6 +203,8 @@
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
+ gobject_class->dispose = gst_adder_dispose;
+
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_adder_src_template));
gst_element_class_add_pad_template (gstelement_class,
@@ -217,6 +222,11 @@
"generate an EOS when all input channels did", FALSE,
G_PARAM_READWRITE));
+ g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_CAPS,
+ g_param_spec_pointer ("caps", "pad capabilities",
+ "fix all adder capabilities to supplied value",
+ G_PARAM_READWRITE));
+
gobject_class->get_property = gst_adder_get_property;
gobject_class->set_property = gst_adder_set_property;
@@ -226,6 +236,44 @@
}
static void
+gst_adder_set_caps(GstAdder * adder,
+ const GstCaps * caps)
+{
+ GstStructure * structure;
+ const char * media_type;
+
+ if (adder == NULL || !GST_IS_ADDER(adder)
+ || caps == NULL || !GST_IS_CAPS(caps)) {
+
+ return;
+ }
+ if (adder->caps != NULL) {
+ gst_caps_free(adder->caps);
+ }
+
+ adder->caps = gst_caps_copy(caps);
+
+ structure = gst_caps_get_structure (adder->caps, 0);
+ media_type = gst_structure_get_name (structure);
+ if (strcmp (media_type, "audio/x-raw-int") == 0) {
+ GST_DEBUG ("parse_caps sets adder to format int");
+ adder->format = GST_ADDER_FORMAT_INT;
+ gst_structure_get_int (structure, "width", &adder->width);
+ gst_structure_get_int (structure, "depth", &adder->depth);
+ gst_structure_get_int (structure, "endianness", &adder->endianness);
+ gst_structure_get_boolean (structure, "signed", &adder->is_signed);
+ gst_structure_get_int (structure, "channels", &adder->channels);
+ gst_structure_get_int (structure, "rate", &adder->rate);
+ } else if (strcmp (media_type, "audio/x-raw-float") == 0) {
+ GST_DEBUG ("parse_caps sets adder to format float");
+ adder->format = GST_ADDER_FORMAT_FLOAT;
+ gst_structure_get_int (structure, "width", &adder->width);
+ gst_structure_get_int (structure, "channels", &adder->channels);
+ gst_structure_get_int (structure, "rate", &adder->rate);
+ }
+}
+
+static void
gst_adder_init (GstAdder * adder)
{
adder->srcpad =
@@ -238,6 +286,8 @@
adder->format = GST_ADDER_FORMAT_UNSET;
+ adder->caps = NULL;
+
/* keep track of the sinkpads requested */
adder->numsinkpads = 0;
@@ -246,6 +296,18 @@
adder->eos = FALSE;
}
+static void
+gst_adder_dispose(GObject * object)
+{
+ GstAdder * adder = GST_ADDER(object);
+
+ g_return_if_fail(GST_IS_ADDER(adder));
+ if (adder->caps) {
+ gst_caps_free(adder->caps);
+ }
+ G_OBJECT_CLASS(parent_class)->dispose(object);
+}
+
static GstPad *
gst_adder_request_new_pad (GstElement * element, GstPadTemplate * templ,
const gchar * unused)
@@ -339,6 +401,9 @@
case ARG_EOS:
g_value_set_boolean (value, adder->eos);
break;
+ case ARG_CAPS:
+ g_value_set_pointer (value, adder->caps);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -360,6 +425,9 @@
case ARG_EOS:
adder->eos = g_value_get_boolean (value);
break;
+ case ARG_CAPS:
+ gst_adder_set_caps(adder, g_value_get_pointer(value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -613,23 +681,28 @@
gst_adder_get_caps (GstPad * pad)
{
GstAdder *adder = GST_ADDER (gst_pad_get_parent (pad));
- GstCaps *caps = gst_caps_new_any ();
- GstCaps *tmp, *res;
- GstPad *otherpad;
- const GList *pads;
-
- for (pads = gst_element_get_pad_list (GST_ELEMENT (adder));
- pads != NULL; pads = pads->next) {
- otherpad = GST_PAD (pads->data);
-
- tmp = gst_pad_get_allowed_caps (otherpad);
- res = gst_caps_intersect (caps, tmp);
- gst_caps_free (tmp);
- gst_caps_free (caps);
- caps = res;
- }
- return caps;
+ if (adder->caps != NULL) {
+ return gst_caps_copy(adder->caps);
+ } else {
+ GstCaps *caps = gst_caps_new_any ();
+ GstCaps *tmp, *res;
+ GstPad *otherpad;
+ const GList *pads;
+
+ for (pads = gst_element_get_pad_list (GST_ELEMENT (adder));
+ pads != NULL; pads = pads->next) {
+ otherpad = GST_PAD (pads->data);
+
+ tmp = gst_pad_get_allowed_caps (otherpad);
+ res = gst_caps_intersect (caps, tmp);
+ gst_caps_free (tmp);
+ gst_caps_free (caps);
+ caps = res;
+ }
+
+ return caps;
+ }
}
static gboolean