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

Side by Side Diff: webrtc/video/video_receive_stream.cc

Issue 2998293002: Make CodecType conversion functions non-optional. (Closed)
Patch Set: Keep old functions for backwards-compat Created 3 years, 3 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 | « webrtc/video/send_statistics_proxy.cc ('k') | webrtc/video/video_send_stream.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 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 29 matching lines...) Expand all
40 40
41 namespace webrtc { 41 namespace webrtc {
42 42
43 namespace { 43 namespace {
44 VideoCodec CreateDecoderVideoCodec(const VideoReceiveStream::Decoder& decoder) { 44 VideoCodec CreateDecoderVideoCodec(const VideoReceiveStream::Decoder& decoder) {
45 VideoCodec codec; 45 VideoCodec codec;
46 memset(&codec, 0, sizeof(codec)); 46 memset(&codec, 0, sizeof(codec));
47 47
48 codec.plType = decoder.payload_type; 48 codec.plType = decoder.payload_type;
49 strncpy(codec.plName, decoder.payload_name.c_str(), sizeof(codec.plName)); 49 strncpy(codec.plName, decoder.payload_name.c_str(), sizeof(codec.plName));
50 codec.codecType = 50 codec.codecType = PayloadStringToCodecType(decoder.payload_name);
51 PayloadNameToCodecType(decoder.payload_name).value_or(kVideoCodecGeneric);
52 51
53 if (codec.codecType == kVideoCodecVP8) { 52 if (codec.codecType == kVideoCodecVP8) {
54 *(codec.VP8()) = VideoEncoder::GetDefaultVp8Settings(); 53 *(codec.VP8()) = VideoEncoder::GetDefaultVp8Settings();
55 } else if (codec.codecType == kVideoCodecVP9) { 54 } else if (codec.codecType == kVideoCodecVP9) {
56 *(codec.VP9()) = VideoEncoder::GetDefaultVp9Settings(); 55 *(codec.VP9()) = VideoEncoder::GetDefaultVp9Settings();
57 } else if (codec.codecType == kVideoCodecH264) { 56 } else if (codec.codecType == kVideoCodecH264) {
58 *(codec.H264()) = VideoEncoder::GetDefaultH264Settings(); 57 *(codec.H264()) = VideoEncoder::GetDefaultH264Settings();
59 codec.H264()->profile = 58 codec.H264()->profile =
60 H264::ParseSdpProfileLevelId(decoder.codec_params)->profile; 59 H264::ParseSdpProfileLevelId(decoder.codec_params)->profile;
61 } 60 }
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 if (stream_is_active && !receiving_keyframe) { 442 if (stream_is_active && !receiving_keyframe) {
444 LOG(LS_WARNING) << "No decodable frame in " << wait_ms 443 LOG(LS_WARNING) << "No decodable frame in " << wait_ms
445 << " ms, requesting keyframe."; 444 << " ms, requesting keyframe.";
446 RequestKeyFrame(); 445 RequestKeyFrame();
447 } 446 }
448 } 447 }
449 return true; 448 return true;
450 } 449 }
451 } // namespace internal 450 } // namespace internal
452 } // namespace webrtc 451 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/send_statistics_proxy.cc ('k') | webrtc/video/video_send_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698