mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-22 16:26:39 +00:00
Fix example apps by drawing in the main-loop.
This commit is contained in:
parent
3c1f1b195f
commit
00fdca0c14
2 changed files with 24 additions and 14 deletions
|
@ -92,17 +92,22 @@ draw_spectrum (gfloat * data)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* process delayed message */
|
/* process delayed message */
|
||||||
|
static gboolean
|
||||||
|
delayed_idle_spectrum_update (gpointer user_data)
|
||||||
|
{
|
||||||
|
draw_spectrum ((gfloat *) user_data);
|
||||||
|
g_free (user_data);
|
||||||
|
return (FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
delayed_spectrum_update (GstClock * sync_clock, GstClockTime time,
|
delayed_spectrum_update (GstClock * sync_clock, GstClockTime time,
|
||||||
GstClockID id, gpointer user_data)
|
GstClockID id, gpointer user_data)
|
||||||
{
|
{
|
||||||
if (!GST_CLOCK_TIME_IS_VALID (time))
|
if (GST_CLOCK_TIME_IS_VALID (time))
|
||||||
goto done;
|
g_idle_add (delayed_idle_spectrum_update, user_data);
|
||||||
|
else
|
||||||
draw_spectrum ((gfloat *) user_data);
|
g_free (user_data);
|
||||||
|
|
||||||
done:
|
|
||||||
g_free (user_data);
|
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,17 +81,22 @@ draw_spectrum (gfloat * data)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* process delayed message */
|
/* process delayed message */
|
||||||
|
static gboolean
|
||||||
|
delayed_idle_spectrum_update (gpointer user_data)
|
||||||
|
{
|
||||||
|
draw_spectrum ((gfloat *) user_data);
|
||||||
|
g_free (user_data);
|
||||||
|
return (FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
delayed_spectrum_update (GstClock * sync_clock, GstClockTime time,
|
delayed_spectrum_update (GstClock * sync_clock, GstClockTime time,
|
||||||
GstClockID id, gpointer user_data)
|
GstClockID id, gpointer user_data)
|
||||||
{
|
{
|
||||||
if (!GST_CLOCK_TIME_IS_VALID (time))
|
if (GST_CLOCK_TIME_IS_VALID (time))
|
||||||
goto done;
|
g_idle_add (delayed_idle_spectrum_update, user_data);
|
||||||
|
else
|
||||||
draw_spectrum ((gfloat *) user_data);
|
g_free (user_data);
|
||||||
|
|
||||||
done:
|
|
||||||
g_free (user_data);
|
|
||||||
return (TRUE);
|
return (TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue