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