Commit c79ea002 authored by Benjamin Berg's avatar Benjamin Berg
Browse files

wfd: Request and parse some microsoft extensions

parent e26469e1
......@@ -27,6 +27,8 @@ static const gchar * params_m3_optional[] = {
static const gchar *params_m3_query_extra[] = {
"wfd_display_edid",
"wfd_idr_request_capability",
"microsoft_cursor",
};
/**
......@@ -298,6 +300,39 @@ wfd_params_from_sink (WfdParams *self, const guint8 *body, gsize body_size)
self->edid->data[i] = byte;
}
}
else if (g_str_equal (option, "wfd_idr_request_capability"))
{
/* Assume IDR request capable if it is the string one */
self->idr_request_capability = g_str_equal (value, "1");
}
else if (g_str_equal (option, "microsoft_cursor"))
{
g_auto(GStrv) split_value = NULL;
self->ms_cursor_capability = FALSE;
if (g_str_equal (value, "none"))
continue;
split_value = g_strsplit (value, " ", 5);
if (g_strv_length (split_value) != 4)
{
g_warning ("WfdParams: Unknown microsoft_cursor value %s", value);
continue;
}
/* The first argument is either "none" or "full" where "full" means that
* the hardware supports XOR blending (which we don't support). */
self->ms_cursor_width = g_ascii_strtoll (split_value[1], NULL, 16);
self->ms_cursor_height = g_ascii_strtoll (split_value[2], NULL, 16);
self->ms_cursor_port = g_ascii_strtoll (split_value[3], NULL, 16);
/* Do some sanity checks, and set capable to TRUE if everything is good. */
if (self->ms_cursor_width >= 32 && self->ms_cursor_height >= 32 && self->ms_cursor_port >= 0)
self->ms_cursor_capability = TRUE;
else
g_warning ("WfdParams: microsoft_cursor extension has odd values: \"%s\"", value);
}
else
{
g_debug ("WfdParams: Not handling option %s", option);
......
......@@ -15,6 +15,12 @@ struct _WfdParams
guint16 secondary_rtp_port;
GByteArray *edid;
gboolean idr_request_capability;
gboolean ms_cursor_capability;
guint16 ms_cursor_width;
guint16 ms_cursor_height;
guint16 ms_cursor_port;
WfdVideoCodec *selected_codec;
WfdResolution *selected_resolution;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment