Skip to content
Snippets Groups Projects
Commit 9dac5fda authored by Julian Bouzas's avatar Julian Bouzas
Browse files

parser-streams: add get_lowest_stream API

parent 91e309ba
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,21 @@ wp_parser_streams_find_stream (const struct WpParserStreamsData *data,
return NULL;
}
const struct WpParserStreamsStreamData *
wp_parser_streams_get_lowest_stream (const struct WpParserStreamsData *data)
{
const struct WpParserStreamsStreamData *res = NULL;
guint lowest = G_MAXUINT;
for (guint i = 0; i < data->n_streams; i++) {
const struct WpParserStreamsStreamData *s = data->streams + i;
if (s->priority < lowest) {
lowest = s->priority;
res = s;
}
}
return res;
}
static void wp_parser_streams_config_parser_init (gpointer iface,
gpointer iface_data);
......
......@@ -32,6 +32,8 @@ struct WpParserStreamsData {
/* Helpers */
const struct WpParserStreamsStreamData *wp_parser_streams_find_stream (
const struct WpParserStreamsData *data, const char *name);
const struct WpParserStreamsStreamData *wp_parser_streams_get_lowest_stream (
const struct WpParserStreamsData *data);
#define WP_TYPE_PARSER_STREAMS (wp_parser_streams_get_type ())
G_DECLARE_FINAL_TYPE (WpParserStreams, wp_parser_streams,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment