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

Side by Side Diff: media/video/capture/fake_video_capture_device_unittest.cc

Issue 1179323002: Video Capture: extract storage info from pixel format in VideoCaptureFormat. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: hubbe@s comments and minor rebase Created 5 years, 6 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 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 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/test/test_timeouts.h" 8 #include "base/test/test_timeouts.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "media/base/video_capture_types.h" 10 #include "media/base/video_capture_types.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 size_t y_stride, 74 size_t y_stride,
75 size_t u_stride, 75 size_t u_stride,
76 size_t v_stride, 76 size_t v_stride,
77 const VideoCaptureFormat& frame_format, 77 const VideoCaptureFormat& frame_format,
78 int clockwise_rotation, 78 int clockwise_rotation,
79 const base::TimeTicks& timestamp) { 79 const base::TimeTicks& timestamp) {
80 frame_cb_.Run(frame_format); 80 frame_cb_.Run(frame_format);
81 } 81 }
82 82
83 // Virtual methods for capturing using Client's Buffers. 83 // Virtual methods for capturing using Client's Buffers.
84 scoped_ptr<Buffer> ReserveOutputBuffer(media::VideoPixelFormat format, 84 scoped_ptr<Buffer> ReserveOutputBuffer(const gfx::Size& dimensions,
85 const gfx::Size& dimensions) { 85 media::VideoPixelFormat format,
86 EXPECT_TRUE(format == PIXEL_FORMAT_I420 || 86 media::VideoPixelStorage storage) {
87 format == PIXEL_FORMAT_GPUMEMORYBUFFER); 87 EXPECT_TRUE(format == PIXEL_FORMAT_I420 || format == PIXEL_FORMAT_ARGB);
hubbe 2015/06/18 19:23:11 EXPECT for storage?
mcasas 2015/06/19 02:58:36 Done.
88 EXPECT_GT(dimensions.GetArea(), 0); 88 EXPECT_GT(dimensions.GetArea(), 0);
89 const VideoCaptureFormat frame_format(dimensions, 0.0, format); 89 const VideoCaptureFormat frame_format(dimensions, 0.0, format);
90 return make_scoped_ptr( 90 return make_scoped_ptr(
91 new MockBuffer(0, frame_format.ImageAllocationSize())); 91 new MockBuffer(0, frame_format.ImageAllocationSize()));
92 } 92 }
93 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer, 93 void OnIncomingCapturedBuffer(scoped_ptr<Buffer> buffer,
94 const VideoCaptureFormat& frame_format, 94 const VideoCaptureFormat& frame_format,
95 const base::TimeTicks& timestamp) { 95 const base::TimeTicks& timestamp) {
96 frame_cb_.Run(frame_format); 96 frame_cb_.Run(frame_format);
97 } 97 }
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 EXPECT_EQ(supported_formats[2].pixel_format, PIXEL_FORMAT_I420); 223 EXPECT_EQ(supported_formats[2].pixel_format, PIXEL_FORMAT_I420);
224 EXPECT_GE(supported_formats[2].frame_rate, 20.0); 224 EXPECT_GE(supported_formats[2].frame_rate, 20.0);
225 EXPECT_EQ(supported_formats[3].frame_size.width(), 1920); 225 EXPECT_EQ(supported_formats[3].frame_size.width(), 1920);
226 EXPECT_EQ(supported_formats[3].frame_size.height(), 1080); 226 EXPECT_EQ(supported_formats[3].frame_size.height(), 1080);
227 EXPECT_EQ(supported_formats[3].pixel_format, PIXEL_FORMAT_I420); 227 EXPECT_EQ(supported_formats[3].pixel_format, PIXEL_FORMAT_I420);
228 EXPECT_GE(supported_formats[3].frame_rate, 20.0); 228 EXPECT_GE(supported_formats[3].frame_rate, 20.0);
229 } 229 }
230 } 230 }
231 231
232 }; // namespace media 232 }; // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698