OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
186 // internally. Platforms whose VDAs fail to support mid-stream resolution | 186 // internally. Platforms whose VDAs fail to support mid-stream resolution |
187 // change gracefully need to have their clients cover for them, and we do that | 187 // change gracefully need to have their clients cover for them, and we do that |
188 // here. | 188 // here. |
189 #ifdef ANDROID | 189 #ifdef ANDROID |
190 const bool kVDACanHandleMidstreamResize = false; | 190 const bool kVDACanHandleMidstreamResize = false; |
191 #else | 191 #else |
192 const bool kVDACanHandleMidstreamResize = true; | 192 const bool kVDACanHandleMidstreamResize = true; |
193 #endif | 193 #endif |
194 | 194 |
195 bool need_to_reset_for_midstream_resize = false; | 195 bool need_to_reset_for_midstream_resize = false; |
196 if (inputImage._frameType == webrtc::kKeyFrame) { | 196 if (inputImage._frameType == webrtc::kVideoFrameKey) { |
mcasas
2015/10/19 17:47:04
nit: I'd call it |kKeyVideoFrame|.
| |
197 gfx::Size new_frame_size(inputImage._encodedWidth, | 197 gfx::Size new_frame_size(inputImage._encodedWidth, |
198 inputImage._encodedHeight); | 198 inputImage._encodedHeight); |
199 DVLOG(2) << "Got key frame. size=" << new_frame_size.ToString(); | 199 DVLOG(2) << "Got key frame. size=" << new_frame_size.ToString(); |
200 | 200 |
201 if (new_frame_size.width() > max_resolution_.width() || | 201 if (new_frame_size.width() > max_resolution_.width() || |
202 new_frame_size.width() < min_resolution_.width() || | 202 new_frame_size.width() < min_resolution_.width() || |
203 new_frame_size.height() > max_resolution_.height() || | 203 new_frame_size.height() > max_resolution_.height() || |
204 new_frame_size.height() < min_resolution_.height()) { | 204 new_frame_size.height() < min_resolution_.height()) { |
205 DVLOG(1) << "Resolution unsupported, falling back to software decode"; | 205 DVLOG(1) << "Resolution unsupported, falling back to software decode"; |
206 return WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE; | 206 return WEBRTC_VIDEO_CODEC_FALLBACK_SOFTWARE; |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
826 for (std::deque<std::pair<webrtc::EncodedImage, BufferData>>::iterator it = | 826 for (std::deque<std::pair<webrtc::EncodedImage, BufferData>>::iterator it = |
827 pending_buffers_.begin(); | 827 pending_buffers_.begin(); |
828 it != pending_buffers_.end(); ++it) { | 828 it != pending_buffers_.end(); ++it) { |
829 delete[] it->first._buffer; | 829 delete[] it->first._buffer; |
830 } | 830 } |
831 | 831 |
832 pending_buffers_.clear(); | 832 pending_buffers_.clear(); |
833 } | 833 } |
834 | 834 |
835 } // namespace content | 835 } // namespace content |
OLD | NEW |