mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-24 22:50:03 +01:00
module-avb: avdecc: use enum instead of a boolean for avb mode (milan vs legacy avb)
This commit is contained in:
parent
9f1c11ac34
commit
f3d0642994
2 changed files with 18 additions and 4 deletions
|
|
@ -253,10 +253,10 @@ struct server *avdecc_server_new(struct impl *impl, struct spa_dict *props)
|
||||||
str = spa_dict_lookup(props, "ifname");
|
str = spa_dict_lookup(props, "ifname");
|
||||||
server->ifname = str ? strdup(str) : NULL;
|
server->ifname = str ? strdup(str) : NULL;
|
||||||
|
|
||||||
if ((str = spa_dict_lookup(props, "milan")) != NULL)
|
if ((str = spa_dict_lookup(props, "milan")) != NULL && spa_atob(str))
|
||||||
server->milan = spa_atob(str);
|
server->avb_mode = AVB_MODE_MILAN_V12;
|
||||||
else
|
else
|
||||||
server->milan = false;
|
server->avb_mode = AVB_MODE_LEGACY;
|
||||||
|
|
||||||
spa_hook_list_init(&server->listener_list);
|
spa_hook_list_init(&server->listener_list);
|
||||||
spa_list_init(&server->descriptors);
|
spa_list_init(&server->descriptors);
|
||||||
|
|
|
||||||
|
|
@ -52,13 +52,27 @@ struct descriptor {
|
||||||
void *ptr;
|
void *ptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
enum avb_mode {
|
||||||
|
/** The legacy AVB Mode */
|
||||||
|
AVB_MODE_LEGACY,
|
||||||
|
/**
|
||||||
|
* \brief Milan version 1.2, which subset of the AVB,
|
||||||
|
* \see Milan Specifications https://avnu.org/resource/milan-specification/
|
||||||
|
*/
|
||||||
|
AVB_MODE_MILAN_V12,
|
||||||
|
|
||||||
|
/** Future AVB mode will be added here if necessary */
|
||||||
|
AVB_MODE_MAX
|
||||||
|
};
|
||||||
|
|
||||||
struct server {
|
struct server {
|
||||||
struct spa_list link;
|
struct spa_list link;
|
||||||
struct impl *impl;
|
struct impl *impl;
|
||||||
|
|
||||||
char *ifname;
|
char *ifname;
|
||||||
/** Parsed from the configuration pipewire-avb.conf */
|
/** Parsed from the configuration pipewire-avb.conf */
|
||||||
bool milan;
|
enum avb_mode avb_mode;
|
||||||
uint8_t mac_addr[6];
|
uint8_t mac_addr[6];
|
||||||
uint64_t entity_id;
|
uint64_t entity_id;
|
||||||
int ifindex;
|
int ifindex;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue