OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_TEST_FAKE_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ | 5 #ifndef MEDIA_CAST_TEST_FAKE_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ |
6 #define MEDIA_CAST_TEST_FAKE_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ | 6 #define MEDIA_CAST_TEST_FAKE_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ |
7 | 7 |
8 #include "media/filters/gpu_video_accelerator_factories.h" | 8 #include "media/filters/gpu_video_accelerator_factories.h" |
9 | 9 |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "media/cast/test/fake_single_thread_task_runner.h" | 11 #include "media/cast/test/fake_single_thread_task_runner.h" |
12 | 12 |
13 namespace media { | 13 namespace media { |
14 namespace cast { | 14 namespace cast { |
15 namespace test { | 15 namespace test { |
16 | 16 |
17 class FakeGpuVideoAcceleratorFactories : public GpuVideoAcceleratorFactories { | 17 class FakeGpuVideoAcceleratorFactories : public GpuVideoAcceleratorFactories { |
18 public: | 18 public: |
19 explicit FakeGpuVideoAcceleratorFactories( | 19 explicit FakeGpuVideoAcceleratorFactories( |
20 const scoped_refptr<base::SingleThreadTaskRunner>& fake_task_runner); | 20 const scoped_refptr<base::SingleThreadTaskRunner>& fake_task_runner); |
21 | 21 |
22 virtual scoped_ptr<VideoEncodeAccelerator> CreateVideoEncodeAccelerator( | 22 virtual scoped_ptr<VideoEncodeAccelerator> CreateVideoEncodeAccelerator() |
23 VideoEncodeAccelerator::Client* client) OVERRIDE; | 23 OVERRIDE; |
24 | 24 |
25 virtual base::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE; | 25 virtual base::SharedMemory* CreateSharedMemory(size_t size) OVERRIDE; |
26 | 26 |
27 virtual scoped_refptr<base::SingleThreadTaskRunner> | 27 virtual scoped_refptr<base::SingleThreadTaskRunner> |
28 GetTaskRunner() OVERRIDE; | 28 GetTaskRunner() OVERRIDE; |
29 // | 29 // |
30 // The following functions are no-op. | 30 // The following functions are no-op. |
31 // | 31 // |
32 virtual uint32 CreateTextures(int32 count, | 32 virtual uint32 CreateTextures(int32 count, |
33 const gfx::Size& size, | 33 const gfx::Size& size, |
34 std::vector<uint32>* texture_ids, | 34 std::vector<uint32>* texture_ids, |
35 std::vector<gpu::Mailbox>* texture_mailboxes, | 35 std::vector<gpu::Mailbox>* texture_mailboxes, |
36 uint32 texture_target) OVERRIDE; | 36 uint32 texture_target) OVERRIDE; |
37 | 37 |
38 virtual void DeleteTexture(uint32 texture_id) OVERRIDE {} | 38 virtual void DeleteTexture(uint32 texture_id) OVERRIDE {} |
39 | 39 |
40 virtual void WaitSyncPoint(uint32 sync_point) OVERRIDE {} | 40 virtual void WaitSyncPoint(uint32 sync_point) OVERRIDE {} |
41 | 41 |
42 virtual void ReadPixels(uint32 texture_id, | 42 virtual void ReadPixels(uint32 texture_id, |
43 const gfx::Rect& visible_rect, | 43 const gfx::Rect& visible_rect, |
44 const SkBitmap& pixels) OVERRIDE {}; | 44 const SkBitmap& pixels) OVERRIDE {}; |
45 | 45 |
46 virtual scoped_ptr<VideoDecodeAccelerator> CreateVideoDecodeAccelerator( | 46 virtual scoped_ptr<VideoDecodeAccelerator> CreateVideoDecodeAccelerator( |
47 VideoCodecProfile profile, | 47 VideoCodecProfile profile) OVERRIDE; |
48 VideoDecodeAccelerator::Client* client) OVERRIDE; | |
49 | 48 |
50 private: | 49 private: |
51 friend class base::RefCountedThreadSafe<FakeGpuVideoAcceleratorFactories>; | 50 friend class base::RefCountedThreadSafe<FakeGpuVideoAcceleratorFactories>; |
52 virtual ~FakeGpuVideoAcceleratorFactories(); | 51 virtual ~FakeGpuVideoAcceleratorFactories(); |
53 | 52 |
54 const scoped_refptr<base::SingleThreadTaskRunner> fake_task_runner_; | 53 const scoped_refptr<base::SingleThreadTaskRunner> fake_task_runner_; |
55 | 54 |
56 DISALLOW_COPY_AND_ASSIGN(FakeGpuVideoAcceleratorFactories); | 55 DISALLOW_COPY_AND_ASSIGN(FakeGpuVideoAcceleratorFactories); |
57 }; | 56 }; |
58 | 57 |
59 } // namespace test | 58 } // namespace test |
60 } // namespace cast | 59 } // namespace cast |
61 } // namespace media | 60 } // namespace media |
62 | 61 |
63 #endif // MEDIA_CAST_TEST_FAKE_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ | 62 #endif // MEDIA_CAST_TEST_FAKE_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ |
OLD | NEW |