summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-12 20:44:55 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-12 20:44:55 +0000
commit09b1639499698897c778544f8701b6caad7bd220 (patch)
treeb0caaba6117e71441b26d201834c3ad5a3fa8efe /media
parent7b3b9d92c446662c6f9d40e8a7b980435613a75c (diff)
downloadchromium_src-09b1639499698897c778544f8701b6caad7bd220.zip
chromium_src-09b1639499698897c778544f8701b6caad7bd220.tar.gz
chromium_src-09b1639499698897c778544f8701b6caad7bd220.tar.bz2
Remove WriteableBuffer interface as DataBuffer is the only implementation.
Turns out we never needed multiple WritableBuffer implementations. BUG=54110 TEST=media_unittests Review URL: http://codereview.chromium.org/4824002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65988 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/base/buffers.h17
-rw-r--r--media/base/data_buffer.h17
-rw-r--r--media/base/data_buffer_unittest.cc6
-rw-r--r--media/base/filters.h1
4 files changed, 15 insertions, 26 deletions
diff --git a/media/base/buffers.h b/media/base/buffers.h
index 1b33415..9149465 100644
--- a/media/base/buffers.h
+++ b/media/base/buffers.h
@@ -103,23 +103,6 @@ class Buffer : public StreamSample {
virtual ~Buffer() {}
};
-
-class WritableBuffer : public Buffer {
- public:
- // Returns a read-write pointer to the buffer data.
- virtual uint8* GetWritableData() = 0;
-
- // Updates the size of valid data in bytes, which must be less than or equal
- // to GetBufferSize().
- virtual void SetDataSize(size_t data_size) = 0;
-
- // Returns the size of the underlying buffer.
- virtual size_t GetBufferSize() const = 0;
-
- protected:
- virtual ~WritableBuffer() {}
-};
-
} // namespace media
#endif // MEDIA_BASE_BUFFERS_H_
diff --git a/media/base/data_buffer.h b/media/base/data_buffer.h
index 26ecb8a..36fbb85 100644
--- a/media/base/data_buffer.h
+++ b/media/base/data_buffer.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2008-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// A simple implementation of WritableBuffer that takes ownership of
-// the given data pointer.
+// A simple implementation of Buffer that takes ownership of the given data
+// pointer.
//
// DataBuffer assumes that memory was allocated with new uint8[].
@@ -15,7 +15,7 @@
namespace media {
-class DataBuffer : public WritableBuffer {
+class DataBuffer : public Buffer {
public:
// Takes ownership of the passed |buffer|, assumes valid data of size
// |buffer_size|.
@@ -29,9 +29,14 @@ class DataBuffer : public WritableBuffer {
virtual const uint8* GetData() const;
virtual size_t GetDataSize() const;
- // WritableBuffer implementation.
+ // Returns a read-write pointer to the buffer data.
virtual uint8* GetWritableData();
+
+ // Updates the size of valid data in bytes, which must be less than or equal
+ // to GetBufferSize().
virtual void SetDataSize(size_t data_size);
+
+ // Returns the size of the underlying buffer.
virtual size_t GetBufferSize() const;
protected:
@@ -41,6 +46,8 @@ class DataBuffer : public WritableBuffer {
scoped_array<uint8> data_;
size_t buffer_size_;
size_t data_size_;
+
+ DISALLOW_COPY_AND_ASSIGN(DataBuffer);
};
} // namespace media
diff --git a/media/base/data_buffer_unittest.cc b/media/base/data_buffer_unittest.cc
index 8e40d1a..8c870cf 100644
--- a/media/base/data_buffer_unittest.cc
+++ b/media/base/data_buffer_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2008-2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -35,7 +35,7 @@ TEST(DataBufferTest, StreamSampleImpl) {
EXPECT_FALSE(buffer->IsDiscontinuous());
}
-TEST(DataBufferTest, Ctors) {
+TEST(DataBufferTest, Constructors) {
const size_t kTestSize = 10;
scoped_refptr<DataBuffer> buffer(new DataBuffer(0));
@@ -46,7 +46,7 @@ TEST(DataBufferTest, Ctors) {
EXPECT_EQ(kTestSize, buffer2->GetBufferSize());
}
-TEST(DataBufferTest, WritableBufferImpl) {
+TEST(DataBufferTest, ReadingWriting) {
const char kData[] = "hello";
const size_t kDataSize = arraysize(kData);
const char kNewData[] = "chromium";
diff --git a/media/base/filters.h b/media/base/filters.h
index d12e3e8..bec7d39 100644
--- a/media/base/filters.h
+++ b/media/base/filters.h
@@ -42,7 +42,6 @@ class Decoder;
class DemuxerStream;
class FilterHost;
class MediaFilter;
-class WritableBuffer;
// Identifies the type of filter implementation. Each filter has to be one of
// the following types. This is used to identify filter object during