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

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

Issue 2592303002: Reland [Mojo Video Capture] Replace method OnIncomingCapturedVideoFrame() with OnIncomingCapturedBuf (Closed)
Patch Set: Rebase Created 3 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
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 OnIncomingCapturedVideoFrame( 104 void OnIncomingCapturedBufferExt(
105 std::unique_ptr<Buffer> buffer, 105 std::unique_ptr<Buffer> buffer,
106 scoped_refptr<media::VideoFrame> frame) override { 106 const VideoCaptureFormat& format,
107 VideoCaptureFormat format(frame->natural_size(), 30.0, 107 base::TimeTicks reference_time,
108 PIXEL_FORMAT_I420); 108 base::TimeDelta timestamp,
109 gfx::Rect visible_rect,
110 const VideoFrameMetadata& additional_metadata) override {
109 frame_cb_.Run(format); 111 frame_cb_.Run(format);
110 } 112 }
111 std::unique_ptr<Buffer> ResurrectLastOutputBuffer( 113 std::unique_ptr<Buffer> ResurrectLastOutputBuffer(
112 const gfx::Size& dimensions, 114 const gfx::Size& dimensions,
113 media::VideoPixelFormat format, 115 media::VideoPixelFormat format,
114 media::VideoPixelStorage storage, 116 media::VideoPixelStorage storage,
115 int frame_feedback_id) override { 117 int frame_feedback_id) override {
116 return std::unique_ptr<Buffer>(); 118 return std::unique_ptr<Buffer>();
117 } 119 }
118 double GetBufferPoolUtilization() const override { return 0.0; } 120 double GetBufferPoolUtilization() const override { return 0.0; }
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 INSTANTIATE_TEST_CASE_P( 476 INSTANTIATE_TEST_CASE_P(
475 , 477 ,
476 FakeVideoCaptureDeviceCommandLineTest, 478 FakeVideoCaptureDeviceCommandLineTest,
477 Values(CommandLineTestData{"fps=-1", 5, 1u}, 479 Values(CommandLineTestData{"fps=-1", 5, 1u},
478 CommandLineTestData{"fps=29.97, device-count=1", 29.97f, 1u}, 480 CommandLineTestData{"fps=29.97, device-count=1", 29.97f, 1u},
479 CommandLineTestData{"fps=60, device-count=2", 60, 2u}, 481 CommandLineTestData{"fps=60, device-count=2", 60, 2u},
480 CommandLineTestData{"fps=1000, device-count=-1", 60, 1u}, 482 CommandLineTestData{"fps=1000, device-count=-1", 60, 1u},
481 CommandLineTestData{"device-count=2", 20, 2u}, 483 CommandLineTestData{"device-count=2", 20, 2u},
482 CommandLineTestData{"device-count=0", 20, 1u})); 484 CommandLineTestData{"device-count=0", 20, 1u}));
483 }; // namespace media 485 }; // 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