OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 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 #ifndef MEDIA_CDM_CDM_BUFFER_ALLOCATOR_H_ | |
6 #define MEDIA_CDM_CDM_BUFFER_ALLOCATOR_H_ | |
7 | |
8 #include <stdint.h> | |
9 | |
10 #include "base/macros.h" | |
11 #include "base/memory/ref_counted.h" | |
12 #include "base/memory/scoped_ptr.h" | |
13 #include "media/base/media_export.h" | |
14 | |
15 namespace media { | |
16 | |
17 class CdmBuffer; | |
18 class CdmVideoFrame; | |
19 | |
20 class MEDIA_EXPORT CdmBufferAllocator { | |
21 public: | |
22 virtual ~CdmBufferAllocator(); | |
23 | |
24 // Allocates a buffer with at least |capacity| bytes. The caller owns the | |
25 // buffer, and must call Release() when it is done with the memory. | |
xhwang
2016/02/11 19:24:13
The Allocate and Release calls exist on PpbBufferA
jrummell
2016/02/11 22:08:16
Changed to simply return cdm::Buffer. No more refp
| |
26 virtual scoped_refptr<CdmBuffer> Allocate(uint32_t capacity) = 0; | |
27 | |
28 // Releases the buffer. A buffer can be recycled after it is released. | |
29 virtual void Release(scoped_refptr<CdmBuffer> buffer) = 0; | |
30 | |
31 // Returns a new VideoFrameImpl. | |
32 virtual scoped_ptr<CdmVideoFrame> CreateCdmVideoFrame() = 0; | |
xhwang
2016/02/11 19:24:13
This class can create a VideoFrame now. Maybe we s
jrummell
2016/02/11 22:08:15
Done.
| |
33 | |
34 protected: | |
35 CdmBufferAllocator(); | |
36 | |
37 private: | |
38 DISALLOW_COPY_AND_ASSIGN(CdmBufferAllocator); | |
39 }; | |
40 | |
41 } // namespace media | |
42 | |
43 #endif // MEDIA_CDM_CDM_BUFFER_ALLOCATOR_H_ | |
OLD | NEW |