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

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

Issue 189513004: Make sure natural_size is set when a frame is cropped. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed DCHECK of natural size since the decoder pipeline do not abey. Created 6 years, 9 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
« no previous file with comments | « no previous file | media/base/video_frame.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | media/base/video_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698