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

Side by Side Diff: webrtc/modules/video_coding/codecs/vp8/simulcast_encoder_adapter.cc

Issue 1415693002: Remove VideoFrameType aliases for FrameType. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 } 239 }
240 if (encoded_complete_callback_ == NULL) { 240 if (encoded_complete_callback_ == NULL) {
241 return WEBRTC_VIDEO_CODEC_UNINITIALIZED; 241 return WEBRTC_VIDEO_CODEC_UNINITIALIZED;
242 } 242 }
243 243
244 // All active streams should generate a key frame if 244 // All active streams should generate a key frame if
245 // a key frame is requested by any stream. 245 // a key frame is requested by any stream.
246 bool send_key_frame = false; 246 bool send_key_frame = false;
247 if (frame_types) { 247 if (frame_types) {
248 for (size_t i = 0; i < frame_types->size(); ++i) { 248 for (size_t i = 0; i < frame_types->size(); ++i) {
249 if (frame_types->at(i) == kKeyFrame) { 249 if (frame_types->at(i) == kVideoFrameKey) {
250 send_key_frame = true; 250 send_key_frame = true;
251 break; 251 break;
252 } 252 }
253 } 253 }
254 } 254 }
255 for (size_t stream_idx = 0; stream_idx < streaminfos_.size(); ++stream_idx) { 255 for (size_t stream_idx = 0; stream_idx < streaminfos_.size(); ++stream_idx) {
256 if (streaminfos_[stream_idx].key_frame_request && 256 if (streaminfos_[stream_idx].key_frame_request &&
257 streaminfos_[stream_idx].send_stream) { 257 streaminfos_[stream_idx].send_stream) {
258 send_key_frame = true; 258 send_key_frame = true;
259 break; 259 break;
260 } 260 }
261 } 261 }
262 262
263 int src_width = input_image.width(); 263 int src_width = input_image.width();
264 int src_height = input_image.height(); 264 int src_height = input_image.height();
265 for (size_t stream_idx = 0; stream_idx < streaminfos_.size(); ++stream_idx) { 265 for (size_t stream_idx = 0; stream_idx < streaminfos_.size(); ++stream_idx) {
266 // Don't encode frames in resolutions that we don't intend to send. 266 // Don't encode frames in resolutions that we don't intend to send.
267 if (!streaminfos_[stream_idx].send_stream) 267 if (!streaminfos_[stream_idx].send_stream)
268 continue; 268 continue;
269 269
270 std::vector<FrameType> stream_frame_types; 270 std::vector<FrameType> stream_frame_types;
271 if (send_key_frame) { 271 if (send_key_frame) {
272 stream_frame_types.push_back(kKeyFrame); 272 stream_frame_types.push_back(kVideoFrameKey);
273 streaminfos_[stream_idx].key_frame_request = false; 273 streaminfos_[stream_idx].key_frame_request = false;
274 } else { 274 } else {
275 stream_frame_types.push_back(kDeltaFrame); 275 stream_frame_types.push_back(kVideoFrameDelta);
276 } 276 }
277 277
278 int dst_width = streaminfos_[stream_idx].width; 278 int dst_width = streaminfos_[stream_idx].width;
279 int dst_height = streaminfos_[stream_idx].height; 279 int dst_height = streaminfos_[stream_idx].height;
280 // If scaling isn't required, because the input resolution 280 // If scaling isn't required, because the input resolution
281 // matches the destination or the input image is empty (e.g. 281 // matches the destination or the input image is empty (e.g.
282 // a keyframe request for encoders with internal camera 282 // a keyframe request for encoders with internal camera
283 // sources), pass the image on directly. Otherwise, we'll 283 // sources), pass the image on directly. Otherwise, we'll
284 // scale it to match what the encoder expects (below). 284 // scale it to match what the encoder expects (below).
285 if ((dst_width == src_width && dst_height == src_height) || 285 if ((dst_width == src_width && dst_height == src_height) ||
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 bool SimulcastEncoderAdapter::SupportsNativeHandle() const { 501 bool SimulcastEncoderAdapter::SupportsNativeHandle() const {
502 // We should not be calling this method before streaminfos_ are configured. 502 // We should not be calling this method before streaminfos_ are configured.
503 RTC_DCHECK(!streaminfos_.empty()); 503 RTC_DCHECK(!streaminfos_.empty());
504 // TODO(pbos): Support textures when using more than one encoder. 504 // TODO(pbos): Support textures when using more than one encoder.
505 if (streaminfos_.size() != 1) 505 if (streaminfos_.size() != 1)
506 return false; 506 return false;
507 return streaminfos_[0].encoder->SupportsNativeHandle(); 507 return streaminfos_[0].encoder->SupportsNativeHandle();
508 } 508 }
509 509
510 } // namespace webrtc 510 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698