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

Side by Side Diff: content/renderer/media/rtc_video_decoder.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_decoder.h" 5 #include "content/renderer/media/rtc_video_decoder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 start_time_ = timestamp; 140 start_time_ = timestamp;
141 got_first_frame_ = true; 141 got_first_frame_ = true;
142 } 142 }
143 143
144 // Always allocate a new frame. 144 // Always allocate a new frame.
145 // 145 //
146 // TODO(scherkus): migrate this to proper buffer recycling. 146 // TODO(scherkus): migrate this to proper buffer recycling.
147 scoped_refptr<media::VideoFrame> video_frame = 147 scoped_refptr<media::VideoFrame> video_frame =
148 media::VideoFrame::CreateFrame(media::VideoFrame::YV12, 148 media::VideoFrame::CreateFrame(media::VideoFrame::YV12,
149 visible_size_, 149 visible_size_,
150 gfx::Rect(visible_size_),
150 visible_size_, 151 visible_size_,
151 timestamp - start_time_); 152 timestamp - start_time_);
152 last_frame_timestamp_ = timestamp; 153 last_frame_timestamp_ = timestamp;
153 154
154 // Aspect ratio unsupported; DCHECK when there are non-square pixels. 155 // Aspect ratio unsupported; DCHECK when there are non-square pixels.
155 DCHECK_EQ(frame->GetPixelWidth(), 1u); 156 DCHECK_EQ(frame->GetPixelWidth(), 1u);
156 DCHECK_EQ(frame->GetPixelHeight(), 1u); 157 DCHECK_EQ(frame->GetPixelHeight(), 1u);
157 158
158 int y_rows = frame->GetHeight(); 159 int y_rows = frame->GetHeight();
159 int uv_rows = frame->GetHeight() / 2; // YV12 format. 160 int uv_rows = frame->GetHeight() / 2; // YV12 format.
(...skipping 29 matching lines...) Expand all
189 video_track_->RemoveRenderer(this); 190 video_track_->RemoveRenderer(this);
190 video_track_ = NULL; 191 video_track_ = NULL;
191 } 192 }
192 } 193 }
193 194
194 RTCVideoDecoder::~RTCVideoDecoder() { 195 RTCVideoDecoder::~RTCVideoDecoder() {
195 DCHECK_NE(kNormal, state_); 196 DCHECK_NE(kNormal, state_);
196 } 197 }
197 198
198 } // namespace content 199 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/local_video_capture.cc ('k') | content/renderer/media/rtc_video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698