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

Side by Side Diff: webrtc/media/base/codec.cc

Issue 2854123003: Build WebRTC with data channel only. (Closed)
Patch Set: CR comments. Created 3 years, 7 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) 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)
Taylor Brandstetter 2017/05/11 04:43:11 Only need HAVE_WEBRTC_VIDEO, technically
Zhi Huang 2017/05/12 20:05:33 Done.
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;
Taylor Brandstetter 2017/05/11 04:43:11 In all of these "#else" blocks, can you add RTC_NO
Zhi Huang 2017/05/12 20:05:33 Done.
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698