mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
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.
64 lines
1.7 KiB
C
64 lines
1.7 KiB
C
/* Spa ALSA support */
|
|
/* SPDX-FileCopyrightText: Copyright © 2018 Wim Taymans */
|
|
/* SPDX-License-Identifier: MIT */
|
|
|
|
#include "config.h"
|
|
|
|
#include <errno.h>
|
|
|
|
#include <spa/support/plugin.h>
|
|
#include <spa/support/log.h>
|
|
|
|
extern const struct spa_handle_factory spa_alsa_source_factory;
|
|
extern const struct spa_handle_factory spa_alsa_sink_factory;
|
|
extern const struct spa_handle_factory spa_alsa_udev_factory;
|
|
extern const struct spa_handle_factory spa_alsa_pcm_device_factory;
|
|
extern const struct spa_handle_factory spa_alsa_seq_bridge_factory;
|
|
extern const struct spa_handle_factory spa_alsa_acp_device_factory;
|
|
#ifdef HAVE_ALSA_COMPRESS_OFFLOAD
|
|
extern const struct spa_handle_factory spa_alsa_compress_offload_sink_factory;
|
|
extern const struct spa_handle_factory spa_alsa_compress_offload_device_factory;
|
|
#endif
|
|
|
|
struct spa_log_topic log_topic = SPA_LOG_TOPIC(0, "spa.alsa");
|
|
struct spa_log_topic *alsa_log_topic = &log_topic;
|
|
|
|
SPA_EXPORT
|
|
int spa_handle_factory_enum(const struct spa_handle_factory **factory, uint32_t *index)
|
|
{
|
|
spa_return_val_if_fail(factory != NULL, -EINVAL);
|
|
spa_return_val_if_fail(index != NULL, -EINVAL);
|
|
|
|
switch (*index) {
|
|
case 0:
|
|
*factory = &spa_alsa_source_factory;
|
|
break;
|
|
case 1:
|
|
*factory = &spa_alsa_sink_factory;
|
|
break;
|
|
case 2:
|
|
*factory = &spa_alsa_udev_factory;
|
|
break;
|
|
case 3:
|
|
*factory = &spa_alsa_pcm_device_factory;
|
|
break;
|
|
case 4:
|
|
*factory = &spa_alsa_seq_bridge_factory;
|
|
break;
|
|
case 5:
|
|
*factory = &spa_alsa_acp_device_factory;
|
|
break;
|
|
#ifdef HAVE_ALSA_COMPRESS_OFFLOAD
|
|
case 6:
|
|
*factory = &spa_alsa_compress_offload_sink_factory;
|
|
break;
|
|
case 7:
|
|
*factory = &spa_alsa_compress_offload_device_factory;
|
|
break;
|
|
#endif
|
|
default:
|
|
return 0;
|
|
}
|
|
(*index)++;
|
|
return 1;
|
|
}
|