OLD | NEW |
| (Empty) |
1 // Copyright 2014 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 CHROMECAST_COMMON_MEDIA_SHARED_MEMORY_CHUNK_H_ | |
6 #define CHROMECAST_COMMON_MEDIA_SHARED_MEMORY_CHUNK_H_ | |
7 | |
8 #include <stddef.h> | |
9 | |
10 #include <memory> | |
11 | |
12 #include "base/macros.h" | |
13 #include "chromecast/media/cma/ipc/media_memory_chunk.h" | |
14 | |
15 namespace base { | |
16 class SharedMemory; | |
17 } | |
18 | |
19 namespace chromecast { | |
20 namespace media { | |
21 | |
22 class SharedMemoryChunk : public MediaMemoryChunk { | |
23 public: | |
24 SharedMemoryChunk(std::unique_ptr<base::SharedMemory> shared_mem, | |
25 size_t size); | |
26 ~SharedMemoryChunk() override; | |
27 | |
28 // MediaMemoryChunk implementation. | |
29 void* data() const override; | |
30 size_t size() const override; | |
31 bool valid() const override; | |
32 | |
33 private: | |
34 std::unique_ptr<base::SharedMemory> shared_mem_; | |
35 size_t size_; | |
36 | |
37 DISALLOW_COPY_AND_ASSIGN(SharedMemoryChunk); | |
38 }; | |
39 | |
40 } // namespace media | |
41 } // namespace chromecast | |
42 | |
43 #endif // CHROMECAST_COMMON_MEDIA_SHARED_MEMORY_CHUNK_H_ | |
OLD | NEW |