Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Unified Diff: media/base/limits.h

Issue 2908073002: Make OS audio buffer size limits visible. (Closed)
Patch Set: Different approach as suggested by olka. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/base/limits.h
diff --git a/media/base/limits.h b/media/base/limits.h
index d6a50d40c5ca3d65df32209136da1181bc20d7db..9ee736842790afd31742b971cdd5544df5194477 100644
--- a/media/base/limits.h
+++ b/media/base/limits.h
@@ -7,6 +7,8 @@
#ifndef MEDIA_BASE_LIMITS_H_
#define MEDIA_BASE_LIMITS_H_
+#include "build/build_config.h"
+
namespace media {
namespace limits {
@@ -54,6 +56,28 @@ enum {
kMaxInitDataLength = 64 * 1024, // 64 KB
kMaxSessionResponseLength = 64 * 1024, // 64 KB
kMaxKeySystemLength = 256,
+
+ // Minimum and maximum buffer sizes per audio platform.
+#if defined(OS_MACOSX)
+ kMinimumInputOutputBufferSize = 128,
o1ka 2017/06/09 10:52:39 To keep it simple, maybe just name them kMinAudioB
Andrew MacPherson 2017/06/12 11:23:33 Done.
+ kMaximumInputOutputBufferSize = 4096,
+ kMinimumOutputBufferSize = kMinimumInputOutputBufferSize,
+ kMaximumOutputBufferSize = kMaximumInputOutputBufferSize,
+#elif defined(USE_PULSEAUDIO)
+ kMinimumOutputBufferSize = 512,
+ kMaximumOutputBufferSize = 8192,
+#elif defined(USE_CRAS)
+ kMinimumOutputBufferSize = 512,
o1ka 2017/06/09 10:52:39 This is a bit confusing, see AudioManagerCras::Get
Andrew MacPherson 2017/06/12 11:23:33 Done, I've dropped the minimum to 256 now. Maybe G
+ kMaximumOutputBufferSize = 8192,
+#elif defined(OS_WIN)
+ // TODO(andrew.macpherson): I can't see any maximum buffer size specified for
+ // either Android or Windows, so I'm not sure if this should be INT_MAX or
+ // something else. Specifying 4096 so that there is no behaviour change since
+ // we had hardcoded 4096 as the maximum previously.
+ kMaximumOutputBufferSize = 4096,
+#elif defined(OS_ANDROID)
+ kMaximumOutputBufferSize = 4096,
+#endif
};
} // namespace limits

Powered by Google App Engine
This is Rietveld 408576698