summaryrefslogtreecommitdiffstats
path: root/media/base/data_buffer.cc
diff options
context:
space:
mode:
authorscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-16 21:46:10 +0000
committerscherkus@chromium.org <scherkus@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-16 21:46:10 +0000
commitd8a447c5f7eef2dfe00a2a80466288be0d7329f7 (patch)
tree81378251205188e2718b4fc73282e62beca1c624 /media/base/data_buffer.cc
parentf7842f9049b7c2a16e29f01d713685ab32cd4c47 (diff)
downloadchromium_src-d8a447c5f7eef2dfe00a2a80466288be0d7329f7.zip
chromium_src-d8a447c5f7eef2dfe00a2a80466288be0d7329f7.tar.gz
chromium_src-d8a447c5f7eef2dfe00a2a80466288be0d7329f7.tar.bz2
Checking in media::DataBuffer, a simple implementation of WritableBufferInterface.
Removed media/base/media.cc, since it's no longer needed to generate media.lib. Also added media/using_media.scons and updated scons files for Linux build. Review URL: http://codereview.chromium.org/13682 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7099 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/data_buffer.cc')
-rwxr-xr-xmedia/base/data_buffer.cc62
1 files changed, 62 insertions, 0 deletions
diff --git a/media/base/data_buffer.cc b/media/base/data_buffer.cc
new file mode 100755
index 0000000..c5c290d
--- /dev/null
+++ b/media/base/data_buffer.cc
@@ -0,0 +1,62 @@
+// Copyright (c) 2006-2008 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.
+
+#include "base/logging.h"
+#include "media/base/data_buffer.h"
+
+namespace media {
+
+DataBuffer::DataBuffer(char* data, size_t buffer_size, size_t data_size,
+ int64 timestamp, int64 duration)
+ : data_(data),
+ buffer_size_(buffer_size),
+ data_size_(data_size),
+ timestamp_(timestamp),
+ duration_(duration) {
+ DCHECK(data);
+ DCHECK(buffer_size >= 0);
+ DCHECK(data_size <= buffer_size);
+}
+
+DataBuffer::~DataBuffer() {
+ delete [] data_;
+}
+
+int64 DataBuffer::GetTimestamp() const {
+ return timestamp_;
+}
+
+void DataBuffer::SetTimestamp(int64 timestamp) {
+ timestamp_ = timestamp;
+}
+
+int64 DataBuffer::GetDuration() const {
+ return duration_;
+}
+
+void DataBuffer::SetDuration(int64 duration) {
+ duration_ = duration;
+}
+
+const char* DataBuffer::GetData() const {
+ return data_;
+}
+
+size_t DataBuffer::GetDataSize() const {
+ return data_size_;
+}
+
+char* DataBuffer::GetWritableData() {
+ return data_;
+}
+
+size_t DataBuffer::GetBufferSize() const {
+ return buffer_size_;
+}
+
+void DataBuffer::SetDataSize(size_t data_size) {
+ data_size_ = data_size;
+}
+
+} // namespace media