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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 | 361 |
362 void MediaStreamVideoSource::DoStopSource() { | 362 void MediaStreamVideoSource::DoStopSource() { |
363 DCHECK(CalledOnValidThread()); | 363 DCHECK(CalledOnValidThread()); |
364 DVLOG(3) << "DoStopSource()"; | 364 DVLOG(3) << "DoStopSource()"; |
365 StopSourceImpl(); | 365 StopSourceImpl(); |
366 state_ = ENDED; | 366 state_ = ENDED; |
367 SetReadyState(blink::WebMediaStreamSource::ReadyStateEnded); | 367 SetReadyState(blink::WebMediaStreamSource::ReadyStateEnded); |
368 } | 368 } |
369 | 369 |
370 void MediaStreamVideoSource::DeliverVideoFrame( | 370 void MediaStreamVideoSource::DeliverVideoFrame( |
371 const scoped_refptr<media::VideoFrame>& frame) { | 371 const scoped_refptr<media::VideoFrame>& frame, |
| 372 const media::VideoCaptureFormat& format) { |
372 DCHECK(CalledOnValidThread()); | 373 DCHECK(CalledOnValidThread()); |
373 scoped_refptr<media::VideoFrame> video_frame(frame); | 374 scoped_refptr<media::VideoFrame> video_frame(frame); |
374 | 375 |
375 if (frame->visible_rect().size().width() > max_frame_output_size_.width() || | 376 if (frame->visible_rect().size().width() > max_frame_output_size_.width() || |
376 frame->visible_rect().size().height() > max_frame_output_size_.height()) { | 377 frame->visible_rect().size().height() > max_frame_output_size_.height()) { |
377 // If |frame| is not the size that is expected, we need to crop it by | 378 // If |frame| is not the size that is expected, we need to crop it by |
378 // providing a new |visible_rect|. The new visible rect must be within the | 379 // providing a new |visible_rect|. The new visible rect must be within the |
379 // original |visible_rect|. | 380 // original |visible_rect|. |
380 gfx::Rect output_rect = frame->visible_rect(); | 381 gfx::Rect output_rect = frame->visible_rect(); |
381 output_rect.ClampToCenteredSize(max_frame_output_size_); | 382 output_rect.ClampToCenteredSize(max_frame_output_size_); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 MediaStreamVideoSource::RequestedConstraints::RequestedConstraints( | 500 MediaStreamVideoSource::RequestedConstraints::RequestedConstraints( |
500 const blink::WebMediaConstraints& constraints, | 501 const blink::WebMediaConstraints& constraints, |
501 const ConstraintsCallback& callback) | 502 const ConstraintsCallback& callback) |
502 : constraints(constraints), callback(callback) { | 503 : constraints(constraints), callback(callback) { |
503 } | 504 } |
504 | 505 |
505 MediaStreamVideoSource::RequestedConstraints::~RequestedConstraints() { | 506 MediaStreamVideoSource::RequestedConstraints::~RequestedConstraints() { |
506 } | 507 } |
507 | 508 |
508 } // namespace content | 509 } // namespace content |
OLD | NEW |