OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CAST_SENDER_FAKE_VIDEO_ENCODE_ACCELERATOR_FACTORY_H_ | 5 #ifndef MEDIA_CAST_SENDER_FAKE_VIDEO_ENCODE_ACCELERATOR_FACTORY_H_ |
6 #define MEDIA_CAST_SENDER_FAKE_VIDEO_ENCODE_ACCELERATOR_FACTORY_H_ | 6 #define MEDIA_CAST_SENDER_FAKE_VIDEO_ENCODE_ACCELERATOR_FACTORY_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
| 10 #include <memory> |
| 11 |
10 #include "base/callback.h" | 12 #include "base/callback.h" |
11 #include "base/macros.h" | 13 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "base/memory/shared_memory.h" | 15 #include "base/memory/shared_memory.h" |
15 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
16 #include "media/cast/cast_config.h" | 17 #include "media/cast/cast_config.h" |
17 #include "media/video/fake_video_encode_accelerator.h" | 18 #include "media/video/fake_video_encode_accelerator.h" |
18 | 19 |
19 namespace media { | 20 namespace media { |
20 namespace cast { | 21 namespace cast { |
21 | 22 |
22 // Used by test code to create fake VideoEncodeAccelerators. The test code | 23 // Used by test code to create fake VideoEncodeAccelerators. The test code |
23 // controls when the response callback is invoked. | 24 // controls when the response callback is invoked. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 void RespondWithVideoEncodeAccelerator(); | 69 void RespondWithVideoEncodeAccelerator(); |
69 | 70 |
70 // Runs the |callback| provided to the last call to | 71 // Runs the |callback| provided to the last call to |
71 // CreateSharedMemory() with the new base::SharedMemory instance. | 72 // CreateSharedMemory() with the new base::SharedMemory instance. |
72 void RespondWithSharedMemory(); | 73 void RespondWithSharedMemory(); |
73 | 74 |
74 private: | 75 private: |
75 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 76 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
76 bool will_init_succeed_; | 77 bool will_init_succeed_; |
77 bool auto_respond_; | 78 bool auto_respond_; |
78 scoped_ptr<media::VideoEncodeAccelerator> next_response_vea_; | 79 std::unique_ptr<media::VideoEncodeAccelerator> next_response_vea_; |
79 ReceiveVideoEncodeAcceleratorCallback vea_response_callback_; | 80 ReceiveVideoEncodeAcceleratorCallback vea_response_callback_; |
80 scoped_ptr<base::SharedMemory> next_response_shm_; | 81 std::unique_ptr<base::SharedMemory> next_response_shm_; |
81 ReceiveVideoEncodeMemoryCallback shm_response_callback_; | 82 ReceiveVideoEncodeMemoryCallback shm_response_callback_; |
82 int vea_response_count_; | 83 int vea_response_count_; |
83 int shm_response_count_; | 84 int shm_response_count_; |
84 media::VideoEncodeAccelerator* last_response_vea_; | 85 media::VideoEncodeAccelerator* last_response_vea_; |
85 base::SharedMemory* last_response_shm_; | 86 base::SharedMemory* last_response_shm_; |
86 | 87 |
87 DISALLOW_COPY_AND_ASSIGN(FakeVideoEncodeAcceleratorFactory); | 88 DISALLOW_COPY_AND_ASSIGN(FakeVideoEncodeAcceleratorFactory); |
88 }; | 89 }; |
89 | 90 |
90 } // namespace cast | 91 } // namespace cast |
91 } // namespace media | 92 } // namespace media |
92 | 93 |
93 #endif // MEDIA_CAST_SENDER_FAKE_VIDEO_ENCODE_ACCELERATOR_FACTORY_H_ | 94 #endif // MEDIA_CAST_SENDER_FAKE_VIDEO_ENCODE_ACCELERATOR_FACTORY_H_ |
OLD | NEW |