Skip to content

Instantly share code, notes, and snippets.

@steve-ayerhart
Created August 25, 2019 00:53
Show Gist options
  • Save steve-ayerhart/219289469f3b0e0ec368439d99d8df8e to your computer and use it in GitHub Desktop.
Save steve-ayerhart/219289469f3b0e0ec368439d99d8df8e to your computer and use it in GitHub Desktop.
gboolean handle_element (GstBus *bus, GstMessage *msg, UserInterface *ui)
{
const GstStructure *s= gst_message_get_structure (msg);
guint band;
const GValue *magnitudes;
if (gst_structure_has_name (s, "spectrum"))
{
magnitudes = gst_structure_get_value (s, "magnitude");
gfloat *m;
for (band = 0; band < 128; ++band)
{
m = &g_array_index (ui->spectrum_magnitudes, gfloat, band);
*m = g_value_get_float (gst_value_list_get_value (magnitudes, band));
}
}
g_debug ("%f", g_array_index (ui->spectrum_magnitudes, gfloat, 1));
return TRUE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment