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

Side by Side Diff: content/browser/media/capture/desktop_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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "content/browser/media/capture/desktop_capture_device.h" 5 #include "content/browser/media/capture/desktop_capture_device.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string.h> 9 #include <string.h>
10 #include <algorithm> 10 #include <algorithm>
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 return std::unique_ptr<Buffer>(); 86 return std::unique_ptr<Buffer>();
87 } 87 }
88 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer, 88 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer,
89 const media::VideoCaptureFormat& frame_format, 89 const media::VideoCaptureFormat& frame_format,
90 base::TimeTicks reference_time, 90 base::TimeTicks reference_time,
91 base::TimeDelta timestamp) override { 91 base::TimeDelta timestamp) override {
92 DoOnIncomingCapturedBuffer(); 92 DoOnIncomingCapturedBuffer();
93 } 93 }
94 void OnIncomingCapturedVideoFrame( 94 void OnIncomingCapturedVideoFrame(
95 std::unique_ptr<Buffer> buffer, 95 std::unique_ptr<Buffer> buffer,
96 const scoped_refptr<media::VideoFrame>& frame, 96 const scoped_refptr<media::VideoFrame>& frame) override {
97 base::TimeTicks reference_time) override {
98 DoOnIncomingCapturedVideoFrame(); 97 DoOnIncomingCapturedVideoFrame();
99 } 98 }
100 std::unique_ptr<Buffer> ResurrectLastOutputBuffer( 99 std::unique_ptr<Buffer> ResurrectLastOutputBuffer(
101 const gfx::Size& dimensions, 100 const gfx::Size& dimensions,
102 media::VideoPixelFormat format, 101 media::VideoPixelFormat format,
103 media::VideoPixelStorage storage) override { 102 media::VideoPixelStorage storage) override {
104 EXPECT_TRUE(format == media::PIXEL_FORMAT_I420 && 103 EXPECT_TRUE(format == media::PIXEL_FORMAT_I420 &&
105 storage == media::PIXEL_STORAGE_CPU); 104 storage == media::PIXEL_STORAGE_CPU);
106 DoResurrectLastOutputBuffer(); 105 DoResurrectLastOutputBuffer();
107 return std::unique_ptr<Buffer>(); 106 return std::unique_ptr<Buffer>();
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 frame_size); 551 frame_size);
553 for (int i = 0; i < output_frame_->size().height(); ++i) { 552 for (int i = 0; i < output_frame_->size().height(); ++i) {
554 EXPECT_EQ(0, 553 EXPECT_EQ(0,
555 memcmp(inverted_frame->data() + i * inverted_frame->stride(), 554 memcmp(inverted_frame->data() + i * inverted_frame->stride(),
556 output_frame_->data() + i * output_frame_->stride(), 555 output_frame_->data() + i * output_frame_->stride(),
557 output_frame_->stride())); 556 output_frame_->stride()));
558 } 557 }
559 } 558 }
560 559
561 } // namespace content 560 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698