a2dp.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. *
  4. * BlueZ - Bluetooth protocol stack for Linux
  5. *
  6. * Copyright (C) 2006-2010 Nokia Corporation
  7. * Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
  8. * Copyright (C) 2011 BMW Car IT GmbH. All rights reserved.
  9. *
  10. *
  11. */
  12. struct a2dp_sep;
  13. struct a2dp_setup;
  14. typedef void (*a2dp_endpoint_select_t) (struct a2dp_setup *setup, void *ret,
  15. int size);
  16. typedef void (*a2dp_endpoint_config_t) (struct a2dp_setup *setup, gboolean ret);
  17. struct a2dp_endpoint {
  18. const char *(*get_name) (struct a2dp_sep *sep, void *user_data);
  19. const char *(*get_path) (struct a2dp_sep *sep, void *user_data);
  20. size_t (*get_capabilities) (struct a2dp_sep *sep,
  21. uint8_t **capabilities,
  22. void *user_data);
  23. int (*select_configuration) (struct a2dp_sep *sep,
  24. uint8_t *capabilities,
  25. size_t length,
  26. struct a2dp_setup *setup,
  27. a2dp_endpoint_select_t cb,
  28. void *user_data);
  29. int (*set_configuration) (struct a2dp_sep *sep,
  30. uint8_t *configuration,
  31. size_t length,
  32. struct a2dp_setup *setup,
  33. a2dp_endpoint_config_t cb,
  34. void *user_data);
  35. void (*clear_configuration) (struct a2dp_sep *sep, void *user_data);
  36. void (*set_delay) (struct a2dp_sep *sep, uint16_t delay,
  37. void *user_data);
  38. };
  39. typedef void (*a2dp_discover_cb_t) (struct avdtp *session, GSList *seps,
  40. int err, void *user_data);
  41. typedef void (*a2dp_select_cb_t) (struct avdtp *session, struct a2dp_sep *sep,
  42. GSList *caps, int err,
  43. void *user_data);
  44. typedef void (*a2dp_config_cb_t) (struct avdtp *session, struct a2dp_sep *sep,
  45. struct avdtp_stream *stream, int err,
  46. void *user_data);
  47. typedef void (*a2dp_stream_cb_t) (struct avdtp *session, int err,
  48. void *user_data);
  49. struct a2dp_sep *a2dp_add_sep(struct btd_adapter *adapter, uint8_t type,
  50. uint8_t codec, gboolean delay_reporting,
  51. struct a2dp_endpoint *endpoint,
  52. void *user_data, GDestroyNotify destroy,
  53. int *err);
  54. void a2dp_remove_sep(struct a2dp_sep *sep);
  55. unsigned int a2dp_discover(struct avdtp *session, a2dp_discover_cb_t cb,
  56. void *user_data);
  57. unsigned int a2dp_select_capabilities(struct avdtp *session,
  58. uint8_t type, const char *sender,
  59. a2dp_select_cb_t cb,
  60. void *user_data);
  61. unsigned int a2dp_config(struct avdtp *session, struct a2dp_sep *sep,
  62. a2dp_config_cb_t cb, GSList *caps,
  63. void *user_data);
  64. unsigned int a2dp_resume(struct avdtp *session, struct a2dp_sep *sep,
  65. a2dp_stream_cb_t cb, void *user_data);
  66. unsigned int a2dp_suspend(struct avdtp *session, struct a2dp_sep *sep,
  67. a2dp_stream_cb_t cb, void *user_data);
  68. gboolean a2dp_cancel(unsigned int id);
  69. gboolean a2dp_sep_lock(struct a2dp_sep *sep, struct avdtp *session);
  70. gboolean a2dp_sep_unlock(struct a2dp_sep *sep, struct avdtp *session);
  71. struct avdtp_stream *a2dp_sep_get_stream(struct a2dp_sep *sep);
  72. struct btd_device *a2dp_setup_get_device(struct a2dp_setup *setup);
  73. const char *a2dp_setup_remote_path(struct a2dp_setup *setup);
  74. struct avdtp *a2dp_avdtp_get(struct btd_device *device);