Remove cricket::RtpTransceiverDirection
Replaces cricket::RtpTransceiverDirection with webrtc::RtpTransceiverDirection, which is part of the public API. Bug: webrtc:8558 Change-Id: Ibfc9373e25187e98fb969e7ac937a1371c8fa4c7 Reviewed-on: https://webrtc-review.googlesource.com/24129 Commit-Queue: Steve Anton <steveanton@webrtc.org> Reviewed-by: Peter Thatcher <pthatcher@webrtc.org> Reviewed-by: Zhi Huang <zhihuang@webrtc.org> Cr-Commit-Position: refs/heads/master@{#20899}
This commit is contained in:
@ -22,6 +22,7 @@
|
||||
#include "ortc/ortcrtpsenderadapter.h"
|
||||
#include "ortc/rtpparametersconversion.h"
|
||||
#include "ortc/rtptransportadapter.h"
|
||||
#include "pc/rtpmediautils.h"
|
||||
#include "rtc_base/checks.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -314,18 +315,21 @@ RTCError RtpTransportControllerAdapter::ValidateAndApplyAudioSenderParameters(
|
||||
}
|
||||
}
|
||||
|
||||
cricket::RtpTransceiverDirection local_direction =
|
||||
cricket::RtpTransceiverDirection::FromMediaContentDirection(
|
||||
auto local_direction =
|
||||
cricket::RtpTransceiverDirectionFromMediaContentDirection(
|
||||
local_audio_description_.direction());
|
||||
bool local_send = RtpTransceiverDirectionHasSend(local_direction);
|
||||
bool local_recv = RtpTransceiverDirectionHasRecv(local_direction);
|
||||
int bandwidth = cricket::kAutoBandwidth;
|
||||
if (parameters.encodings.size() == 1u) {
|
||||
if (parameters.encodings[0].max_bitrate_bps) {
|
||||
bandwidth = *parameters.encodings[0].max_bitrate_bps;
|
||||
}
|
||||
local_direction.send = parameters.encodings[0].active;
|
||||
local_send = parameters.encodings[0].active;
|
||||
} else {
|
||||
local_direction.send = false;
|
||||
local_send = false;
|
||||
}
|
||||
local_direction = RtpTransceiverDirectionFromSendRecv(local_send, local_recv);
|
||||
if (primary_ssrc && !stream_params_result.value().empty()) {
|
||||
*primary_ssrc = stream_params_result.value()[0].first_ssrc();
|
||||
}
|
||||
@ -347,9 +351,11 @@ RTCError RtpTransportControllerAdapter::ValidateAndApplyAudioSenderParameters(
|
||||
local_audio_description_.mutable_streams() = stream_params_result.MoveValue();
|
||||
// Direction set based on encoding "active" flag.
|
||||
local_audio_description_.set_direction(
|
||||
local_direction.ToMediaContentDirection());
|
||||
cricket::MediaContentDirectionFromRtpTransceiverDirection(
|
||||
local_direction));
|
||||
remote_audio_description_.set_direction(
|
||||
local_direction.Reversed().ToMediaContentDirection());
|
||||
cricket::MediaContentDirectionFromRtpTransceiverDirection(
|
||||
RtpTransceiverDirectionReversed(local_direction)));
|
||||
|
||||
// Set remote content first, to ensure the stream is created with the correct
|
||||
// codec.
|
||||
@ -403,18 +409,21 @@ RTCError RtpTransportControllerAdapter::ValidateAndApplyVideoSenderParameters(
|
||||
}
|
||||
}
|
||||
|
||||
cricket::RtpTransceiverDirection local_direction =
|
||||
cricket::RtpTransceiverDirection::FromMediaContentDirection(
|
||||
local_video_description_.direction());
|
||||
auto local_direction =
|
||||
cricket::RtpTransceiverDirectionFromMediaContentDirection(
|
||||
local_audio_description_.direction());
|
||||
bool local_send = RtpTransceiverDirectionHasSend(local_direction);
|
||||
bool local_recv = RtpTransceiverDirectionHasRecv(local_direction);
|
||||
int bandwidth = cricket::kAutoBandwidth;
|
||||
if (parameters.encodings.size() == 1u) {
|
||||
if (parameters.encodings[0].max_bitrate_bps) {
|
||||
bandwidth = *parameters.encodings[0].max_bitrate_bps;
|
||||
}
|
||||
local_direction.send = parameters.encodings[0].active;
|
||||
local_send = parameters.encodings[0].active;
|
||||
} else {
|
||||
local_direction.send = false;
|
||||
local_send = false;
|
||||
}
|
||||
local_direction = RtpTransceiverDirectionFromSendRecv(local_send, local_recv);
|
||||
if (primary_ssrc && !stream_params_result.value().empty()) {
|
||||
*primary_ssrc = stream_params_result.value()[0].first_ssrc();
|
||||
}
|
||||
@ -436,9 +445,11 @@ RTCError RtpTransportControllerAdapter::ValidateAndApplyVideoSenderParameters(
|
||||
local_video_description_.mutable_streams() = stream_params_result.MoveValue();
|
||||
// Direction set based on encoding "active" flag.
|
||||
local_video_description_.set_direction(
|
||||
local_direction.ToMediaContentDirection());
|
||||
cricket::MediaContentDirectionFromRtpTransceiverDirection(
|
||||
local_direction));
|
||||
remote_video_description_.set_direction(
|
||||
local_direction.Reversed().ToMediaContentDirection());
|
||||
cricket::MediaContentDirectionFromRtpTransceiverDirection(
|
||||
RtpTransceiverDirectionReversed(local_direction)));
|
||||
|
||||
// Set remote content first, to ensure the stream is created with the correct
|
||||
// codec.
|
||||
@ -471,9 +482,6 @@ RTCError RtpTransportControllerAdapter::ValidateAndApplyAudioReceiverParameters(
|
||||
return extensions_result.MoveError();
|
||||
}
|
||||
|
||||
cricket::RtpTransceiverDirection local_direction =
|
||||
cricket::RtpTransceiverDirection::FromMediaContentDirection(
|
||||
local_audio_description_.direction());
|
||||
auto stream_params_result = ToCricketStreamParamsVec(parameters.encodings);
|
||||
if (!stream_params_result.ok()) {
|
||||
return stream_params_result.MoveError();
|
||||
@ -492,8 +500,13 @@ RTCError RtpTransportControllerAdapter::ValidateAndApplyAudioReceiverParameters(
|
||||
}
|
||||
}
|
||||
|
||||
local_direction.recv =
|
||||
bool local_send = RtpTransceiverDirectionHasSend(
|
||||
cricket::RtpTransceiverDirectionFromMediaContentDirection(
|
||||
local_audio_description_.direction()));
|
||||
bool local_recv =
|
||||
!parameters.encodings.empty() && parameters.encodings[0].active;
|
||||
auto local_direction =
|
||||
RtpTransceiverDirectionFromSendRecv(local_send, local_recv);
|
||||
|
||||
// Validation is done, so we can attempt applying the descriptions. Received
|
||||
// codecs and header extensions go in local description, streams go in
|
||||
@ -512,9 +525,11 @@ RTCError RtpTransportControllerAdapter::ValidateAndApplyAudioReceiverParameters(
|
||||
stream_params_result.MoveValue();
|
||||
// Direction set based on encoding "active" flag.
|
||||
local_audio_description_.set_direction(
|
||||
local_direction.ToMediaContentDirection());
|
||||
cricket::MediaContentDirectionFromRtpTransceiverDirection(
|
||||
local_direction));
|
||||
remote_audio_description_.set_direction(
|
||||
local_direction.Reversed().ToMediaContentDirection());
|
||||
cricket::MediaContentDirectionFromRtpTransceiverDirection(
|
||||
RtpTransceiverDirectionReversed(local_direction)));
|
||||
|
||||
if (!voice_channel_->SetLocalContent(&local_audio_description_,
|
||||
cricket::CA_OFFER, nullptr)) {
|
||||
@ -545,9 +560,6 @@ RTCError RtpTransportControllerAdapter::ValidateAndApplyVideoReceiverParameters(
|
||||
return extensions_result.MoveError();
|
||||
}
|
||||
|
||||
cricket::RtpTransceiverDirection local_direction =
|
||||
cricket::RtpTransceiverDirection::FromMediaContentDirection(
|
||||
local_video_description_.direction());
|
||||
int bandwidth = cricket::kAutoBandwidth;
|
||||
auto stream_params_result = ToCricketStreamParamsVec(parameters.encodings);
|
||||
if (!stream_params_result.ok()) {
|
||||
@ -567,8 +579,13 @@ RTCError RtpTransportControllerAdapter::ValidateAndApplyVideoReceiverParameters(
|
||||
}
|
||||
}
|
||||
|
||||
local_direction.recv =
|
||||
bool local_send = RtpTransceiverDirectionHasSend(
|
||||
cricket::RtpTransceiverDirectionFromMediaContentDirection(
|
||||
local_video_description_.direction()));
|
||||
bool local_recv =
|
||||
!parameters.encodings.empty() && parameters.encodings[0].active;
|
||||
auto local_direction =
|
||||
RtpTransceiverDirectionFromSendRecv(local_send, local_recv);
|
||||
|
||||
// Validation is done, so we can attempt applying the descriptions. Received
|
||||
// codecs and header extensions go in local description, streams go in
|
||||
@ -588,9 +605,11 @@ RTCError RtpTransportControllerAdapter::ValidateAndApplyVideoReceiverParameters(
|
||||
stream_params_result.MoveValue();
|
||||
// Direction set based on encoding "active" flag.
|
||||
local_video_description_.set_direction(
|
||||
local_direction.ToMediaContentDirection());
|
||||
cricket::MediaContentDirectionFromRtpTransceiverDirection(
|
||||
local_direction));
|
||||
remote_video_description_.set_direction(
|
||||
local_direction.Reversed().ToMediaContentDirection());
|
||||
cricket::MediaContentDirectionFromRtpTransceiverDirection(
|
||||
RtpTransceiverDirectionReversed(local_direction)));
|
||||
|
||||
if (!video_channel_->SetLocalContent(&local_video_description_,
|
||||
cricket::CA_OFFER, nullptr)) {
|
||||
|
||||
Reference in New Issue
Block a user