OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 #include <algorithm> // max | 10 #include <algorithm> // max |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
256 class VideoRotationObserver : public test::SendTest { | 256 class VideoRotationObserver : public test::SendTest { |
257 public: | 257 public: |
258 VideoRotationObserver() : SendTest(kDefaultTimeoutMs) { | 258 VideoRotationObserver() : SendTest(kDefaultTimeoutMs) { |
259 EXPECT_TRUE(parser_->RegisterRtpHeaderExtension( | 259 EXPECT_TRUE(parser_->RegisterRtpHeaderExtension( |
260 kRtpExtensionVideoRotation, test::kVideoRotationExtensionId)); | 260 kRtpExtensionVideoRotation, test::kVideoRotationExtensionId)); |
261 } | 261 } |
262 | 262 |
263 Action OnSendRtp(const uint8_t* packet, size_t length) override { | 263 Action OnSendRtp(const uint8_t* packet, size_t length) override { |
264 RTPHeader header; | 264 RTPHeader header; |
265 EXPECT_TRUE(parser_->Parse(packet, length, &header)); | 265 EXPECT_TRUE(parser_->Parse(packet, length, &header)); |
266 // Wait for last packet of the frame. | |
danilchap
2017/05/12 13:56:11
May be better to explain why wait for the last pac
ilnik
2017/05/12 14:46:08
Fixed. Now comment is more informative.
| |
267 if (!header.markerBit) | |
danilchap
2017/05/12 13:56:11
while normally early return is better, may be here
ilnik
2017/05/12 14:46:08
It can be on the packet with not marker bit (if it
danilchap
2017/05/12 18:56:15
It might be in any packet (like before your CL), b
ilnik
2017/05/15 09:38:33
Done.
| |
268 return SEND_PACKET; | |
266 EXPECT_TRUE(header.extension.hasVideoRotation); | 269 EXPECT_TRUE(header.extension.hasVideoRotation); |
267 EXPECT_EQ(kVideoRotation_90, header.extension.videoRotation); | 270 EXPECT_EQ(kVideoRotation_90, header.extension.videoRotation); |
268 observation_complete_.Set(); | 271 observation_complete_.Set(); |
269 return SEND_PACKET; | 272 return SEND_PACKET; |
270 } | 273 } |
271 | 274 |
272 void ModifyVideoConfigs( | 275 void ModifyVideoConfigs( |
273 VideoSendStream::Config* send_config, | 276 VideoSendStream::Config* send_config, |
274 std::vector<VideoReceiveStream::Config>* receive_configs, | 277 std::vector<VideoReceiveStream::Config>* receive_configs, |
275 VideoEncoderConfig* encoder_config) override { | 278 VideoEncoderConfig* encoder_config) override { |
(...skipping 19 matching lines...) Expand all Loading... | |
295 class VideoRotationObserver : public test::SendTest { | 298 class VideoRotationObserver : public test::SendTest { |
296 public: | 299 public: |
297 VideoRotationObserver() : SendTest(kDefaultTimeoutMs) { | 300 VideoRotationObserver() : SendTest(kDefaultTimeoutMs) { |
298 EXPECT_TRUE(parser_->RegisterRtpHeaderExtension( | 301 EXPECT_TRUE(parser_->RegisterRtpHeaderExtension( |
299 kRtpExtensionVideoContentType, test::kVideoContentTypeExtensionId)); | 302 kRtpExtensionVideoContentType, test::kVideoContentTypeExtensionId)); |
300 } | 303 } |
301 | 304 |
302 Action OnSendRtp(const uint8_t* packet, size_t length) override { | 305 Action OnSendRtp(const uint8_t* packet, size_t length) override { |
303 RTPHeader header; | 306 RTPHeader header; |
304 EXPECT_TRUE(parser_->Parse(packet, length, &header)); | 307 EXPECT_TRUE(parser_->Parse(packet, length, &header)); |
308 // Wait for last packet of the frame. | |
309 if (!header.markerBit) | |
310 return SEND_PACKET; | |
305 EXPECT_TRUE(header.extension.hasVideoContentType); | 311 EXPECT_TRUE(header.extension.hasVideoContentType); |
306 EXPECT_EQ(VideoContentType::SCREENSHARE, | 312 EXPECT_EQ(VideoContentType::SCREENSHARE, |
307 header.extension.videoContentType); | 313 header.extension.videoContentType); |
308 observation_complete_.Set(); | 314 observation_complete_.Set(); |
309 return SEND_PACKET; | 315 return SEND_PACKET; |
310 } | 316 } |
311 | 317 |
312 void ModifyVideoConfigs( | 318 void ModifyVideoConfigs( |
313 VideoSendStream::Config* send_config, | 319 VideoSendStream::Config* send_config, |
314 std::vector<VideoReceiveStream::Config>* receive_configs, | 320 std::vector<VideoReceiveStream::Config>* receive_configs, |
(...skipping 3015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3330 rtc::CriticalSection crit_; | 3336 rtc::CriticalSection crit_; |
3331 uint32_t max_bitrate_bps_ GUARDED_BY(&crit_); | 3337 uint32_t max_bitrate_bps_ GUARDED_BY(&crit_); |
3332 bool first_packet_sent_ GUARDED_BY(&crit_); | 3338 bool first_packet_sent_ GUARDED_BY(&crit_); |
3333 rtc::Event bitrate_changed_event_; | 3339 rtc::Event bitrate_changed_event_; |
3334 } test; | 3340 } test; |
3335 | 3341 |
3336 RunBaseTest(&test); | 3342 RunBaseTest(&test); |
3337 } | 3343 } |
3338 | 3344 |
3339 } // namespace webrtc | 3345 } // namespace webrtc |
OLD | NEW |