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

Side by Side Diff: talk/media/webrtc/webrtcvideoengine2.cc

Issue 1657023002: Implement NullVideoDecoder to avoid crash on unsupported decoders. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Feedback Created 4 years, 10 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
« no previous file with comments | « no previous file | webrtc/video/video_decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 2240 matching lines...) Expand 10 before | Expand all | Expand 10 after
2251 if (type == webrtc::kVideoCodecVP9) { 2251 if (type == webrtc::kVideoCodecVP9) {
2252 return AllocatedDecoder( 2252 return AllocatedDecoder(
2253 webrtc::VideoDecoder::Create(webrtc::VideoDecoder::kVp9), type, false); 2253 webrtc::VideoDecoder::Create(webrtc::VideoDecoder::kVp9), type, false);
2254 } 2254 }
2255 2255
2256 if (type == webrtc::kVideoCodecH264) { 2256 if (type == webrtc::kVideoCodecH264) {
2257 return AllocatedDecoder( 2257 return AllocatedDecoder(
2258 webrtc::VideoDecoder::Create(webrtc::VideoDecoder::kH264), type, false); 2258 webrtc::VideoDecoder::Create(webrtc::VideoDecoder::kH264), type, false);
2259 } 2259 }
2260 2260
2261 // This shouldn't happen, we should not be trying to create something we don't 2261 return AllocatedDecoder(
2262 // support. 2262 webrtc::VideoDecoder::Create(webrtc::VideoDecoder::kUnsupportedCodec),
2263 RTC_DCHECK(false); 2263 webrtc::kVideoCodecUnknown, false);
2264 return AllocatedDecoder(NULL, webrtc::kVideoCodecUnknown, false);
2265 } 2264 }
2266 2265
2267 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::ConfigureCodecs( 2266 void WebRtcVideoChannel2::WebRtcVideoReceiveStream::ConfigureCodecs(
2268 const std::vector<VideoCodecSettings>& recv_codecs, 2267 const std::vector<VideoCodecSettings>& recv_codecs,
2269 std::vector<AllocatedDecoder>* old_decoders) { 2268 std::vector<AllocatedDecoder>* old_decoders) {
2270 *old_decoders = allocated_decoders_; 2269 *old_decoders = allocated_decoders_;
2271 allocated_decoders_.clear(); 2270 allocated_decoders_.clear();
2272 config_.decoders.clear(); 2271 config_.decoders.clear();
2273 for (size_t i = 0; i < recv_codecs.size(); ++i) { 2272 for (size_t i = 0; i < recv_codecs.size(); ++i) {
2274 AllocatedDecoder allocated_decoder = 2273 AllocatedDecoder allocated_decoder =
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
2585 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; 2584 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id];
2586 } 2585 }
2587 } 2586 }
2588 2587
2589 return video_codecs; 2588 return video_codecs;
2590 } 2589 }
2591 2590
2592 } // namespace cricket 2591 } // namespace cricket
2593 2592
2594 #endif // HAVE_WEBRTC_VIDEO 2593 #endif // HAVE_WEBRTC_VIDEO
OLDNEW
« no previous file with comments | « no previous file | webrtc/video/video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698