cc: Fix logic for detecting when raster tasks were throttled
[chromium-blink-merge.git] / media / base / buffers.h
blob6a6c7303d1d52418fa0bea6ec1dd6f7db20b5be6
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Timestamps are derived directly from the encoded media file and are commonly
6 // known as the presentation timestamp (PTS). Durations are a best-guess and
7 // are usually derived from the sample/frame rate of the media file.
8 //
9 // Due to encoding and transmission errors, it is not guaranteed that timestamps
10 // arrive in a monotonically increasing order nor that the next timestamp will
11 // be equal to the previous timestamp plus the duration.
13 // In the ideal scenario for a 25fps movie, buffers are timestamped as followed:
15 // Buffer0 Buffer1 Buffer2 ... BufferN
16 // Timestamp: 0us 40000us 80000us ... (N*40000)us
17 // Duration*: 40000us 40000us 40000us ... 40000us
19 // *25fps = 0.04s per frame = 40000us per frame
21 #ifndef MEDIA_BASE_BUFFERS_H_
22 #define MEDIA_BASE_BUFFERS_H_
24 #include "base/basictypes.h"
25 #include "base/memory/ref_counted.h"
26 #include "base/time/time.h"
27 #include "media/base/media_export.h"
29 namespace media {
31 // TODO(scherkus): Move the contents of this file elsewhere.
33 // Indicates an invalid or missing timestamp.
34 MEDIA_EXPORT extern inline base::TimeDelta kNoTimestamp() {
35 return base::TimeDelta::FromMicroseconds(kint64min);
38 // Represents an infinite stream duration.
39 MEDIA_EXPORT extern inline base::TimeDelta kInfiniteDuration() {
40 return base::TimeDelta::FromMicroseconds(kint64max);
43 } // namespace media
45 #endif // MEDIA_BASE_BUFFERS_H_