OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |