| OLD | NEW |
| 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 // Defines various types of timestamped media buffers used for transporting | 5 // Defines various types of timestamped media buffers used for transporting |
| 6 // data between filters. Every buffer contains a timestamp in microseconds | 6 // data between filters. Every buffer contains a timestamp in microseconds |
| 7 // describing the relative position of the buffer within the media stream, and | 7 // describing the relative position of the buffer within the media stream, and |
| 8 // the duration in microseconds for the length of time the buffer will be | 8 // the duration in microseconds for the length of time the buffer will be |
| 9 // rendered. | 9 // rendered. |
| 10 // | 10 // |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "base/basictypes.h" | 30 #include "base/basictypes.h" |
| 31 #include "base/memory/ref_counted.h" | 31 #include "base/memory/ref_counted.h" |
| 32 #include "base/time.h" | 32 #include "base/time.h" |
| 33 #include "media/base/media_export.h" | 33 #include "media/base/media_export.h" |
| 34 | 34 |
| 35 namespace media { | 35 namespace media { |
| 36 | 36 |
| 37 // Indicates an invalid or missing timestamp. | 37 // Indicates an invalid or missing timestamp. |
| 38 MEDIA_EXPORT extern const base::TimeDelta kNoTimestamp; | 38 MEDIA_EXPORT extern const base::TimeDelta kNoTimestamp; |
| 39 | 39 |
| 40 // Represents an infinite stream duration. |
| 41 MEDIA_EXPORT extern const base::TimeDelta kInfiniteDuration; |
| 42 |
| 40 class MEDIA_EXPORT StreamSample | 43 class MEDIA_EXPORT StreamSample |
| 41 : public base::RefCountedThreadSafe<StreamSample> { | 44 : public base::RefCountedThreadSafe<StreamSample> { |
| 42 public: | 45 public: |
| 43 // Returns the timestamp of this buffer in microseconds. | 46 // Returns the timestamp of this buffer in microseconds. |
| 44 base::TimeDelta GetTimestamp() const { | 47 base::TimeDelta GetTimestamp() const { |
| 45 return timestamp_; | 48 return timestamp_; |
| 46 } | 49 } |
| 47 | 50 |
| 48 // Returns the duration of this buffer in microseconds. | 51 // Returns the duration of this buffer in microseconds. |
| 49 base::TimeDelta GetDuration() const { | 52 base::TimeDelta GetDuration() const { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // If there's no data in this buffer, it represents end of stream. | 92 // If there's no data in this buffer, it represents end of stream. |
| 90 virtual bool IsEndOfStream() const OVERRIDE; | 93 virtual bool IsEndOfStream() const OVERRIDE; |
| 91 | 94 |
| 92 protected: | 95 protected: |
| 93 virtual ~Buffer() {} | 96 virtual ~Buffer() {} |
| 94 }; | 97 }; |
| 95 | 98 |
| 96 } // namespace media | 99 } // namespace media |
| 97 | 100 |
| 98 #endif // MEDIA_BASE_BUFFERS_H_ | 101 #endif // MEDIA_BASE_BUFFERS_H_ |
| OLD | NEW |