-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
CMakeLists: Add flag to disable Cubeb #13306
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -11,10 +11,13 @@ | |||
#include "AudioCommon/SoundStream.h" | ||||
#include "Common/WorkQueueThread.h" | ||||
|
||||
#ifdef HAVE_CUBEB | ||||
#include <cubeb/cubeb.h> | ||||
#endif | ||||
|
||||
class CubebStream final : public SoundStream | ||||
{ | ||||
#ifdef HAVE_CUBEB | ||||
public: | ||||
CubebStream(); | ||||
CubebStream(const CubebStream& other) = delete; | ||||
|
@@ -25,6 +28,7 @@ class CubebStream final : public SoundStream | |||
bool Init() override; | ||||
bool SetRunning(bool running) override; | ||||
void SetVolume(int) override; | ||||
static bool IsValid() { return true; } | ||||
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. Shouldn't this have a symmetric one in the 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. If it isn't defined, then it will fall back to the
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. Oh, great, I didn't realize it was a base class method. Too bad you can't slap |
||||
|
||||
private: | ||||
bool m_stereo = false; | ||||
|
@@ -43,4 +47,5 @@ class CubebStream final : public SoundStream | |||
static long DataCallback(cubeb_stream* stream, void* user_data, const void* /*input_buffer*/, | ||||
void* output_buffer, long num_frames); | ||||
static void StateCallback(cubeb_stream* stream, void* user_data, cubeb_state state); | ||||
#endif | ||||
}; |
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.
Can we just move this out of the
#ifdef
soup and do it all the time? I'd expect that any platforms not in this chain (likeANDROID
for example) to returnfalse
so it'd be skipped anyways.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.
afaik Android uses OpenSL ES by default, so moving this block out of the ifdefs would cause Android to default to Cubeb.
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.
Yeah well, you could move it in front, but I guess either is fine then 🤷
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 that would then affect Linux instead and make ALSA the default backend instead of Cubeb?
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.
Hm true. Bleh. Nevermind then I guess. But such define chains usually irk the heck out of me, and I try to avoid (or rewrite) them in favor of making it easier to follow. Not today I suppose.