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

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

Issue 10832087: Remove VideoDecoderConfig.frame_rate_xxx() & VideoFrame:Get/SetDuration() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 (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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 got_first_frame_ = true; 154 got_first_frame_ = true;
155 } 155 }
156 156
157 // Always allocate a new frame. 157 // Always allocate a new frame.
158 // 158 //
159 // TODO(scherkus): migrate this to proper buffer recycling. 159 // TODO(scherkus): migrate this to proper buffer recycling.
160 scoped_refptr<media::VideoFrame> video_frame = 160 scoped_refptr<media::VideoFrame> video_frame =
161 media::VideoFrame::CreateFrame(media::VideoFrame::YV12, 161 media::VideoFrame::CreateFrame(media::VideoFrame::YV12,
162 visible_size_.width(), 162 visible_size_.width(),
163 visible_size_.height(), 163 visible_size_.height(),
164 timestamp - start_time_, 164 timestamp - start_time_);
165 base::TimeDelta::FromMilliseconds(0));
166 last_frame_timestamp_ = timestamp; 165 last_frame_timestamp_ = timestamp;
167 166
168 // Aspect ratio unsupported; DCHECK when there are non-square pixels. 167 // Aspect ratio unsupported; DCHECK when there are non-square pixels.
169 DCHECK_EQ(frame->GetPixelWidth(), 1u); 168 DCHECK_EQ(frame->GetPixelWidth(), 1u);
170 DCHECK_EQ(frame->GetPixelHeight(), 1u); 169 DCHECK_EQ(frame->GetPixelHeight(), 1u);
171 170
172 int y_rows = frame->GetHeight(); 171 int y_rows = frame->GetHeight();
173 int uv_rows = frame->GetHeight() / 2; // YV12 format. 172 int uv_rows = frame->GetHeight() / 2; // YV12 format.
174 CopyYPlane(frame->GetYPlane(), frame->GetYPitch(), y_rows, video_frame); 173 CopyYPlane(frame->GetYPlane(), frame->GetYPitch(), y_rows, video_frame);
175 CopyUPlane(frame->GetUPlane(), frame->GetUPitch(), uv_rows, video_frame); 174 CopyUPlane(frame->GetUPlane(), frame->GetUPitch(), uv_rows, video_frame);
(...skipping 25 matching lines...) Expand all
201 DCHECK(main_thread_->RunsTasksOnCurrentThread()); 200 DCHECK(main_thread_->RunsTasksOnCurrentThread());
202 if (video_track_) { 201 if (video_track_) {
203 video_track_->RemoveRenderer(this); 202 video_track_->RemoveRenderer(this);
204 video_track_ = NULL; 203 video_track_ = NULL;
205 } 204 }
206 } 205 }
207 206
208 RTCVideoDecoder::~RTCVideoDecoder() { 207 RTCVideoDecoder::~RTCVideoDecoder() {
209 DCHECK_NE(kNormal, state_); 208 DCHECK_NE(kNormal, state_);
210 } 209 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698