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

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

Issue 11993002: Tighten up media::DecoderBuffer API contract for end of stream buffers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | media/base/decoder_buffer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_BASE_DATA_BUFFER_H_ 5 #ifndef MEDIA_BASE_DATA_BUFFER_H_
6 #define MEDIA_BASE_DATA_BUFFER_H_ 6 #define MEDIA_BASE_DATA_BUFFER_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/time.h" 10 #include "base/time.h"
11 #include "media/base/media_export.h" 11 #include "media/base/media_export.h"
12 12
13 namespace media { 13 namespace media {
14 14
15 // A simple buffer that takes ownership of the given data pointer or allocates 15 // A simple buffer that takes ownership of the given data pointer or allocates
16 // as necessary. 16 // as necessary.
17 // 17 //
18 // Unlike DecoderBuffer, allocations are assumed to be allocated with the 18 // Unlike DecoderBuffer, allocations are assumed to be allocated with the
19 // default memory allocator (i.e., new uint8[]). 19 // default memory allocator (i.e., new uint8[]).
20 //
21 // NOTE: It is illegal to call any method when IsEndOfStream() is true.
20 class MEDIA_EXPORT DataBuffer : public base::RefCountedThreadSafe<DataBuffer> { 22 class MEDIA_EXPORT DataBuffer : public base::RefCountedThreadSafe<DataBuffer> {
21 public: 23 public:
22 // Allocates buffer of size |buffer_size| >= 0. 24 // Allocates buffer of size |buffer_size| >= 0.
23 explicit DataBuffer(int buffer_size); 25 explicit DataBuffer(int buffer_size);
24 26
25 // Assumes valid data of size |buffer_size|. 27 // Assumes valid data of size |buffer_size|.
26 DataBuffer(scoped_array<uint8> buffer, int buffer_size); 28 DataBuffer(scoped_array<uint8> buffer, int buffer_size);
27 29
28 // Create a DataBuffer whose |data_| is copied from |data|. 30 // Create a DataBuffer whose |data_| is copied from |data|.
29 // 31 //
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 scoped_array<uint8> data_; 74 scoped_array<uint8> data_;
73 int buffer_size_; 75 int buffer_size_;
74 int data_size_; 76 int data_size_;
75 77
76 DISALLOW_COPY_AND_ASSIGN(DataBuffer); 78 DISALLOW_COPY_AND_ASSIGN(DataBuffer);
77 }; 79 };
78 80
79 } // namespace media 81 } // namespace media
80 82
81 #endif // MEDIA_BASE_DATA_BUFFER_H_ 83 #endif // MEDIA_BASE_DATA_BUFFER_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/decoder_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698