cubeb: /opt/local/var/macports/build/cubeOkuRas/work/cubeb-1b7de400134aac33d9c6b59ac1be9ddbf86d16eb/include/cubeb/cubeb.h Source File

cubeb 0.0.0

Loading...
Searching...
No Matches
cubeb.h
Go to the documentation of this file.
1/*
2 * Copyright © 2011 Mozilla Foundation
3 *
4 * This program is made available under an ISC-style license. See the
5 * accompanying file LICENSE for details.
6 */
7#if !defined(CUBEB_c2f983e9_c96f_e71c_72c3_bbf62992a382)
8#define CUBEB_c2f983e9_c96f_e71c_72c3_bbf62992a382
9
10#include "cubeb_export.h"
11#include <stdint.h>
12#include <stdlib.h>
13
14#if defined(__cplusplus)
15extern "C" {
16#endif
17
123
126
127typedef struct cubeb
128 cubeb;
129typedef struct cubeb_stream
130 cubeb_stream;
131
133 typedef enum {
135 CUBEB_SAMPLE_S16LE,
137 CUBEB_SAMPLE_S16BE,
139 CUBEB_SAMPLE_FLOAT32LE,
141 CUBEB_SAMPLE_FLOAT32BE,
142#if defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__)
144 CUBEB_SAMPLE_S16NE = CUBEB_SAMPLE_S16BE,
146 CUBEB_SAMPLE_FLOAT32NE = CUBEB_SAMPLE_FLOAT32BE
147#else
149 CUBEB_SAMPLE_S16NE = CUBEB_SAMPLE_S16LE,
151 CUBEB_SAMPLE_FLOAT32NE = CUBEB_SAMPLE_FLOAT32LE
152#endif
153} cubeb_sample_format;
154
157 typedef void const * cubeb_devid;
158
160 typedef enum {
161 CUBEB_LOG_DISABLED = 0,
162 CUBEB_LOG_NORMAL =
163 1,
164 CUBEB_LOG_VERBOSE = 2,
166} cubeb_log_level;
167
169 typedef enum {
170 CHANNEL_UNKNOWN = 0,
171 CHANNEL_FRONT_LEFT = 1 << 0,
172 CHANNEL_FRONT_RIGHT = 1 << 1,
173 CHANNEL_FRONT_CENTER = 1 << 2,
174 CHANNEL_LOW_FREQUENCY = 1 << 3,
175 CHANNEL_BACK_LEFT = 1 << 4,
176 CHANNEL_BACK_RIGHT = 1 << 5,
177 CHANNEL_FRONT_LEFT_OF_CENTER = 1 << 6,
178 CHANNEL_FRONT_RIGHT_OF_CENTER = 1 << 7,
179 CHANNEL_BACK_CENTER = 1 << 8,
180 CHANNEL_SIDE_LEFT = 1 << 9,
181 CHANNEL_SIDE_RIGHT = 1 << 10,
182 CHANNEL_TOP_CENTER = 1 << 11,
183 CHANNEL_TOP_FRONT_LEFT = 1 << 12,
184 CHANNEL_TOP_FRONT_CENTER = 1 << 13,
185 CHANNEL_TOP_FRONT_RIGHT = 1 << 14,
186 CHANNEL_TOP_BACK_LEFT = 1 << 15,
187 CHANNEL_TOP_BACK_CENTER = 1 << 16,
188 CHANNEL_TOP_BACK_RIGHT = 1 << 17
189} cubeb_channel;
190
194 typedef uint32_t cubeb_channel_layout;
195// Some common layout definitions.
196enum {
197 CUBEB_LAYOUT_UNDEFINED = 0, // Indicate the speaker's layout is undefined.
198 CUBEB_LAYOUT_MONO = CHANNEL_FRONT_CENTER,
199 CUBEB_LAYOUT_MONO_LFE = CUBEB_LAYOUT_MONO | CHANNEL_LOW_FREQUENCY,
200 CUBEB_LAYOUT_STEREO = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT,
201 CUBEB_LAYOUT_STEREO_LFE = CUBEB_LAYOUT_STEREO | CHANNEL_LOW_FREQUENCY,
202 CUBEB_LAYOUT_3F =
203 CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT | CHANNEL_FRONT_CENTER,
204 CUBEB_LAYOUT_3F_LFE = CUBEB_LAYOUT_3F | CHANNEL_LOW_FREQUENCY,
205 CUBEB_LAYOUT_2F1 =
206 CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT | CHANNEL_BACK_CENTER,
207 CUBEB_LAYOUT_2F1_LFE = CUBEB_LAYOUT_2F1 | CHANNEL_LOW_FREQUENCY,
208 CUBEB_LAYOUT_3F1 = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT |
209 CHANNEL_FRONT_CENTER | CHANNEL_BACK_CENTER,
210 CUBEB_LAYOUT_3F1_LFE = CUBEB_LAYOUT_3F1 | CHANNEL_LOW_FREQUENCY,
211 CUBEB_LAYOUT_2F2 = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT |
212 CHANNEL_SIDE_LEFT | CHANNEL_SIDE_RIGHT,
213 CUBEB_LAYOUT_2F2_LFE = CUBEB_LAYOUT_2F2 | CHANNEL_LOW_FREQUENCY,
214 CUBEB_LAYOUT_QUAD = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT |
215 CHANNEL_BACK_LEFT | CHANNEL_BACK_RIGHT,
216 CUBEB_LAYOUT_QUAD_LFE = CUBEB_LAYOUT_QUAD | CHANNEL_LOW_FREQUENCY,
217 CUBEB_LAYOUT_3F2 = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT |
218 CHANNEL_FRONT_CENTER | CHANNEL_SIDE_LEFT |
219 CHANNEL_SIDE_RIGHT,
220 CUBEB_LAYOUT_3F2_LFE = CUBEB_LAYOUT_3F2 | CHANNEL_LOW_FREQUENCY,
221 CUBEB_LAYOUT_3F2_BACK = CUBEB_LAYOUT_QUAD | CHANNEL_FRONT_CENTER,
222 CUBEB_LAYOUT_3F2_LFE_BACK = CUBEB_LAYOUT_3F2_BACK | CHANNEL_LOW_FREQUENCY,
223 CUBEB_LAYOUT_3F3R_LFE = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT |
224 CHANNEL_FRONT_CENTER | CHANNEL_LOW_FREQUENCY |
225 CHANNEL_BACK_CENTER | CHANNEL_SIDE_LEFT |
226 CHANNEL_SIDE_RIGHT,
227 CUBEB_LAYOUT_3F4_LFE = CHANNEL_FRONT_LEFT | CHANNEL_FRONT_RIGHT |
228 CHANNEL_FRONT_CENTER | CHANNEL_LOW_FREQUENCY |
229 CHANNEL_BACK_LEFT | CHANNEL_BACK_RIGHT |
230 CHANNEL_SIDE_LEFT | CHANNEL_SIDE_RIGHT,
231};
232
234 typedef enum {
235 CUBEB_STREAM_PREF_NONE = 0x00,
236 CUBEB_STREAM_PREF_LOOPBACK =
237 0x01,
241 CUBEB_STREAM_PREF_DISABLE_DEVICE_SWITCHING = 0x02,
244 CUBEB_STREAM_PREF_VOICE =
245 0x04,
251 CUBEB_STREAM_PREF_RAW =
252 0x08,
254 CUBEB_STREAM_PREF_PERSIST = 0x10,
258 CUBEB_STREAM_PREF_JACK_NO_AUTO_CONNECT = 0x20
261} cubeb_stream_prefs;
262
267 typedef enum {
268 CUBEB_INPUT_PROCESSING_PARAM_NONE = 0x00,
269 CUBEB_INPUT_PROCESSING_PARAM_ECHO_CANCELLATION = 0x01,
270 CUBEB_INPUT_PROCESSING_PARAM_NOISE_SUPPRESSION = 0x02,
271 CUBEB_INPUT_PROCESSING_PARAM_AUTOMATIC_GAIN_CONTROL = 0x04,
272 CUBEB_INPUT_PROCESSING_PARAM_VOICE_ISOLATION = 0x08,
273} cubeb_input_processing_params;
274
276 typedef struct {
277 cubeb_sample_format format;
279 uint32_t rate;
280 uint32_t channels;
281 cubeb_channel_layout
282 layout;
284 cubeb_stream_prefs prefs;
285 cubeb_input_processing_params input_params;
288} cubeb_stream_params;
289
291 typedef struct {
292 char * output_name;
293 char * input_name;
294} cubeb_device;
295
297 typedef enum {
298 CUBEB_STATE_STARTED,
299 CUBEB_STATE_STOPPED,
300 CUBEB_STATE_DRAINED,
301 CUBEB_STATE_ERROR
302} cubeb_state;
303
305enum {
306 CUBEB_OK = 0,
307 CUBEB_ERROR = -1,
308 CUBEB_ERROR_INVALID_FORMAT =
309 -2,
310 CUBEB_ERROR_INVALID_PARAMETER = -3,
311 CUBEB_ERROR_NOT_SUPPORTED =
312 -4,
313 CUBEB_ERROR_DEVICE_UNAVAILABLE =
314 -5
315};
316
320 typedef enum {
321 CUBEB_DEVICE_TYPE_UNKNOWN,
322 CUBEB_DEVICE_TYPE_INPUT,
323 CUBEB_DEVICE_TYPE_OUTPUT
324} cubeb_device_type;
325
329 typedef enum {
330 CUBEB_DEVICE_STATE_DISABLED,
332 CUBEB_DEVICE_STATE_UNPLUGGED,
334 CUBEB_DEVICE_STATE_ENABLED
335} cubeb_device_state;
336
340 typedef enum {
341 CUBEB_DEVICE_FMT_S16LE = 0x0010,
342 CUBEB_DEVICE_FMT_S16BE = 0x0020,
343 CUBEB_DEVICE_FMT_F32LE = 0x1000,
344 CUBEB_DEVICE_FMT_F32BE = 0x2000
345} cubeb_device_fmt;
346
347#if defined(WORDS_BIGENDIAN) || defined(__BIG_ENDIAN__)
349#define CUBEB_DEVICE_FMT_S16NE CUBEB_DEVICE_FMT_S16BE
352#define CUBEB_DEVICE_FMT_F32NE CUBEB_DEVICE_FMT_F32BE
353#else
355#define CUBEB_DEVICE_FMT_S16NE CUBEB_DEVICE_FMT_S16LE
358#define CUBEB_DEVICE_FMT_F32NE CUBEB_DEVICE_FMT_F32LE
359#endif
361#define CUBEB_DEVICE_FMT_S16_MASK \
362 (CUBEB_DEVICE_FMT_S16LE | CUBEB_DEVICE_FMT_S16BE)
363
364#define CUBEB_DEVICE_FMT_F32_MASK \
365 (CUBEB_DEVICE_FMT_F32LE | CUBEB_DEVICE_FMT_F32BE)
366
367#define CUBEB_DEVICE_FMT_ALL \
368 (CUBEB_DEVICE_FMT_S16_MASK | CUBEB_DEVICE_FMT_F32_MASK)
369
374 typedef enum {
375 CUBEB_DEVICE_PREF_NONE = 0x00,
376 CUBEB_DEVICE_PREF_MULTIMEDIA = 0x01,
377 CUBEB_DEVICE_PREF_VOICE = 0x02,
378 CUBEB_DEVICE_PREF_NOTIFICATION = 0x04,
379 CUBEB_DEVICE_PREF_ALL = 0x0F
380} cubeb_device_pref;
381
387 typedef struct {
388 cubeb_devid devid;
389 char const *
390 device_id;
391 char const * friendly_name;
393 char const * group_id;
396 char const * vendor_name;
397
398 cubeb_device_type type;
399 cubeb_device_state state;
400 cubeb_device_pref preferred;
401
402 cubeb_device_fmt format;
403 cubeb_device_fmt
404 default_format;
405 uint32_t max_channels;
406 uint32_t default_rate;
407 uint32_t max_rate;
408 uint32_t min_rate;
409
410 uint32_t latency_lo;
411 uint32_t latency_hi;
412} cubeb_device_info;
413
417 typedef struct {
418 cubeb_device_info * device;
419 size_t count;
420} cubeb_device_collection;
421
423 typedef struct {
424 const char * const *
425 names;
426 size_t count;
427} cubeb_backend_names;
428
451 typedef long (*cubeb_data_callback)(cubeb_stream * stream, void * user_ptr,
452 void const * input_buffer,
453 void * output_buffer, long nframes);
454
459 typedef void (*cubeb_state_callback)(cubeb_stream * stream, void * user_ptr,
460 cubeb_state state);
461
465 typedef void (*cubeb_device_changed_callback)(void * user_ptr);
466
474 typedef void (*cubeb_device_collection_changed_callback)(cubeb * context,
475 void * user_ptr);
476
478 typedef void (*cubeb_log_callback)(char const * fmt, ...);
479
498CUBEB_EXPORT int
499cubeb_init(cubeb ** context, char const * context_name,
500 char const * backend_name);
501
505CUBEB_EXPORT char const *
506cubeb_get_backend_id(cubeb * context);
507
511CUBEB_EXPORT cubeb_backend_names
512cubeb_get_backend_names();
513
521CUBEB_EXPORT int
522cubeb_get_max_channel_count(cubeb * context, uint32_t * max_channels);
523
535CUBEB_EXPORT int
536cubeb_get_min_latency(cubeb * context, cubeb_stream_params * params,
537 uint32_t * latency_frames);
538
546CUBEB_EXPORT int
547cubeb_get_preferred_sample_rate(cubeb * context, uint32_t * rate);
548
557CUBEB_EXPORT int
558cubeb_get_supported_input_processing_params(
559 cubeb * context, cubeb_input_processing_params * params);
560
564CUBEB_EXPORT void
565cubeb_destroy(cubeb * context);
566
599CUBEB_EXPORT int
600cubeb_stream_init(cubeb * context, cubeb_stream ** stream,
601 char const * stream_name, cubeb_devid input_device,
602 cubeb_stream_params * input_stream_params,
603 cubeb_devid output_device,
604 cubeb_stream_params * output_stream_params,
605 uint32_t latency_frames, cubeb_data_callback data_callback,
606 cubeb_state_callback state_callback, void * user_ptr);
607
611CUBEB_EXPORT void
612cubeb_stream_destroy(cubeb_stream * stream);
613
618CUBEB_EXPORT int
619cubeb_stream_start(cubeb_stream * stream);
620
625CUBEB_EXPORT int
626cubeb_stream_stop(cubeb_stream * stream);
627
633CUBEB_EXPORT int
634cubeb_stream_get_position(cubeb_stream * stream, uint64_t * position);
635
644CUBEB_EXPORT int
645cubeb_stream_get_latency(cubeb_stream * stream, uint32_t * latency);
646
656CUBEB_EXPORT int
657cubeb_stream_get_input_latency(cubeb_stream * stream, uint32_t * latency);
665CUBEB_EXPORT int
666cubeb_stream_set_volume(cubeb_stream * stream, float volume);
667
674CUBEB_EXPORT int
675cubeb_stream_set_name(cubeb_stream * stream, char const * stream_name);
676
684CUBEB_EXPORT int
685cubeb_stream_get_current_device(cubeb_stream * stm,
686 cubeb_device ** const device);
687
697CUBEB_EXPORT int
698cubeb_stream_set_input_mute(cubeb_stream * stream, int mute);
699
708CUBEB_EXPORT int
709cubeb_stream_set_input_processing_params(cubeb_stream * stream,
710 cubeb_input_processing_params params);
711
718CUBEB_EXPORT int
719cubeb_stream_device_destroy(cubeb_stream * stream, cubeb_device * devices);
720
729CUBEB_EXPORT int
730cubeb_stream_register_device_changed_callback(
731 cubeb_stream * stream,
732 cubeb_device_changed_callback device_changed_callback);
733
738CUBEB_EXPORT void *
739cubeb_stream_user_ptr(cubeb_stream * stream);
740
749CUBEB_EXPORT int
750cubeb_enumerate_devices(cubeb * context, cubeb_device_type devtype,
751 cubeb_device_collection * collection);
752
758CUBEB_EXPORT int
759cubeb_device_collection_destroy(cubeb * context,
760 cubeb_device_collection * collection);
761
778CUBEB_EXPORT int
779cubeb_register_device_collection_changed(
780 cubeb * context, cubeb_device_type devtype,
781 cubeb_device_collection_changed_callback callback, void * user_ptr);
782
791CUBEB_EXPORT int
792cubeb_set_log_callback(cubeb_log_level log_level,
793 cubeb_log_callback log_callback);
794
795#if defined(__cplusplus)
796}
797#endif
798
799#endif /* CUBEB_c2f983e9_c96f_e71c_72c3_bbf62992a382 */
cubeb_get_backend_names
CUBEB_EXPORT cubeb_backend_names cubeb_get_backend_names()
Get a read-only array of strings identifying available backends.
cubeb_get_preferred_sample_rate
CUBEB_EXPORT int cubeb_get_preferred_sample_rate(cubeb *context, uint32_t *rate)
Get the preferred sample rate for this backend: this is hardware and platform dependent,...
cubeb_devid
void const * cubeb_devid
An opaque handle used to refer a particular input or output device across calls.
Definition cubeb.h:157
cubeb_stream_get_current_device
CUBEB_EXPORT int cubeb_stream_get_current_device(cubeb_stream *stm, cubeb_device **const device)
Get the current output device for this stream.
cubeb_channel
cubeb_channel
A single channel position, to be used in a bitmask.
Definition cubeb.h:169
cubeb_get_backend_id
CUBEB_EXPORT char const * cubeb_get_backend_id(cubeb *context)
Get a read-only string identifying this context's current backend.
cubeb_device_collection_changed_callback
void(* cubeb_device_collection_changed_callback)(cubeb *context, void *user_ptr)
User supplied callback called when the underlying device collection changed.
Definition cubeb.h:474
cubeb_device_type
cubeb_device_type
Whether a particular device is an input device (e.g.
Definition cubeb.h:320
cubeb_register_device_collection_changed
CUBEB_EXPORT int cubeb_register_device_collection_changed(cubeb *context, cubeb_device_type devtype, cubeb_device_collection_changed_callback callback, void *user_ptr)
Registers a callback which is called when the system detects a new device or a device is removed,...
cubeb_enumerate_devices
CUBEB_EXPORT int cubeb_enumerate_devices(cubeb *context, cubeb_device_type devtype, cubeb_device_collection *collection)
Returns enumerated devices.
cubeb_stream_device_destroy
CUBEB_EXPORT int cubeb_stream_device_destroy(cubeb_stream *stream, cubeb_device *devices)
Destroy a cubeb_device structure.
cubeb_stream_get_input_latency
CUBEB_EXPORT int cubeb_stream_get_input_latency(cubeb_stream *stream, uint32_t *latency)
Get the input latency for this stream, in frames.
cubeb_device_pref
cubeb_device_pref
Channel type for a cubeb_stream.
Definition cubeb.h:374
cubeb_stream_set_volume
CUBEB_EXPORT int cubeb_stream_set_volume(cubeb_stream *stream, float volume)
Set the volume for a stream.
cubeb_log_callback
void(* cubeb_log_callback)(char const *fmt,...)
User supplied callback called when a message needs logging.
Definition cubeb.h:478
cubeb_set_log_callback
CUBEB_EXPORT int cubeb_set_log_callback(cubeb_log_level log_level, cubeb_log_callback log_callback)
Set a callback to be called with a message.
cubeb_stream_set_input_processing_params
CUBEB_EXPORT int cubeb_stream_set_input_processing_params(cubeb_stream *stream, cubeb_input_processing_params params)
Set what input processing features to enable for this stream.
cubeb_device_changed_callback
void(* cubeb_device_changed_callback)(void *user_ptr)
User supplied callback called when the underlying device changed.
Definition cubeb.h:465
cubeb
struct cubeb cubeb
Opaque handle referencing the application state.
Definition cubeb.h:127
cubeb_stream_register_device_changed_callback
CUBEB_EXPORT int cubeb_stream_register_device_changed_callback(cubeb_stream *stream, cubeb_device_changed_callback device_changed_callback)
Set a callback to be notified when the output device changes.
cubeb_stream_start
CUBEB_EXPORT int cubeb_stream_start(cubeb_stream *stream)
Start playback.
cubeb_stream_init
CUBEB_EXPORT int cubeb_stream_init(cubeb *context, cubeb_stream **stream, char const *stream_name, cubeb_devid input_device, cubeb_stream_params *input_stream_params, cubeb_devid output_device, cubeb_stream_params *output_stream_params, uint32_t latency_frames, cubeb_data_callback data_callback, cubeb_state_callback state_callback, void *user_ptr)
Initialize a stream associated with the supplied application context.
cubeb_data_callback
long(* cubeb_data_callback)(cubeb_stream *stream, void *user_ptr, void const *input_buffer, void *output_buffer, long nframes)
User supplied data callback.
Definition cubeb.h:451
cubeb_sample_format
cubeb_sample_format
Sample format enumeration.
Definition cubeb.h:133
CUBEB_SAMPLE_FLOAT32LE
@ CUBEB_SAMPLE_FLOAT32LE
Big endian 32-bit IEEE floating point PCM.
Definition cubeb.h:139
CUBEB_SAMPLE_FLOAT32BE
@ CUBEB_SAMPLE_FLOAT32BE
Native endian 16-bit signed PCM.
Definition cubeb.h:141
CUBEB_SAMPLE_S16BE
@ CUBEB_SAMPLE_S16BE
Little endian 32-bit IEEE floating point PCM.
Definition cubeb.h:137
CUBEB_SAMPLE_S16LE
@ CUBEB_SAMPLE_S16LE
Little endian 16-bit signed PCM.
Definition cubeb.h:135
CUBEB_SAMPLE_S16NE
@ CUBEB_SAMPLE_S16NE
Native endian 32-bit IEEE floating point PCM.
Definition cubeb.h:149
cubeb_device_state
cubeb_device_state
The state of a device.
Definition cubeb.h:329
CUBEB_DEVICE_STATE_DISABLED
@ CUBEB_DEVICE_STATE_DISABLED
The device has been disabled at the system level.
Definition cubeb.h:330
CUBEB_DEVICE_STATE_ENABLED
@ CUBEB_DEVICE_STATE_ENABLED
The device is enabled.
Definition cubeb.h:334
CUBEB_DEVICE_STATE_UNPLUGGED
@ CUBEB_DEVICE_STATE_UNPLUGGED
The device is enabled, but nothing is plugged into it.
Definition cubeb.h:332
cubeb_stream_set_input_mute
CUBEB_EXPORT int cubeb_stream_set_input_mute(cubeb_stream *stream, int mute)
Set input mute state for this stream.
cubeb_get_max_channel_count
CUBEB_EXPORT int cubeb_get_max_channel_count(cubeb *context, uint32_t *max_channels)
Get the maximum possible number of channels.
cubeb_get_supported_input_processing_params
CUBEB_EXPORT int cubeb_get_supported_input_processing_params(cubeb *context, cubeb_input_processing_params *params)
Get the supported input processing features for this backend.
cubeb_stream_prefs
cubeb_stream_prefs
Miscellaneous stream preferences.
Definition cubeb.h:234
CUBEB_STREAM_PREF_JACK_NO_AUTO_CONNECT
@ CUBEB_STREAM_PREF_JACK_NO_AUTO_CONNECT
Don't automatically try to connect ports.
Definition cubeb.h:258
CUBEB_STREAM_PREF_NONE
@ CUBEB_STREAM_PREF_NONE
No stream preferences are requested.
Definition cubeb.h:235
CUBEB_STREAM_PREF_DISABLE_DEVICE_SWITCHING
@ CUBEB_STREAM_PREF_DISABLE_DEVICE_SWITCHING
Disable switching default device on OS changes.
Definition cubeb.h:241
CUBEB_STREAM_PREF_PERSIST
@ CUBEB_STREAM_PREF_PERSIST
Request that the volume and mute settings should persist across restarts of the stream and/or applica...
Definition cubeb.h:254
CUBEB_STREAM_PREF_RAW
@ CUBEB_STREAM_PREF_RAW
Windows only.
Definition cubeb.h:251
CUBEB_STREAM_PREF_VOICE
@ CUBEB_STREAM_PREF_VOICE
This stream is going to transport voice data.
Definition cubeb.h:244
CUBEB_STREAM_PREF_LOOPBACK
@ CUBEB_STREAM_PREF_LOOPBACK
Request a loopback stream.
Definition cubeb.h:236
cubeb_stream_get_latency
CUBEB_EXPORT int cubeb_stream_get_latency(cubeb_stream *stream, uint32_t *latency)
Get the latency for this stream, in frames.
cubeb_init
CUBEB_EXPORT int cubeb_init(cubeb **context, char const *context_name, char const *backend_name)
Initialize an application context.
cubeb_stream
struct cubeb_stream cubeb_stream
Opaque handle referencing the stream state.
Definition cubeb.h:129
cubeb_stream_stop
CUBEB_EXPORT int cubeb_stream_stop(cubeb_stream *stream)
Stop playback.
cubeb_device_collection_destroy
CUBEB_EXPORT int cubeb_device_collection_destroy(cubeb *context, cubeb_device_collection *collection)
Destroy a cubeb_device_collection, and its cubeb_device_info.
cubeb_stream_get_position
CUBEB_EXPORT int cubeb_stream_get_position(cubeb_stream *stream, uint64_t *position)
Get the current stream playback position.
cubeb_state_callback
void(* cubeb_state_callback)(cubeb_stream *stream, void *user_ptr, cubeb_state state)
User supplied state callback.
Definition cubeb.h:459
cubeb_channel_layout
uint32_t cubeb_channel_layout
A bitmask representing the channel layout of a cubeb stream.
Definition cubeb.h:194
cubeb_stream_destroy
CUBEB_EXPORT void cubeb_stream_destroy(cubeb_stream *stream)
Destroy a stream.
cubeb_stream_set_name
CUBEB_EXPORT int cubeb_stream_set_name(cubeb_stream *stream, char const *stream_name)
Change a stream's name.
cubeb_device_fmt
cubeb_device_fmt
Architecture specific sample type.
Definition cubeb.h:340
CUBEB_DEVICE_FMT_S16BE
@ CUBEB_DEVICE_FMT_S16BE
16-bit integers, Big Endian.
Definition cubeb.h:342
CUBEB_DEVICE_FMT_F32BE
@ CUBEB_DEVICE_FMT_F32BE
32-bit floating point, Big Endian.
Definition cubeb.h:344
CUBEB_DEVICE_FMT_S16LE
@ CUBEB_DEVICE_FMT_S16LE
16-bit integers, Little Endian.
Definition cubeb.h:341
CUBEB_DEVICE_FMT_F32LE
@ CUBEB_DEVICE_FMT_F32LE
32-bit floating point, Little Endian.
Definition cubeb.h:343
cubeb_destroy
CUBEB_EXPORT void cubeb_destroy(cubeb *context)
Destroy an application context.
cubeb_log_level
cubeb_log_level
Level (verbosity) of logging for a particular cubeb context.
Definition cubeb.h:160
CUBEB_LOG_NORMAL
@ CUBEB_LOG_NORMAL
< Logging disabled
Definition cubeb.h:162
CUBEB_LOG_VERBOSE
@ CUBEB_LOG_VERBOSE
Verbose logging of callbacks, can have performance implications.
Definition cubeb.h:164
cubeb_input_processing_params
cubeb_input_processing_params
Input stream audio processing parameters.
Definition cubeb.h:267
CUBEB_ERROR
@ CUBEB_ERROR
Unclassified error.
Definition cubeb.h:307
CUBEB_ERROR_INVALID_FORMAT
@ CUBEB_ERROR_INVALID_FORMAT
Unsupported cubeb_stream_params requested.
Definition cubeb.h:308
CUBEB_ERROR_NOT_SUPPORTED
@ CUBEB_ERROR_NOT_SUPPORTED
Optional function not implemented in current backend.
Definition cubeb.h:311
CUBEB_ERROR_DEVICE_UNAVAILABLE
@ CUBEB_ERROR_DEVICE_UNAVAILABLE
Device specified by cubeb_devid not available.
Definition cubeb.h:313
CUBEB_OK
@ CUBEB_OK
Success.
Definition cubeb.h:306
CUBEB_ERROR_INVALID_PARAMETER
@ CUBEB_ERROR_INVALID_PARAMETER
Invalid parameter specified.
Definition cubeb.h:310
cubeb_get_min_latency
CUBEB_EXPORT int cubeb_get_min_latency(cubeb *context, cubeb_stream_params *params, uint32_t *latency_frames)
Get the minimal latency value, in frames, that is guaranteed to work when creating a stream for the s...
cubeb_state
cubeb_state
Stream states signaled via state_callback.
Definition cubeb.h:297
CUBEB_STATE_STARTED
@ CUBEB_STATE_STARTED
Stream started.
Definition cubeb.h:298
CUBEB_STATE_ERROR
@ CUBEB_STATE_ERROR
Stream disabled due to error.
Definition cubeb.h:301
CUBEB_STATE_DRAINED
@ CUBEB_STATE_DRAINED
Stream drained.
Definition cubeb.h:300
CUBEB_STATE_STOPPED
@ CUBEB_STATE_STOPPED
Stream stopped.
Definition cubeb.h:299
cubeb_stream_user_ptr
CUBEB_EXPORT void * cubeb_stream_user_ptr(cubeb_stream *stream)
Return the user data pointer registered with the stream with cubeb_stream_init.
cubeb_backend_names
Array of compiled backends returned by cubeb_get_backend_names.
Definition cubeb.h:423
cubeb_backend_names::names
const char *const * names
Array of strings representing backend names.
Definition cubeb.h:425
cubeb_backend_names::count
size_t count
Length of the array.
Definition cubeb.h:426
cubeb_device_collection
Device collection.
Definition cubeb.h:417
cubeb_device_collection::count
size_t count
Device count in collection.
Definition cubeb.h:419
cubeb_device_collection::device
cubeb_device_info * device
Array of pointers to device info.
Definition cubeb.h:418
cubeb_device_info
This structure holds the characteristics of an input or output audio device.
Definition cubeb.h:387
cubeb_device_info::state
cubeb_device_state state
State of device disabled/enabled/unplugged.
Definition cubeb.h:399
cubeb_device_info::max_rate
uint32_t max_rate
Maximum sample rate supported.
Definition cubeb.h:407
cubeb_device_info::min_rate
uint32_t min_rate
Minimum sample rate supported.
Definition cubeb.h:408
cubeb_device_info::type
cubeb_device_type type
Type of device (Input/Output).
Definition cubeb.h:398
cubeb_device_info::preferred
cubeb_device_pref preferred
Preferred device.
Definition cubeb.h:400
cubeb_device_info::default_format
cubeb_device_fmt default_format
The default sample format for this device.
Definition cubeb.h:404
cubeb_device_info::group_id
char const * group_id
Two devices have the same group identifier if they belong to the same physical device; for example a ...
Definition cubeb.h:393
cubeb_device_info::max_channels
uint32_t max_channels
Channels.
Definition cubeb.h:405
cubeb_device_info::default_rate
uint32_t default_rate
Default/Preferred sample rate.
Definition cubeb.h:406
cubeb_device_info::latency_lo
uint32_t latency_lo
Lowest possible latency in frames.
Definition cubeb.h:410
cubeb_device_info::vendor_name
char const * vendor_name
Optional vendor name, may be NULL.
Definition cubeb.h:396
cubeb_device_info::latency_hi
uint32_t latency_hi
Higest possible latency in frames.
Definition cubeb.h:411
cubeb_device_info::device_id
char const * device_id
Device identifier which might be presented in a UI.
Definition cubeb.h:390
cubeb_device_info::devid
cubeb_devid devid
Device identifier handle.
Definition cubeb.h:388
cubeb_device_info::friendly_name
char const * friendly_name
Friendly device name which might be presented in a UI.
Definition cubeb.h:391
cubeb_device_info::format
cubeb_device_fmt format
Sample format supported.
Definition cubeb.h:402
cubeb_device
Audio device description.
Definition cubeb.h:291
cubeb_device::input_name
char * input_name
The name of the input device.
Definition cubeb.h:293
cubeb_device::output_name
char * output_name
The name of the output device.
Definition cubeb.h:292
cubeb_stream_params
Stream format initialization parameters.
Definition cubeb.h:276
cubeb_stream_params::input_params
cubeb_input_processing_params input_params
Requested input processing params.
Definition cubeb.h:285
cubeb_stream_params::format
cubeb_sample_format format
Requested sample format.
Definition cubeb.h:277
cubeb_stream_params::layout
cubeb_channel_layout layout
Requested channel layout.
Definition cubeb.h:282
cubeb_stream_params::prefs
cubeb_stream_prefs prefs
Requested preferences.
Definition cubeb.h:284
cubeb_stream_params::rate
uint32_t rate
Requested sample rate.
Definition cubeb.h:279
cubeb_stream_params::channels
uint32_t channels
Requested channel count.
Definition cubeb.h:280