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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Contains limit definition constants for the media subsystem. 5 // Contains limit definition constants for the media subsystem.
6 6
7 #ifndef MEDIA_BASE_LIMITS_H_ 7 #ifndef MEDIA_BASE_LIMITS_H_
8 #define MEDIA_BASE_LIMITS_H_ 8 #define MEDIA_BASE_LIMITS_H_
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 11
12 namespace media { 12 namespace media {
13 13
14 struct Limits { 14 namespace limits {
15 // For video.
16 static const int kMaxDimension = (1 << 15) - 1; // 32767
17 static const int kMaxCanvas = (1 << (14 * 2)); // 16384 x 16384
18 15
19 // Total number of video frames which are populating in the pipeline. 16 // Maximum possible dimension (width or height) for any video.
20 static const size_t kMaxVideoFrames = 4; 17 static const int kMaxDimension = (1 << 15) - 1; // 32767
Ami GONE FROM CHROMIUM 2011/12/03 02:11:38 Drop the statics everywhere in this file. Right no
scherkus (not reviewing) 2011/12/06 02:05:57 Done.
21 18
22 // Following limits are used by AudioParameters::IsValid(). 19 // Maximum possible canvas size (width multiplied by height) for any video.
23 // The 192 Khz constant is the frequency of quicktime lossless audio codec. 20 static const int kMaxCanvas = (1 << (14 * 2)); // 16384 x 16384
24 // MP4 is limited to 96 Khz, and mp3 is limited to 48 Khz.
25 // OGG vorbis was initially limited to 96 Khz, but recent tools are unlimited.
26 // 192 Khz is also the limit on most PC audio hardware.
27 static const int kMaxSampleRate = 192000;
28 static const int kMinSampleRate = 8000;
29 static const int kMaxChannels = 32;
30 static const int kMaxBitsPerSample = 64;
31 static const int kMaxSamplesPerPacket = kMaxSampleRate;
32 21
33 // Maximum possible time. 22 // Total number of video frames which are populating in the pipeline.
34 static const int64 kMaxTimeInMicroseconds = kint64max; 23 static const size_t kMaxVideoFrames = 4;
35 }; 24
25 // Following limits are used by AudioParameters::IsValid().
Ami GONE FROM CHROMIUM 2011/12/03 02:11:38 s/Following/The following/
scherkus (not reviewing) 2011/12/06 02:05:57 Done.
Ami GONE FROM CHROMIUM 2011/12/07 01:04:48 Nope.
26 //
27 // A few notes on samples rates of common formats:
Ami GONE FROM CHROMIUM 2011/12/03 02:11:38 s/samples/sample/
28 // - AAC files are limited to 96 Khz.
Ami GONE FROM CHROMIUM 2011/12/03 02:11:38 s/Khz/kHz/ here and below.
scherkus (not reviewing) 2011/12/06 02:05:57 Done.
29 // - MP3 files are limited to 48 Khz.
30 // - Vorbis used to be limited to 96 KHz, but no longer has that restriction.
31 // - Most PC audio hardware is limited to 192 KHz.
32 static const int kMaxSampleRate = 192000;
33 static const int kMinSampleRate = 8000;
34 static const int kMaxChannels = 32;
35 static const int kMaxBitsPerSample = 64;
36 static const int kMaxSamplesPerPacket = kMaxSampleRate;
37
38 // Maximum possible time.
39 static const int64 kMaxTimeInMicroseconds = kint64max;
Ami GONE FROM CHROMIUM 2011/12/03 02:11:38 This should die. See my specific comments at call
scherkus (not reviewing) 2011/12/06 02:05:57 Done.
40
41 } // namespace limits
36 42
37 } // namespace media 43 } // namespace media
38 44
39 #endif // MEDIA_BASE_LIMITS_H_ 45 #endif // MEDIA_BASE_LIMITS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698