summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@gnome.org>2009-10-19 16:45:24 +0200
committerBenjamin Otte <otte@gnome.org>2009-10-19 16:45:24 +0200
commitfbc83169fd779117019dd3b392c460399d76fba3 (patch)
tree6305a795415c85ab9dfc38868ac43302219b686d
parent760c03495d74d51751f03b764e36a80684257845 (diff)
Use gst_caps_set_{simple,value} instead of our own functions
The functions are in gstreamer 0.10.26
-rw-r--r--configure.ac2
-rw-r--r--gst-libs/gst/cairo/gstcairocaps.c74
-rw-r--r--gst-libs/gst/cairo/gstcairocaps.h9
-rw-r--r--gst-libs/gst/cairo/gstcairoformat.c9
-rw-r--r--gst/cairo/gstcairomixer.c2
5 files changed, 13 insertions, 83 deletions
diff --git a/configure.ac b/configure.ac
index d5d17dc..87c6916 100644
--- a/configure.ac
+++ b/configure.ac
@@ -59,7 +59,7 @@ AM_PROG_LIBTOOL
AS_PROG_OBJC
dnl *** required versions of GStreamer stuff ***
-GST_REQ=0.10.24.1
+GST_REQ=0.10.25.1
GSTPB_REQ=0.10.24.1
dnl *** autotools stuff ****
diff --git a/gst-libs/gst/cairo/gstcairocaps.c b/gst-libs/gst/cairo/gstcairocaps.c
index 6e97294..9836c5f 100644
--- a/gst-libs/gst/cairo/gstcairocaps.c
+++ b/gst-libs/gst/cairo/gstcairocaps.c
@@ -28,66 +28,6 @@
#include "gstcairocapsany.h"
-#define gst_caps_get_structure_unchecked gst_caps_get_structure
-#define IS_WRITABLE(caps) (g_atomic_int_get (&(caps)->refcount) == 1)
-void
-gst_cairo_caps_set_value (GstCaps * caps, const char *field,
- const GValue * value)
-{
- guint i, len;
-
- g_return_if_fail (GST_IS_CAPS (caps));
- g_return_if_fail (IS_WRITABLE (caps));
- g_return_if_fail (field != NULL);
- g_return_if_fail (G_IS_VALUE (value));
-
- len = caps->structs->len;
- for (i = 0; i < len; i++) {
- GstStructure *structure = gst_caps_get_structure_unchecked (caps, i);
- gst_structure_set_value (structure, field, value);
- }
-}
-
-void
-gst_cairo_caps_set_simple (GstCaps * caps, const char *field, ...)
-{
- GValue value = { 0, };
- va_list varargs;
-
- g_return_if_fail (GST_IS_CAPS (caps));
- g_return_if_fail (IS_WRITABLE (caps));
-
- va_start (varargs, field);
- while (field) {
- GType type;
- char *err;
-
- type = va_arg (varargs, GType);
-
- if (G_UNLIKELY (type == G_TYPE_DATE)) {
- g_warning ("Don't use G_TYPE_DATE, use GST_TYPE_DATE instead\n");
- type = GST_TYPE_DATE;
- }
-
- g_value_init (&value, type);
- G_VALUE_COLLECT (&value, varargs, 0, &err);
- if (G_UNLIKELY (err)) {
- g_critical ("%s", err);
- return;
- }
-
- gst_cairo_caps_set_value (caps, field, &value);
-
- g_value_unset (&value);
-
- field = va_arg (varargs, const gchar *);
- }
- va_end (varargs);
-}
-
-#undef gst_caps_get_structure_unchecked
-#undef IS_WRITABLE
-
/**
* gst_cairo_caps_any:
*
@@ -147,26 +87,26 @@ gst_cairo_caps_expand (const GstCaps * caps, GstCairoFormatOption expand)
}
if (expand & GST_CAIRO_FORMAT_WIDTH) {
- gst_cairo_caps_set_simple (copy, "width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
+ gst_caps_set_simple (copy, "width", GST_TYPE_INT_RANGE, 1, G_MAXINT,
NULL);
} else {
- gst_cairo_caps_set_value (copy, "width",
+ gst_caps_set_value (copy, "width",
gst_structure_get_value (expand_me, "width"));
}
if (expand & GST_CAIRO_FORMAT_HEIGHT) {
- gst_cairo_caps_set_simple (copy, "height", GST_TYPE_INT_RANGE, 1,
+ gst_caps_set_simple (copy, "height", GST_TYPE_INT_RANGE, 1,
G_MAXINT, NULL);
} else {
- gst_cairo_caps_set_value (copy, "height",
+ gst_caps_set_value (copy, "height",
gst_structure_get_value (expand_me, "height"));
}
if (expand & GST_CAIRO_FORMAT_FRAMERATE) {
- gst_cairo_caps_set_simple (copy, "framerate", GST_TYPE_FRACTION_RANGE, 0,
+ gst_caps_set_simple (copy, "framerate", GST_TYPE_FRACTION_RANGE, 0,
1, G_MAXINT, 1, NULL);
} else {
- gst_cairo_caps_set_value (copy, "framerate",
+ gst_caps_set_value (copy, "framerate",
gst_structure_get_value (expand_me, "framerate"));
}
@@ -180,7 +120,7 @@ gst_cairo_caps_expand (const GstCaps * caps, GstCairoFormatOption expand)
const GValue *value =
gst_structure_get_value (expand_me, "pixel-aspect-ratio");
if (value)
- gst_cairo_caps_set_value (copy, "pixel-aspect-ratio", value);
+ gst_caps_set_value (copy, "pixel-aspect-ratio", value);
}
gst_caps_append (expanded, copy);
diff --git a/gst-libs/gst/cairo/gstcairocaps.h b/gst-libs/gst/cairo/gstcairocaps.h
index 2541bf0..6f097dd 100644
--- a/gst-libs/gst/cairo/gstcairocaps.h
+++ b/gst-libs/gst/cairo/gstcairocaps.h
@@ -33,15 +33,6 @@ GstCaps * gst_cairo_caps_expand (const GstCaps *
GstCairoFormatOption expand);
-/* Those belong in GStreamer really */
-void gst_cairo_caps_set_value (GstCaps * caps,
- const char * field,
- const GValue * value);
-void gst_cairo_caps_set_simple (GstCaps * caps,
- const char * field,
- ...);
-
-
G_END_DECLS
#endif /* __GST_CAIRO_CAPS_H__ */
diff --git a/gst-libs/gst/cairo/gstcairoformat.c b/gst-libs/gst/cairo/gstcairoformat.c
index 614cfc9..5bdb126 100644
--- a/gst-libs/gst/cairo/gstcairoformat.c
+++ b/gst-libs/gst/cairo/gstcairoformat.c
@@ -196,15 +196,14 @@ gst_cairo_format_to_caps (const GstCairoFormat * format,
caps = gst_caps_make_writable (caps);
if (fixed & GST_CAIRO_FORMAT_WIDTH)
- gst_cairo_caps_set_simple (caps, "width", G_TYPE_INT, format->width, NULL);
+ gst_caps_set_simple (caps, "width", G_TYPE_INT, format->width, NULL);
if (fixed & GST_CAIRO_FORMAT_HEIGHT)
- gst_cairo_caps_set_simple (caps, "height", G_TYPE_INT, format->height,
- NULL);
+ gst_caps_set_simple (caps, "height", G_TYPE_INT, format->height, NULL);
if (fixed & GST_CAIRO_FORMAT_FRAMERATE)
- gst_cairo_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION,
+ gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION,
format->framerate.num, format->framerate.denom, NULL);
if (fixed & GST_CAIRO_FORMAT_PAR && format->par.denom != 0)
- gst_cairo_caps_set_simple (caps, "pixel-aspect-ratio", GST_TYPE_FRACTION,
+ gst_caps_set_simple (caps, "pixel-aspect-ratio", GST_TYPE_FRACTION,
format->par.num, format->par.denom, NULL);
return caps;
diff --git a/gst/cairo/gstcairomixer.c b/gst/cairo/gstcairomixer.c
index 005c7bd..19ca656 100644
--- a/gst/cairo/gstcairomixer.c
+++ b/gst/cairo/gstcairomixer.c
@@ -345,7 +345,7 @@ gst_cairo_mixer_getcaps (GstPad * pad)
caps = gst_cairo_caps_any ();
gst_cairo_format_get_frame_rate (master->format, &fps_n, &fps_d);
- gst_cairo_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION, fps_n, fps_d,
+ gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION, fps_n, fps_d,
NULL);
gst_object_unref (mixer);