OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2004 Google Inc. | 3 * Copyright 2004 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 } // namespace | 106 } // namespace |
107 | 107 |
108 namespace cricket { | 108 namespace cricket { |
109 class WebRtcVideoEngine2Test : public ::testing::Test { | 109 class WebRtcVideoEngine2Test : public ::testing::Test { |
110 public: | 110 public: |
111 WebRtcVideoEngine2Test() : WebRtcVideoEngine2Test(nullptr) {} | 111 WebRtcVideoEngine2Test() : WebRtcVideoEngine2Test(nullptr) {} |
112 WebRtcVideoEngine2Test(WebRtcVoiceEngine* voice_engine) | 112 WebRtcVideoEngine2Test(WebRtcVoiceEngine* voice_engine) |
113 : call_(webrtc::Call::Create(webrtc::Call::Config())), | 113 : call_(webrtc::Call::Create(webrtc::Call::Config())), |
114 engine_() { | 114 engine_() { |
115 std::vector<VideoCodec> engine_codecs = engine_.codecs(); | 115 std::vector<VideoCodec> engine_codecs = engine_.codecs(); |
116 DCHECK(!engine_codecs.empty()); | 116 RTC_DCHECK(!engine_codecs.empty()); |
117 bool codec_set = false; | 117 bool codec_set = false; |
118 for (size_t i = 0; i < engine_codecs.size(); ++i) { | 118 for (size_t i = 0; i < engine_codecs.size(); ++i) { |
119 if (engine_codecs[i].name == "red") { | 119 if (engine_codecs[i].name == "red") { |
120 default_red_codec_ = engine_codecs[i]; | 120 default_red_codec_ = engine_codecs[i]; |
121 } else if (engine_codecs[i].name == "ulpfec") { | 121 } else if (engine_codecs[i].name == "ulpfec") { |
122 default_ulpfec_codec_ = engine_codecs[i]; | 122 default_ulpfec_codec_ = engine_codecs[i]; |
123 } else if (engine_codecs[i].name == "rtx") { | 123 } else if (engine_codecs[i].name == "rtx") { |
124 int associated_payload_type; | 124 int associated_payload_type; |
125 if (engine_codecs[i].GetParam(kCodecParamAssociatedPayloadType, | 125 if (engine_codecs[i].GetParam(kCodecParamAssociatedPayloadType, |
126 &associated_payload_type)) { | 126 &associated_payload_type)) { |
127 default_apt_rtx_types_[associated_payload_type] = engine_codecs[i].id; | 127 default_apt_rtx_types_[associated_payload_type] = engine_codecs[i].id; |
128 } | 128 } |
129 } else if (!codec_set) { | 129 } else if (!codec_set) { |
130 default_codec_ = engine_codecs[i]; | 130 default_codec_ = engine_codecs[i]; |
131 codec_set = true; | 131 codec_set = true; |
132 } | 132 } |
133 } | 133 } |
134 | 134 |
135 DCHECK(codec_set); | 135 RTC_DCHECK(codec_set); |
136 } | 136 } |
137 | 137 |
138 protected: | 138 protected: |
139 VideoMediaChannel* SetUpForExternalEncoderFactory( | 139 VideoMediaChannel* SetUpForExternalEncoderFactory( |
140 cricket::WebRtcVideoEncoderFactory* encoder_factory, | 140 cricket::WebRtcVideoEncoderFactory* encoder_factory, |
141 const std::vector<VideoCodec>& codecs); | 141 const std::vector<VideoCodec>& codecs); |
142 | 142 |
143 VideoMediaChannel* SetUpForExternalDecoderFactory( | 143 VideoMediaChannel* SetUpForExternalDecoderFactory( |
144 cricket::WebRtcVideoDecoderFactory* decoder_factory, | 144 cricket::WebRtcVideoDecoderFactory* decoder_factory, |
145 const std::vector<VideoCodec>& codecs); | 145 const std::vector<VideoCodec>& codecs); |
(...skipping 2829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2975 SimulcastBitrateMode simulcast_bitrate_mode) { | 2975 SimulcastBitrateMode simulcast_bitrate_mode) { |
2976 cricket::VideoOptions options; | 2976 cricket::VideoOptions options; |
2977 options.video_highest_bitrate.Set(bitrate_mode); | 2977 options.video_highest_bitrate.Set(bitrate_mode); |
2978 EXPECT_TRUE(channel_->SetOptions(options)); | 2978 EXPECT_TRUE(channel_->SetOptions(options)); |
2979 | 2979 |
2980 std::vector<VideoCodec> codecs; | 2980 std::vector<VideoCodec> codecs; |
2981 codecs.push_back(codec); | 2981 codecs.push_back(codec); |
2982 ASSERT_TRUE(channel_->SetSendCodecs(codecs)); | 2982 ASSERT_TRUE(channel_->SetSendCodecs(codecs)); |
2983 | 2983 |
2984 std::vector<uint32> ssrcs = MAKE_VECTOR(kSsrcs3); | 2984 std::vector<uint32> ssrcs = MAKE_VECTOR(kSsrcs3); |
2985 DCHECK(num_configured_streams <= ssrcs.size()); | 2985 RTC_DCHECK(num_configured_streams <= ssrcs.size()); |
2986 ssrcs.resize(num_configured_streams); | 2986 ssrcs.resize(num_configured_streams); |
2987 | 2987 |
2988 FakeVideoSendStream* stream = | 2988 FakeVideoSendStream* stream = |
2989 AddSendStream(CreateSimStreamParams("cname", ssrcs)); | 2989 AddSendStream(CreateSimStreamParams("cname", ssrcs)); |
2990 // Send a full-size frame to trigger a stream reconfiguration to use all | 2990 // Send a full-size frame to trigger a stream reconfiguration to use all |
2991 // expected simulcast layers. | 2991 // expected simulcast layers. |
2992 cricket::FakeVideoCapturer capturer; | 2992 cricket::FakeVideoCapturer capturer; |
2993 EXPECT_TRUE(channel_->SetCapturer(ssrcs.front(), &capturer)); | 2993 EXPECT_TRUE(channel_->SetCapturer(ssrcs.front(), &capturer)); |
2994 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(cricket::VideoFormat( | 2994 EXPECT_EQ(cricket::CS_RUNNING, capturer.Start(cricket::VideoFormat( |
2995 codec.width, codec.height, | 2995 codec.width, codec.height, |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3207 // Ensures that the correct settings are applied to the codec when two temporal | 3207 // Ensures that the correct settings are applied to the codec when two temporal |
3208 // layer screencasting is enabled, and that the correct simulcast settings are | 3208 // layer screencasting is enabled, and that the correct simulcast settings are |
3209 // reapplied when disabling screencasting. | 3209 // reapplied when disabling screencasting. |
3210 TEST_F(WebRtcVideoChannel2SimulcastTest, | 3210 TEST_F(WebRtcVideoChannel2SimulcastTest, |
3211 DISABLED_TwoTemporalLayerScreencastSettings) { | 3211 DISABLED_TwoTemporalLayerScreencastSettings) { |
3212 // TODO(pbos): Implement. | 3212 // TODO(pbos): Implement. |
3213 FAIL() << "Not implemented."; | 3213 FAIL() << "Not implemented."; |
3214 } | 3214 } |
3215 | 3215 |
3216 } // namespace cricket | 3216 } // namespace cricket |
OLD | NEW |