| 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_source.h" | 5 #include "content/renderer/media/media_stream_video_source.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 // const int vert_crop = frame->visible_rect().y() + | 380 // const int vert_crop = frame->visible_rect().y() + |
| 381 // ((frame->visible_rect().height() - visible_height) / 2); | 381 // ((frame->visible_rect().height() - visible_height) / 2); |
| 382 const int horiz_crop = 0; | 382 const int horiz_crop = 0; |
| 383 const int vert_crop = 0; | 383 const int vert_crop = 0; |
| 384 | 384 |
| 385 const int visible_height = std::min(frame_output_size_.height(), | 385 const int visible_height = std::min(frame_output_size_.height(), |
| 386 frame->visible_rect().height()); | 386 frame->visible_rect().height()); |
| 387 | 387 |
| 388 gfx::Rect rect(horiz_crop, vert_crop, visible_width, visible_height); | 388 gfx::Rect rect(horiz_crop, vert_crop, visible_width, visible_height); |
| 389 video_frame = media::VideoFrame::WrapVideoFrame( | 389 video_frame = media::VideoFrame::WrapVideoFrame( |
| 390 frame, rect, base::Bind(&ReleaseOriginalFrame, frame)); | 390 frame, rect, rect.size(), base::Bind(&ReleaseOriginalFrame, frame)); |
| 391 } | 391 } |
| 392 | 392 |
| 393 if ((frame->format() == media::VideoFrame::I420 || | 393 if ((frame->format() == media::VideoFrame::I420 || |
| 394 frame->format() == media::VideoFrame::YV12) && | 394 frame->format() == media::VideoFrame::YV12) && |
| 395 capture_adapter_) { | 395 capture_adapter_) { |
| 396 capture_adapter_->OnFrameCaptured(video_frame); | 396 capture_adapter_->OnFrameCaptured(video_frame); |
| 397 } | 397 } |
| 398 } | 398 } |
| 399 | 399 |
| 400 void MediaStreamVideoSource::OnSupportedFormats( | 400 void MediaStreamVideoSource::OnSupportedFormats( |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 MediaStreamVideoSource::RequestedConstraints::RequestedConstraints( | 493 MediaStreamVideoSource::RequestedConstraints::RequestedConstraints( |
| 494 const blink::WebMediaConstraints& constraints, | 494 const blink::WebMediaConstraints& constraints, |
| 495 const ConstraintsCallback& callback) | 495 const ConstraintsCallback& callback) |
| 496 : constraints(constraints), callback(callback) { | 496 : constraints(constraints), callback(callback) { |
| 497 } | 497 } |
| 498 | 498 |
| 499 MediaStreamVideoSource::RequestedConstraints::~RequestedConstraints() { | 499 MediaStreamVideoSource::RequestedConstraints::~RequestedConstraints() { |
| 500 } | 500 } |
| 501 | 501 |
| 502 } // namespace content | 502 } // namespace content |
| OLD | NEW |