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

Unified Diff: webrtc/media/base/codec.cc

Issue 2528343002: H.264 packetization mode 0 (try 3) (Closed)
Patch Set: Filed issue on mode 1 = 0 Created 4 years 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
Index: webrtc/media/base/codec.cc
diff --git a/webrtc/media/base/codec.cc b/webrtc/media/base/codec.cc
index 835cf77b3e77a87e3e31e7df747e09300cbd363b..76441a2c5c9ffb29543ea0250e8802fc3ed0ce15 100644
--- a/webrtc/media/base/codec.cc
+++ b/webrtc/media/base/codec.cc
@@ -82,7 +82,9 @@ bool FeedbackParams::HasDuplicateEntries() const {
}
Codec::Codec(int id, const std::string& name, int clockrate)
- : id(id), name(name), clockrate(clockrate) {}
+ : id(id), name(name), clockrate(clockrate) {
+ SetDefaultParameters();
+}
Codec::Codec() : id(0), clockrate(0) {}
@@ -107,6 +109,16 @@ bool Codec::Matches(const Codec& codec) const {
: (_stricmp(name.c_str(), codec.name.c_str()) == 0);
}
+void Codec::SetDefaultParameters() {
+ if (_stricmp(kH264CodecName, name.c_str()) == 0) {
+ // TODO(magjed): Move setting these parameters into webrtc::H264Encoder
+ // instead.
+ SetParam(kH264FmtpProfileLevelId, kH264ProfileLevelConstrainedBaseline);
+ SetParam(kH264FmtpLevelAsymmetryAllowed, "1");
+ SetParam(kH264FmtpPacketizationMode, "1");
+ }
sprang_webrtc 2016/12/01 16:58:56 Why was this moved here?
hta-webrtc 2016/12/01 18:26:27 Because it was the simplest way to set a default v
magjed_webrtc 2016/12/02 12:34:25 This is a step in the wrong direction. Why can't y
hta-webrtc 2016/12/02 12:48:47 Why is it a step in the wrong direction? Previous
+}
+
bool Codec::GetParam(const std::string& name, std::string* out) const {
CodecParameterMap::const_iterator iter = params.find(name);
if (iter == params.end())

Powered by Google App Engine
This is Rietveld 408576698