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

Unified Diff: webrtc/pc/mediasession.h

Issue 1845673002: Removing `preference` field from `cricket::Codec`. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixing sort order (got reversed when optimizations were made) Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/pc/channelmanager_unittest.cc ('k') | webrtc/pc/mediasession.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/mediasession.h
diff --git a/webrtc/pc/mediasession.h b/webrtc/pc/mediasession.h
index ae221554e20b596a569db934fdb285b37183614d..98a1f070d687ec8457f3f22a8be70899d8ee5517 100644
--- a/webrtc/pc/mediasession.h
+++ b/webrtc/pc/mediasession.h
@@ -293,10 +293,9 @@ class MediaContentDescription : public ContentDescription {
template <class C>
class MediaContentDescriptionImpl : public MediaContentDescription {
public:
- struct PreferenceSort {
- bool operator()(C a, C b) { return a.preference > b.preference; }
- };
+ typedef C CodecType;
+ // Codecs should be in preference order (most preferred codec first).
const std::vector<C>& codecs() const { return codecs_; }
void set_codecs(const std::vector<C>& codecs) { codecs_ = codecs; }
virtual bool has_codecs() const { return !codecs_.empty(); }
@@ -330,9 +329,6 @@ class MediaContentDescriptionImpl : public MediaContentDescription {
AddCodec(*codec);
}
}
- void SortCodecs() {
- std::sort(codecs_.begin(), codecs_.end(), PreferenceSort());
- }
private:
std::vector<C> codecs_;
« no previous file with comments | « webrtc/pc/channelmanager_unittest.cc ('k') | webrtc/pc/mediasession.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698