• Home
  • Raw
  • Download

Lines Matching refs:card

70     int (*acquire)(struct hf_audio_card *card);
103 static DBusMessage *card_send(struct hf_audio_card *card, const char *method, DBusError *err) in card_send() argument
105 pa_bluetooth_transport *t = card->transport; in card_send()
109 …r = dbus_connection_send_with_reply_and_block(pa_dbus_connection_get(card->backend->connection), m… in card_send()
115 static int card_connect(struct hf_audio_card *card) { in card_connect() argument
119 if (card->connecting) in card_connect()
122 card->connecting = true; in card_connect()
125 r = card_send(card, "Connect", &err); in card_connect()
129 card->connecting = false; in card_connect()
136 if (card->connecting) in card_connect()
142 static int card_acquire(struct hf_audio_card *card) { in card_acquire() argument
150 r = card_send(card, "Acquire", &err); in card_acquire()
160 card->acquire = card_connect; in card_acquire()
161 return card_connect(card); in card_acquire()
175 card->transport->codec = codec; in card_acquire()
176 card->fd = fd; in card_acquire()
187 …ce_unlink_cb(pa_bluetooth_discovery *y, const pa_bluetooth_device *d, struct hf_audio_card *card) { in device_unlink_cb() argument
189 pa_assert(card); in device_unlink_cb()
191 hf_audio_agent_card_removed(card->backend, card->path); in device_unlink_cb()
197 struct hf_audio_card *card = pa_xnew0(struct hf_audio_card, 1); in hf_audio_card_new() local
199 card->path = pa_xstrdup(path); in hf_audio_card_new()
200 card->backend = backend; in hf_audio_card_new()
201 card->fd = -1; in hf_audio_card_new()
202 card->acquire = card_acquire; in hf_audio_card_new()
204card->device_unlink_slot = pa_hook_connect(pa_bluetooth_discovery_hook(backend->discovery, PA_BLUE… in hf_audio_card_new()
205 … PA_HOOK_NORMAL, (pa_hook_cb_t) device_unlink_cb, card); in hf_audio_card_new()
207 return card; in hf_audio_card_new()
210 static void hf_audio_card_free(struct hf_audio_card *card) { in hf_audio_card_free() argument
211 pa_assert(card); in hf_audio_card_free()
213 if (card->device_unlink_slot) in hf_audio_card_free()
214 pa_hook_slot_free(card->device_unlink_slot); in hf_audio_card_free()
216 if (card->transport) in hf_audio_card_free()
217 pa_bluetooth_transport_free(card->transport); in hf_audio_card_free()
219 pa_xfree(card->path); in hf_audio_card_free()
220 pa_xfree(card->remote_address); in hf_audio_card_free()
221 pa_xfree(card->local_address); in hf_audio_card_free()
222 pa_xfree(card); in hf_audio_card_free()
255 struct hf_audio_card *card = t->userdata; in hf_audio_agent_transport_acquire() local
258 pa_assert(card); in hf_audio_agent_transport_acquire()
260 if (!optional && card->fd < 0) { in hf_audio_agent_transport_acquire()
261 err = card->acquire(card); in hf_audio_agent_transport_acquire()
276 err = socket_accept(card->fd); in hf_audio_agent_transport_acquire()
278 pa_log_error("Deferred setup failed on fd %d: %s", card->fd, pa_cstrerror(-err)); in hf_audio_agent_transport_acquire()
282 return card->fd; in hf_audio_agent_transport_acquire()
286 struct hf_audio_card *card = t->userdata; in hf_audio_agent_transport_release() local
288 pa_assert(card); in hf_audio_agent_transport_release()
290 if (card->fd < 0) { in hf_audio_agent_transport_release()
296 shutdown(card->fd, SHUT_RDWR); in hf_audio_agent_transport_release()
297 close(card->fd); in hf_audio_agent_transport_release()
298 card->fd = -1; in hf_audio_agent_transport_release()
304 struct hf_audio_card *card; in hf_audio_agent_card_found() local
314 card = hf_audio_card_new(backend, path); in hf_audio_agent_card_found()
333 pa_xfree(card->remote_address); in hf_audio_agent_card_found()
334 card->remote_address = pa_xstrdup(value); in hf_audio_agent_card_found()
336 pa_xfree(card->local_address); in hf_audio_agent_card_found()
337 card->local_address = pa_xstrdup(value); in hf_audio_agent_card_found()
348 …d = pa_bluetooth_discovery_get_device_by_address(backend->discovery, card->remote_address, card->l… in hf_audio_agent_card_found()
354 card->transport = pa_bluetooth_transport_new(d, backend->ofono_bus_id, path, p, NULL, 0); in hf_audio_agent_card_found()
355 card->transport->acquire = hf_audio_agent_transport_acquire; in hf_audio_agent_card_found()
356 card->transport->release = hf_audio_agent_transport_release; in hf_audio_agent_card_found()
357 card->transport->userdata = card; in hf_audio_agent_card_found()
359 pa_bluetooth_transport_put(card->transport); in hf_audio_agent_card_found()
360 pa_hashmap_put(backend->cards, card->path, card); in hf_audio_agent_card_found()
365 hf_audio_card_free(card); in hf_audio_agent_card_found()
369 struct hf_audio_card *card; in hf_audio_agent_card_removed() local
376 card = pa_hashmap_remove(backend->cards, path); in hf_audio_agent_card_removed()
377 if (!card) in hf_audio_agent_card_removed()
380 hf_audio_card_free(card); in hf_audio_agent_card_removed()
608 struct hf_audio_card *card; in hf_audio_agent_new_connection() local
628 card = pa_hashmap_get(backend->cards, path); in hf_audio_agent_new_connection()
630 if (!card || codec != HFP_AUDIO_CODEC_CVSD || card->fd >= 0) { in hf_audio_agent_new_connection()
640 card->connecting = false; in hf_audio_agent_new_connection()
641 card->fd = fd; in hf_audio_agent_new_connection()
642 card->transport->codec = codec; in hf_audio_agent_new_connection()
644 pa_bluetooth_transport_set_state(card->transport, PA_BLUETOOTH_TRANSPORT_STATE_PLAYING); in hf_audio_agent_new_connection()