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

Side by Side Diff: media/mojo/services/mojo_cdm_allocator.h

Issue 1968833002: media: Make media mojo services a component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase only Created 4 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
« no previous file with comments | « media/mojo/services/media_mojo_export.h ('k') | media/mojo/services/mojo_cdm_service.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 2016 The Chromium Authors. All rights reserved. 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 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 #ifndef MEDIA_MOJO_SERVICES_MOJO_CDM_ALLOCATOR_H_ 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_CDM_ALLOCATOR_H_
6 #define MEDIA_MOJO_SERVICES_MOJO_CDM_ALLOCATOR_H_ 6 #define MEDIA_MOJO_SERVICES_MOJO_CDM_ALLOCATOR_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <map> 11 #include <map>
12 #include <memory> 12 #include <memory>
13 13
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/threading/thread_checker.h" 16 #include "base/threading/thread_checker.h"
17 #include "media/cdm/cdm_allocator.h" 17 #include "media/cdm/cdm_allocator.h"
18 #include "media/mojo/services/media_mojo_export.h"
18 #include "mojo/public/cpp/system/buffer.h" 19 #include "mojo/public/cpp/system/buffer.h"
19 20
20 namespace media { 21 namespace media {
21 22
22 // This is a CdmAllocator that creates buffers using mojo shared memory. 23 // This is a CdmAllocator that creates buffers using mojo shared memory.
23 // The internal logic is similar to ppapi_cdm_buffer.cc. 24 // The internal logic is similar to ppapi_cdm_buffer.cc.
24 class MojoCdmAllocator : public CdmAllocator { 25 class MEDIA_MOJO_EXPORT MojoCdmAllocator : public CdmAllocator {
25 public: 26 public:
26 MojoCdmAllocator(); 27 MojoCdmAllocator();
27 ~MojoCdmAllocator() final; 28 ~MojoCdmAllocator() final;
28 29
29 // CdmAllocator implementation. 30 // CdmAllocator implementation.
30 cdm::Buffer* CreateCdmBuffer(size_t capacity) final; 31 cdm::Buffer* CreateCdmBuffer(size_t capacity) final;
31 std::unique_ptr<VideoFrameImpl> CreateCdmVideoFrame() final; 32 std::unique_ptr<VideoFrameImpl> CreateCdmVideoFrame() final;
32 33
33 private: 34 private:
34 friend class MojoCdmAllocatorTest; 35 friend class MojoCdmAllocatorTest;
(...skipping 28 matching lines...) Expand all
63 64
64 // NOTE: Weak pointers must be invalidated before all other member variables. 65 // NOTE: Weak pointers must be invalidated before all other member variables.
65 base::WeakPtrFactory<MojoCdmAllocator> weak_ptr_factory_; 66 base::WeakPtrFactory<MojoCdmAllocator> weak_ptr_factory_;
66 67
67 DISALLOW_COPY_AND_ASSIGN(MojoCdmAllocator); 68 DISALLOW_COPY_AND_ASSIGN(MojoCdmAllocator);
68 }; 69 };
69 70
70 } // namespace media 71 } // namespace media
71 72
72 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_ALLOCATOR_H_ 73 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_ALLOCATOR_H_
OLDNEW
« no previous file with comments | « media/mojo/services/media_mojo_export.h ('k') | media/mojo/services/mojo_cdm_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698