aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorDan Glastonbury <[email protected]>2017-05-22 18:55:15 +1000
committerAlex Chronopoulos <[email protected]>2017-05-22 11:55:15 +0300
commit96cdb173f86dfc86cbd21d097b24ec1e256d69fc (patch)
treed1e37936ba60cb43266b16430d2c0fa044bd1efe /include
parent91f801d661d6fcad9d01ea5ba3bbf5d59fa9ac4c (diff)
downloadcubeb-96cdb173f86dfc86cbd21d097b24ec1e256d69fc.tar.gz
cubeb-96cdb173f86dfc86cbd21d097b24ec1e256d69fc.zip
Push destroy fns to backend (#302)
* Make cubeb_device_info_destroy private. * Move implementation of cubeb_device_collection_destroy to cubeb_utils. * Move cubeb_device_collection_destroy implementation into backend. Push the responsiblity for destroying device collections to the backends so they can make independent choices on how to handle allocation. * Unstage space changes
Diffstat (limited to 'include')
-rw-r--r--include/cubeb/cubeb.h23
1 files changed, 11 insertions, 12 deletions
diff --git a/include/cubeb/cubeb.h b/include/cubeb/cubeb.h
index 1421878..1caba7b 100644
--- a/include/cubeb/cubeb.h
+++ b/include/cubeb/cubeb.h
@@ -330,9 +330,10 @@ typedef enum {
} cubeb_device_pref;
/** This structure holds the characteristics
- * of an input or output audio device. It can be obtained using
- * `cubeb_enumerate_devices`, and must be destroyed using
- * `cubeb_device_info_destroy`. */
+ * of an input or output audio device. It is obtained using
+ * `cubeb_enumerate_devices`, which returns these structures via
+ * `cubeb_device_collection` and must be destroyed via
+ * `cubeb_device_collection_destroy`. */
typedef struct {
cubeb_devid devid; /**< Device identifier handle. */
char const * device_id; /**< Device identifier which might be presented in a UI. */
@@ -355,10 +356,12 @@ typedef struct {
unsigned int latency_hi; /**< Higest possible latency in frames. */
} cubeb_device_info;
-/** Device collection. */
+/** Device collection.
+ * Returned by `cubeb_enumerate_devices` and destroyed by
+ * `cubeb_device_collection_destroy`. */
typedef struct {
uint32_t count; /**< Device count in collection. */
- cubeb_device_info * device[1]; /**< Array of pointers to device info. */
+ cubeb_device_info * device[1]; /**< Array of pointers to device info. */
} cubeb_device_collection;
/** User supplied data callback.
@@ -612,16 +615,12 @@ CUBEB_EXPORT int cubeb_enumerate_devices(cubeb * context,
cubeb_device_collection ** collection);
/** Destroy a cubeb_device_collection, and its `cubeb_device_info`.
+ @param context
@param collection collection to destroy
@retval CUBEB_OK
@retval CUBEB_ERROR_INVALID_PARAMETER if collection is an invalid pointer */
-CUBEB_EXPORT int cubeb_device_collection_destroy(cubeb_device_collection * collection);
-
-/** Destroy a cubeb_device_info structure.
- @param info pointer to device info structure
- @retval CUBEB_OK
- @retval CUBEB_ERROR_INVALID_PARAMETER if info is an invalid pointer */
-CUBEB_EXPORT int cubeb_device_info_destroy(cubeb_device_info * info);
+CUBEB_EXPORT int cubeb_device_collection_destroy(cubeb * context,
+ cubeb_device_collection * collection);
/** Registers a callback which is called when the system detects
a new device or a device is removed.