Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(554)

Side by Side Diff: media/base/data_buffer.cc

Issue 13682: Checking in media::DataBuffer, a simple implementation of WritableBufferInterface. (Closed)
Patch Set: it try Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/base/data_buffer.h ('k') | media/base/data_buffer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2006-2008 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.
4
5 #include "base/logging.h"
6 #include "media/base/data_buffer.h"
7
8 namespace media {
9
10 DataBuffer::DataBuffer(char* data, size_t buffer_size, size_t data_size,
11 int64 timestamp, int64 duration)
12 : data_(data),
13 buffer_size_(buffer_size),
14 data_size_(data_size),
15 timestamp_(timestamp),
16 duration_(duration) {
17 DCHECK(data);
18 DCHECK(buffer_size >= 0);
19 DCHECK(data_size <= buffer_size);
20 }
21
22 DataBuffer::~DataBuffer() {
23 delete [] data_;
24 }
25
26 int64 DataBuffer::GetTimestamp() const {
27 return timestamp_;
28 }
29
30 void DataBuffer::SetTimestamp(int64 timestamp) {
31 timestamp_ = timestamp;
32 }
33
34 int64 DataBuffer::GetDuration() const {
35 return duration_;
36 }
37
38 void DataBuffer::SetDuration(int64 duration) {
39 duration_ = duration;
40 }
41
42 const char* DataBuffer::GetData() const {
43 return data_;
44 }
45
46 size_t DataBuffer::GetDataSize() const {
47 return data_size_;
48 }
49
50 char* DataBuffer::GetWritableData() {
51 return data_;
52 }
53
54 size_t DataBuffer::GetBufferSize() const {
55 return buffer_size_;
56 }
57
58 void DataBuffer::SetDataSize(size_t data_size) {
59 data_size_ = data_size;
60 }
61
62 } // namespace media
OLDNEW
« no previous file with comments | « media/base/data_buffer.h ('k') | media/base/data_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698