summaryrefslogtreecommitdiffstats
path: root/media/base/buffers.h
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-26 23:14:45 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-26 23:14:45 +0000
commit548dbf4f083e44da8045b61e4af5e9e66397b811 (patch)
tree1d98d87836dbbe409305331e91f814da54b58ebe /media/base/buffers.h
parent46c47f32735e50227ce3bf976effe97ff3995953 (diff)
downloadchromium_src-548dbf4f083e44da8045b61e4af5e9e66397b811.zip
chromium_src-548dbf4f083e44da8045b61e4af5e9e66397b811.tar.gz
chromium_src-548dbf4f083e44da8045b61e4af5e9e66397b811.tar.bz2
Removed StreamSample as a shared base class between Buffer and VideoFrame.
The only code we've had that depended on StreamSample was PtsHeap, which was removed in r118610. Review URL: https://chromiumcodereview.appspot.com/9809032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129038 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/buffers.h')
-rw-r--r--media/base/buffers.h69
1 files changed, 25 insertions, 44 deletions
diff --git a/media/base/buffers.h b/media/base/buffers.h
index 379b175..2013a4a 100644
--- a/media/base/buffers.h
+++ b/media/base/buffers.h
@@ -2,11 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Defines various types of timestamped media buffers used for transporting
-// data between filters. Every buffer contains a timestamp in microseconds
-// describing the relative position of the buffer within the media stream, and
-// the duration in microseconds for the length of time the buffer will be
-// rendered.
+// Defines a base class for representing timestamped media data. Every buffer
+// contains a timestamp in microseconds describing the relative position of
+// the buffer within the media stream, and the duration in microseconds for
+// the length of time the buffer will be rendered.
//
// Timestamps are derived directly from the encoded media file and are commonly
// known as the presentation timestamp (PTS). Durations are a best-guess and
@@ -46,62 +45,44 @@ MEDIA_EXPORT extern inline base::TimeDelta kInfiniteDuration() {
return base::TimeDelta::FromMicroseconds(kint64max);
}
-class MEDIA_EXPORT StreamSample
- : public base::RefCountedThreadSafe<StreamSample> {
+class MEDIA_EXPORT Buffer : public base::RefCountedThreadSafe<Buffer> {
public:
- // Returns the timestamp of this buffer in microseconds.
- base::TimeDelta GetTimestamp() const {
- return timestamp_;
- }
+ // Returns a read only pointer to the buffer data.
+ virtual const uint8* GetData() const = 0;
- // Returns the duration of this buffer in microseconds.
- base::TimeDelta GetDuration() const {
- return duration_;
- }
+ // Returns the size of valid data in bytes.
+ virtual size_t GetDataSize() const = 0;
- // Indicates that the sample is the last one in the stream. This method is
- // pure virtual so implementors can decide when to declare end of stream
- // depending on specific data.
- virtual bool IsEndOfStream() const = 0;
+ // If there's no data in this buffer, it represents end of stream.
+ bool IsEndOfStream() const;
- // Sets the timestamp of this buffer in microseconds.
+ // Return DecryptConfig if buffer is encrypted, or NULL otherwise.
+ virtual const DecryptConfig* GetDecryptConfig() const;
+
+ base::TimeDelta GetTimestamp() const {
+ return timestamp_;
+ }
void SetTimestamp(const base::TimeDelta& timestamp) {
timestamp_ = timestamp;
}
- // Sets the duration of this buffer in microseconds.
+ base::TimeDelta GetDuration() const {
+ return duration_;
+ }
void SetDuration(const base::TimeDelta& duration) {
duration_ = duration;
}
protected:
- friend class base::RefCountedThreadSafe<StreamSample>;
- StreamSample();
- virtual ~StreamSample();
+ friend class base::RefCountedThreadSafe<Buffer>;
+ Buffer(base::TimeDelta timestamp, base::TimeDelta duration);
+ virtual ~Buffer();
+ private:
base::TimeDelta timestamp_;
base::TimeDelta duration_;
- private:
- DISALLOW_COPY_AND_ASSIGN(StreamSample);
-};
-
-class MEDIA_EXPORT Buffer : public StreamSample {
- public:
- // Returns a read only pointer to the buffer data.
- virtual const uint8* GetData() const = 0;
-
- // Returns the size of valid data in bytes.
- virtual size_t GetDataSize() const = 0;
-
- // If there's no data in this buffer, it represents end of stream.
- virtual bool IsEndOfStream() const OVERRIDE;
-
- // Return DecryptConfig if buffer is encrypted, or NULL otherwise.
- virtual const DecryptConfig* GetDecryptConfig() const;
-
- protected:
- virtual ~Buffer() {}
+ DISALLOW_COPY_AND_ASSIGN(Buffer);
};
} // namespace media