Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Julian Bouzas
WirePlumber
Commits
9dac5fda
Commit
9dac5fda
authored
Dec 05, 2019
by
Julian Bouzas
Browse files
parser-streams: add get_lowest_stream API
parent
91e309ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/module-config-policy/parser-streams.c
View file @
9dac5fda
...
...
@@ -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
);
...
...
modules/module-config-policy/parser-streams.h
View file @
9dac5fda
...
...
@@ -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
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment