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

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: fixes 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. 15
16 static const int kMaxDimension = (1 << 15) - 1; // 32767 16 enum {
17 static const int kMaxCanvas = (1 << (14 * 2)); // 16384 x 16384 17 // Maximum possible dimension (width or height) for any video.
18 kMaxDimension = (1 << 15) - 1, // 32767
19
20 // Maximum possible canvas size (width multiplied by height) for any video.
21 kMaxCanvas = (1 << (14 * 2)), // 16384 x 16384
18 22
19 // Total number of video frames which are populating in the pipeline. 23 // Total number of video frames which are populating in the pipeline.
20 static const size_t kMaxVideoFrames = 4; 24 kMaxVideoFrames = 4,
21 25
22 // Following limits are used by AudioParameters::IsValid(). 26 // Following limits are used by AudioParameters::IsValid().
23 // The 192 Khz constant is the frequency of quicktime lossless audio codec. 27 //
24 // MP4 is limited to 96 Khz, and mp3 is limited to 48 Khz. 28 // A few notes on samples rates of common formats:
Ami GONE FROM CHROMIUM 2011/12/07 01:04:48 depluralize "samples"
scherkus (not reviewing) 2011/12/07 05:56:56 whoops I must of lost those changes when I ditched
25 // OGG vorbis was initially limited to 96 Khz, but recent tools are unlimited. 29 // - AAC files are limited to 96 kHz.
26 // 192 Khz is also the limit on most PC audio hardware. 30 // - MP3 files are limited to 48 kHz.
27 static const int kMaxSampleRate = 192000; 31 // - Vorbis used to be limited to 96 KHz, but no longer has that
28 static const int kMinSampleRate = 8000; 32 // restriction.
29 static const int kMaxChannels = 32; 33 // - Most PC audio hardware is limited to 192 KHz.
30 static const int kMaxBitsPerSample = 64; 34 kMaxSampleRate = 192000,
31 static const int kMaxSamplesPerPacket = kMaxSampleRate; 35 kMinSampleRate = 8000,
36 kMaxChannels = 32,
37 kMaxBitsPerSample = 64,
38 kMaxSamplesPerPacket = kMaxSampleRate,
32 39
33 // Maximum possible time. 40 // Represents an infinite stream duration.
34 static const int64 kMaxTimeInMicroseconds = kint64max; 41 kInfiniteDuration = kint64max,
35 }; 42 };
36 43
44 } // namespace limits
45
37 } // namespace media 46 } // namespace media
38 47
39 #endif // MEDIA_BASE_LIMITS_H_ 48 #endif // MEDIA_BASE_LIMITS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698