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

Side by Side Diff: media/cdm/cdm_buffer_allocator.h

Issue 1673383002: Add allocator interface for use by cdm_adapter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simple classes Created 4 years, 10 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
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698