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

Side by Side Diff: content/browser/media/capture/web_contents_video_capture_device_unittest.cc

Issue 2045813003: Decouple capture timestamp and reference time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit Created 4 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 (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 "content/browser/media/capture/web_contents_video_capture_device.h" 5 #include "content/browser/media/capture/web_contents_video_capture_device.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 // Trampoline method to workaround GMOCK problems with std::unique_ptr<>. 365 // Trampoline method to workaround GMOCK problems with std::unique_ptr<>.
366 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer, 366 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer,
367 const media::VideoCaptureFormat& frame_format, 367 const media::VideoCaptureFormat& frame_format,
368 base::TimeTicks reference_time, 368 base::TimeTicks reference_time,
369 base::TimeDelta timestamp) override { 369 base::TimeDelta timestamp) override {
370 DoOnIncomingCapturedBuffer(); 370 DoOnIncomingCapturedBuffer();
371 } 371 }
372 372
373 void OnIncomingCapturedVideoFrame( 373 void OnIncomingCapturedVideoFrame(
374 std::unique_ptr<Buffer> buffer, 374 std::unique_ptr<Buffer> buffer,
375 const scoped_refptr<media::VideoFrame>& frame, 375 const scoped_refptr<media::VideoFrame>& frame) override {
376 base::TimeTicks reference_time) override {
377 EXPECT_FALSE(frame->visible_rect().IsEmpty()); 376 EXPECT_FALSE(frame->visible_rect().IsEmpty());
378 EXPECT_EQ(media::PIXEL_FORMAT_I420, frame->format()); 377 EXPECT_EQ(media::PIXEL_FORMAT_I420, frame->format());
379 double frame_rate = 0; 378 double frame_rate = 0;
380 EXPECT_TRUE( 379 EXPECT_TRUE(
381 frame->metadata()->GetDouble(media::VideoFrameMetadata::FRAME_RATE, 380 frame->metadata()->GetDouble(media::VideoFrameMetadata::FRAME_RATE,
382 &frame_rate)); 381 &frame_rate));
383 EXPECT_EQ(kTestFramesPerSecond, frame_rate); 382 EXPECT_EQ(kTestFramesPerSecond, frame_rate);
384 383
385 // TODO(miu): We just look at the center pixel presently, because if the 384 // TODO(miu): We just look at the center pixel presently, because if the
386 // analysis is too slow, the backlog of frames will grow without bound and 385 // analysis is too slow, the backlog of frames will grow without bound and
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after
1210 for (int i = 0; i < 3; ++i) { 1209 for (int i = 0; i < 3; ++i) {
1211 SimulateRefreshFrameRequest(); 1210 SimulateRefreshFrameRequest();
1212 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); 1211 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN));
1213 } 1212 }
1214 1213
1215 device()->StopAndDeAllocate(); 1214 device()->StopAndDeAllocate();
1216 } 1215 }
1217 1216
1218 } // namespace 1217 } // namespace
1219 } // namespace content 1218 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698