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

Side by Side Diff: webrtc/pc/mediasession_unittest.cc

Issue 2408153002: Remove cricket::VideoCodec with, height and framerate properties (Closed)
Patch Set: Rebased Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « webrtc/pc/channelmanager_unittest.cc ('k') | no next file » | 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 2004 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2004 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 AudioCodec(126, "speex", 16000, 22000, 1), 89 AudioCodec(126, "speex", 16000, 22000, 1),
90 AudioCodec(0, "PCMU", 8000, 64000, 1), 90 AudioCodec(0, "PCMU", 8000, 64000, 1),
91 AudioCodec(127, "iLBC", 8000, 13300, 1), 91 AudioCodec(127, "iLBC", 8000, 13300, 1),
92 }; 92 };
93 93
94 static const AudioCodec kAudioCodecsAnswer[] = { 94 static const AudioCodec kAudioCodecsAnswer[] = {
95 AudioCodec(102, "iLBC", 8000, 13300, 1), 95 AudioCodec(102, "iLBC", 8000, 13300, 1),
96 AudioCodec(0, "PCMU", 8000, 64000, 1), 96 AudioCodec(0, "PCMU", 8000, 64000, 1),
97 }; 97 };
98 98
99 static const VideoCodec kVideoCodecs1[] = { 99 static const VideoCodec kVideoCodecs1[] = {VideoCodec(96, "H264-SVC"),
100 VideoCodec(96, "H264-SVC", 320, 200, 30), 100 VideoCodec(97, "H264")};
101 VideoCodec(97, "H264", 320, 200, 30)};
102 101
103 static const VideoCodec kVideoCodecs2[] = { 102 static const VideoCodec kVideoCodecs2[] = {VideoCodec(126, "H264"),
104 VideoCodec(126, "H264", 320, 200, 30), 103 VideoCodec(127, "H263")};
105 VideoCodec(127, "H263", 320, 200, 30)};
106 104
107 static const VideoCodec kVideoCodecsAnswer[] = { 105 static const VideoCodec kVideoCodecsAnswer[] = {VideoCodec(97, "H264")};
108 VideoCodec(97, "H264", 320, 200, 30)};
109 106
110 static const DataCodec kDataCodecs1[] = {DataCodec(98, "binary-data"), 107 static const DataCodec kDataCodecs1[] = {DataCodec(98, "binary-data"),
111 DataCodec(99, "utf8-text")}; 108 DataCodec(99, "utf8-text")};
112 109
113 static const DataCodec kDataCodecs2[] = {DataCodec(126, "binary-data"), 110 static const DataCodec kDataCodecs2[] = {DataCodec(126, "binary-data"),
114 DataCodec(127, "utf8-text")}; 111 DataCodec(127, "utf8-text")};
115 112
116 static const DataCodec kDataCodecsAnswer[] = {DataCodec(98, "binary-data"), 113 static const DataCodec kDataCodecsAnswer[] = {DataCodec(98, "binary-data"),
117 DataCodec(99, "utf8-text")}; 114 DataCodec(99, "utf8-text")};
118 115
(...skipping 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after
1835 EXPECT_EQ(expected_codecs, updated_vcd->codecs()); 1832 EXPECT_EQ(expected_codecs, updated_vcd->codecs());
1836 } 1833 }
1837 1834
1838 // Test that RTX is ignored when there is no associated payload type parameter. 1835 // Test that RTX is ignored when there is no associated payload type parameter.
1839 TEST_F(MediaSessionDescriptionFactoryTest, RtxWithoutApt) { 1836 TEST_F(MediaSessionDescriptionFactoryTest, RtxWithoutApt) {
1840 MediaSessionOptions opts; 1837 MediaSessionOptions opts;
1841 opts.recv_video = true; 1838 opts.recv_video = true;
1842 opts.recv_audio = false; 1839 opts.recv_audio = false;
1843 std::vector<VideoCodec> f1_codecs = MAKE_VECTOR(kVideoCodecs1); 1840 std::vector<VideoCodec> f1_codecs = MAKE_VECTOR(kVideoCodecs1);
1844 // This creates RTX without associated payload type parameter. 1841 // This creates RTX without associated payload type parameter.
1845 AddRtxCodec(VideoCodec(126, cricket::kRtxCodecName, 0, 0, 0), &f1_codecs); 1842 AddRtxCodec(VideoCodec(126, cricket::kRtxCodecName), &f1_codecs);
1846 f1_.set_video_codecs(f1_codecs); 1843 f1_.set_video_codecs(f1_codecs);
1847 1844
1848 std::vector<VideoCodec> f2_codecs = MAKE_VECTOR(kVideoCodecs2); 1845 std::vector<VideoCodec> f2_codecs = MAKE_VECTOR(kVideoCodecs2);
1849 // This creates RTX for H264 with the payload type |f2_| uses. 1846 // This creates RTX for H264 with the payload type |f2_| uses.
1850 AddRtxCodec(VideoCodec::CreateRtxCodec(125, kVideoCodecs2[0].id), &f2_codecs); 1847 AddRtxCodec(VideoCodec::CreateRtxCodec(125, kVideoCodecs2[0].id), &f2_codecs);
1851 f2_.set_video_codecs(f2_codecs); 1848 f2_.set_video_codecs(f2_codecs);
1852 1849
1853 std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL)); 1850 std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
1854 ASSERT_TRUE(offer.get() != NULL); 1851 ASSERT_TRUE(offer.get() != NULL);
1855 // kCodecParamAssociatedPayloadType will always be added to the offer when RTX 1852 // kCodecParamAssociatedPayloadType will always be added to the offer when RTX
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
1983 TEST_F(MediaSessionDescriptionFactoryTest, SimSsrcsGenerateMultipleRtxSsrcs) { 1980 TEST_F(MediaSessionDescriptionFactoryTest, SimSsrcsGenerateMultipleRtxSsrcs) {
1984 MediaSessionOptions opts; 1981 MediaSessionOptions opts;
1985 opts.recv_video = true; 1982 opts.recv_video = true;
1986 opts.recv_audio = false; 1983 opts.recv_audio = false;
1987 1984
1988 // Add simulcast streams. 1985 // Add simulcast streams.
1989 opts.AddSendVideoStream("stream1", "stream1label", 3); 1986 opts.AddSendVideoStream("stream1", "stream1label", 3);
1990 1987
1991 // Use a single real codec, and then add RTX for it. 1988 // Use a single real codec, and then add RTX for it.
1992 std::vector<VideoCodec> f1_codecs; 1989 std::vector<VideoCodec> f1_codecs;
1993 f1_codecs.push_back(VideoCodec(97, "H264", 320, 200, 30)); 1990 f1_codecs.push_back(VideoCodec(97, "H264"));
1994 AddRtxCodec(VideoCodec::CreateRtxCodec(125, 97), &f1_codecs); 1991 AddRtxCodec(VideoCodec::CreateRtxCodec(125, 97), &f1_codecs);
1995 f1_.set_video_codecs(f1_codecs); 1992 f1_.set_video_codecs(f1_codecs);
1996 1993
1997 // Ensure that the offer has an RTX ssrc for each regular ssrc, and that there 1994 // Ensure that the offer has an RTX ssrc for each regular ssrc, and that there
1998 // is a FID ssrc + grouping for each. 1995 // is a FID ssrc + grouping for each.
1999 std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL)); 1996 std::unique_ptr<SessionDescription> offer(f1_.CreateOffer(opts, NULL));
2000 ASSERT_TRUE(offer.get() != NULL); 1997 ASSERT_TRUE(offer.get() != NULL);
2001 VideoContentDescription* desc = static_cast<VideoContentDescription*>( 1998 VideoContentDescription* desc = static_cast<VideoContentDescription*>(
2002 offer->GetContentDescriptionByName(cricket::CN_VIDEO)); 1999 offer->GetContentDescriptionByName(cricket::CN_VIDEO));
2003 ASSERT_TRUE(desc != NULL); 2000 ASSERT_TRUE(desc != NULL);
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
2904 ::testing::Combine( 2901 ::testing::Combine(
2905 ::testing::Values(cricket::MD_SENDONLY, 2902 ::testing::Values(cricket::MD_SENDONLY,
2906 cricket::MD_RECVONLY, 2903 cricket::MD_RECVONLY,
2907 cricket::MD_SENDRECV, 2904 cricket::MD_SENDRECV,
2908 cricket::MD_INACTIVE), 2905 cricket::MD_INACTIVE),
2909 ::testing::Values(cricket::MD_SENDONLY, 2906 ::testing::Values(cricket::MD_SENDONLY,
2910 cricket::MD_RECVONLY, 2907 cricket::MD_RECVONLY,
2911 cricket::MD_SENDRECV, 2908 cricket::MD_SENDRECV,
2912 cricket::MD_INACTIVE), 2909 cricket::MD_INACTIVE),
2913 ::testing::Bool())); 2910 ::testing::Bool()));
OLDNEW
« no previous file with comments | « webrtc/pc/channelmanager_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698