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

Unified Diff: media/base/limits.h

Issue 8786013: Replace media::Limits struct with media::limits namespace and update documentation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix logic Created 9 years 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
« no previous file with comments | « media/base/buffers.cc ('k') | media/base/video_decoder_config.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/limits.h
diff --git a/media/base/limits.h b/media/base/limits.h
index 93522d2baa28c165d7227baf83758644c30e0b93..2f5b80169cb1261c7a4645134d72eee3f46d8fb9 100644
--- a/media/base/limits.h
+++ b/media/base/limits.h
@@ -11,29 +11,35 @@
namespace media {
-struct Limits {
- // For video.
- static const int kMaxDimension = (1 << 15) - 1; // 32767
- static const int kMaxCanvas = (1 << (14 * 2)); // 16384 x 16384
+namespace limits {
+
+enum {
+ // Maximum possible dimension (width or height) for any video.
+ kMaxDimension = (1 << 15) - 1, // 32767
+
+ // Maximum possible canvas size (width multiplied by height) for any video.
+ kMaxCanvas = (1 << (14 * 2)), // 16384 x 16384
// Total number of video frames which are populating in the pipeline.
- static const size_t kMaxVideoFrames = 4;
-
- // Following limits are used by AudioParameters::IsValid().
- // The 192 Khz constant is the frequency of quicktime lossless audio codec.
- // MP4 is limited to 96 Khz, and mp3 is limited to 48 Khz.
- // OGG vorbis was initially limited to 96 Khz, but recent tools are unlimited.
- // 192 Khz is also the limit on most PC audio hardware.
- static const int kMaxSampleRate = 192000;
- static const int kMinSampleRate = 8000;
- static const int kMaxChannels = 32;
- static const int kMaxBitsPerSample = 64;
- static const int kMaxSamplesPerPacket = kMaxSampleRate;
-
- // Maximum possible time.
- static const int64 kMaxTimeInMicroseconds = kint64max;
+ kMaxVideoFrames = 4,
+
+ // The following limits are used by AudioParameters::IsValid().
+ //
+ // A few notes on sample rates of common formats:
+ // - AAC files are limited to 96 kHz.
+ // - MP3 files are limited to 48 kHz.
+ // - Vorbis used to be limited to 96 KHz, but no longer has that
+ // restriction.
+ // - Most PC audio hardware is limited to 192 KHz.
+ kMaxSampleRate = 192000,
+ kMinSampleRate = 8000,
+ kMaxChannels = 32,
+ kMaxBitsPerSample = 64,
+ kMaxSamplesPerPacket = kMaxSampleRate,
};
+} // namespace limits
+
} // namespace media
#endif // MEDIA_BASE_LIMITS_H_
« no previous file with comments | « media/base/buffers.cc ('k') | media/base/video_decoder_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698