OLD | NEW |
---|---|
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 2897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2908 EXPECT_EQ(120, vp8.id); | 2908 EXPECT_EQ(120, vp8.id); |
2909 cricket::CodecParameterMap::iterator found = | 2909 cricket::CodecParameterMap::iterator found = |
2910 vp8.params.find("x-google-min-bitrate"); | 2910 vp8.params.find("x-google-min-bitrate"); |
2911 ASSERT_TRUE(found != vp8.params.end()); | 2911 ASSERT_TRUE(found != vp8.params.end()); |
2912 EXPECT_EQ(found->second, "10"); | 2912 EXPECT_EQ(found->second, "10"); |
2913 found = vp8.params.find("x-google-max-quantization"); | 2913 found = vp8.params.find("x-google-max-quantization"); |
2914 ASSERT_TRUE(found != vp8.params.end()); | 2914 ASSERT_TRUE(found != vp8.params.end()); |
2915 EXPECT_EQ(found->second, "40"); | 2915 EXPECT_EQ(found->second, "40"); |
2916 } | 2916 } |
2917 | 2917 |
2918 TEST_F(WebRtcSdpTest, DeserializeVideoFmtpWithSprops) { | |
2919 JsepSessionDescription jdesc_output(kDummyString); | |
2920 | |
2921 const char kSdpWithFmtpString[] = | |
2922 "v=0\r\n" | |
2923 "o=- 18446744069414584320 18446462598732840960 IN IP4 127.0.0.1\r\n" | |
2924 "s=-\r\n" | |
2925 "t=0 0\r\n" | |
2926 "m=video 49170 RTP/AVP 98\r\n" | |
2927 "a=rtpmap:98 H264/90000\r\n" | |
2928 "a=fmtp:98 profile-level-id=42A01E; " | |
2929 "sprop-parameter-sets=Z0IACpZTBYmI,aMljiA==\r\n"; | |
2930 | |
2931 // Deserialize | |
sprang_webrtc
2016/05/30 15:43:29
End comments with a period. Though I don't think y
johan
2016/05/30 15:57:06
Done.
| |
2932 SdpParseError error; | |
2933 EXPECT_TRUE( | |
2934 webrtc::SdpDeserialize(kSdpWithFmtpString, &jdesc_output, &error)); | |
2935 | |
2936 const ContentInfo* vc = GetFirstVideoContent(jdesc_output.description()); | |
2937 ASSERT_TRUE(vc != NULL); | |
sprang_webrtc
2016/05/30 15:43:29
nullptr
johan
2016/05/30 15:57:06
Done.
| |
2938 const VideoContentDescription* vcd = | |
2939 static_cast<const VideoContentDescription*>(vc->description); | |
2940 ASSERT_FALSE(vcd->codecs().empty()); | |
2941 cricket::VideoCodec h264 = vcd->codecs()[0]; | |
2942 EXPECT_EQ("H264", h264.name); | |
2943 EXPECT_EQ(98, h264.id); | |
2944 cricket::CodecParameterMap::const_iterator found = | |
2945 h264.params.find("profile-level-id"); | |
2946 ASSERT_TRUE(found != h264.params.end()); | |
2947 EXPECT_EQ(found->second, "42A01E"); | |
2948 found = h264.params.find("sprop-parameter-sets"); | |
2949 ASSERT_TRUE(found != h264.params.end()); | |
2950 EXPECT_EQ(found->second, "Z0IACpZTBYmI,aMljiA=="); | |
2951 } | |
2952 | |
2918 TEST_F(WebRtcSdpTest, DeserializeVideoFmtpWithSpace) { | 2953 TEST_F(WebRtcSdpTest, DeserializeVideoFmtpWithSpace) { |
2919 JsepSessionDescription jdesc_output(kDummyString); | 2954 JsepSessionDescription jdesc_output(kDummyString); |
2920 | 2955 |
2921 const char kSdpWithFmtpString[] = | 2956 const char kSdpWithFmtpString[] = |
2922 "v=0\r\n" | 2957 "v=0\r\n" |
2923 "o=- 18446744069414584320 18446462598732840960 IN IP4 127.0.0.1\r\n" | 2958 "o=- 18446744069414584320 18446462598732840960 IN IP4 127.0.0.1\r\n" |
2924 "s=-\r\n" | 2959 "s=-\r\n" |
2925 "t=0 0\r\n" | 2960 "t=0 0\r\n" |
2926 "m=video 3457 RTP/SAVPF 120\r\n" | 2961 "m=video 3457 RTP/SAVPF 120\r\n" |
2927 "a=rtpmap:120 VP8/90000\r\n" | 2962 "a=rtpmap:120 VP8/90000\r\n" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3140 EXPECT_TRUE( | 3175 EXPECT_TRUE( |
3141 SdpDeserialize(kUnifiedPlanSdpFullString, &deserialized_description)); | 3176 SdpDeserialize(kUnifiedPlanSdpFullString, &deserialized_description)); |
3142 | 3177 |
3143 EXPECT_TRUE(CompareSessionDescription(jdesc_, deserialized_description)); | 3178 EXPECT_TRUE(CompareSessionDescription(jdesc_, deserialized_description)); |
3144 } | 3179 } |
3145 | 3180 |
3146 TEST_F(WebRtcSdpTest, SerializeUnifiedPlanSessionDescription) { | 3181 TEST_F(WebRtcSdpTest, SerializeUnifiedPlanSessionDescription) { |
3147 MakeUnifiedPlanDescription(); | 3182 MakeUnifiedPlanDescription(); |
3148 TestSerialize(jdesc_, true); | 3183 TestSerialize(jdesc_, true); |
3149 } | 3184 } |
OLD | NEW |