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

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

Issue 10228017: Add initial implementation of SourceBufferStream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase ToT Created 8 years, 7 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/filters/source_buffer_stream.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 // A simple implementation of Buffer that takes ownership of the given data 5 // A simple implementation of Buffer that takes ownership of the given data
6 // pointer. 6 // pointer.
7 // 7 //
8 // DataBuffer assumes that memory was allocated with new uint8[]. 8 // DataBuffer assumes that memory was allocated with new uint8[].
9 9
10 #ifndef MEDIA_BASE_DATA_BUFFER_H_ 10 #ifndef MEDIA_BASE_DATA_BUFFER_H_
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 virtual int GetBufferSize() const; 43 virtual int GetBufferSize() const;
44 44
45 virtual void SetDecryptConfig(scoped_ptr<DecryptConfig> decrypt_config); 45 virtual void SetDecryptConfig(scoped_ptr<DecryptConfig> decrypt_config);
46 46
47 protected: 47 protected:
48 // Copies from [data,data+size) to owned array. 48 // Copies from [data,data+size) to owned array.
49 DataBuffer(const uint8* data, int size); 49 DataBuffer(const uint8* data, int size);
50 virtual ~DataBuffer(); 50 virtual ~DataBuffer();
51 51
52 private: 52 private:
53 // Helper method to allocate |data_| with at least |buffer_size| bytes.
54 void AllocateBuffer(int buffer_size);
55
53 scoped_array<uint8> data_; 56 scoped_array<uint8> data_;
54 int buffer_size_; 57 int buffer_size_;
55 int data_size_; 58 int data_size_;
56 scoped_ptr<DecryptConfig> decrypt_config_; 59 scoped_ptr<DecryptConfig> decrypt_config_;
57 60
58 DISALLOW_COPY_AND_ASSIGN(DataBuffer); 61 DISALLOW_COPY_AND_ASSIGN(DataBuffer);
59 }; 62 };
60 63
61 } // namespace media 64 } // namespace media
62 65
63 #endif // MEDIA_BASE_DATA_BUFFER_H_ 66 #endif // MEDIA_BASE_DATA_BUFFER_H_
OLDNEW
« no previous file with comments | « no previous file | media/filters/source_buffer_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698