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

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

Issue 11269017: Plumb through cropped output size for VideoFrame (Closed) Base URL: https://git.chromium.org/git/chromium/src@git-svn
Patch Set: Found the windows failure, and fixed it. Thanks akalin@ Created 8 years, 1 month 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/rtc_video_renderer.h" 5 #include "content/renderer/media/rtc_video_renderer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop_proxy.h" 10 #include "base/message_loop_proxy.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 void RTCVideoRenderer::SetSize(int width, int height) { 68 void RTCVideoRenderer::SetSize(int width, int height) {
69 } 69 }
70 70
71 void RTCVideoRenderer::RenderFrame(const cricket::VideoFrame* frame) { 71 void RTCVideoRenderer::RenderFrame(const cricket::VideoFrame* frame) {
72 base::TimeDelta timestamp = base::TimeDelta::FromMilliseconds( 72 base::TimeDelta timestamp = base::TimeDelta::FromMilliseconds(
73 frame->GetTimeStamp() / talk_base::kNumNanosecsPerMillisec); 73 frame->GetTimeStamp() / talk_base::kNumNanosecsPerMillisec);
74 gfx::Size size(frame->GetWidth(), frame->GetHeight()); 74 gfx::Size size(frame->GetWidth(), frame->GetHeight());
75 scoped_refptr<media::VideoFrame> video_frame = 75 scoped_refptr<media::VideoFrame> video_frame =
76 media::VideoFrame::CreateFrame(media::VideoFrame::YV12, 76 media::VideoFrame::CreateFrame(media::VideoFrame::YV12,
77 size, 77 size,
78 gfx::Rect(size),
78 size, 79 size,
79 timestamp); 80 timestamp);
80 81
81 // Aspect ratio unsupported; DCHECK when there are non-square pixels. 82 // Aspect ratio unsupported; DCHECK when there are non-square pixels.
82 DCHECK_EQ(frame->GetPixelWidth(), 1u); 83 DCHECK_EQ(frame->GetPixelWidth(), 1u);
83 DCHECK_EQ(frame->GetPixelHeight(), 1u); 84 DCHECK_EQ(frame->GetPixelHeight(), 1u);
84 85
85 int y_rows = frame->GetHeight(); 86 int y_rows = frame->GetHeight();
86 int uv_rows = frame->GetHeight() / 2; // YV12 format. 87 int uv_rows = frame->GetHeight() / 2; // YV12 format.
87 CopyYPlane(frame->GetYPlane(), frame->GetYPitch(), y_rows, video_frame); 88 CopyYPlane(frame->GetYPlane(), frame->GetYPitch(), y_rows, video_frame);
(...skipping 10 matching lines...) Expand all
98 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); 99 DCHECK(message_loop_proxy_->BelongsToCurrentThread());
99 100
100 if (state_ != kStarted) { 101 if (state_ != kStarted) {
101 return; 102 return;
102 } 103 }
103 104
104 repaint_cb_.Run(video_frame); 105 repaint_cb_.Run(video_frame);
105 } 106 }
106 107
107 } // namespace content 108 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/rtc_video_decoder_unittest.cc ('k') | media/base/video_decoder_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698