summaryrefslogtreecommitdiffstats
path: root/meta-pipewire/recipes-multimedia/wireplumber/wireplumber_git.bb
blob: 618ee142d20db8bb350daa5c5a6fff131b130842 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
SUMMARY     = "Session / Policy Manager for PipeWire"
HOMEPAGE    = "https://gitlab.freedesktop.org/gkiagia/wireplumber"
BUGTRACKER  = "https://gitlab.freedesktop.org/gkiagia/wireplumber/issues"
AUTHOR      = "George Kiagiadakis <george.kiagiadakis@collabora.com>"
SECTION     = "multimedia"

LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;beginline=3;md5=e8ad01a5182f2c1b3a2640e9ea268264"

inherit meson pkgconfig gobject-introspection

DEPENDS = "glib-2.0 glib-2.0-native pipewire"

SRC_URI = "git://gitlab.freedesktop.org/gkiagia/wireplumber;protocol=https;branch=0.1"
SRCREV = "68a44d5db3d5bbdd77f97a694178c2eef4d08705"

PV = "0.1.1+git${SRCPV}"
S  = "${WORKDIR}/git"

PACKAGES =+ "${PN}-config"

FILES_${PN} += "\
    ${libdir}/wireplumber-*/* \
"
RPROVIDES_${PN} += "virtual/pipewire-sessionmanager"
RDEPENDS_${PN} += "virtual/wireplumber-config"


FILES_${PN}-config += "\
    ${sysconfdir}/wireplumber/* \
"
CONFFILES_${PN}-config += "\
    ${sysconfdir}/wireplumber/* \
"

RPROVIDES_${PN}-config += "virtual/wireplumber-config"
inks[0]->uid; // search for channel uid into mixer sinks and derive sound card for (int idx = 0; mixer->sinks[idx]; idx++) { for (int jdx = 0; jdx < mixer->sinks[idx]->ccount; jdx++) { if (mixer->sinks[idx]->channels[jdx]->uid && !strcasecmp(channel, mixer->sinks[idx]->channels[jdx]->uid)) { return mixer->sinks[idx]->sndcard->params; } } } } return NULL; } PUBLIC AlsaSndPcmT *ApiSinkGetByUid(SoftMixerT *mixer, const char *target) { // if no attached zone found, then try direct sink attachment for (int idx = 0; mixer->sinks[idx]; idx++) { if (mixer->sinks[idx]->uid && !strcasecmp(mixer->sinks[idx]->uid, target)) { return mixer->sinks[idx]; } } return NULL; } PUBLIC int ApiSinkAttach(SoftMixerT *mixer, AFB_ReqT request, const char *uid, json_object * argsJ) { int index; char *dmixUid = NULL; for (index = 0; index < mixer->max.sinks; index++) { if (!mixer->sinks[index]) break; } if (index == mixer->max.sinks) { AFB_ReqFailF(request, "too-small", "mixer=%s max sink=%d", mixer->uid, mixer->max.sinks); goto OnErrorExit; } switch (json_object_get_type(argsJ)) { long count; AlsaPcmCtlT* dmixConfig; case json_type_object: mixer->sinks[index] = ApiPcmAttachOne(mixer, uid, SND_PCM_STREAM_PLAYBACK, argsJ); if (!mixer->sinks[index]) { AFB_ReqFailF(request, "invalid-syntax", "mixer=%s invalid sink= %s", mixer->uid, json_object_get_string(argsJ)); goto OnErrorExit; } // move from hardware to DMIX attach to sndcard if (asprintf(&dmixUid, "dmix-%s", mixer->sinks[index]->uid) == -1) goto OnErrorExit; dmixConfig = AlsaCreateDmix(mixer, dmixUid, mixer->sinks[index], 0); if (!dmixConfig) { AFB_ReqFailF(request, "internal-error", "mixer=%s sink=%s fail to create DMIX config", mixer->uid, mixer->sinks[index]->uid); goto OnErrorExit; } break; case json_type_array: count = json_object_array_length(argsJ); if (count > (mixer->max.sinks - index)) { AFB_ReqFailF(request, "too-small", "mixer=%s max sink=%d", mixer->uid, mixer->max.sinks); goto OnErrorExit; } for (int idx = 0; idx < count; idx++) { json_object *sinkJ = json_object_array_get_idx(argsJ, idx); AlsaSndPcmT * pcm = ApiPcmAttachOne(mixer, uid, SND_PCM_STREAM_PLAYBACK, sinkJ); if (!pcm) { AFB_ReqFailF(request, "invalid-syntax", "mixer=%s invalid sink= %s", mixer->uid, json_object_get_string(sinkJ)); goto OnErrorExit; } // move from hardware to DMIX attach to sndcard if (asprintf(&dmixUid, "dmix-%s", pcm->uid) == -1) goto OnErrorExit; dmixConfig = AlsaCreateDmix(mixer, dmixUid, pcm, 0); if (!dmixConfig) { AFB_ReqFailF(request, "internal-error", "mixer=%s sink=%s fail to create DMIX config", mixer->uid, pcm->uid); goto OnErrorExit; } mixer->sinks[index + idx] = pcm; } break; default: AFB_ReqFailF(request, "invalid-syntax", "mixer=%s sinks invalid argsJ= %s", mixer->uid, json_object_get_string(argsJ)); goto OnErrorExit; } return 0; OnErrorExit: free(dmixUid); return -1; }