OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 int max_bitrate_bps) { | 575 int max_bitrate_bps) { |
576 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 576 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
577 RTC_DCHECK_GE(max_bitrate_bps, min_bitrate_bps); | 577 RTC_DCHECK_GE(max_bitrate_bps, min_bitrate_bps); |
578 rtc::Event thread_sync_event(false /* manual_reset */, false); | 578 rtc::Event thread_sync_event(false /* manual_reset */, false); |
579 worker_queue_->PostTask([&] { | 579 worker_queue_->PostTask([&] { |
580 // We may get a callback immediately as the observer is registered, so make | 580 // We may get a callback immediately as the observer is registered, so make |
581 // sure the bitrate limits in config_ are up-to-date. | 581 // sure the bitrate limits in config_ are up-to-date. |
582 config_.min_bitrate_bps = min_bitrate_bps; | 582 config_.min_bitrate_bps = min_bitrate_bps; |
583 config_.max_bitrate_bps = max_bitrate_bps; | 583 config_.max_bitrate_bps = max_bitrate_bps; |
584 bitrate_allocator_->AddObserver(this, min_bitrate_bps, max_bitrate_bps, 0, | 584 bitrate_allocator_->AddObserver(this, min_bitrate_bps, max_bitrate_bps, 0, |
585 true); | 585 true, config_.track_id); |
586 thread_sync_event.Set(); | 586 thread_sync_event.Set(); |
587 }); | 587 }); |
588 thread_sync_event.Wait(rtc::Event::kForever); | 588 thread_sync_event.Wait(rtc::Event::kForever); |
589 } | 589 } |
590 | 590 |
591 void AudioSendStream::RemoveBitrateObserver() { | 591 void AudioSendStream::RemoveBitrateObserver() { |
592 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); | 592 RTC_DCHECK(worker_thread_checker_.CalledOnValidThread()); |
593 rtc::Event thread_sync_event(false /* manual_reset */, false); | 593 rtc::Event thread_sync_event(false /* manual_reset */, false); |
594 worker_queue_->PostTask([this, &thread_sync_event] { | 594 worker_queue_->PostTask([this, &thread_sync_event] { |
595 bitrate_allocator_->RemoveObserver(this); | 595 bitrate_allocator_->RemoveObserver(this); |
(...skipping 10 matching lines...) Expand all Loading... |
606 if (rtp_rtcp_module_->RegisterSendPayload(codec) != 0) { | 606 if (rtp_rtcp_module_->RegisterSendPayload(codec) != 0) { |
607 LOG(LS_ERROR) << "RegisterCngPayloadType() failed to register CN to " | 607 LOG(LS_ERROR) << "RegisterCngPayloadType() failed to register CN to " |
608 "RTP/RTCP module"; | 608 "RTP/RTCP module"; |
609 } | 609 } |
610 } | 610 } |
611 } | 611 } |
612 | 612 |
613 | 613 |
614 } // namespace internal | 614 } // namespace internal |
615 } // namespace webrtc | 615 } // namespace webrtc |
OLD | NEW |