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

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

Issue 101843005: Convert video capture pipline to base::TimeTicks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 9890509b Rebase, Windows compile fixes Created 6 years, 11 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/message_loop/message_loop_proxy.h" 9 #include "base/message_loop/message_loop_proxy.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 explicit MockClient(base::Callback<void(const VideoCaptureFormat&)> frame_cb) 71 explicit MockClient(base::Callback<void(const VideoCaptureFormat&)> frame_cb)
72 : main_thread_(base::MessageLoopProxy::current()), frame_cb_(frame_cb) {} 72 : main_thread_(base::MessageLoopProxy::current()), frame_cb_(frame_cb) {}
73 73
74 virtual void OnError() OVERRIDE { 74 virtual void OnError() OVERRIDE {
75 OnErr(); 75 OnErr();
76 } 76 }
77 77
78 virtual void OnIncomingCapturedFrame(const uint8* data, 78 virtual void OnIncomingCapturedFrame(const uint8* data,
79 int length, 79 int length,
80 base::Time timestamp, 80 base::TimeTicks timestamp,
81 int rotation, 81 int rotation,
82 const VideoCaptureFormat& format) 82 const VideoCaptureFormat& format)
83 OVERRIDE { 83 OVERRIDE {
84 main_thread_->PostTask(FROM_HERE, base::Bind(frame_cb_, format)); 84 main_thread_->PostTask(FROM_HERE, base::Bind(frame_cb_, format));
85 } 85 }
86 86
87 virtual void OnIncomingCapturedBuffer(const scoped_refptr<Buffer>& buffer, 87 virtual void OnIncomingCapturedBuffer(const scoped_refptr<Buffer>& buffer,
88 media::VideoFrame::Format format, 88 media::VideoFrame::Format format,
89 const gfx::Size& dimensions, 89 const gfx::Size& dimensions,
90 base::Time timestamp, 90 base::TimeTicks timestamp,
91 int frame_rate) OVERRIDE { 91 int frame_rate) OVERRIDE {
92 NOTREACHED(); 92 NOTREACHED();
93 } 93 }
94 94
95 private: 95 private:
96 scoped_refptr<base::MessageLoopProxy> main_thread_; 96 scoped_refptr<base::MessageLoopProxy> main_thread_;
97 base::Callback<void(const VideoCaptureFormat&)> frame_cb_; 97 base::Callback<void(const VideoCaptureFormat&)> frame_cb_;
98 }; 98 };
99 99
100 class VideoCaptureDeviceTest : public testing::Test { 100 class VideoCaptureDeviceTest : public testing::Test {
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 EXPECT_EQ(supported_formats[0].pixel_format, media::PIXEL_FORMAT_I420); 430 EXPECT_EQ(supported_formats[0].pixel_format, media::PIXEL_FORMAT_I420);
431 EXPECT_GE(supported_formats[0].frame_rate, 20); 431 EXPECT_GE(supported_formats[0].frame_rate, 20);
432 EXPECT_EQ(supported_formats[1].frame_size.width(), 320); 432 EXPECT_EQ(supported_formats[1].frame_size.width(), 320);
433 EXPECT_EQ(supported_formats[1].frame_size.height(), 240); 433 EXPECT_EQ(supported_formats[1].frame_size.height(), 240);
434 EXPECT_EQ(supported_formats[1].pixel_format, media::PIXEL_FORMAT_I420); 434 EXPECT_EQ(supported_formats[1].pixel_format, media::PIXEL_FORMAT_I420);
435 EXPECT_GE(supported_formats[1].frame_rate, 20); 435 EXPECT_GE(supported_formats[1].frame_rate, 20);
436 } 436 }
437 } 437 }
438 438
439 }; // namespace media 439 }; // namespace media
OLDNEW
« no previous file with comments | « media/video/capture/video_capture_device.h ('k') | media/video/capture/win/video_capture_device_mf_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698