OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 |
11 #include "webrtc/media/base/codec.h" | 11 #include "webrtc/media/base/codec.h" |
12 | 12 |
13 #include <algorithm> | 13 #include <algorithm> |
14 #include <sstream> | 14 #include <sstream> |
15 | 15 |
16 #include "webrtc/base/checks.h" | 16 #include "webrtc/base/checks.h" |
17 #include "webrtc/base/logging.h" | 17 #include "webrtc/base/logging.h" |
18 #include "webrtc/base/stringencode.h" | 18 #include "webrtc/base/stringencode.h" |
19 #include "webrtc/base/stringutils.h" | 19 #include "webrtc/base/stringutils.h" |
20 #include "webrtc/common_video/h264/profile_level_id.h" | 20 #include "webrtc/common_video/h264/profile_level_id.h" |
21 | 21 |
22 namespace cricket { | 22 namespace cricket { |
23 | 23 |
24 static bool IsSameH264Profile(const CodecParameterMap& params1, | 24 static bool IsSameH264Profile(const CodecParameterMap& params1, |
25 const CodecParameterMap& params2) { | 25 const CodecParameterMap& params2) { |
| 26 #if defined(HAVE_WEBRTC_VOICE) && defined(HAVE_WEBRTC_VIDEO) |
26 const rtc::Optional<webrtc::H264::ProfileLevelId> profile_level_id = | 27 const rtc::Optional<webrtc::H264::ProfileLevelId> profile_level_id = |
27 webrtc::H264::ParseSdpProfileLevelId(params1); | 28 webrtc::H264::ParseSdpProfileLevelId(params1); |
28 const rtc::Optional<webrtc::H264::ProfileLevelId> other_profile_level_id = | 29 const rtc::Optional<webrtc::H264::ProfileLevelId> other_profile_level_id = |
29 webrtc::H264::ParseSdpProfileLevelId(params2); | 30 webrtc::H264::ParseSdpProfileLevelId(params2); |
30 // Compare H264 profiles, but not levels. | 31 // Compare H264 profiles, but not levels. |
31 return profile_level_id && other_profile_level_id && | 32 return profile_level_id && other_profile_level_id && |
32 profile_level_id->profile == other_profile_level_id->profile; | 33 profile_level_id->profile == other_profile_level_id->profile; |
| 34 #else |
| 35 return false; |
| 36 #endif |
33 } | 37 } |
34 | 38 |
35 bool FeedbackParam::operator==(const FeedbackParam& other) const { | 39 bool FeedbackParam::operator==(const FeedbackParam& other) const { |
36 return _stricmp(other.id().c_str(), id().c_str()) == 0 && | 40 return _stricmp(other.id().c_str(), id().c_str()) == 0 && |
37 _stricmp(other.param().c_str(), param().c_str()) == 0; | 41 _stricmp(other.param().c_str(), param().c_str()) == 0; |
38 } | 42 } |
39 | 43 |
40 bool FeedbackParams::operator==(const FeedbackParams& other) const { | 44 bool FeedbackParams::operator==(const FeedbackParams& other) const { |
41 return params_ == other.params_; | 45 return params_ == other.params_; |
42 } | 46 } |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 if (CodecNamesEq(codec.name.c_str(), kH264CodecName) && | 357 if (CodecNamesEq(codec.name.c_str(), kH264CodecName) && |
354 !IsSameH264Profile(codec.params, supported_codec.params)) { | 358 !IsSameH264Profile(codec.params, supported_codec.params)) { |
355 continue; | 359 continue; |
356 } | 360 } |
357 return &supported_codec; | 361 return &supported_codec; |
358 } | 362 } |
359 return nullptr; | 363 return nullptr; |
360 } | 364 } |
361 | 365 |
362 } // namespace cricket | 366 } // namespace cricket |
OLD | NEW |