mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
alsa-compress-offload: Add device object and udev based autodetection
As part of this, in alsa-udev.c, certain structures and variables referred to as "device" are renamed to "card". Otherwise, there is ambiguity, since "device" can mean a udev device, an SPA device, a compress-offload device, a PCM device etc. Also, replace "card id" with "card number" to emphasize that these integers are not actually SPA object IDs.
This commit is contained in:
parent
ae4bff78a3
commit
8e6d070148
8 changed files with 1050 additions and 237 deletions
30
spa/plugins/alsa/compress-offload-api-util.h
Normal file
30
spa/plugins/alsa/compress-offload-api-util.h
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#ifndef SPA_ALSA_COMPRESS_OFFLOAD_DEVICE_UTIL_H
|
||||
#define SPA_ALSA_COMPRESS_OFFLOAD_DEVICE_UTIL_H
|
||||
|
||||
#include <spa/support/log.h>
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ >= 4
|
||||
#define COMPR_API_PRIVATE __attribute__((visibility("hidden")))
|
||||
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)
|
||||
#define COMPR_API_PRIVATE __attribute__((visibility("hidden")))
|
||||
#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
|
||||
#define COMPR_API_PRIVATE __hidden
|
||||
#else
|
||||
#define COMPR_API_PRIVATE
|
||||
#endif
|
||||
|
||||
enum spa_compress_offload_direction {
|
||||
SPA_COMPRESS_OFFLOAD_DIRECTION_PLAYBACK,
|
||||
SPA_COMPRESS_OFFLOAD_DIRECTION_CAPTURE
|
||||
};
|
||||
|
||||
/* This exists for situations where both the direction of the compress-offload
|
||||
* device and the functions from asoundlib.h are needed. It is not possible to
|
||||
* include asoundlib.h and the compress-offload headers in the same C file,
|
||||
* since these headers contain conflicting declarations. Provide this direction
|
||||
* check function to keep the compress-offload headers encapsulated. */
|
||||
COMPR_API_PRIVATE int get_compress_offload_device_direction(int card_nr, int device_nr,
|
||||
struct spa_log *log,
|
||||
enum spa_compress_offload_direction *direction);
|
||||
|
||||
#endif /* SPA_ALSA_COMPRESS_OFFLOAD_DEVICE_UTIL_H */
|
||||
Loading…
Add table
Add a link
Reference in a new issue