Created
August 25, 2019 00:53
-
-
Save steve-ayerhart/219289469f3b0e0ec368439d99d8df8e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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