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. |
| 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); |
| 2938 const VideoContentDescription* vcd = |
| 2939 static_cast<const VideoContentDescription*>(vc->description); |
| 2940 ASSERT_TRUE(vcd != NULL); |
| 2941 ASSERT_FALSE(vcd->codecs().empty()); |
| 2942 cricket::VideoCodec h264 = vcd->codecs()[0]; |
| 2943 EXPECT_EQ("H264", h264.name); |
| 2944 EXPECT_EQ(98, h264.id); |
| 2945 cricket::CodecParameterMap::const_iterator found = |
| 2946 h264.params.find("profile-level-id"); |
| 2947 ASSERT_TRUE(found != h264.params.end()); |
| 2948 EXPECT_EQ(found->second, "42A01E"); |
| 2949 found = h264.params.find("sprop-parameter-sets"); |
| 2950 ASSERT_TRUE(found != h264.params.end()); |
| 2951 EXPECT_EQ(found->second, "Z0IACpZTBYmI,aMljiA=="); |
| 2952 } |
| 2953 |
2918 TEST_F(WebRtcSdpTest, DeserializeVideoFmtpWithSpace) { | 2954 TEST_F(WebRtcSdpTest, DeserializeVideoFmtpWithSpace) { |
2919 JsepSessionDescription jdesc_output(kDummyString); | 2955 JsepSessionDescription jdesc_output(kDummyString); |
2920 | 2956 |
2921 const char kSdpWithFmtpString[] = | 2957 const char kSdpWithFmtpString[] = |
2922 "v=0\r\n" | 2958 "v=0\r\n" |
2923 "o=- 18446744069414584320 18446462598732840960 IN IP4 127.0.0.1\r\n" | 2959 "o=- 18446744069414584320 18446462598732840960 IN IP4 127.0.0.1\r\n" |
2924 "s=-\r\n" | 2960 "s=-\r\n" |
2925 "t=0 0\r\n" | 2961 "t=0 0\r\n" |
2926 "m=video 3457 RTP/SAVPF 120\r\n" | 2962 "m=video 3457 RTP/SAVPF 120\r\n" |
2927 "a=rtpmap:120 VP8/90000\r\n" | 2963 "a=rtpmap:120 VP8/90000\r\n" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3140 EXPECT_TRUE( | 3176 EXPECT_TRUE( |
3141 SdpDeserialize(kUnifiedPlanSdpFullString, &deserialized_description)); | 3177 SdpDeserialize(kUnifiedPlanSdpFullString, &deserialized_description)); |
3142 | 3178 |
3143 EXPECT_TRUE(CompareSessionDescription(jdesc_, deserialized_description)); | 3179 EXPECT_TRUE(CompareSessionDescription(jdesc_, deserialized_description)); |
3144 } | 3180 } |
3145 | 3181 |
3146 TEST_F(WebRtcSdpTest, SerializeUnifiedPlanSessionDescription) { | 3182 TEST_F(WebRtcSdpTest, SerializeUnifiedPlanSessionDescription) { |
3147 MakeUnifiedPlanDescription(); | 3183 MakeUnifiedPlanDescription(); |
3148 TestSerialize(jdesc_, true); | 3184 TestSerialize(jdesc_, true); |
3149 } | 3185 } |
OLD | NEW |