Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: content/renderer/media/media_stream_video_source.cc

Issue 242013002: Refactor video capturing code in the render process (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove TimeTicks Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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,
373 const base::TimeTicks& timestamp) {
Ami GONE FROM CHROMIUM 2014/04/25 19:56:17 Why is this param still here?
372 DCHECK(CalledOnValidThread()); 374 DCHECK(CalledOnValidThread());
373 scoped_refptr<media::VideoFrame> video_frame(frame); 375 scoped_refptr<media::VideoFrame> video_frame(frame);
374 376
375 if (frame->visible_rect().size().width() > max_frame_output_size_.width() || 377 if (frame->visible_rect().size().width() > max_frame_output_size_.width() ||
376 frame->visible_rect().size().height() > max_frame_output_size_.height()) { 378 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 379 // 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 380 // providing a new |visible_rect|. The new visible rect must be within the
379 // original |visible_rect|. 381 // original |visible_rect|.
380 gfx::Rect output_rect = frame->visible_rect(); 382 gfx::Rect output_rect = frame->visible_rect();
381 output_rect.ClampToCenteredSize(max_frame_output_size_); 383 output_rect.ClampToCenteredSize(max_frame_output_size_);
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 MediaStreamVideoSource::RequestedConstraints::RequestedConstraints( 501 MediaStreamVideoSource::RequestedConstraints::RequestedConstraints(
500 const blink::WebMediaConstraints& constraints, 502 const blink::WebMediaConstraints& constraints,
501 const ConstraintsCallback& callback) 503 const ConstraintsCallback& callback)
502 : constraints(constraints), callback(callback) { 504 : constraints(constraints), callback(callback) {
503 } 505 }
504 506
505 MediaStreamVideoSource::RequestedConstraints::~RequestedConstraints() { 507 MediaStreamVideoSource::RequestedConstraints::~RequestedConstraints() {
506 } 508 }
507 509
508 } // namespace content 510 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_video_source.h ('k') | content/renderer/media/media_stream_video_source_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698