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

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

Issue 10269022: Add StreamParserBuffer to ChunkDemuxer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to CR 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/base/data_buffer.cc » ('j') | media/base/data_buffer.cc » ('J')
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 27 matching lines...) Expand all
38 // Updates the size of valid data in bytes, which must be less than or equal 38 // Updates the size of valid data in bytes, which must be less than or equal
39 // to GetBufferSize(). 39 // to GetBufferSize().
40 virtual void SetDataSize(int data_size); 40 virtual void SetDataSize(int data_size);
41 41
42 // Returns the size of the underlying buffer. 42 // Returns the size of the underlying buffer.
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 DataBuffer(const uint8* data, int size);
Ami GONE FROM CHROMIUM 2012/05/02 17:57:25 // Copies from [data,data+size) to owned array.
vrk (LEFT CHROMIUM) 2012/05/02 19:55:18 Done.
48 virtual ~DataBuffer(); 49 virtual ~DataBuffer();
49 50
50 private: 51 private:
52 // Helper method to allocate |data_| with at least |buffer_size| bytes.
53 void AllocateBuffer(int buffer_size);
54
51 scoped_array<uint8> data_; 55 scoped_array<uint8> data_;
52 int buffer_size_; 56 int buffer_size_;
53 int data_size_; 57 int data_size_;
54 scoped_ptr<DecryptConfig> decrypt_config_; 58 scoped_ptr<DecryptConfig> decrypt_config_;
55 59
56 DISALLOW_COPY_AND_ASSIGN(DataBuffer); 60 DISALLOW_COPY_AND_ASSIGN(DataBuffer);
57 }; 61 };
58 62
59 } // namespace media 63 } // namespace media
60 64
61 #endif // MEDIA_BASE_DATA_BUFFER_H_ 65 #endif // MEDIA_BASE_DATA_BUFFER_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/data_buffer.cc » ('j') | media/base/data_buffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698