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

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

Issue 10949029: Replace av_malloc with AlignedAlloc for memory allocation in DecoderBuffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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.cc » ('j') | media/base/decoder_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 specialized buffer for interfacing with audio / video decoders. 5 // A specialized buffer for interfacing with audio / video decoders.
6 // 6 //
7 // Specifically ensures that data is aligned and padded as necessary by the 7 // Specifically ensures that data is aligned and padded as necessary by the
8 // underlying decoding framework. On desktop platforms this means memory is 8 // underlying decoding framework. On desktop platforms this means memory is
9 // allocated using FFmpeg with particular alignment and padding requirements. 9 // allocated using FFmpeg with particular alignment and padding requirements.
10 // 10 //
11 // Also includes decoder specific functionality for decryption. 11 // Also includes decoder specific functionality for decryption.
12 12
13 #ifndef MEDIA_BASE_DECODER_BUFFER_H_ 13 #ifndef MEDIA_BASE_DECODER_BUFFER_H_
14 #define MEDIA_BASE_DECODER_BUFFER_H_ 14 #define MEDIA_BASE_DECODER_BUFFER_H_
15 15
16 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
17 #include "media/base/buffers.h" 17 #include "media/base/buffers.h"
18 #include "media/base/decrypt_config.h" 18 #include "media/base/decrypt_config.h"
19 19
20 namespace media { 20 namespace media {
21 21
22 class MEDIA_EXPORT DecoderBuffer : public Buffer { 22 class MEDIA_EXPORT DecoderBuffer : public Buffer {
23 public: 23 public:
24 static const int kPaddingSize = 16;
DaleCurtis 2012/09/20 00:00:04 Comments for both. enum { kPaddingBytes = 16, kAl
xhwang 2012/09/20 01:43:03 Done.
25 static const int kAlignmentSize = 32;
26
24 // Allocates buffer of size |buffer_size| >= 0. Buffer will be padded and 27 // Allocates buffer of size |buffer_size| >= 0. Buffer will be padded and
25 // aligned as necessary. 28 // aligned as necessary.
26 explicit DecoderBuffer(int buffer_size); 29 explicit DecoderBuffer(int buffer_size);
27 30
28 // Create a DecoderBuffer whose |data_| is copied from |data|. Buffer will be 31 // Create a DecoderBuffer whose |data_| is copied from |data|. Buffer will be
29 // padded and aligned as necessary. |data| must not be NULL and |size| >= 0. 32 // padded and aligned as necessary. |data| must not be NULL and |size| >= 0.
30 static scoped_refptr<DecoderBuffer> CopyFrom(const uint8* data, int size); 33 static scoped_refptr<DecoderBuffer> CopyFrom(const uint8* data, int size);
31 34
32 // Create a DecoderBuffer indicating we've reached end of stream. GetData() 35 // Create a DecoderBuffer indicating we've reached end of stream. GetData()
33 // and GetWritableData() will return NULL and GetDataSize() will return 0. 36 // and GetWritableData() will return NULL and GetDataSize() will return 0.
(...skipping 23 matching lines...) Expand all
57 60
58 // Constructor helper method for memory allocations. 61 // Constructor helper method for memory allocations.
59 void Initialize(); 62 void Initialize();
60 63
61 DISALLOW_COPY_AND_ASSIGN(DecoderBuffer); 64 DISALLOW_COPY_AND_ASSIGN(DecoderBuffer);
62 }; 65 };
63 66
64 } // namespace media 67 } // namespace media
65 68
66 #endif // MEDIA_BASE_DECODER_BUFFER_H_ 69 #endif // MEDIA_BASE_DECODER_BUFFER_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/decoder_buffer.cc » ('j') | media/base/decoder_buffer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698