| OLD | NEW |
| 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 "content/renderer/media/media_stream_video_capturer_source.h" | 5 #include "content/renderer/media/media_stream_video_capturer_source.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 .WillByDefault(WithArgs<3>( | 35 .WillByDefault(WithArgs<3>( |
| 36 Invoke(this, &MockVideoCapturerSource::EnumerateDeviceFormats))); | 36 Invoke(this, &MockVideoCapturerSource::EnumerateDeviceFormats))); |
| 37 } | 37 } |
| 38 | 38 |
| 39 MOCK_METHOD0(RequestRefreshFrame, void()); | 39 MOCK_METHOD0(RequestRefreshFrame, void()); |
| 40 MOCK_METHOD4(GetCurrentSupportedFormats, | 40 MOCK_METHOD4(GetCurrentSupportedFormats, |
| 41 void(int max_requested_width, | 41 void(int max_requested_width, |
| 42 int max_requested_height, | 42 int max_requested_height, |
| 43 double max_requested_frame_rate, | 43 double max_requested_frame_rate, |
| 44 const VideoCaptureDeviceFormatsCB& callback)); | 44 const VideoCaptureDeviceFormatsCB& callback)); |
| 45 MOCK_METHOD0(GetPreferredFormats, media::VideoCaptureFormats()); |
| 45 MOCK_METHOD3(StartCapture, | 46 MOCK_METHOD3(StartCapture, |
| 46 void(const media::VideoCaptureParams& params, | 47 void(const media::VideoCaptureParams& params, |
| 47 const VideoCaptureDeliverFrameCB& new_frame_callback, | 48 const VideoCaptureDeliverFrameCB& new_frame_callback, |
| 48 const RunningCallback& running_callback)); | 49 const RunningCallback& running_callback)); |
| 49 MOCK_METHOD0(StopCapture, void()); | 50 MOCK_METHOD0(StopCapture, void()); |
| 50 | 51 |
| 51 void EnumerateDeviceFormats(const VideoCaptureDeviceFormatsCB& callback) { | 52 void EnumerateDeviceFormats(const VideoCaptureDeviceFormatsCB& callback) { |
| 52 media::VideoCaptureFormat kFormatSmall(gfx::Size(640, 480), 30.0, | 53 media::VideoCaptureFormat kFormatSmall(gfx::Size(640, 480), 30.0, |
| 53 media::PIXEL_FORMAT_I420); | 54 media::PIXEL_FORMAT_I420); |
| 54 media::VideoCaptureFormat kFormatLarge(gfx::Size(1920, 1080), 30.0, | 55 media::VideoCaptureFormat kFormatLarge(gfx::Size(1920, 1080), 30.0, |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 run_loop.Run(); | 397 run_loop.Run(); |
| 397 fake_sink.DisconnectFromTrack(); | 398 fake_sink.DisconnectFromTrack(); |
| 398 EXPECT_EQ(reference_capture_time, capture_time); | 399 EXPECT_EQ(reference_capture_time, capture_time); |
| 399 double metadata_value; | 400 double metadata_value; |
| 400 EXPECT_TRUE(metadata.GetDouble(media::VideoFrameMetadata::FRAME_RATE, | 401 EXPECT_TRUE(metadata.GetDouble(media::VideoFrameMetadata::FRAME_RATE, |
| 401 &metadata_value)); | 402 &metadata_value)); |
| 402 EXPECT_EQ(30.0, metadata_value); | 403 EXPECT_EQ(30.0, metadata_value); |
| 403 } | 404 } |
| 404 | 405 |
| 405 } // namespace content | 406 } // namespace content |
| OLD | NEW |