Skip to content

Commit

Permalink
media: Populate location to qos structure
Browse files Browse the repository at this point in the history
Allow clients to register Location for endpoint.
  • Loading branch information
kirankrishnappa-intel authored and Vudentz committed Oct 20, 2023
1 parent 8a33509 commit a1fb50f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions profiles/audio/media.c
Original file line number Diff line number Diff line change
Expand Up @@ -1610,6 +1610,10 @@ static int parse_properties(DBusMessageIter *props, const char **uuid,
if (var != DBUS_TYPE_UINT16)
return -EINVAL;
dbus_message_iter_get_basic(&value, &qos->ppd_max);
} else if (strcasecmp(key, "Locations") == 0) {
if (var != DBUS_TYPE_UINT32)
return -EINVAL;
dbus_message_iter_get_basic(&value, &qos->location);
}

dbus_message_iter_next(props);
Expand Down Expand Up @@ -2800,6 +2804,13 @@ static void app_register_endpoint(void *data, void *user_data)
dbus_message_iter_get_basic(&iter, &qos.ppd_min);
}

if (g_dbus_proxy_get_property(proxy, "Locations", &iter)) {
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_UINT32)
goto fail;

dbus_message_iter_get_basic(&iter, &qos.location);
}

endpoint = media_endpoint_create(app->adapter, app->sender, path, uuid,
delay_reporting, codec,
vendor.cid, vendor.vid, &qos,
Expand Down

0 comments on commit a1fb50f

Please sign in to comment.