OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 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 #include "media/cast/test/fake_gpu_video_accelerator_factories.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "media/cast/test/fake_video_encode_accelerator.h" |
| 9 |
| 10 namespace media { |
| 11 namespace cast { |
| 12 namespace test { |
| 13 |
| 14 FakeGpuVideoAcceleratorFactories::FakeGpuVideoAcceleratorFactories( |
| 15 const scoped_refptr<base::TaskRunner>& fake_task_runner) |
| 16 : fake_task_runner_(fake_task_runner) { |
| 17 } |
| 18 |
| 19 FakeGpuVideoAcceleratorFactories::~FakeGpuVideoAcceleratorFactories() { |
| 20 } |
| 21 |
| 22 scoped_ptr<VideoEncodeAccelerator> |
| 23 FakeGpuVideoAcceleratorFactories::CreateVideoEncodeAccelerator( |
| 24 VideoEncodeAccelerator::Client* client) { |
| 25 return scoped_ptr<VideoEncodeAccelerator>( |
| 26 new FakeVideoEncodeAccelerator(client)); |
| 27 } |
| 28 |
| 29 base::SharedMemory* FakeGpuVideoAcceleratorFactories::CreateSharedMemory( |
| 30 size_t size) { |
| 31 base::SharedMemory* shm = new base::SharedMemory(); |
| 32 if (!shm->CreateAndMapAnonymous(size)) { |
| 33 NOTREACHED(); |
| 34 } |
| 35 return shm; |
| 36 } |
| 37 |
| 38 scoped_refptr<base::SingleThreadTaskRunner> |
| 39 FakeGpuVideoAcceleratorFactories::GetTaskRunner() { |
| 40 return scoped_refptr<base::SingleThreadTaskRunner>( |
| 41 static_cast<base::SingleThreadTaskRunner*>(fake_task_runner_.get())); |
| 42 } |
| 43 |
| 44 uint32 FakeGpuVideoAcceleratorFactories::CreateTextures( |
| 45 int32 count, |
| 46 const gfx::Size& size, |
| 47 std::vector<uint32>* texture_ids, |
| 48 std::vector<gpu::Mailbox>* texture_mailboxes, |
| 49 uint32 texture_target) { |
| 50 return 0; |
| 51 } |
| 52 |
| 53 scoped_ptr<VideoDecodeAccelerator> |
| 54 FakeGpuVideoAcceleratorFactories::CreateVideoDecodeAccelerator( |
| 55 VideoCodecProfile profile, |
| 56 VideoDecodeAccelerator::Client* client) { |
| 57 return scoped_ptr<VideoDecodeAccelerator>( |
| 58 static_cast<media::VideoDecodeAccelerator*>(NULL)); |
| 59 } |
| 60 |
| 61 bool FakeGpuVideoAcceleratorFactories::IsAborted() { |
| 62 return false; |
| 63 } |
| 64 |
| 65 } // namespace test |
| 66 } // namespace cast |
| 67 } // namespace media |
| 68 |
OLD | NEW |