Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(840)

Unified Diff: webrtc/pc/channel.cc

Issue 2863123002: Wire up BWE stats through WebrtcSession so that they are filled in both for audio and video calls. (Closed)
Patch Set: Comments addressed." Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/pc/channel.h ('k') | webrtc/pc/rtcstatscollector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/channel.cc
diff --git a/webrtc/pc/channel.cc b/webrtc/pc/channel.cc
index f5428a43effac7a93fce554e11946c220946337c..86b5d5f5b681bd9e6e5adac05534ac7d0349d5dc 100644
--- a/webrtc/pc/channel.cc
+++ b/webrtc/pc/channel.cc
@@ -443,39 +443,42 @@ bool BaseChannel::Enable(bool enable) {
}
bool BaseChannel::AddRecvStream(const StreamParams& sp) {
- return InvokeOnWorker(RTC_FROM_HERE,
- Bind(&BaseChannel::AddRecvStream_w, this, sp));
+ return InvokeOnWorker<bool>(RTC_FROM_HERE,
+ Bind(&BaseChannel::AddRecvStream_w, this, sp));
}
bool BaseChannel::RemoveRecvStream(uint32_t ssrc) {
- return InvokeOnWorker(RTC_FROM_HERE,
- Bind(&BaseChannel::RemoveRecvStream_w, this, ssrc));
+ return InvokeOnWorker<bool>(
+ RTC_FROM_HERE, Bind(&BaseChannel::RemoveRecvStream_w, this, ssrc));
}
bool BaseChannel::AddSendStream(const StreamParams& sp) {
- return InvokeOnWorker(
+ return InvokeOnWorker<bool>(
RTC_FROM_HERE, Bind(&MediaChannel::AddSendStream, media_channel(), sp));
}
bool BaseChannel::RemoveSendStream(uint32_t ssrc) {
- return InvokeOnWorker(RTC_FROM_HERE, Bind(&MediaChannel::RemoveSendStream,
- media_channel(), ssrc));
+ return InvokeOnWorker<bool>(
+ RTC_FROM_HERE,
+ Bind(&MediaChannel::RemoveSendStream, media_channel(), ssrc));
}
bool BaseChannel::SetLocalContent(const MediaContentDescription* content,
ContentAction action,
std::string* error_desc) {
TRACE_EVENT0("webrtc", "BaseChannel::SetLocalContent");
- return InvokeOnWorker(RTC_FROM_HERE, Bind(&BaseChannel::SetLocalContent_w,
- this, content, action, error_desc));
+ return InvokeOnWorker<bool>(
+ RTC_FROM_HERE,
+ Bind(&BaseChannel::SetLocalContent_w, this, content, action, error_desc));
}
bool BaseChannel::SetRemoteContent(const MediaContentDescription* content,
ContentAction action,
std::string* error_desc) {
TRACE_EVENT0("webrtc", "BaseChannel::SetRemoteContent");
- return InvokeOnWorker(RTC_FROM_HERE, Bind(&BaseChannel::SetRemoteContent_w,
- this, content, action, error_desc));
+ return InvokeOnWorker<bool>(
+ RTC_FROM_HERE, Bind(&BaseChannel::SetRemoteContent_w, this, content,
+ action, error_desc));
}
void BaseChannel::StartConnectionMonitor(int cms) {
@@ -1505,9 +1508,9 @@ bool VoiceChannel::SetAudioSend(uint32_t ssrc,
bool enable,
const AudioOptions* options,
AudioSource* source) {
- return InvokeOnWorker(RTC_FROM_HERE,
- Bind(&VoiceMediaChannel::SetAudioSend, media_channel(),
- ssrc, enable, options, source));
+ return InvokeOnWorker<bool>(
+ RTC_FROM_HERE, Bind(&VoiceMediaChannel::SetAudioSend, media_channel(),
+ ssrc, enable, options, source));
}
// TODO(juberti): Handle early media the right way. We should get an explicit
@@ -1527,20 +1530,22 @@ void VoiceChannel::SetEarlyMedia(bool enable) {
}
bool VoiceChannel::CanInsertDtmf() {
- return InvokeOnWorker(
+ return InvokeOnWorker<bool>(
RTC_FROM_HERE, Bind(&VoiceMediaChannel::CanInsertDtmf, media_channel()));
}
bool VoiceChannel::InsertDtmf(uint32_t ssrc,
int event_code,
int duration) {
- return InvokeOnWorker(RTC_FROM_HERE, Bind(&VoiceChannel::InsertDtmf_w, this,
- ssrc, event_code, duration));
+ return InvokeOnWorker<bool>(
+ RTC_FROM_HERE,
+ Bind(&VoiceChannel::InsertDtmf_w, this, ssrc, event_code, duration));
}
bool VoiceChannel::SetOutputVolume(uint32_t ssrc, double volume) {
- return InvokeOnWorker(RTC_FROM_HERE, Bind(&VoiceMediaChannel::SetOutputVolume,
- media_channel(), ssrc, volume));
+ return InvokeOnWorker<bool>(
+ RTC_FROM_HERE,
+ Bind(&VoiceMediaChannel::SetOutputVolume, media_channel(), ssrc, volume));
}
void VoiceChannel::SetRawAudioSink(
@@ -1549,8 +1554,8 @@ void VoiceChannel::SetRawAudioSink(
// We need to work around Bind's lack of support for unique_ptr and ownership
// passing. So we invoke to our own little routine that gets a pointer to
// our local variable. This is OK since we're synchronously invoking.
- InvokeOnWorker(RTC_FROM_HERE,
- Bind(&SetRawAudioSink_w, media_channel(), ssrc, &sink));
+ InvokeOnWorker<bool>(RTC_FROM_HERE,
+ Bind(&SetRawAudioSink_w, media_channel(), ssrc, &sink));
}
webrtc::RtpParameters VoiceChannel::GetRtpSendParameters(uint32_t ssrc) const {
@@ -1566,7 +1571,7 @@ webrtc::RtpParameters VoiceChannel::GetRtpSendParameters_w(
bool VoiceChannel::SetRtpSendParameters(
uint32_t ssrc,
const webrtc::RtpParameters& parameters) {
- return InvokeOnWorker(
+ return InvokeOnWorker<bool>(
RTC_FROM_HERE,
Bind(&VoiceChannel::SetRtpSendParameters_w, this, ssrc, parameters));
}
@@ -1591,7 +1596,7 @@ webrtc::RtpParameters VoiceChannel::GetRtpReceiveParameters_w(
bool VoiceChannel::SetRtpReceiveParameters(
uint32_t ssrc,
const webrtc::RtpParameters& parameters) {
- return InvokeOnWorker(
+ return InvokeOnWorker<bool>(
RTC_FROM_HERE,
Bind(&VoiceChannel::SetRtpReceiveParameters_w, this, ssrc, parameters));
}
@@ -1602,8 +1607,8 @@ bool VoiceChannel::SetRtpReceiveParameters_w(uint32_t ssrc,
}
bool VoiceChannel::GetStats(VoiceMediaInfo* stats) {
- return InvokeOnWorker(RTC_FROM_HERE, Bind(&VoiceMediaChannel::GetStats,
- media_channel(), stats));
+ return InvokeOnWorker<bool>(RTC_FROM_HERE, Bind(&VoiceMediaChannel::GetStats,
+ media_channel(), stats));
}
std::vector<webrtc::RtpSource> VoiceChannel::GetSources(uint32_t ssrc) const {
@@ -1922,9 +1927,9 @@ bool VideoChannel::SetVideoSend(
bool mute,
const VideoOptions* options,
rtc::VideoSourceInterface<webrtc::VideoFrame>* source) {
- return InvokeOnWorker(RTC_FROM_HERE,
- Bind(&VideoMediaChannel::SetVideoSend, media_channel(),
- ssrc, mute, options, source));
+ return InvokeOnWorker<bool>(
+ RTC_FROM_HERE, Bind(&VideoMediaChannel::SetVideoSend, media_channel(),
+ ssrc, mute, options, source));
}
webrtc::RtpParameters VideoChannel::GetRtpSendParameters(uint32_t ssrc) const {
@@ -1940,7 +1945,7 @@ webrtc::RtpParameters VideoChannel::GetRtpSendParameters_w(
bool VideoChannel::SetRtpSendParameters(
uint32_t ssrc,
const webrtc::RtpParameters& parameters) {
- return InvokeOnWorker(
+ return InvokeOnWorker<bool>(
RTC_FROM_HERE,
Bind(&VideoChannel::SetRtpSendParameters_w, this, ssrc, parameters));
}
@@ -1965,7 +1970,7 @@ webrtc::RtpParameters VideoChannel::GetRtpReceiveParameters_w(
bool VideoChannel::SetRtpReceiveParameters(
uint32_t ssrc,
const webrtc::RtpParameters& parameters) {
- return InvokeOnWorker(
+ return InvokeOnWorker<bool>(
RTC_FROM_HERE,
Bind(&VideoChannel::SetRtpReceiveParameters_w, this, ssrc, parameters));
}
@@ -1987,9 +1992,14 @@ void VideoChannel::UpdateMediaSendRecvState_w() {
LOG(LS_INFO) << "Changing video state, send=" << send;
}
+void VideoChannel::FillBitrateInfo(BandwidthEstimationInfo* bwe_info) {
+ InvokeOnWorker<void>(RTC_FROM_HERE, Bind(&VideoMediaChannel::FillBitrateInfo,
+ media_channel(), bwe_info));
+}
+
bool VideoChannel::GetStats(VideoMediaInfo* stats) {
- return InvokeOnWorker(RTC_FROM_HERE, Bind(&VideoMediaChannel::GetStats,
- media_channel(), stats));
+ return InvokeOnWorker<bool>(RTC_FROM_HERE, Bind(&VideoMediaChannel::GetStats,
+ media_channel(), stats));
}
void VideoChannel::StartMediaMonitor(int cms) {
@@ -2179,7 +2189,7 @@ bool RtpDataChannel::Init_w(
bool RtpDataChannel::SendData(const SendDataParams& params,
const rtc::CopyOnWriteBuffer& payload,
SendDataResult* result) {
- return InvokeOnWorker(
+ return InvokeOnWorker<bool>(
RTC_FROM_HERE, Bind(&DataMediaChannel::SendData, media_channel(), params,
payload, result));
}
« no previous file with comments | « webrtc/pc/channel.h ('k') | webrtc/pc/rtcstatscollector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698