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

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

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/buffers.h ('k') | media/base/data_buffer.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 // A simple implementation of WritableBufferInterface that takes ownership of
6 // the given data pointer.
7 //
8 // DataBuffer assumes that memory was allocated with new char[].
9
10 #ifndef MEDIA_BASE_DATA_BUFFER_H_
11 #define MEDIA_BASE_DATA_BUFFER_H_
12
13 #include "media/base/buffers.h"
14
15 namespace media {
16
17 class DataBuffer : public WritableBufferInterface {
18 public:
19 DataBuffer(char* data, size_t buffer_size, size_t data_size,
20 int64 timestamp, int64 duration);
21
22 // StreamSampleInterface
23 virtual int64 GetTimestamp() const;
24 virtual void SetTimestamp(int64 timestamp);
25 virtual int64 GetDuration() const;
26 virtual void SetDuration(int64 duration);
27
28 // BufferInterface
29 virtual const char* GetData() const;
30 virtual size_t GetDataSize() const;
31
32 // WritableBufferInterface
33 virtual char* GetWritableData();
34 virtual size_t GetBufferSize() const;
35 virtual void SetDataSize(size_t data_size);
36
37 protected:
38 virtual ~DataBuffer();
39
40 private:
41 char* data_;
42 size_t buffer_size_;
43 size_t data_size_;
44 int64 timestamp_;
45 int64 duration_;
46 };
47
48 } // namespace media
49
50 #endif // MEDIA_BASE_DATA_BUFFER_H_
OLDNEW
« no previous file with comments | « media/base/buffers.h ('k') | media/base/data_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698