Pipewireパッケージ(ちょっと変更)
Revisión | 17c583bbe73d030c6cf740c69397521e9764df5a (tree) |
---|---|
Tiempo | 2023-11-13 01:48:25 |
Autor | Pauli Virtanen <pav@iki....> |
Commiter | Pauli Virtanen |
bluez5: iso-io: get proper group id for broadcast
@@ -37,7 +37,7 @@ struct group { | ||
37 | 37 | struct spa_source source; |
38 | 38 | struct spa_list streams; |
39 | 39 | int timerfd; |
40 | - uint8_t cig; | |
40 | + uint8_t id; | |
41 | 41 | uint64_t next; |
42 | 42 | uint64_t duration; |
43 | 43 | uint32_t paused; |
@@ -155,7 +155,7 @@ static void group_on_timeout(struct spa_source *source) | ||
155 | 155 | if ((res = spa_system_timerfd_read(group->data_system, group->timerfd, &exp)) < 0) { |
156 | 156 | if (res != -EAGAIN) |
157 | 157 | spa_log_warn(group->log, "%p: ISO group:%u error reading timerfd: %s", |
158 | - group, group->cig, spa_strerror(res)); | |
158 | + group, group->id, spa_strerror(res)); | |
159 | 159 | return; |
160 | 160 | } |
161 | 161 |
@@ -178,7 +178,7 @@ static void group_on_timeout(struct spa_source *source) | ||
178 | 178 | |
179 | 179 | if (group->paused) { |
180 | 180 | --group->paused; |
181 | - spa_log_debug(group->log, "%p: ISO group:%d paused:%u", group, group->cig, group->paused); | |
181 | + spa_log_debug(group->log, "%p: ISO group:%u paused:%u", group, group->id, group->paused); | |
182 | 182 | } |
183 | 183 | |
184 | 184 | /* Produce output */ |
@@ -194,7 +194,7 @@ static void group_on_timeout(struct spa_source *source) | ||
194 | 194 | } |
195 | 195 | if (stream->this.size == 0) { |
196 | 196 | spa_log_debug(group->log, "%p: ISO group:%u miss fd:%d", |
197 | - group, group->cig, stream->fd); | |
197 | + group, group->id, stream->fd); | |
198 | 198 | if (stream_silence(stream) < 0) { |
199 | 199 | fail = true; |
200 | 200 | continue; |
@@ -208,7 +208,7 @@ static void group_on_timeout(struct spa_source *source) | ||
208 | 208 | } |
209 | 209 | |
210 | 210 | spa_log_trace(group->log, "%p: ISO group:%u sent fd:%d size:%u ts:%u idle:%d res:%d", |
211 | - group, group->cig, stream->fd, (unsigned)stream->this.size, | |
211 | + group, group->id, stream->fd, (unsigned)stream->this.size, | |
212 | 212 | (unsigned)stream->this.timestamp, stream->idle, res); |
213 | 213 | |
214 | 214 | stream->this.size = 0; |
@@ -243,19 +243,29 @@ static struct group *group_create(struct spa_bt_transport *t, | ||
243 | 243 | struct spa_log *log, struct spa_loop *data_loop, struct spa_system *data_system) |
244 | 244 | { |
245 | 245 | struct group *group; |
246 | + uint8_t id; | |
246 | 247 | |
247 | 248 | if (t->bap_interval <= 5000) { |
248 | 249 | errno = EINVAL; |
249 | 250 | return NULL; |
250 | 251 | } |
251 | 252 | |
253 | + if (t->profile & (SPA_BT_PROFILE_BAP_SINK | SPA_BT_PROFILE_BAP_SOURCE)) { | |
254 | + id = t->bap_cig; | |
255 | + } else if (t->profile & (SPA_BT_PROFILE_BAP_BROADCAST_SINK | SPA_BT_PROFILE_BAP_BROADCAST_SOURCE)) { | |
256 | + id = t->bap_big; | |
257 | + } else { | |
258 | + errno = EINVAL; | |
259 | + return NULL; | |
260 | + } | |
261 | + | |
252 | 262 | group = calloc(1, sizeof(struct group)); |
253 | 263 | if (group == NULL) |
254 | 264 | return NULL; |
255 | 265 | |
256 | 266 | spa_log_topic_init(log, &log_topic); |
257 | 267 | |
258 | - group->cig = t->bap_cig; | |
268 | + group->id = id; | |
259 | 269 | group->log = log; |
260 | 270 | group->data_loop = data_loop; |
261 | 271 | group->data_system = data_system; |