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

Side by Side Diff: webrtc/api/webrtcsdp_unittest.cc

Issue 2511933002: Reland of Stop using hardcoded payload types for video codecs (Closed)
Patch Set: Remove singleton pattern for InternalEncoderFactory 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/api/android/jni/androidmediaencoder_jni.cc ('k') | webrtc/media/BUILD.gn » ('j') | 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 2011 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2011 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 2065 matching lines...) Expand 10 before | Expand all | Expand 10 after
2076 kCandidateFoundation1); 2076 kCandidateFoundation1);
2077 candidate.set_tcptype(cricket::TCPTYPE_ACTIVE_STR); 2077 candidate.set_tcptype(cricket::TCPTYPE_ACTIVE_STR);
2078 std::unique_ptr<IceCandidateInterface> jcandidate( 2078 std::unique_ptr<IceCandidateInterface> jcandidate(
2079 new JsepIceCandidate(std::string("audio_content_name"), 0, candidate)); 2079 new JsepIceCandidate(std::string("audio_content_name"), 0, candidate));
2080 2080
2081 std::string message = webrtc::SdpSerializeCandidate(*jcandidate); 2081 std::string message = webrtc::SdpSerializeCandidate(*jcandidate);
2082 EXPECT_EQ(std::string(kSdpTcpActiveCandidate), message); 2082 EXPECT_EQ(std::string(kSdpTcpActiveCandidate), message);
2083 } 2083 }
2084 2084
2085 TEST_F(WebRtcSdpTest, SerializeSessionDescriptionWithH264) { 2085 TEST_F(WebRtcSdpTest, SerializeSessionDescriptionWithH264) {
2086 if (!webrtc::H264Encoder::IsSupported()) 2086 cricket::VideoCodec h264_codec("H264");
2087 return; 2087 h264_codec.SetParam("profile-level-id", "42e01f");
2088 for (const auto& codec : cricket::DefaultVideoCodecList()) { 2088 h264_codec.SetParam("level-asymmetry-allowed", "1");
2089 video_desc_->AddCodec(codec); 2089 h264_codec.SetParam("packetization-mode", "1");
2090 } 2090 video_desc_->AddCodec(h264_codec);
2091
2091 jdesc_.Initialize(desc_.Copy(), kSessionId, kSessionVersion); 2092 jdesc_.Initialize(desc_.Copy(), kSessionId, kSessionVersion);
2092 2093
2093 std::string message = webrtc::SdpSerialize(jdesc_, false); 2094 std::string message = webrtc::SdpSerialize(jdesc_, false);
2094 size_t after_pt = message.find(" H264/90000"); 2095 size_t after_pt = message.find(" H264/90000");
2095 ASSERT_NE(after_pt, std::string::npos); 2096 ASSERT_NE(after_pt, std::string::npos);
2096 size_t before_pt = message.rfind("a=rtpmap:", after_pt); 2097 size_t before_pt = message.rfind("a=rtpmap:", after_pt);
2097 ASSERT_NE(before_pt, std::string::npos); 2098 ASSERT_NE(before_pt, std::string::npos);
2098 before_pt += strlen("a=rtpmap:"); 2099 before_pt += strlen("a=rtpmap:");
2099 std::string pt = message.substr(before_pt, after_pt - before_pt); 2100 std::string pt = message.substr(before_pt, after_pt - before_pt);
2100 // TODO(hta): Check if payload type |pt| occurs in the m=video line. 2101 // TODO(hta): Check if payload type |pt| occurs in the m=video line.
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
3193 "o=- 18446744069414584320 18446462598732840960 IN IP4 127.0.0.1\r\n" 3194 "o=- 18446744069414584320 18446462598732840960 IN IP4 127.0.0.1\r\n"
3194 "s=-\r\n" 3195 "s=-\r\n"
3195 "t=0 0\r\n" 3196 "t=0 0\r\n"
3196 "m=video 9 UDP/DTLS/SCTP 120\r\n" 3197 "m=video 9 UDP/DTLS/SCTP 120\r\n"
3197 "a=sctp-port 5000\r\n" 3198 "a=sctp-port 5000\r\n"
3198 "a=fmtp:108 foo=10\r\n"; 3199 "a=fmtp:108 foo=10\r\n";
3199 3200
3200 ExpectParseFailure(std::string(kSdpWithSctpPortInVideoDescription), 3201 ExpectParseFailure(std::string(kSdpWithSctpPortInVideoDescription),
3201 "sctp-port"); 3202 "sctp-port");
3202 } 3203 }
OLDNEW
« no previous file with comments | « webrtc/api/android/jni/androidmediaencoder_jni.cc ('k') | webrtc/media/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698