| OLD | NEW |
| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 storage == media::PIXEL_STORAGE_CPU); | 85 storage == media::PIXEL_STORAGE_CPU); |
| 86 DoReserveOutputBuffer(); | 86 DoReserveOutputBuffer(); |
| 87 return std::unique_ptr<Buffer>(); | 87 return std::unique_ptr<Buffer>(); |
| 88 } | 88 } |
| 89 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer, | 89 void OnIncomingCapturedBuffer(std::unique_ptr<Buffer> buffer, |
| 90 const media::VideoCaptureFormat& format, | 90 const media::VideoCaptureFormat& format, |
| 91 base::TimeTicks reference_time, | 91 base::TimeTicks reference_time, |
| 92 base::TimeDelta timestamp) override { | 92 base::TimeDelta timestamp) override { |
| 93 DoOnIncomingCapturedBuffer(); | 93 DoOnIncomingCapturedBuffer(); |
| 94 } | 94 } |
| 95 void OnIncomingCapturedBufferExt( | 95 void OnIncomingCapturedVideoFrame( |
| 96 std::unique_ptr<Buffer> buffer, | 96 std::unique_ptr<Buffer> buffer, |
| 97 const media::VideoCaptureFormat& format, | 97 scoped_refptr<media::VideoFrame> frame) override { |
| 98 base::TimeTicks reference_time, | |
| 99 base::TimeDelta timestamp, | |
| 100 gfx::Rect visible_rect, | |
| 101 const media::VideoFrameMetadata& additional_metadata) override { | |
| 102 DoOnIncomingCapturedVideoFrame(); | 98 DoOnIncomingCapturedVideoFrame(); |
| 103 } | 99 } |
| 104 std::unique_ptr<Buffer> ResurrectLastOutputBuffer( | 100 std::unique_ptr<Buffer> ResurrectLastOutputBuffer( |
| 105 const gfx::Size& dimensions, | 101 const gfx::Size& dimensions, |
| 106 media::VideoPixelFormat format, | 102 media::VideoPixelFormat format, |
| 107 media::VideoPixelStorage storage, | 103 media::VideoPixelStorage storage, |
| 108 int frame_feedback_id) override { | 104 int frame_feedback_id) override { |
| 109 EXPECT_TRUE(format == media::PIXEL_FORMAT_I420 && | 105 EXPECT_TRUE(format == media::PIXEL_FORMAT_I420 && |
| 110 storage == media::PIXEL_STORAGE_CPU); | 106 storage == media::PIXEL_STORAGE_CPU); |
| 111 DoResurrectLastOutputBuffer(); | 107 DoResurrectLastOutputBuffer(); |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 frame_size); | 553 frame_size); |
| 558 for (int i = 0; i < output_frame_->size().height(); ++i) { | 554 for (int i = 0; i < output_frame_->size().height(); ++i) { |
| 559 EXPECT_EQ(0, | 555 EXPECT_EQ(0, |
| 560 memcmp(inverted_frame->data() + i * inverted_frame->stride(), | 556 memcmp(inverted_frame->data() + i * inverted_frame->stride(), |
| 561 output_frame_->data() + i * output_frame_->stride(), | 557 output_frame_->data() + i * output_frame_->stride(), |
| 562 output_frame_->stride())); | 558 output_frame_->stride())); |
| 563 } | 559 } |
| 564 } | 560 } |
| 565 | 561 |
| 566 } // namespace content | 562 } // namespace content |
| OLD | NEW |