mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
spa: alsa,v4l2: use proper enum for action
An enum provides better debugging experience
and makes the source code easier to grasp.
(cherry picked from commit 5fa34988fa)
This commit is contained in:
parent
dd03036667
commit
6aea34ff72
2 changed files with 12 additions and 8 deletions
|
|
@ -31,9 +31,11 @@
|
||||||
|
|
||||||
#define MAX_CARDS 64
|
#define MAX_CARDS 64
|
||||||
|
|
||||||
#define ACTION_ADD 0
|
enum action {
|
||||||
#define ACTION_REMOVE 1
|
ACTION_ADD,
|
||||||
#define ACTION_DISABLE 2
|
ACTION_REMOVE,
|
||||||
|
ACTION_DISABLE,
|
||||||
|
};
|
||||||
|
|
||||||
/* Used for unavailable devices in the card structure. */
|
/* Used for unavailable devices in the card structure. */
|
||||||
#define ID_DEVICE_NOT_SUPPORTED 0
|
#define ID_DEVICE_NOT_SUPPORTED 0
|
||||||
|
|
@ -718,7 +720,7 @@ static bool check_access(struct impl *this, struct card *card)
|
||||||
return card->accessible;
|
return card->accessible;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void process_card(struct impl *this, uint32_t action, struct udev_device *udev_device)
|
static void process_card(struct impl *this, enum action action, struct udev_device *udev_device)
|
||||||
{
|
{
|
||||||
unsigned int card_nr;
|
unsigned int card_nr;
|
||||||
struct card *card;
|
struct card *card;
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,11 @@
|
||||||
|
|
||||||
#define MAX_DEVICES 64
|
#define MAX_DEVICES 64
|
||||||
|
|
||||||
#define ACTION_ADD 0
|
enum action {
|
||||||
#define ACTION_REMOVE 1
|
ACTION_ADD,
|
||||||
#define ACTION_DISABLE 2
|
ACTION_REMOVE,
|
||||||
|
ACTION_DISABLE,
|
||||||
|
};
|
||||||
|
|
||||||
struct device {
|
struct device {
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
|
|
@ -357,7 +359,7 @@ static bool check_access(struct impl *this, struct device *device)
|
||||||
return device->accessible;
|
return device->accessible;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void process_device(struct impl *this, uint32_t action, struct udev_device *dev)
|
static void process_device(struct impl *this, enum action action, struct udev_device *dev)
|
||||||
{
|
{
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
struct device *device;
|
struct device *device;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue