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

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

Issue 2854123003: Build WebRTC with data channel only. (Closed)
Patch Set: More modular apporach. Proof of concept. Need more work. 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 bool IsSameH264Profile(const CodecParameterMap& params1,
25 const CodecParameterMap& params2) { 25 const CodecParameterMap& params2);
26 const rtc::Optional<webrtc::H264::ProfileLevelId> profile_level_id =
27 webrtc::H264::ParseSdpProfileLevelId(params1);
28 const rtc::Optional<webrtc::H264::ProfileLevelId> other_profile_level_id =
29 webrtc::H264::ParseSdpProfileLevelId(params2);
30 // Compare H264 profiles, but not levels.
31 return profile_level_id && other_profile_level_id &&
32 profile_level_id->profile == other_profile_level_id->profile;
33 }
34 26
35 bool FeedbackParam::operator==(const FeedbackParam& other) const { 27 bool FeedbackParam::operator==(const FeedbackParam& other) const {
36 return _stricmp(other.id().c_str(), id().c_str()) == 0 && 28 return _stricmp(other.id().c_str(), id().c_str()) == 0 &&
37 _stricmp(other.param().c_str(), param().c_str()) == 0; 29 _stricmp(other.param().c_str(), param().c_str()) == 0;
38 } 30 }
39 31
40 bool FeedbackParams::operator==(const FeedbackParams& other) const { 32 bool FeedbackParams::operator==(const FeedbackParams& other) const {
41 return params_ == other.params_; 33 return params_ == other.params_;
42 } 34 }
43 35
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 if (CodecNamesEq(codec.name.c_str(), kH264CodecName) && 345 if (CodecNamesEq(codec.name.c_str(), kH264CodecName) &&
354 !IsSameH264Profile(codec.params, supported_codec.params)) { 346 !IsSameH264Profile(codec.params, supported_codec.params)) {
355 continue; 347 continue;
356 } 348 }
357 return &supported_codec; 349 return &supported_codec;
358 } 350 }
359 return nullptr; 351 return nullptr;
360 } 352 }
361 353
362 } // namespace cricket 354 } // namespace cricket
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698