Chromium Code Reviews| Index: webrtc/pc/channel.cc |
| diff --git a/webrtc/pc/channel.cc b/webrtc/pc/channel.cc |
| index 6c9d72222814c66e9aab88b16e97418b4e5c9e66..afa2736a3982cddef54c05bb6d71180f9451baa8 100644 |
| --- a/webrtc/pc/channel.cc |
| +++ b/webrtc/pc/channel.cc |
| @@ -1389,6 +1389,31 @@ void VoiceChannel::SetRawAudioSink( |
| InvokeOnWorker(Bind(&SetRawAudioSink_w, media_channel(), ssrc, &sink)); |
| } |
| +webrtc::RTCRtpParameters VoiceChannel::GetRtpParameters(uint32_t ssrc) { |
| + webrtc::RTCRtpParameters parameters; |
| + InvokeOnWorker( |
| + Bind(&VoiceChannel::GetRtpParameters_w, this, ssrc, ¶meters)); |
| + return parameters; |
| +} |
| + |
| +bool VoiceChannel::GetRtpParameters_w(uint32_t ssrc, |
| + webrtc::RTCRtpParameters* parameters) { |
| + *parameters = media_channel()->GetRtpParameters(ssrc); |
| + return true; |
|
pthatcher1
2016/03/12 01:21:04
Just make it a void if it can't fail.
skvlad
2016/03/15 21:18:18
For some reason I saw the definition of InvokeOnWo
|
| +} |
| + |
| +bool VoiceChannel::SetRtpParameters( |
| + uint32_t ssrc, |
| + const webrtc::RTCRtpParameters& parameters) { |
| + return InvokeOnWorker( |
| + Bind(&VoiceChannel::SetRtpParameters_w, this, ssrc, parameters)); |
| +} |
| + |
| +bool VoiceChannel::SetRtpParameters_w(uint32_t ssrc, |
| + webrtc::RTCRtpParameters parameters) { |
| + return media_channel()->SetRtpParameters(ssrc, parameters); |
| +} |
| + |
| bool VoiceChannel::GetStats(VoiceMediaInfo* stats) { |
| return InvokeOnWorker(Bind(&VoiceMediaChannel::GetStats, |
| media_channel(), stats)); |
| @@ -1544,7 +1569,9 @@ bool VoiceChannel::SetRemoteContent_w(const MediaContentDescription* content, |
| if (audio->agc_minus_10db()) { |
| send_params.options.adjust_agc_delta = rtc::Optional<int>(kAgcMinus10db); |
| } |
| - if (!media_channel()->SetSendParameters(send_params)) { |
| + |
| + bool parameters_applied = ApplySendParameters(send_params); |
| + if (!parameters_applied) { |
| SafeSetError("Failed to set remote audio description send parameters.", |
| error_desc); |
| return false; |
| @@ -1569,6 +1596,10 @@ bool VoiceChannel::SetRemoteContent_w(const MediaContentDescription* content, |
| return true; |
| } |
| +bool VoiceChannel::ApplySendParameters(const AudioSendParameters& parameters) { |
| + return media_channel()->SetSendParameters(parameters); |
|
pthatcher1
2016/03/12 01:21:04
Why was this moved to a separate method?
skvlad
2016/03/15 21:18:18
Oops, this is a leftover from an earlier version w
|
| +} |
| + |
| void VoiceChannel::HandleEarlyMediaTimeout() { |
| // This occurs on the main thread, not the worker thread. |
| if (!received_media_) { |
| @@ -1693,6 +1724,30 @@ bool VideoChannel::SetVideoSend(uint32_t ssrc, |
| ssrc, mute, options)); |
| } |
| +webrtc::RTCRtpParameters VideoChannel::GetRtpParameters(uint32_t ssrc) { |
| + webrtc::RTCRtpParameters parameters; |
| + InvokeOnWorker( |
| + Bind(&VideoChannel::GetRtpParameters_w, this, ssrc, ¶meters)); |
| + return parameters; |
| +} |
| + |
| +bool VideoChannel::GetRtpParameters_w(uint32_t ssrc, |
| + webrtc::RTCRtpParameters* parameters) { |
| + *parameters = media_channel()->GetRtpParameters(ssrc); |
| + return true; |
|
pthatcher1
2016/03/12 01:21:04
same here
skvlad
2016/03/15 21:18:18
Done.
|
| +} |
| + |
| +bool VideoChannel::SetRtpParameters( |
| + uint32_t ssrc, |
| + const webrtc::RTCRtpParameters& parameters) { |
| + return InvokeOnWorker( |
| + Bind(&VideoChannel::SetRtpParameters_w, this, ssrc, parameters)); |
| +} |
| + |
| +bool VideoChannel::SetRtpParameters_w(uint32_t ssrc, |
| + webrtc::RTCRtpParameters parameters) { |
| + return media_channel()->SetRtpParameters(ssrc, parameters); |
| +} |
| void VideoChannel::ChangeState() { |
| // Send outgoing data if we're the active call, we have the remote content, |
| // and we have had some form of connectivity. |
| @@ -1800,7 +1855,10 @@ bool VideoChannel::SetRemoteContent_w(const MediaContentDescription* content, |
| if (video->conference_mode()) { |
| send_params.conference_mode = true; |
| } |
| - if (!media_channel()->SetSendParameters(send_params)) { |
| + |
| + bool parameters_applied = ApplySendParameters(send_params); |
| + |
| + if (!parameters_applied) { |
| SafeSetError("Failed to set remote video description send parameters.", |
| error_desc); |
| return false; |
| @@ -1855,6 +1913,10 @@ void VideoChannel::OnScreencastWindowEvent_s(uint32_t ssrc, |
| SignalScreencastWindowEvent(ssrc, we); |
| } |
| +bool VideoChannel::ApplySendParameters(const VideoSendParameters& parameters) { |
| + return media_channel()->SetSendParameters(parameters); |
| +} |
|
pthatcher1
2016/03/12 01:21:04
same here
skvlad
2016/03/15 21:18:18
Done.
|
| + |
| void VideoChannel::OnMessage(rtc::Message *pmsg) { |
| switch (pmsg->message_id) { |
| case MSG_SCREENCASTWINDOWEVENT: { |