OLD | NEW |
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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 // Trampoline method to workaround GMOCK problems with std::unique_ptr<>. | 368 // Trampoline method to workaround GMOCK problems with std::unique_ptr<>. |
369 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer, | 369 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer, |
370 const media::VideoCaptureFormat& frame_format, | 370 const media::VideoCaptureFormat& frame_format, |
371 base::TimeTicks reference_time, | 371 base::TimeTicks reference_time, |
372 base::TimeDelta timestamp) override { | 372 base::TimeDelta timestamp) override { |
373 DoOnIncomingCapturedBuffer(); | 373 DoOnIncomingCapturedBuffer(); |
374 } | 374 } |
375 | 375 |
376 void OnIncomingCapturedVideoFrame( | 376 void OnIncomingCapturedVideoFrame( |
377 std::unique_ptr<Buffer> buffer, | 377 std::unique_ptr<Buffer> buffer, |
378 const scoped_refptr<media::VideoFrame>& frame) override { | 378 scoped_refptr<media::VideoFrame> frame) override { |
379 EXPECT_FALSE(frame->visible_rect().IsEmpty()); | 379 EXPECT_FALSE(frame->visible_rect().IsEmpty()); |
380 EXPECT_EQ(media::PIXEL_FORMAT_I420, frame->format()); | 380 EXPECT_EQ(media::PIXEL_FORMAT_I420, frame->format()); |
381 double frame_rate = 0; | 381 double frame_rate = 0; |
382 EXPECT_TRUE( | 382 EXPECT_TRUE( |
383 frame->metadata()->GetDouble(media::VideoFrameMetadata::FRAME_RATE, | 383 frame->metadata()->GetDouble(media::VideoFrameMetadata::FRAME_RATE, |
384 &frame_rate)); | 384 &frame_rate)); |
385 EXPECT_EQ(kTestFramesPerSecond, frame_rate); | 385 EXPECT_EQ(kTestFramesPerSecond, frame_rate); |
386 | 386 |
387 // TODO(miu): We just look at the center pixel presently, because if the | 387 // TODO(miu): We just look at the center pixel presently, because if the |
388 // analysis is too slow, the backlog of frames will grow without bound and | 388 // analysis is too slow, the backlog of frames will grow without bound and |
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1263 for (int i = 0; i < 3; ++i) { | 1263 for (int i = 0; i < 3; ++i) { |
1264 SimulateRefreshFrameRequest(); | 1264 SimulateRefreshFrameRequest(); |
1265 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); | 1265 ASSERT_NO_FATAL_FAILURE(client_observer()->WaitForNextColor(SK_ColorGREEN)); |
1266 } | 1266 } |
1267 | 1267 |
1268 device()->StopAndDeAllocate(); | 1268 device()->StopAndDeAllocate(); |
1269 } | 1269 } |
1270 | 1270 |
1271 } // namespace | 1271 } // namespace |
1272 } // namespace content | 1272 } // namespace content |
OLD | NEW |