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

Side by Side Diff: webrtc/pc/mediasession_unittest.cc

Issue 2493733003: Optimize FindCodecById and ReferencedCodecsMatch (Closed)
Patch Set: Created 4 years, 1 month 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/pc/mediasession.cc ('k') | no next file » | 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 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright 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
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 185
186 static cricket::MediaContentDirection 186 static cricket::MediaContentDirection
187 GetMediaDirection(const ContentInfo* content) { 187 GetMediaDirection(const ContentInfo* content) {
188 cricket::MediaContentDescription* desc = 188 cricket::MediaContentDescription* desc =
189 reinterpret_cast<cricket::MediaContentDescription*>(content->description); 189 reinterpret_cast<cricket::MediaContentDescription*>(content->description);
190 return desc->direction(); 190 return desc->direction();
191 } 191 }
192 192
193 static void AddRtxCodec(const VideoCodec& rtx_codec, 193 static void AddRtxCodec(const VideoCodec& rtx_codec,
194 std::vector<VideoCodec>* codecs) { 194 std::vector<VideoCodec>* codecs) {
195 VideoCodec rtx; 195 ASSERT_FALSE(cricket::FindCodecById(*codecs, rtx_codec.id));
196 ASSERT_FALSE(cricket::FindCodecById(*codecs, rtx_codec.id, &rtx));
197 codecs->push_back(rtx_codec); 196 codecs->push_back(rtx_codec);
198 } 197 }
199 198
200 template <class T> 199 template <class T>
201 static std::vector<std::string> GetCodecNames(const std::vector<T>& codecs) { 200 static std::vector<std::string> GetCodecNames(const std::vector<T>& codecs) {
202 std::vector<std::string> codec_names; 201 std::vector<std::string> codec_names;
203 for (const auto& codec : codecs) { 202 for (const auto& codec : codecs) {
204 codec_names.push_back(codec.name); 203 codec_names.push_back(codec.name);
205 } 204 }
206 return codec_names; 205 return codec_names;
(...skipping 2694 matching lines...) Expand 10 before | Expand all | Expand 10 after
2901 ::testing::Combine( 2900 ::testing::Combine(
2902 ::testing::Values(cricket::MD_SENDONLY, 2901 ::testing::Values(cricket::MD_SENDONLY,
2903 cricket::MD_RECVONLY, 2902 cricket::MD_RECVONLY,
2904 cricket::MD_SENDRECV, 2903 cricket::MD_SENDRECV,
2905 cricket::MD_INACTIVE), 2904 cricket::MD_INACTIVE),
2906 ::testing::Values(cricket::MD_SENDONLY, 2905 ::testing::Values(cricket::MD_SENDONLY,
2907 cricket::MD_RECVONLY, 2906 cricket::MD_RECVONLY,
2908 cricket::MD_SENDRECV, 2907 cricket::MD_SENDRECV,
2909 cricket::MD_INACTIVE), 2908 cricket::MD_INACTIVE),
2910 ::testing::Bool())); 2909 ::testing::Bool()));
OLDNEW
« no previous file with comments | « webrtc/pc/mediasession.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698