Commit 068ee888 authored by Wim Taymans's avatar Wim Taymans

update for child proxy api change

parent 3d61d12e
...@@ -307,12 +307,12 @@ gst_iir_equalizer_band_get_type (void) ...@@ -307,12 +307,12 @@ gst_iir_equalizer_band_get_type (void)
/* child proxy iface */ /* child proxy iface */
static GstObject * static GObject *
gst_iir_equalizer_child_proxy_get_child_by_index (GstChildProxy * child_proxy, gst_iir_equalizer_child_proxy_get_child_by_index (GstChildProxy * child_proxy,
guint index) guint index)
{ {
GstIirEqualizer *equ = GST_IIR_EQUALIZER (child_proxy); GstIirEqualizer *equ = GST_IIR_EQUALIZER (child_proxy);
GstObject *ret; GObject *ret;
BANDS_LOCK (equ); BANDS_LOCK (equ);
if (G_UNLIKELY (index >= equ->freq_band_count)) { if (G_UNLIKELY (index >= equ->freq_band_count)) {
...@@ -320,7 +320,7 @@ gst_iir_equalizer_child_proxy_get_child_by_index (GstChildProxy * child_proxy, ...@@ -320,7 +320,7 @@ gst_iir_equalizer_child_proxy_get_child_by_index (GstChildProxy * child_proxy,
g_return_val_if_fail (index < equ->freq_band_count, NULL); g_return_val_if_fail (index < equ->freq_band_count, NULL);
} }
ret = gst_object_ref (equ->bands[index]); ret = g_object_ref (equ->bands[index]);
BANDS_UNLOCK (equ); BANDS_UNLOCK (equ);
GST_LOG_OBJECT (equ, "return child[%d] %" GST_PTR_FORMAT, index, ret); GST_LOG_OBJECT (equ, "return child[%d] %" GST_PTR_FORMAT, index, ret);
...@@ -653,15 +653,15 @@ gst_iir_equalizer_compute_frequencies (GstIirEqualizer * equ, guint new_count) ...@@ -653,15 +653,15 @@ gst_iir_equalizer_compute_frequencies (GstIirEqualizer * equ, guint new_count)
GST_DEBUG ("adding band[%d]=%p", i, equ->bands[i]); GST_DEBUG ("adding band[%d]=%p", i, equ->bands[i]);
gst_object_set_parent (GST_OBJECT (equ->bands[i]), GST_OBJECT (equ)); gst_object_set_parent (GST_OBJECT (equ->bands[i]), GST_OBJECT (equ));
gst_child_proxy_child_added (GST_OBJECT (equ), gst_child_proxy_child_added (G_OBJECT (equ),
GST_OBJECT (equ->bands[i])); G_OBJECT (equ->bands[i]), name);
} }
} else { } else {
/* free unused bands */ /* free unused bands */
for (i = new_count; i < old_count; i++) { for (i = new_count; i < old_count; i++) {
GST_DEBUG ("removing band[%d]=%p", i, equ->bands[i]); GST_DEBUG ("removing band[%d]=%p", i, equ->bands[i]);
gst_child_proxy_child_removed (GST_OBJECT (equ), gst_child_proxy_child_removed (G_OBJECT (equ),
GST_OBJECT (equ->bands[i])); G_OBJECT (equ->bands[i]), GST_OBJECT_NAME (equ->bands[i]));
gst_object_unparent (GST_OBJECT (equ->bands[i])); gst_object_unparent (GST_OBJECT (equ->bands[i]));
equ->bands[i] = NULL; equ->bands[i] = NULL;
} }
......
...@@ -150,34 +150,34 @@ gst_iir_equalizer_10bands_set_property (GObject * object, guint prop_id, ...@@ -150,34 +150,34 @@ gst_iir_equalizer_10bands_set_property (GObject * object, guint prop_id,
switch (prop_id) { switch (prop_id) {
case PROP_BAND0: case PROP_BAND0:
gst_child_proxy_set_property (GST_OBJECT (equ), "band0::gain", value); gst_child_proxy_set_property (G_OBJECT (equ), "band0::gain", value);
break; break;
case PROP_BAND1: case PROP_BAND1:
gst_child_proxy_set_property (GST_OBJECT (equ), "band1::gain", value); gst_child_proxy_set_property (G_OBJECT (equ), "band1::gain", value);
break; break;
case PROP_BAND2: case PROP_BAND2:
gst_child_proxy_set_property (GST_OBJECT (equ), "band2::gain", value); gst_child_proxy_set_property (G_OBJECT (equ), "band2::gain", value);
break; break;
case PROP_BAND3: case PROP_BAND3:
gst_child_proxy_set_property (GST_OBJECT (equ), "band3::gain", value); gst_child_proxy_set_property (G_OBJECT (equ), "band3::gain", value);
break; break;
case PROP_BAND4: case PROP_BAND4:
gst_child_proxy_set_property (GST_OBJECT (equ), "band4::gain", value); gst_child_proxy_set_property (G_OBJECT (equ), "band4::gain", value);
break; break;
case PROP_BAND5: case PROP_BAND5:
gst_child_proxy_set_property (GST_OBJECT (equ), "band5::gain", value); gst_child_proxy_set_property (G_OBJECT (equ), "band5::gain", value);
break; break;
case PROP_BAND6: case PROP_BAND6:
gst_child_proxy_set_property (GST_OBJECT (equ), "band6::gain", value); gst_child_proxy_set_property (G_OBJECT (equ), "band6::gain", value);
break; break;
case PROP_BAND7: case PROP_BAND7:
gst_child_proxy_set_property (GST_OBJECT (equ), "band7::gain", value); gst_child_proxy_set_property (G_OBJECT (equ), "band7::gain", value);
break; break;
case PROP_BAND8: case PROP_BAND8:
gst_child_proxy_set_property (GST_OBJECT (equ), "band8::gain", value); gst_child_proxy_set_property (G_OBJECT (equ), "band8::gain", value);
break; break;
case PROP_BAND9: case PROP_BAND9:
gst_child_proxy_set_property (GST_OBJECT (equ), "band9::gain", value); gst_child_proxy_set_property (G_OBJECT (equ), "band9::gain", value);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
...@@ -193,34 +193,34 @@ gst_iir_equalizer_10bands_get_property (GObject * object, guint prop_id, ...@@ -193,34 +193,34 @@ gst_iir_equalizer_10bands_get_property (GObject * object, guint prop_id,
switch (prop_id) { switch (prop_id) {
case PROP_BAND0: case PROP_BAND0:
gst_child_proxy_get_property (GST_OBJECT (equ), "band0::gain", value); gst_child_proxy_get_property (G_OBJECT (equ), "band0::gain", value);
break; break;
case PROP_BAND1: case PROP_BAND1:
gst_child_proxy_get_property (GST_OBJECT (equ), "band1::gain", value); gst_child_proxy_get_property (G_OBJECT (equ), "band1::gain", value);
break; break;
case PROP_BAND2: case PROP_BAND2:
gst_child_proxy_get_property (GST_OBJECT (equ), "band2::gain", value); gst_child_proxy_get_property (G_OBJECT (equ), "band2::gain", value);
break; break;
case PROP_BAND3: case PROP_BAND3:
gst_child_proxy_get_property (GST_OBJECT (equ), "band3::gain", value); gst_child_proxy_get_property (G_OBJECT (equ), "band3::gain", value);
break; break;
case PROP_BAND4: case PROP_BAND4:
gst_child_proxy_get_property (GST_OBJECT (equ), "band4::gain", value); gst_child_proxy_get_property (G_OBJECT (equ), "band4::gain", value);
break; break;
case PROP_BAND5: case PROP_BAND5:
gst_child_proxy_get_property (GST_OBJECT (equ), "band5::gain", value); gst_child_proxy_get_property (G_OBJECT (equ), "band5::gain", value);
break; break;
case PROP_BAND6: case PROP_BAND6:
gst_child_proxy_get_property (GST_OBJECT (equ), "band6::gain", value); gst_child_proxy_get_property (G_OBJECT (equ), "band6::gain", value);
break; break;
case PROP_BAND7: case PROP_BAND7:
gst_child_proxy_get_property (GST_OBJECT (equ), "band7::gain", value); gst_child_proxy_get_property (G_OBJECT (equ), "band7::gain", value);
break; break;
case PROP_BAND8: case PROP_BAND8:
gst_child_proxy_get_property (GST_OBJECT (equ), "band8::gain", value); gst_child_proxy_get_property (G_OBJECT (equ), "band8::gain", value);
break; break;
case PROP_BAND9: case PROP_BAND9:
gst_child_proxy_get_property (GST_OBJECT (equ), "band9::gain", value); gst_child_proxy_get_property (G_OBJECT (equ), "band9::gain", value);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......
...@@ -105,13 +105,13 @@ gst_iir_equalizer_3bands_set_property (GObject * object, guint prop_id, ...@@ -105,13 +105,13 @@ gst_iir_equalizer_3bands_set_property (GObject * object, guint prop_id,
switch (prop_id) { switch (prop_id) {
case PROP_BAND0: case PROP_BAND0:
gst_child_proxy_set_property (GST_OBJECT (equ), "band0::gain", value); gst_child_proxy_set_property (G_OBJECT (equ), "band0::gain", value);
break; break;
case PROP_BAND1: case PROP_BAND1:
gst_child_proxy_set_property (GST_OBJECT (equ), "band1::gain", value); gst_child_proxy_set_property (G_OBJECT (equ), "band1::gain", value);
break; break;
case PROP_BAND2: case PROP_BAND2:
gst_child_proxy_set_property (GST_OBJECT (equ), "band2::gain", value); gst_child_proxy_set_property (G_OBJECT (equ), "band2::gain", value);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
...@@ -127,13 +127,13 @@ gst_iir_equalizer_3bands_get_property (GObject * object, guint prop_id, ...@@ -127,13 +127,13 @@ gst_iir_equalizer_3bands_get_property (GObject * object, guint prop_id,
switch (prop_id) { switch (prop_id) {
case PROP_BAND0: case PROP_BAND0:
gst_child_proxy_get_property (GST_OBJECT (equ), "band0::gain", value); gst_child_proxy_get_property (G_OBJECT (equ), "band0::gain", value);
break; break;
case PROP_BAND1: case PROP_BAND1:
gst_child_proxy_get_property (GST_OBJECT (equ), "band1::gain", value); gst_child_proxy_get_property (G_OBJECT (equ), "band1::gain", value);
break; break;
case PROP_BAND2: case PROP_BAND2:
gst_child_proxy_get_property (GST_OBJECT (equ), "band2::gain", value); gst_child_proxy_get_property (G_OBJECT (equ), "band2::gain", value);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
......
...@@ -1812,7 +1812,8 @@ gst_videomixer2_request_new_pad (GstElement * element, ...@@ -1812,7 +1812,8 @@ gst_videomixer2_request_new_pad (GstElement * element,
/* add the pad to the element */ /* add the pad to the element */
gst_element_add_pad (element, GST_PAD (mixpad)); gst_element_add_pad (element, GST_PAD (mixpad));
gst_child_proxy_child_added (GST_OBJECT (mix), GST_OBJECT (mixpad)); gst_child_proxy_child_added (G_OBJECT (mix), G_OBJECT (mixpad),
GST_OBJECT_NAME (mixpad));
return GST_PAD (mixpad); return GST_PAD (mixpad);
} }
...@@ -1835,7 +1836,8 @@ gst_videomixer2_release_pad (GstElement * element, GstPad * pad) ...@@ -1835,7 +1836,8 @@ gst_videomixer2_release_pad (GstElement * element, GstPad * pad)
mixpad = GST_VIDEO_MIXER2_PAD (pad); mixpad = GST_VIDEO_MIXER2_PAD (pad);
mix->sinkpads = g_slist_remove (mix->sinkpads, pad); mix->sinkpads = g_slist_remove (mix->sinkpads, pad);
gst_child_proxy_child_removed (GST_OBJECT (mix), GST_OBJECT (mixpad)); gst_child_proxy_child_removed (G_OBJECT (mix), G_OBJECT (mixpad),
GST_OBJECT_NAME (mixpad));
mix->numpads--; mix->numpads--;
update_caps = GST_VIDEO_INFO_FORMAT (&mix->info) != GST_VIDEO_FORMAT_UNKNOWN; update_caps = GST_VIDEO_INFO_FORMAT (&mix->info) != GST_VIDEO_FORMAT_UNKNOWN;
...@@ -1897,16 +1899,16 @@ gst_videomixer2_set_property (GObject * object, ...@@ -1897,16 +1899,16 @@ gst_videomixer2_set_property (GObject * object,
} }
/* GstChildProxy implementation */ /* GstChildProxy implementation */
static GstObject * static GObject *
gst_videomixer2_child_proxy_get_child_by_index (GstChildProxy * child_proxy, gst_videomixer2_child_proxy_get_child_by_index (GstChildProxy * child_proxy,
guint index) guint index)
{ {
GstVideoMixer2 *mix = GST_VIDEO_MIXER2 (child_proxy); GstVideoMixer2 *mix = GST_VIDEO_MIXER2 (child_proxy);
GstObject *obj; GObject *obj;
GST_VIDEO_MIXER2_LOCK (mix); GST_VIDEO_MIXER2_LOCK (mix);
if ((obj = g_slist_nth_data (mix->sinkpads, index))) if ((obj = g_slist_nth_data (mix->sinkpads, index)))
gst_object_ref (obj); g_object_ref (obj);
GST_VIDEO_MIXER2_UNLOCK (mix); GST_VIDEO_MIXER2_UNLOCK (mix);
return obj; return obj;
} }
......
...@@ -153,12 +153,12 @@ GST_START_TEST (test_equalizer_5bands_minus_24) ...@@ -153,12 +153,12 @@ GST_START_TEST (test_equalizer_5bands_minus_24)
(equalizer)), 5); (equalizer)), 5);
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
GstObject *band = GObject *band =
gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (equalizer), i); gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (equalizer), i);
fail_unless (band != NULL); fail_unless (band != NULL);
g_object_set (G_OBJECT (band), "gain", -24.0, NULL); g_object_set (band, "gain", -24.0, NULL);
g_object_unref (G_OBJECT (band)); g_object_unref (band);
} }
fail_unless (gst_element_set_state (equalizer, fail_unless (gst_element_set_state (equalizer,
...@@ -221,12 +221,12 @@ GST_START_TEST (test_equalizer_5bands_plus_12) ...@@ -221,12 +221,12 @@ GST_START_TEST (test_equalizer_5bands_plus_12)
(equalizer)), 5); (equalizer)), 5);
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
GstObject *band = GObject *band =
gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (equalizer), i); gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (equalizer), i);
fail_unless (band != NULL); fail_unless (band != NULL);
g_object_set (G_OBJECT (band), "gain", 12.0, NULL); g_object_set (band, "gain", 12.0, NULL);
g_object_unref (G_OBJECT (band)); g_object_unref (band);
} }
fail_unless (gst_element_set_state (equalizer, fail_unless (gst_element_set_state (equalizer,
...@@ -285,11 +285,11 @@ GST_START_TEST (test_equalizer_band_number_changing) ...@@ -285,11 +285,11 @@ GST_START_TEST (test_equalizer_band_number_changing)
(equalizer)), 5); (equalizer)), 5);
for (i = 0; i < 5; i++) { for (i = 0; i < 5; i++) {
GstObject *band; GObject *band;
band = gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (equalizer), i); band = gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (equalizer), i);
fail_unless (band != NULL); fail_unless (band != NULL);
gst_object_unref (band); g_object_unref (band);
} }
g_object_set (G_OBJECT (equalizer), "num-bands", 10, NULL); g_object_set (G_OBJECT (equalizer), "num-bands", 10, NULL);
...@@ -297,11 +297,11 @@ GST_START_TEST (test_equalizer_band_number_changing) ...@@ -297,11 +297,11 @@ GST_START_TEST (test_equalizer_band_number_changing)
(equalizer)), 10); (equalizer)), 10);
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
GstObject *band; GObject *band;
band = gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (equalizer), i); band = gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (equalizer), i);
fail_unless (band != NULL); fail_unless (band != NULL);
gst_object_unref (band); g_object_unref (band);
} }
/* cleanup */ /* cleanup */
......
...@@ -188,7 +188,7 @@ main (int argc, char *argv[]) ...@@ -188,7 +188,7 @@ main (int argc, char *argv[])
hbox = gtk_hbox_new (FALSE, 20); hbox = gtk_hbox_new (FALSE, 20);
for (i = 0; i < NBANDS; i++) { for (i = 0; i < NBANDS; i++) {
GstObject *band; GObject *band;
gdouble freq; gdouble freq;
gdouble bw; gdouble bw;
gdouble gain; gdouble gain;
...@@ -197,9 +197,9 @@ main (int argc, char *argv[]) ...@@ -197,9 +197,9 @@ main (int argc, char *argv[])
band = gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (equalizer), i); band = gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (equalizer), i);
g_assert (band != NULL); g_assert (band != NULL);
g_object_get (G_OBJECT (band), "freq", &freq, NULL); g_object_get (band, "freq", &freq, NULL);
g_object_get (G_OBJECT (band), "bandwidth", &bw, NULL); g_object_get (band, "bandwidth", &bw, NULL);
g_object_get (G_OBJECT (band), "gain", &gain, NULL); g_object_get (band, "gain", &gain, NULL);
label = g_strdup_printf ("%d Hz", (int) (freq + 0.5)); label = g_strdup_printf ("%d Hz", (int) (freq + 0.5));
frame = gtk_frame_new (label); frame = gtk_frame_new (label);
......
...@@ -72,11 +72,11 @@ check_bus (GstClockTime max_wait_time) ...@@ -72,11 +72,11 @@ check_bus (GstClockTime max_wait_time)
static void static void
equalizer_set_band_value (GstElement * eq, guint band, gdouble val) equalizer_set_band_value (GstElement * eq, guint band, gdouble val)
{ {
GstObject *child; GObject *child;
child = gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (eq), band); child = gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (eq), band);
g_object_set (child, "gain", val, NULL); g_object_set (child, "gain", val, NULL);
gst_object_unref (child); g_object_unref (child);
g_print ("Band %2d: %.2f\n", band, val); g_print ("Band %2d: %.2f\n", band, val);
} }
...@@ -84,12 +84,12 @@ static void ...@@ -84,12 +84,12 @@ static void
equalizer_set_all_band_values (GstElement * eq, guint num, gdouble val) equalizer_set_all_band_values (GstElement * eq, guint num, gdouble val)
{ {
gint i; gint i;
GstObject *child; GObject *child;
for (i = 0; i < num; i++) { for (i = 0; i < num; i++) {
child = gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (eq), i); child = gst_child_proxy_get_child_by_index (GST_CHILD_PROXY (eq), i);
g_object_set (child, "gain", val, NULL); g_object_set (child, "gain", val, NULL);
gst_object_unref (child); g_object_unref (child);
} }
g_print ("All bands: %.2f\n", val); g_print ("All bands: %.2f\n", val);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment