-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cubeb.h: Document device switching policy. #582
Open
kinetiknz
wants to merge
1
commit into
master
Choose a base branch
from
devchg_docs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -482,6 +482,21 @@ CUBEB_EXPORT int cubeb_get_preferred_sample_rate(cubeb * context, uint32_t * rat | |
CUBEB_EXPORT void cubeb_destroy(cubeb * context); | ||
|
||
/** Initialize a stream associated with the supplied application context. | ||
|
||
@note A NULL @p output_device or @p input_device will cause cubeb to use | ||
the OS default device for that direction. In this case, cubeb will | ||
automatically switch to a new OS default if a device change is detected. | ||
To disable automatic switching, set @ref | ||
CUBEB_STREAM_PREF_DISABLE_DEVICE_SWITCHING on @ref | ||
cubeb_stream_params.prefs. | ||
|
||
@note If @p output_device or @p input_device is a valid non-NULL @ref | ||
cubeb_devid, cubeb will only ever use the specified device and never | ||
follow device changes automatically. In this case, the application may | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
manage device changes using @ref | ||
cubeb_stream_register_device_changed_callback or @ref | ||
cubeb_register_device_collection_changed. | ||
|
||
@param context A pointer to the cubeb context. | ||
@param stream An out parameter to be filled with the an opaque pointer to a | ||
cubeb stream. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
output_device
selection isn't supported inaudiounit-rust
yet. @padenot : Do we have a plan to support that? (however, the test might be ready here)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it seems we do support
output_device
selection, but I never tested it.If the stream needs to be reinitialize to default output device when the specified
output_device
is no longer available, then we do need to listenkAudioDevicePropertyDeviceIsAlive
for output device like what we do for the input side.On the other hand, if the stream using the specified
output_device
doesn't need to be reinitialized when the specifiedoutput_device
is no longer available, it seemsaudiounit-rust
meets the spec here.Anyway, my problem is: what is the intended behavior when the specified
output_device
orinput_device
is unplugged while they are being used by some active streams?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in flux at the minute. The current behaviour we want in gecko:
When @achronop finishes
setSinkId
, we'll reevaluate this (or as part of his effort).I had a design a long time ago that would allow enough flexibility to implement whatever we need: https://github.com/kinetiknz/cubeb/issues/167. I think it still works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in general the behaviour @kinetiknz documents here is simpler and works just as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I am not missing something the output device is always non-explicit at the moment in Gecko so @kinetiknz 's document covers our needs. This will be changed when sinkId is in place but we can re-evaluate then. I have already some thoughts about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think my question is here:
We do change the output device if the specified
output device
is no longer available but the document states: cubeb never follow device changes automatically.I am ok to reword these once
setSinkId
is done. Just want to make sure this issue is one someone's radar.