GstStaticPadTemplate *templ = walk->data;
GstCaps *caps = gst_static_pad_template_get_caps (templ);
guint leng = gst_caps_get_size (caps);
+ guint i, j;
- for (guint i = 0; !retval && i < leng; ++i) {
+ for (i = 0; !retval && i < leng; ++i) {
GstStructure *st;
st = gst_caps_get_structure (caps, i);
gst_structure_get_string (st, GST_PROTECTION_SYSTEM_ID_CAPS_FIELD);
GST_DEBUG ("Found decryptor that supports protection system %s",
sys_id);
- for (guint j = 0; !retval && system_identifiers[j]; ++j) {
+ for (j = 0; !retval && system_identifiers[j]; ++j) {
GST_TRACE (" compare with %s", system_identifiers[j]);
if (g_ascii_strcasecmp (system_identifiers[j], sys_id) == 0) {
GST_DEBUG (" Selecting %s", system_identifiers[j]);
GstStaticPadTemplate * hsrc, const gchar * element_sinkpad_name,
GstStaticPadTemplate * hsink, const gchar * element_srcpad_name)
{
- GstClock * element_clock;
+ GstClock *element_clock;
gboolean has_sinkpad, has_srcpad;
g_return_if_fail (element != NULL);
{
GstFlowReturn ret = GST_FLOW_OK;
gboolean crank;
+ int i;
g_assert (h->src_harness);
gst_harness_play (h->src_harness);
- for (int i = 0; i < cranks; i++) {
+ for (i = 0; i < cranks; i++) {
crank = gst_harness_crank_single_clock_wait (h->src_harness);
g_assert (crank);
}
- for (int i = 0; i < pushes; i++) {
+ for (i = 0; i < pushes; i++) {
GstBuffer *buf;
buf = gst_harness_pull (h->src_harness);
g_assert (buf != NULL);
gst_harness_sink_push_many (GstHarness * h, gint pushes)
{
GstFlowReturn ret = GST_FLOW_OK;
+ int i;
g_assert (h->sink_harness);
- for (int i = 0; i < pushes; i++) {
+ for (i = 0; i < pushes; i++) {
ret = gst_harness_push_to_sink (h);
if (ret != GST_FLOW_OK)
break;
GList *cb_list = NULL, *cb_list_it;
GstClockTime base;
GstClockReturn result;
+ unsigned int i;
clock = gst_system_clock_obtain ();
fail_unless (clock != NULL, "Could not create instance of GstSystemClock");
* We expect the alarm thread to keep detecting the new entries and to
* switch to wait on the first entry on the list
*/
- for (unsigned int i = ALARM_COUNT; i > 0; --i) {
+ for (i = ALARM_COUNT; i > 0; --i) {
id[i - 1] = gst_clock_new_single_shot_id (clock, base + i * TIME_UNIT);
result =
gst_clock_id_wait_async (id[i - 1], store_callback, &cb_list, NULL);
* Will fail if alarm thread did not properly switch to wait on first entry
* from the list
*/
- for (unsigned int i = 0; i < ALARM_COUNT; ++i) {
+ for (i = 0; i < ALARM_COUNT; ++i) {
fail_unless (cb_list_it != NULL, "No notification received for id[%d]", i);
fail_unless (cb_list_it->data == id[i],
"Expected notification for id[%d]", i);
}
g_mutex_unlock (&store_lock);
- for (unsigned int i = 0; i < ALARM_COUNT; ++i)
+ for (i = 0; i < ALARM_COUNT; ++i)
gst_clock_id_unref (id[i]);
g_list_free (cb_list);
GST_END_TEST;
-typedef struct {
+typedef struct
+{
GThread *thread_wait;
GThread *thread_unschedule;
GMutex lock;
g_mutex_lock (&d->lock);
d->unschedule = d->dont_unschedule_positive_offset ? offset < 0 : TRUE;
- id = d->id = gst_clock_new_single_shot_id (clock, now + (GstClockTime)offset);
+ id = d->id =
+ gst_clock_new_single_shot_id (clock, now + (GstClockTime) offset);
g_mutex_unlock (&d->lock);
fail_unless (id != NULL, "Could not create single shot id");
GST_START_TEST (test_stress_cleanup_unschedule)
{
WaitUnscheduleData data[50];
+ gint i;
- for (gint i = 0; i < G_N_ELEMENTS (data); i++) {
+ for (i = 0; i < G_N_ELEMENTS (data); i++) {
WaitUnscheduleData *d = &data[i];
/* Don't unschedule waits with positive offsets in order to trigger
g_usleep (G_USEC_PER_SEC);
/* Stop and free test data */
- for (gint i = 0; i < G_N_ELEMENTS (data); i++) {
+ for (i = 0; i < G_N_ELEMENTS (data); i++) {
WaitUnscheduleData *d = &data[i];
d->running = FALSE;
g_thread_join (d->thread_wait);
g_mutex_clear (&d->lock);
}
}
+
GST_END_TEST;
GST_START_TEST (test_stress_reschedule)
{
WaitUnscheduleData data[50];
+ gint i;
- for (gint i = 0; i < G_N_ELEMENTS (data); i++) {
+ for (i = 0; i < G_N_ELEMENTS (data); i++) {
WaitUnscheduleData *d = &data[i];
/* Try to unschedule all waits */
g_usleep (G_USEC_PER_SEC);
/* Stop and free test data */
- for (gint i = 0; i < G_N_ELEMENTS (data); i++) {
+ for (i = 0; i < G_N_ELEMENTS (data); i++) {
WaitUnscheduleData *d = &data[i];
d->running = FALSE;
g_thread_join (d->thread_wait);
g_mutex_clear (&d->lock);
}
}
+
GST_END_TEST;