Allow more than one registered network change callback in MediaTransport
Adds methods AddNetworkChangeCallback and RemoveNetworkChangeCallback, to replace SetNetworkChangeCallback. Needed because both VideoChannel and VoiceChannel register such a callback. Bug: webrtc:9719 Change-Id: Ic592b2d775d721a0f44ba0af88ed963bf02d73a3 Reviewed-on: https://webrtc-review.googlesource.com/c/121460 Reviewed-by: Steve Anton <steveanton@webrtc.org> Reviewed-by: Peter Slatala <psla@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#26575}
This commit is contained in:
parent
3e6188868b
commit
fe6e50f0af
1
api/DEPS
1
api/DEPS
@ -111,6 +111,7 @@ specific_include_rules = {
|
||||
"media_transport_interface\.h": [
|
||||
"+rtc_base/copy_on_write_buffer.h", # As used by datachannelinterface.h
|
||||
"+rtc_base/network_route.h",
|
||||
"+rtc_base/deprecation.h",
|
||||
],
|
||||
|
||||
"peer_connection_factory_proxy\.h": [
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
#include "api/units/data_rate.h"
|
||||
#include "api/video/encoded_image.h"
|
||||
#include "rtc_base/copy_on_write_buffer.h"
|
||||
#include "rtc_base/deprecation.h"
|
||||
#include "rtc_base/network_route.h"
|
||||
|
||||
namespace rtc {
|
||||
@ -435,6 +436,7 @@ class MediaTransportInterface {
|
||||
// setting it to nullptr.
|
||||
// TODO(nisse): The SetNetworkChangeCallback is being replaced with Add/Remove
|
||||
// methods, because both video channel and voice channel need to register.
|
||||
RTC_DEPRECATED
|
||||
virtual void SetNetworkChangeCallback(
|
||||
MediaTransportNetworkChangeCallback* callback);
|
||||
virtual void AddNetworkChangeCallback(
|
||||
|
||||
@ -154,7 +154,7 @@ BaseChannel::~BaseChannel() {
|
||||
RTC_DCHECK_RUN_ON(worker_thread_);
|
||||
|
||||
if (media_transport_) {
|
||||
media_transport_->SetNetworkChangeCallback(nullptr);
|
||||
media_transport_->RemoveNetworkChangeCallback(this);
|
||||
}
|
||||
|
||||
// Eats any outstanding messages or packets.
|
||||
@ -217,7 +217,7 @@ void BaseChannel::Init_w(webrtc::RtpTransportInternal* rtp_transport,
|
||||
RTC_LOG(LS_INFO) << "BaseChannel::Init_w, media_transport="
|
||||
<< (media_transport_ != nullptr);
|
||||
if (media_transport_) {
|
||||
media_transport_->SetNetworkChangeCallback(this);
|
||||
media_transport_->AddNetworkChangeCallback(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user