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

Side by Side Diff: media/cast/test/fake_gpu_video_accelerator_factories.cc

Issue 207593002: Cast: Enable use of VideoEncodeAccelerator for hardware video encoding (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: typedef Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
(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 #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 #include "media/video/video_decode_accelerator.h"
10
11 namespace media {
12 namespace cast {
13 namespace test {
14
15 FakeGpuVideoAcceleratorFactories::FakeGpuVideoAcceleratorFactories(
16 const scoped_refptr<base::SingleThreadTaskRunner>& fake_task_runner)
17 : fake_task_runner_(fake_task_runner) {}
18
19 FakeGpuVideoAcceleratorFactories::~FakeGpuVideoAcceleratorFactories() {}
20
21 scoped_ptr<VideoEncodeAccelerator>
22 FakeGpuVideoAcceleratorFactories::CreateVideoEncodeAccelerator() {
23 return scoped_ptr<VideoEncodeAccelerator>(new FakeVideoEncodeAccelerator());
24 }
25
26 base::SharedMemory* FakeGpuVideoAcceleratorFactories::CreateSharedMemory(
27 size_t size) {
28 base::SharedMemory* shm = new base::SharedMemory();
29 if (!shm->CreateAndMapAnonymous(size)) {
30 NOTREACHED();
31 }
32 return shm;
33 }
34
35 scoped_refptr<base::SingleThreadTaskRunner>
36 FakeGpuVideoAcceleratorFactories::GetTaskRunner() {
37 return fake_task_runner_;
38 }
39
40 bool FakeGpuVideoAcceleratorFactories::CreateTextures(
41 int32 count,
42 const gfx::Size& size,
43 std::vector<uint32>* texture_ids,
44 std::vector<gpu::Mailbox>* texture_mailboxes,
45 uint32 texture_target) {
46 return false;
47 }
48
49 scoped_ptr<VideoDecodeAccelerator>
50 FakeGpuVideoAcceleratorFactories::CreateVideoDecodeAccelerator(
51 VideoCodecProfile profile) {
52 return scoped_ptr<VideoDecodeAccelerator>(
53 static_cast<media::VideoDecodeAccelerator*>(NULL));
54 }
55
56 } // namespace test
57 } // namespace cast
58 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/test/fake_gpu_video_accelerator_factories.h ('k') | media/cast/test/fake_video_encode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698