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

Side by Side Diff: media/renderers/mock_gpu_video_accelerator_factories.h

Issue 1304843005: Deal with AllocateGpuMemoryBuffer returning null. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address reveman's nits. Created 5 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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_RENDERERS_MOCK_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ 5 #ifndef MEDIA_RENDERERS_MOCK_GPU_VIDEO_ACCELERATOR_FACTORIES_H_
6 #define MEDIA_RENDERERS_MOCK_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ 6 #define MEDIA_RENDERERS_MOCK_GPU_VIDEO_ACCELERATOR_FACTORIES_H_
7 7
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "media/renderers/gpu_video_accelerator_factories.h" 10 #include "media/renderers/gpu_video_accelerator_factories.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 unsigned ImageTextureTarget() override; 54 unsigned ImageTextureTarget() override;
55 VideoPixelFormat VideoFrameOutputFormat() override { 55 VideoPixelFormat VideoFrameOutputFormat() override {
56 return video_frame_output_format_; 56 return video_frame_output_format_;
57 }; 57 };
58 58
59 void SetVideoFrameOutputFormat( 59 void SetVideoFrameOutputFormat(
60 const VideoPixelFormat video_frame_output_format) { 60 const VideoPixelFormat video_frame_output_format) {
61 video_frame_output_format_ = video_frame_output_format; 61 video_frame_output_format_ = video_frame_output_format;
62 }; 62 };
63 63
64 void SetFailToAllocateGpuMemoryBuffer(bool fail) {
DaleCurtis 2015/09/13 18:48:47 Add ForTesting to the name so presubmit checks wil
Daniele Castagna 2015/09/13 19:31:06 Done.
65 fail_to_allocate_gpu_memory_buffer_ = fail;
66 }
67
64 MOCK_METHOD0(GetGLES2Interface, gpu::gles2::GLES2Interface*()); 68 MOCK_METHOD0(GetGLES2Interface, gpu::gles2::GLES2Interface*());
65 69
66 scoped_ptr<base::SharedMemory> CreateSharedMemory(size_t size) override; 70 scoped_ptr<base::SharedMemory> CreateSharedMemory(size_t size) override;
67 71
68 scoped_ptr<VideoDecodeAccelerator> CreateVideoDecodeAccelerator() override; 72 scoped_ptr<VideoDecodeAccelerator> CreateVideoDecodeAccelerator() override;
69 73
70 scoped_ptr<VideoEncodeAccelerator> CreateVideoEncodeAccelerator() override; 74 scoped_ptr<VideoEncodeAccelerator> CreateVideoEncodeAccelerator() override;
71 75
72 private: 76 private:
73 ~MockGpuVideoAcceleratorFactories() override; 77 ~MockGpuVideoAcceleratorFactories() override;
74 78
75 DISALLOW_COPY_AND_ASSIGN(MockGpuVideoAcceleratorFactories); 79 DISALLOW_COPY_AND_ASSIGN(MockGpuVideoAcceleratorFactories);
76 80
77 VideoPixelFormat video_frame_output_format_ = PIXEL_FORMAT_I420; 81 VideoPixelFormat video_frame_output_format_ = PIXEL_FORMAT_I420;
82
83 bool fail_to_allocate_gpu_memory_buffer_ = false;
78 }; 84 };
79 85
80 } // namespace media 86 } // namespace media
81 87
82 #endif // MEDIA_RENDERERS_MOCK_GPU_VIDEO_ACCELERATOR_FACTORIES_H_ 88 #endif // MEDIA_RENDERERS_MOCK_GPU_VIDEO_ACCELERATOR_FACTORIES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698