@@ -435,9 +435,10 @@ TEST_F(VideoSendStreamImplTest, ForwardsVideoBitrateAllocationWhenEnabled) {
435
435
auto vss_impl = CreateVideoSendStreamImpl (
436
436
kDefaultInitialBitrateBps , kDefaultBitratePriority ,
437
437
VideoEncoderConfig::ContentType::kScreen );
438
+ VideoStreamEncoderInterface::EncoderSink* const sink =
439
+ static_cast <VideoStreamEncoderInterface::EncoderSink*>(
440
+ vss_impl.get ());
438
441
vss_impl->Start ();
439
- VideoBitrateAllocationObserver* const observer =
440
- static_cast <VideoBitrateAllocationObserver*>(vss_impl.get ());
441
442
442
443
// Populate a test instance of video bitrate allocation.
443
444
VideoBitrateAllocation alloc;
@@ -449,7 +450,7 @@ TEST_F(VideoSendStreamImplTest, ForwardsVideoBitrateAllocationWhenEnabled) {
449
450
// Encoder starts out paused, don't forward allocation.
450
451
EXPECT_CALL (rtp_video_sender_, OnBitrateAllocationUpdated (alloc))
451
452
.Times (0 );
452
- observer ->OnBitrateAllocationUpdated (alloc);
453
+ sink ->OnBitrateAllocationUpdated (alloc);
453
454
454
455
// Unpause encoder, allocation should be passed through.
455
456
const uint32_t kBitrateBps = 100000 ;
@@ -460,7 +461,7 @@ TEST_F(VideoSendStreamImplTest, ForwardsVideoBitrateAllocationWhenEnabled) {
460
461
->OnBitrateUpdated (CreateAllocation (kBitrateBps ));
461
462
EXPECT_CALL (rtp_video_sender_, OnBitrateAllocationUpdated (alloc))
462
463
.Times (1 );
463
- observer ->OnBitrateAllocationUpdated (alloc);
464
+ sink ->OnBitrateAllocationUpdated (alloc);
464
465
465
466
// Pause encoder again, and block allocations.
466
467
EXPECT_CALL (rtp_video_sender_, GetPayloadBitrateBps ())
@@ -470,7 +471,7 @@ TEST_F(VideoSendStreamImplTest, ForwardsVideoBitrateAllocationWhenEnabled) {
470
471
->OnBitrateUpdated (CreateAllocation (0 ));
471
472
EXPECT_CALL (rtp_video_sender_, OnBitrateAllocationUpdated (alloc))
472
473
.Times (0 );
473
- observer ->OnBitrateAllocationUpdated (alloc);
474
+ sink ->OnBitrateAllocationUpdated (alloc);
474
475
475
476
vss_impl->Stop ();
476
477
},
@@ -491,8 +492,9 @@ TEST_F(VideoSendStreamImplTest, ThrottlesVideoBitrateAllocationWhenTooSimilar) {
491
492
.WillOnce (Return (kBitrateBps ));
492
493
static_cast <BitrateAllocatorObserver*>(vss_impl.get ())
493
494
->OnBitrateUpdated (CreateAllocation (kBitrateBps ));
494
- VideoBitrateAllocationObserver* const observer =
495
- static_cast <VideoBitrateAllocationObserver*>(vss_impl.get ());
495
+ VideoStreamEncoderInterface::EncoderSink* const sink =
496
+ static_cast <VideoStreamEncoderInterface::EncoderSink*>(
497
+ vss_impl.get ());
496
498
497
499
// Populate a test instance of video bitrate allocation.
498
500
VideoBitrateAllocation alloc;
@@ -504,7 +506,7 @@ TEST_F(VideoSendStreamImplTest, ThrottlesVideoBitrateAllocationWhenTooSimilar) {
504
506
// Initial value.
505
507
EXPECT_CALL (rtp_video_sender_, OnBitrateAllocationUpdated (alloc))
506
508
.Times (1 );
507
- observer ->OnBitrateAllocationUpdated (alloc);
509
+ sink ->OnBitrateAllocationUpdated (alloc);
508
510
509
511
VideoBitrateAllocation updated_alloc = alloc;
510
512
// Needs 10% increase in bitrate to trigger immediate forward.
@@ -514,22 +516,22 @@ TEST_F(VideoSendStreamImplTest, ThrottlesVideoBitrateAllocationWhenTooSimilar) {
514
516
// Too small increase, don't forward.
515
517
updated_alloc.SetBitrate (0 , 0 , base_layer_min_update_bitrate_bps - 1 );
516
518
EXPECT_CALL (rtp_video_sender_, OnBitrateAllocationUpdated (_)).Times (0 );
517
- observer ->OnBitrateAllocationUpdated (updated_alloc);
519
+ sink ->OnBitrateAllocationUpdated (updated_alloc);
518
520
519
521
// Large enough increase, do forward.
520
522
updated_alloc.SetBitrate (0 , 0 , base_layer_min_update_bitrate_bps);
521
523
EXPECT_CALL (rtp_video_sender_,
522
524
OnBitrateAllocationUpdated (updated_alloc))
523
525
.Times (1 );
524
- observer ->OnBitrateAllocationUpdated (updated_alloc);
526
+ sink ->OnBitrateAllocationUpdated (updated_alloc);
525
527
526
528
// This is now a decrease compared to last forward allocation, forward
527
529
// immediately.
528
530
updated_alloc.SetBitrate (0 , 0 , base_layer_min_update_bitrate_bps - 1 );
529
531
EXPECT_CALL (rtp_video_sender_,
530
532
OnBitrateAllocationUpdated (updated_alloc))
531
533
.Times (1 );
532
- observer ->OnBitrateAllocationUpdated (updated_alloc);
534
+ sink ->OnBitrateAllocationUpdated (updated_alloc);
533
535
534
536
vss_impl->Stop ();
535
537
},
@@ -550,8 +552,9 @@ TEST_F(VideoSendStreamImplTest, ForwardsVideoBitrateAllocationOnLayerChange) {
550
552
.WillOnce (Return (kBitrateBps ));
551
553
static_cast <BitrateAllocatorObserver*>(vss_impl.get ())
552
554
->OnBitrateUpdated (CreateAllocation (kBitrateBps ));
553
- VideoBitrateAllocationObserver* const observer =
554
- static_cast <VideoBitrateAllocationObserver*>(vss_impl.get ());
555
+ VideoStreamEncoderInterface::EncoderSink* const sink =
556
+ static_cast <VideoStreamEncoderInterface::EncoderSink*>(
557
+ vss_impl.get ());
555
558
556
559
// Populate a test instance of video bitrate allocation.
557
560
VideoBitrateAllocation alloc;
@@ -563,7 +566,7 @@ TEST_F(VideoSendStreamImplTest, ForwardsVideoBitrateAllocationOnLayerChange) {
563
566
// Initial value.
564
567
EXPECT_CALL (rtp_video_sender_, OnBitrateAllocationUpdated (alloc))
565
568
.Times (1 );
566
- observer ->OnBitrateAllocationUpdated (alloc);
569
+ sink ->OnBitrateAllocationUpdated (alloc);
567
570
568
571
// Move some bitrate from one layer to a new one, but keep sum the same.
569
572
// Since layout has changed, immediately trigger forward.
@@ -574,7 +577,7 @@ TEST_F(VideoSendStreamImplTest, ForwardsVideoBitrateAllocationOnLayerChange) {
574
577
EXPECT_CALL (rtp_video_sender_,
575
578
OnBitrateAllocationUpdated (updated_alloc))
576
579
.Times (1 );
577
- observer ->OnBitrateAllocationUpdated (updated_alloc);
580
+ sink ->OnBitrateAllocationUpdated (updated_alloc);
578
581
579
582
vss_impl->Stop ();
580
583
},
@@ -595,8 +598,9 @@ TEST_F(VideoSendStreamImplTest, ForwardsVideoBitrateAllocationAfterTimeout) {
595
598
.WillRepeatedly (Return (kBitrateBps ));
596
599
static_cast <BitrateAllocatorObserver*>(vss_impl.get ())
597
600
->OnBitrateUpdated (CreateAllocation (kBitrateBps ));
598
- VideoBitrateAllocationObserver* const observer =
599
- static_cast <VideoBitrateAllocationObserver*>(vss_impl.get ());
601
+ VideoStreamEncoderInterface::EncoderSink* const sink =
602
+ static_cast <VideoStreamEncoderInterface::EncoderSink*>(
603
+ vss_impl.get ());
600
604
601
605
// Populate a test instance of video bitrate allocation.
602
606
VideoBitrateAllocation alloc;
@@ -618,14 +622,14 @@ TEST_F(VideoSendStreamImplTest, ForwardsVideoBitrateAllocationAfterTimeout) {
618
622
// Initial value.
619
623
EXPECT_CALL (rtp_video_sender_, OnBitrateAllocationUpdated (alloc))
620
624
.Times (1 );
621
- observer ->OnBitrateAllocationUpdated (alloc);
625
+ sink ->OnBitrateAllocationUpdated (alloc);
622
626
}
623
627
624
628
{
625
629
// Sending same allocation again, this one should be throttled.
626
630
EXPECT_CALL (rtp_video_sender_, OnBitrateAllocationUpdated (alloc))
627
631
.Times (0 );
628
- observer ->OnBitrateAllocationUpdated (alloc);
632
+ sink ->OnBitrateAllocationUpdated (alloc);
629
633
}
630
634
631
635
clock_.AdvanceTimeMicroseconds (kMaxVbaThrottleTimeMs * 1000 );
@@ -634,14 +638,14 @@ TEST_F(VideoSendStreamImplTest, ForwardsVideoBitrateAllocationAfterTimeout) {
634
638
// Sending similar allocation again after timeout, should forward.
635
639
EXPECT_CALL (rtp_video_sender_, OnBitrateAllocationUpdated (alloc))
636
640
.Times (1 );
637
- observer ->OnBitrateAllocationUpdated (alloc);
641
+ sink ->OnBitrateAllocationUpdated (alloc);
638
642
}
639
643
640
644
{
641
645
// Sending similar allocation again without timeout, throttle.
642
646
EXPECT_CALL (rtp_video_sender_, OnBitrateAllocationUpdated (alloc))
643
647
.Times (0 );
644
- observer ->OnBitrateAllocationUpdated (alloc);
648
+ sink ->OnBitrateAllocationUpdated (alloc);
645
649
}
646
650
647
651
{
0 commit comments