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

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

Issue 2582883002: Revert of [Mojo Video Capture] Replace method OnIncomingCapturedVideoFrame with OnIncomingCapturedBufferExt (Closed)
Patch Set: Created 4 years 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 "media/capture/video/fake_video_capture_device.h" 5 #include "media/capture/video/fake_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 <memory> 10 #include <memory>
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 const VideoCaptureFormat frame_format(dimensions, 0.0, format); 94 const VideoCaptureFormat frame_format(dimensions, 0.0, format);
95 return base::MakeUnique<MockBuffer>(0, frame_feedback_id, 95 return base::MakeUnique<MockBuffer>(0, frame_feedback_id,
96 frame_format.ImageAllocationSize()); 96 frame_format.ImageAllocationSize());
97 } 97 }
98 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer, 98 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer,
99 const VideoCaptureFormat& format, 99 const VideoCaptureFormat& format,
100 base::TimeTicks reference_time, 100 base::TimeTicks reference_time,
101 base::TimeDelta timestamp) override { 101 base::TimeDelta timestamp) override {
102 frame_cb_.Run(format); 102 frame_cb_.Run(format);
103 } 103 }
104 void OnIncomingCapturedBufferExt( 104 void OnIncomingCapturedVideoFrame(
105 std::unique_ptr<Buffer> buffer, 105 std::unique_ptr<Buffer> buffer,
106 const VideoCaptureFormat& format, 106 scoped_refptr<media::VideoFrame> frame) override {
107 base::TimeTicks reference_time, 107 VideoCaptureFormat format(frame->natural_size(), 30.0,
108 base::TimeDelta timestamp, 108 PIXEL_FORMAT_I420);
109 gfx::Rect visible_rect,
110 const VideoFrameMetadata& additional_metadata) override {
111 frame_cb_.Run(format); 109 frame_cb_.Run(format);
112 } 110 }
113 std::unique_ptr<Buffer> ResurrectLastOutputBuffer( 111 std::unique_ptr<Buffer> ResurrectLastOutputBuffer(
114 const gfx::Size& dimensions, 112 const gfx::Size& dimensions,
115 media::VideoPixelFormat format, 113 media::VideoPixelFormat format,
116 media::VideoPixelStorage storage, 114 media::VideoPixelStorage storage,
117 int frame_feedback_id) override { 115 int frame_feedback_id) override {
118 return std::unique_ptr<Buffer>(); 116 return std::unique_ptr<Buffer>();
119 } 117 }
120 double GetBufferPoolUtilization() const override { return 0.0; } 118 double GetBufferPoolUtilization() const override { return 0.0; }
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 INSTANTIATE_TEST_CASE_P( 474 INSTANTIATE_TEST_CASE_P(
477 , 475 ,
478 FakeVideoCaptureDeviceCommandLineTest, 476 FakeVideoCaptureDeviceCommandLineTest,
479 Values(CommandLineTestData{"fps=-1", 5, 1u}, 477 Values(CommandLineTestData{"fps=-1", 5, 1u},
480 CommandLineTestData{"fps=29.97, device-count=1", 29.97f, 1u}, 478 CommandLineTestData{"fps=29.97, device-count=1", 29.97f, 1u},
481 CommandLineTestData{"fps=60, device-count=2", 60, 2u}, 479 CommandLineTestData{"fps=60, device-count=2", 60, 2u},
482 CommandLineTestData{"fps=1000, device-count=-1", 60, 1u}, 480 CommandLineTestData{"fps=1000, device-count=-1", 60, 1u},
483 CommandLineTestData{"device-count=2", 20, 2u}, 481 CommandLineTestData{"device-count=2", 20, 2u},
484 CommandLineTestData{"device-count=0", 20, 1u})); 482 CommandLineTestData{"device-count=0", 20, 1u}));
485 }; // namespace media 483 }; // namespace media
OLDNEW
« no previous file with comments | « media/capture/content/thread_safe_capture_oracle.cc ('k') | media/capture/video/linux/v4l2_capture_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698