diff --git a/webrtc/call/rtp_transport_controller_send_interface.h b/webrtc/call/rtp_transport_controller_send_interface.h index 31f07463a3..9d26e98dc2 100644 --- a/webrtc/call/rtp_transport_controller_send_interface.h +++ b/webrtc/call/rtp_transport_controller_send_interface.h @@ -33,7 +33,7 @@ class TransportFeedbackObserver; // // This should also have a reference to the underlying // webrtc::Transport(s). Currently, webrtc::Transport is implemented by -// WebRtcVideoChannel2 and WebRtcVoiceMediaChannel, and owned by +// WebRtcVideoChannel and WebRtcVoiceMediaChannel, and owned by // WebrtcSession. Video and audio always uses different transport // objects, even in the common case where they are bundled over the // same underlying transport. diff --git a/webrtc/media/BUILD.gn b/webrtc/media/BUILD.gn index fd4bf39127..9c76d8c44e 100644 --- a/webrtc/media/BUILD.gn +++ b/webrtc/media/BUILD.gn @@ -140,8 +140,8 @@ rtc_static_library("rtc_media") { "engine/webrtcvideocapturerfactory.h", "engine/webrtcvideodecoderfactory.h", "engine/webrtcvideoencoderfactory.h", - "engine/webrtcvideoengine2.cc", - "engine/webrtcvideoengine2.h", + "engine/webrtcvideoengine.cc", + "engine/webrtcvideoengine.h", "engine/webrtcvoe.h", "engine/webrtcvoiceengine.cc", "engine/webrtcvoiceengine.h", @@ -381,7 +381,7 @@ if (rtc_include_tests) { "engine/webrtcmediaengine_unittest.cc", "engine/webrtcvideocapturer_unittest.cc", "engine/webrtcvideoencoderfactory_unittest.cc", - "engine/webrtcvideoengine2_unittest.cc", + "engine/webrtcvideoengine_unittest.cc", "engine/webrtcvoiceengine_unittest.cc", ] diff --git a/webrtc/media/base/mediachannel.h b/webrtc/media/base/mediachannel.h index 40869594e5..1206cccbea 100644 --- a/webrtc/media/base/mediachannel.h +++ b/webrtc/media/base/mediachannel.h @@ -108,7 +108,7 @@ struct MediaConfig { // Enable WebRTC suspension of video. No video frames will be sent // when the bitrate is below the configured minimum bitrate. This // flag comes from the PeerConnection constraint - // 'googSuspendBelowMinBitrate', and WebRtcVideoChannel2 copies it + // 'googSuspendBelowMinBitrate', and WebRtcVideoChannel copies it // to VideoSendStream::Config::suspend_below_min_bitrate. bool suspend_below_min_bitrate = false; @@ -122,7 +122,7 @@ struct MediaConfig { // This flag comes from PeerConnection's RtcConfiguration, but is // currently only set by the command line flag // 'disable-rtc-smoothness-algorithm'. - // WebRtcVideoChannel2::AddRecvStream copies it to the created + // WebRtcVideoChannel::AddRecvStream copies it to the created // WebRtcVideoReceiveStream, where it is returned by the // SmoothsRenderedFrames method. This method is used by the // VideoReceiveStream, where the value is passed on to the @@ -343,12 +343,12 @@ struct VideoOptions { } // Enable denoising? This flag comes from the getUserMedia - // constraint 'googNoiseReduction', and WebRtcVideoEngine2 passes it + // constraint 'googNoiseReduction', and WebRtcVideoEngine passes it // on to the codec options. Disabled by default. rtc::Optional video_noise_reduction; // Force screencast to use a minimum bitrate. This flag comes from // the PeerConnection constraint 'googScreencastMinBitrate'. It is - // copied to the encoder config by WebRtcVideoChannel2. + // copied to the encoder config by WebRtcVideoChannel. rtc::Optional screencast_min_bitrate_kbps; // Set by screencast sources. Implies selection of encoding settings // suitable for screencast. Most likely not the right way to do @@ -1021,7 +1021,7 @@ struct VideoSendParameters : RtpSendParameters { // description's SDP line 'a=x-google-flag:conference', copied over // by VideoChannel::SetRemoteContent_w, and ultimately used by // conference mode screencast logic in - // WebRtcVideoChannel2::WebRtcVideoSendStream::CreateVideoEncoderConfig. + // WebRtcVideoChannel::WebRtcVideoSendStream::CreateVideoEncoderConfig. // The special screencast behaviour is disabled by default. bool conference_mode = false; }; diff --git a/webrtc/media/engine/internaldecoderfactory.cc b/webrtc/media/engine/internaldecoderfactory.cc index 760575df55..5bc8c4b01c 100644 --- a/webrtc/media/engine/internaldecoderfactory.cc +++ b/webrtc/media/engine/internaldecoderfactory.cc @@ -67,7 +67,7 @@ webrtc::VideoDecoder* InternalDecoderFactory::CreateVideoDecoder( return webrtc::H264Decoder::Create(); // This could happen in a software-fallback for a codec type only // supported externally (e.g. H.264 on iOS or Android) or in current usage - // in WebRtcVideoEngine2 if the external decoder fails to be created. + // in WebRtcVideoEngine if the external decoder fails to be created. LOG(LS_ERROR) << "Unable to create an H.264 decoder fallback. " << "Decoding of this stream will be broken."; return new NullVideoDecoder(); diff --git a/webrtc/media/engine/webrtcmediaengine.cc b/webrtc/media/engine/webrtcmediaengine.cc index 1d0e426168..3c937f21ac 100644 --- a/webrtc/media/engine/webrtcmediaengine.cc +++ b/webrtc/media/engine/webrtcmediaengine.cc @@ -17,7 +17,7 @@ #include "webrtc/media/engine/webrtcvoiceengine.h" #ifdef HAVE_WEBRTC_VIDEO -#include "webrtc/media/engine/webrtcvideoengine2.h" +#include "webrtc/media/engine/webrtcvideoengine.h" #else #include "webrtc/media/engine/nullwebrtcvideoengine.h" #endif @@ -26,7 +26,7 @@ namespace cricket { class WebRtcMediaEngine2 #ifdef HAVE_WEBRTC_VIDEO - : public CompositeMediaEngine { + : public CompositeMediaEngine { #else : public CompositeMediaEngine { #endif @@ -40,7 +40,7 @@ class WebRtcMediaEngine2 WebRtcVideoDecoderFactory* video_decoder_factory, rtc::scoped_refptr audio_mixer) #ifdef HAVE_WEBRTC_VIDEO - : CompositeMediaEngine( + : CompositeMediaEngine( adm, audio_encoder_factory, audio_decoder_factory, diff --git a/webrtc/media/engine/webrtcvideoengine2.cc b/webrtc/media/engine/webrtcvideoengine.cc similarity index 91% rename from webrtc/media/engine/webrtcvideoengine2.cc rename to webrtc/media/engine/webrtcvideoengine.cc index f9fccf101d..999dac228a 100644 --- a/webrtc/media/engine/webrtcvideoengine2.cc +++ b/webrtc/media/engine/webrtcvideoengine.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/media/engine/webrtcvideoengine2.h" +#include "webrtc/media/engine/webrtcvideoengine.h" #include #include @@ -373,7 +373,7 @@ static std::vector GetSupportedCodecs( const WebRtcVideoEncoderFactory* external_encoder_factory); rtc::scoped_refptr -WebRtcVideoChannel2::WebRtcVideoSendStream::ConfigureVideoEncoderSettings( +WebRtcVideoChannel::WebRtcVideoSendStream::ConfigureVideoEncoderSettings( const VideoCodec& codec) { RTC_DCHECK_RUN_ON(&thread_checker_); bool is_screencast = parameters_.options.is_screencast.value_or(false); @@ -432,7 +432,7 @@ DefaultUnsignalledSsrcHandler::DefaultUnsignalledSsrcHandler() : default_sink_(nullptr) {} UnsignalledSsrcHandler::Action DefaultUnsignalledSsrcHandler::OnUnsignalledSsrc( - WebRtcVideoChannel2* channel, + WebRtcVideoChannel* channel, uint32_t ssrc) { rtc::Optional default_recv_ssrc = channel->GetDefaultReceiveStreamSsrc(); @@ -460,7 +460,7 @@ DefaultUnsignalledSsrcHandler::GetDefaultSink() const { } void DefaultUnsignalledSsrcHandler::SetDefaultSink( - WebRtcVideoChannel2* channel, + WebRtcVideoChannel* channel, rtc::VideoSinkInterface* sink) { default_sink_ = sink; rtc::Optional default_recv_ssrc = @@ -470,38 +470,38 @@ void DefaultUnsignalledSsrcHandler::SetDefaultSink( } } -WebRtcVideoEngine2::WebRtcVideoEngine2() +WebRtcVideoEngine::WebRtcVideoEngine() : initialized_(false), external_decoder_factory_(NULL), external_encoder_factory_(NULL) { - LOG(LS_INFO) << "WebRtcVideoEngine2::WebRtcVideoEngine2()"; + LOG(LS_INFO) << "WebRtcVideoEngine::WebRtcVideoEngine()"; } -WebRtcVideoEngine2::~WebRtcVideoEngine2() { - LOG(LS_INFO) << "WebRtcVideoEngine2::~WebRtcVideoEngine2"; +WebRtcVideoEngine::~WebRtcVideoEngine() { + LOG(LS_INFO) << "WebRtcVideoEngine::~WebRtcVideoEngine"; } -void WebRtcVideoEngine2::Init() { - LOG(LS_INFO) << "WebRtcVideoEngine2::Init"; +void WebRtcVideoEngine::Init() { + LOG(LS_INFO) << "WebRtcVideoEngine::Init"; initialized_ = true; } -WebRtcVideoChannel2* WebRtcVideoEngine2::CreateChannel( +WebRtcVideoChannel* WebRtcVideoEngine::CreateChannel( webrtc::Call* call, const MediaConfig& config, const VideoOptions& options) { RTC_DCHECK(initialized_); LOG(LS_INFO) << "CreateChannel. Options: " << options.ToString(); - return new WebRtcVideoChannel2(call, config, options, - external_encoder_factory_, - external_decoder_factory_); + return new WebRtcVideoChannel(call, config, options, + external_encoder_factory_, + external_decoder_factory_); } -std::vector WebRtcVideoEngine2::codecs() const { +std::vector WebRtcVideoEngine::codecs() const { return GetSupportedCodecs(external_encoder_factory_); } -RtpCapabilities WebRtcVideoEngine2::GetCapabilities() const { +RtpCapabilities WebRtcVideoEngine::GetCapabilities() const { RtpCapabilities capabilities; capabilities.header_extensions.push_back( webrtc::RtpExtension(webrtc::RtpExtension::kTimestampOffsetUri, @@ -526,13 +526,13 @@ RtpCapabilities WebRtcVideoEngine2::GetCapabilities() const { return capabilities; } -void WebRtcVideoEngine2::SetExternalDecoderFactory( +void WebRtcVideoEngine::SetExternalDecoderFactory( WebRtcVideoDecoderFactory* decoder_factory) { RTC_DCHECK(!initialized_); external_decoder_factory_ = decoder_factory; } -void WebRtcVideoEngine2::SetExternalEncoderFactory( +void WebRtcVideoEngine::SetExternalEncoderFactory( WebRtcVideoEncoderFactory* encoder_factory) { RTC_DCHECK(!initialized_); if (external_encoder_factory_ == encoder_factory) @@ -636,7 +636,7 @@ static std::vector GetSupportedCodecs( return unified_codecs; } -WebRtcVideoChannel2::WebRtcVideoChannel2( +WebRtcVideoChannel::WebRtcVideoChannel( webrtc::Call* call, const MediaConfig& config, const VideoOptions& options, @@ -658,15 +658,15 @@ WebRtcVideoChannel2::WebRtcVideoChannel2( recv_flexfec_payload_type_ = recv_codecs_.front().flexfec_payload_type; } -WebRtcVideoChannel2::~WebRtcVideoChannel2() { +WebRtcVideoChannel::~WebRtcVideoChannel() { for (auto& kv : send_streams_) delete kv.second; for (auto& kv : receive_streams_) delete kv.second; } -rtc::Optional -WebRtcVideoChannel2::SelectSendVideoCodec( +rtc::Optional +WebRtcVideoChannel::SelectSendVideoCodec( const std::vector& remote_mapped_codecs) const { const std::vector local_supported_codecs = GetSupportedCodecs(external_encoder_factory_); @@ -684,7 +684,7 @@ WebRtcVideoChannel2::SelectSendVideoCodec( return rtc::Optional(); } -bool WebRtcVideoChannel2::NonFlexfecReceiveCodecsHaveChanged( +bool WebRtcVideoChannel::NonFlexfecReceiveCodecsHaveChanged( std::vector before, std::vector after) { if (before.size() != after.size()) { @@ -707,13 +707,13 @@ bool WebRtcVideoChannel2::NonFlexfecReceiveCodecsHaveChanged( std::sort(after.begin(), after.end(), comparison); // Changes in FlexFEC payload type are handled separately in - // WebRtcVideoChannel2::GetChangedRecvParameters, so disregard FlexFEC in the + // WebRtcVideoChannel::GetChangedRecvParameters, so disregard FlexFEC in the // comparison here. return !std::equal(before.begin(), before.end(), after.begin(), VideoCodecSettings::EqualsDisregardingFlexfec); } -bool WebRtcVideoChannel2::GetChangedSendParameters( +bool WebRtcVideoChannel::GetChangedSendParameters( const VideoSendParameters& params, ChangedSendParameters* changed_params) const { if (!ValidateCodecFormats(params.codecs) || @@ -776,12 +776,12 @@ bool WebRtcVideoChannel2::GetChangedSendParameters( return true; } -rtc::DiffServCodePoint WebRtcVideoChannel2::PreferredDscp() const { +rtc::DiffServCodePoint WebRtcVideoChannel::PreferredDscp() const { return rtc::DSCP_AF41; } -bool WebRtcVideoChannel2::SetSendParameters(const VideoSendParameters& params) { - TRACE_EVENT0("webrtc", "WebRtcVideoChannel2::SetSendParameters"); +bool WebRtcVideoChannel::SetSendParameters(const VideoSendParameters& params) { + TRACE_EVENT0("webrtc", "WebRtcVideoChannel::SetSendParameters"); LOG(LS_INFO) << "SetSendParameters: " << params.ToString(); ChangedSendParameters changed_params; if (!GetChangedSendParameters(params, &changed_params)) { @@ -823,7 +823,7 @@ bool WebRtcVideoChannel2::SetSendParameters(const VideoSendParameters& params) { // bitrate config for the codec. This allows FEC to be applied above the // codec target bitrate. // TODO(pbos): Figure out whether b=AS means max bitrate for this - // WebRtcVideoChannel2 (in which case we're good), or per sender (SSRC), + // WebRtcVideoChannel (in which case we're good), or per sender (SSRC), // in which case this should not set a Call::BitrateConfig but rather // reconfigure all senders. bitrate_config_.max_bitrate_bps = @@ -856,7 +856,7 @@ bool WebRtcVideoChannel2::SetSendParameters(const VideoSendParameters& params) { return true; } -webrtc::RtpParameters WebRtcVideoChannel2::GetRtpSendParameters( +webrtc::RtpParameters WebRtcVideoChannel::GetRtpSendParameters( uint32_t ssrc) const { rtc::CritScope stream_lock(&stream_crit_); auto it = send_streams_.find(ssrc); @@ -875,10 +875,10 @@ webrtc::RtpParameters WebRtcVideoChannel2::GetRtpSendParameters( return rtp_params; } -bool WebRtcVideoChannel2::SetRtpSendParameters( +bool WebRtcVideoChannel::SetRtpSendParameters( uint32_t ssrc, const webrtc::RtpParameters& parameters) { - TRACE_EVENT0("webrtc", "WebRtcVideoChannel2::SetRtpSendParameters"); + TRACE_EVENT0("webrtc", "WebRtcVideoChannel::SetRtpSendParameters"); rtc::CritScope stream_lock(&stream_crit_); auto it = send_streams_.find(ssrc); if (it == send_streams_.end()) { @@ -899,7 +899,7 @@ bool WebRtcVideoChannel2::SetRtpSendParameters( return it->second->SetRtpParameters(parameters); } -webrtc::RtpParameters WebRtcVideoChannel2::GetRtpReceiveParameters( +webrtc::RtpParameters WebRtcVideoChannel::GetRtpReceiveParameters( uint32_t ssrc) const { webrtc::RtpParameters rtp_params; rtc::CritScope stream_lock(&stream_crit_); @@ -931,10 +931,10 @@ webrtc::RtpParameters WebRtcVideoChannel2::GetRtpReceiveParameters( return rtp_params; } -bool WebRtcVideoChannel2::SetRtpReceiveParameters( +bool WebRtcVideoChannel::SetRtpReceiveParameters( uint32_t ssrc, const webrtc::RtpParameters& parameters) { - TRACE_EVENT0("webrtc", "WebRtcVideoChannel2::SetRtpReceiveParameters"); + TRACE_EVENT0("webrtc", "WebRtcVideoChannel::SetRtpReceiveParameters"); rtc::CritScope stream_lock(&stream_crit_); // SSRC of 0 represents an unsignaled receive stream. @@ -963,7 +963,7 @@ bool WebRtcVideoChannel2::SetRtpReceiveParameters( return true; } -bool WebRtcVideoChannel2::GetChangedRecvParameters( +bool WebRtcVideoChannel::GetChangedRecvParameters( const VideoRecvParameters& params, ChangedRecvParameters* changed_params) const { if (!ValidateCodecFormats(params.codecs) || @@ -1012,8 +1012,8 @@ bool WebRtcVideoChannel2::GetChangedRecvParameters( return true; } -bool WebRtcVideoChannel2::SetRecvParameters(const VideoRecvParameters& params) { - TRACE_EVENT0("webrtc", "WebRtcVideoChannel2::SetRecvParameters"); +bool WebRtcVideoChannel::SetRecvParameters(const VideoRecvParameters& params) { + TRACE_EVENT0("webrtc", "WebRtcVideoChannel::SetRecvParameters"); LOG(LS_INFO) << "SetRecvParameters: " << params.ToString(); ChangedRecvParameters changed_params; if (!GetChangedRecvParameters(params, &changed_params)) { @@ -1045,7 +1045,7 @@ bool WebRtcVideoChannel2::SetRecvParameters(const VideoRecvParameters& params) { return true; } -std::string WebRtcVideoChannel2::CodecSettingsVectorToString( +std::string WebRtcVideoChannel::CodecSettingsVectorToString( const std::vector& codecs) { std::stringstream out; out << '{'; @@ -1059,7 +1059,7 @@ std::string WebRtcVideoChannel2::CodecSettingsVectorToString( return out.str(); } -bool WebRtcVideoChannel2::GetSendCodec(VideoCodec* codec) { +bool WebRtcVideoChannel::GetSendCodec(VideoCodec* codec) { if (!send_codec_) { LOG(LS_VERBOSE) << "GetSendCodec: No send codec set."; return false; @@ -1068,8 +1068,8 @@ bool WebRtcVideoChannel2::GetSendCodec(VideoCodec* codec) { return true; } -bool WebRtcVideoChannel2::SetSend(bool send) { - TRACE_EVENT0("webrtc", "WebRtcVideoChannel2::SetSend"); +bool WebRtcVideoChannel::SetSend(bool send) { + TRACE_EVENT0("webrtc", "WebRtcVideoChannel::SetSend"); LOG(LS_VERBOSE) << "SetSend: " << (send ? "true" : "false"); if (send && !send_codec_) { LOG(LS_ERROR) << "SetSend(true) called before setting codec."; @@ -1088,7 +1088,7 @@ bool WebRtcVideoChannel2::SetSend(bool send) { // TODO(nisse): The enable argument was used for mute logic which has // been moved to VideoBroadcaster. So remove the argument from this // method. -bool WebRtcVideoChannel2::SetVideoSend( +bool WebRtcVideoChannel::SetVideoSend( uint32_t ssrc, bool enable, const VideoOptions* options, @@ -1111,7 +1111,7 @@ bool WebRtcVideoChannel2::SetVideoSend( return kv->second->SetVideoSend(enable, options, source); } -bool WebRtcVideoChannel2::ValidateSendSsrcAvailability( +bool WebRtcVideoChannel::ValidateSendSsrcAvailability( const StreamParams& sp) const { for (uint32_t ssrc : sp.ssrcs) { if (send_ssrcs_.find(ssrc) != send_ssrcs_.end()) { @@ -1122,7 +1122,7 @@ bool WebRtcVideoChannel2::ValidateSendSsrcAvailability( return true; } -bool WebRtcVideoChannel2::ValidateReceiveSsrcAvailability( +bool WebRtcVideoChannel::ValidateReceiveSsrcAvailability( const StreamParams& sp) const { for (uint32_t ssrc : sp.ssrcs) { if (receive_ssrcs_.find(ssrc) != receive_ssrcs_.end()) { @@ -1134,7 +1134,7 @@ bool WebRtcVideoChannel2::ValidateReceiveSsrcAvailability( return true; } -bool WebRtcVideoChannel2::AddSendStream(const StreamParams& sp) { +bool WebRtcVideoChannel::AddSendStream(const StreamParams& sp) { LOG(LS_INFO) << "AddSendStream: " << sp.ToString(); if (!ValidateStreamParams(sp)) return false; @@ -1175,7 +1175,7 @@ bool WebRtcVideoChannel2::AddSendStream(const StreamParams& sp) { return true; } -bool WebRtcVideoChannel2::RemoveSendStream(uint32_t ssrc) { +bool WebRtcVideoChannel::RemoveSendStream(uint32_t ssrc) { LOG(LS_INFO) << "RemoveSendStream: " << ssrc; WebRtcVideoSendStream* removed_stream; @@ -1212,19 +1212,19 @@ bool WebRtcVideoChannel2::RemoveSendStream(uint32_t ssrc) { return true; } -void WebRtcVideoChannel2::DeleteReceiveStream( - WebRtcVideoChannel2::WebRtcVideoReceiveStream* stream) { +void WebRtcVideoChannel::DeleteReceiveStream( + WebRtcVideoChannel::WebRtcVideoReceiveStream* stream) { for (uint32_t old_ssrc : stream->GetSsrcs()) receive_ssrcs_.erase(old_ssrc); delete stream; } -bool WebRtcVideoChannel2::AddRecvStream(const StreamParams& sp) { +bool WebRtcVideoChannel::AddRecvStream(const StreamParams& sp) { return AddRecvStream(sp, false); } -bool WebRtcVideoChannel2::AddRecvStream(const StreamParams& sp, - bool default_stream) { +bool WebRtcVideoChannel::AddRecvStream(const StreamParams& sp, + bool default_stream) { RTC_DCHECK(thread_checker_.CalledOnValidThread()); LOG(LS_INFO) << "AddRecvStream" << (default_stream ? " (default stream)" : "") @@ -1269,7 +1269,7 @@ bool WebRtcVideoChannel2::AddRecvStream(const StreamParams& sp, return true; } -void WebRtcVideoChannel2::ConfigureReceiverRtp( +void WebRtcVideoChannel::ConfigureReceiverRtp( webrtc::VideoReceiveStream::Config* config, webrtc::FlexfecReceiveStream::Config* flexfec_config, const StreamParams& sp) const { @@ -1321,7 +1321,7 @@ void WebRtcVideoChannel2::ConfigureReceiverRtp( } } -bool WebRtcVideoChannel2::RemoveRecvStream(uint32_t ssrc) { +bool WebRtcVideoChannel::RemoveRecvStream(uint32_t ssrc) { LOG(LS_INFO) << "RemoveRecvStream: " << ssrc; if (ssrc == 0) { LOG(LS_ERROR) << "RemoveRecvStream with 0 ssrc is not supported."; @@ -1341,14 +1341,14 @@ bool WebRtcVideoChannel2::RemoveRecvStream(uint32_t ssrc) { return true; } -bool WebRtcVideoChannel2::SetSink( +bool WebRtcVideoChannel::SetSink( uint32_t ssrc, rtc::VideoSinkInterface* sink) { LOG(LS_INFO) << "SetSink: ssrc:" << ssrc << " " << (sink ? "(ptr)" : "nullptr"); if (ssrc == 0) { // Do not hold |stream_crit_| here, since SetDefaultSink will call - // WebRtcVideoChannel2::GetDefaultReceiveStreamSsrc(). + // WebRtcVideoChannel::GetDefaultReceiveStreamSsrc(). default_unsignalled_ssrc_handler_.SetDefaultSink(this, sink); return true; } @@ -1364,8 +1364,8 @@ bool WebRtcVideoChannel2::SetSink( return true; } -bool WebRtcVideoChannel2::GetStats(VideoMediaInfo* info) { - TRACE_EVENT0("webrtc", "WebRtcVideoChannel2::GetStats"); +bool WebRtcVideoChannel::GetStats(VideoMediaInfo* info) { + TRACE_EVENT0("webrtc", "WebRtcVideoChannel::GetStats"); // Log stats periodically. bool log_stats = false; @@ -1395,7 +1395,7 @@ bool WebRtcVideoChannel2::GetStats(VideoMediaInfo* info) { return true; } -void WebRtcVideoChannel2::FillSenderStats(VideoMediaInfo* video_media_info, +void WebRtcVideoChannel::FillSenderStats(VideoMediaInfo* video_media_info, bool log_stats) { rtc::CritScope stream_lock(&stream_crit_); for (std::map::iterator it = @@ -1406,7 +1406,7 @@ void WebRtcVideoChannel2::FillSenderStats(VideoMediaInfo* video_media_info, } } -void WebRtcVideoChannel2::FillReceiverStats(VideoMediaInfo* video_media_info, +void WebRtcVideoChannel::FillReceiverStats(VideoMediaInfo* video_media_info, bool log_stats) { rtc::CritScope stream_lock(&stream_crit_); for (std::map::iterator it = @@ -1417,7 +1417,7 @@ void WebRtcVideoChannel2::FillReceiverStats(VideoMediaInfo* video_media_info, } } -void WebRtcVideoChannel2::FillBitrateInfo(BandwidthEstimationInfo* bwe_info) { +void WebRtcVideoChannel::FillBitrateInfo(BandwidthEstimationInfo* bwe_info) { rtc::CritScope stream_lock(&stream_crit_); for (std::map::iterator stream = send_streams_.begin(); @@ -1426,7 +1426,7 @@ void WebRtcVideoChannel2::FillBitrateInfo(BandwidthEstimationInfo* bwe_info) { } } -void WebRtcVideoChannel2::FillSendAndReceiveCodecStats( +void WebRtcVideoChannel::FillSendAndReceiveCodecStats( VideoMediaInfo* video_media_info) { for (const VideoCodec& codec : send_params_.codecs) { webrtc::RtpCodecParameters codec_params = codec.ToCodecParameters(); @@ -1440,7 +1440,7 @@ void WebRtcVideoChannel2::FillSendAndReceiveCodecStats( } } -void WebRtcVideoChannel2::OnPacketReceived( +void WebRtcVideoChannel::OnPacketReceived( rtc::CopyOnWriteBuffer* packet, const rtc::PacketTime& packet_time) { const webrtc::PacketTime webrtc_packet_time(packet_time.timestamp, @@ -1501,7 +1501,7 @@ void WebRtcVideoChannel2::OnPacketReceived( } } -void WebRtcVideoChannel2::OnRtcpReceived( +void WebRtcVideoChannel::OnRtcpReceived( rtc::CopyOnWriteBuffer* packet, const rtc::PacketTime& packet_time) { const webrtc::PacketTime webrtc_packet_time(packet_time.timestamp, @@ -1516,26 +1516,26 @@ void WebRtcVideoChannel2::OnRtcpReceived( webrtc_packet_time); } -void WebRtcVideoChannel2::OnReadyToSend(bool ready) { +void WebRtcVideoChannel::OnReadyToSend(bool ready) { LOG(LS_VERBOSE) << "OnReadyToSend: " << (ready ? "Ready." : "Not ready."); call_->SignalChannelNetworkState( webrtc::MediaType::VIDEO, ready ? webrtc::kNetworkUp : webrtc::kNetworkDown); } -void WebRtcVideoChannel2::OnNetworkRouteChanged( +void WebRtcVideoChannel::OnNetworkRouteChanged( const std::string& transport_name, const rtc::NetworkRoute& network_route) { call_->OnNetworkRouteChanged(transport_name, network_route); } -void WebRtcVideoChannel2::OnTransportOverheadChanged( +void WebRtcVideoChannel::OnTransportOverheadChanged( int transport_overhead_per_packet) { call_->OnTransportOverheadChanged(webrtc::MediaType::VIDEO, transport_overhead_per_packet); } -void WebRtcVideoChannel2::SetInterface(NetworkInterface* iface) { +void WebRtcVideoChannel::SetInterface(NetworkInterface* iface) { MediaChannel::SetInterface(iface); // Set the RTP recv/send buffer to a bigger size MediaChannel::SetOption(NetworkInterface::ST_RTP, @@ -1551,7 +1551,7 @@ void WebRtcVideoChannel2::SetInterface(NetworkInterface* iface) { kVideoRtpBufferSize); } -rtc::Optional WebRtcVideoChannel2::GetDefaultReceiveStreamSsrc() { +rtc::Optional WebRtcVideoChannel::GetDefaultReceiveStreamSsrc() { rtc::CritScope stream_lock(&stream_crit_); rtc::Optional ssrc; for (auto it = receive_streams_.begin(); it != receive_streams_.end(); ++it) { @@ -1563,21 +1563,21 @@ rtc::Optional WebRtcVideoChannel2::GetDefaultReceiveStreamSsrc() { return ssrc; } -bool WebRtcVideoChannel2::SendRtp(const uint8_t* data, - size_t len, - const webrtc::PacketOptions& options) { +bool WebRtcVideoChannel::SendRtp(const uint8_t* data, + size_t len, + const webrtc::PacketOptions& options) { rtc::CopyOnWriteBuffer packet(data, len, kMaxRtpPacketLen); rtc::PacketOptions rtc_options; rtc_options.packet_id = options.packet_id; return MediaChannel::SendPacket(&packet, rtc_options); } -bool WebRtcVideoChannel2::SendRtcp(const uint8_t* data, size_t len) { +bool WebRtcVideoChannel::SendRtcp(const uint8_t* data, size_t len) { rtc::CopyOnWriteBuffer packet(data, len, kMaxRtpPacketLen); return MediaChannel::SendRtcp(&packet, rtc::PacketOptions()); } -WebRtcVideoChannel2::WebRtcVideoSendStream::VideoSendStreamParameters:: +WebRtcVideoChannel::WebRtcVideoSendStream::VideoSendStreamParameters:: VideoSendStreamParameters( webrtc::VideoSendStream::Config config, const VideoOptions& options, @@ -1589,7 +1589,7 @@ WebRtcVideoChannel2::WebRtcVideoSendStream::VideoSendStreamParameters:: conference_mode(false), codec_settings(codec_settings) {} -WebRtcVideoChannel2::WebRtcVideoSendStream::AllocatedEncoder::AllocatedEncoder( +WebRtcVideoChannel::WebRtcVideoSendStream::AllocatedEncoder::AllocatedEncoder( webrtc::VideoEncoder* encoder, const cricket::VideoCodec& codec, bool external) @@ -1604,7 +1604,7 @@ WebRtcVideoChannel2::WebRtcVideoSendStream::AllocatedEncoder::AllocatedEncoder( } } -WebRtcVideoChannel2::WebRtcVideoSendStream::WebRtcVideoSendStream( +WebRtcVideoChannel::WebRtcVideoSendStream::WebRtcVideoSendStream( webrtc::Call* call, const StreamParams& sp, webrtc::VideoSendStream::Config config, @@ -1682,14 +1682,14 @@ WebRtcVideoChannel2::WebRtcVideoSendStream::WebRtcVideoSendStream( } } -WebRtcVideoChannel2::WebRtcVideoSendStream::~WebRtcVideoSendStream() { +WebRtcVideoChannel::WebRtcVideoSendStream::~WebRtcVideoSendStream() { if (stream_ != NULL) { call_->DestroyVideoSendStream(stream_); } DestroyVideoEncoder(&allocated_encoder_); } -bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetVideoSend( +bool WebRtcVideoChannel::WebRtcVideoSendStream::SetVideoSend( bool enable, const VideoOptions* options, rtc::VideoSourceInterface* source) { @@ -1731,7 +1731,7 @@ bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetVideoSend( } webrtc::VideoSendStream::DegradationPreference -WebRtcVideoChannel2::WebRtcVideoSendStream::GetDegradationPreference() const { +WebRtcVideoChannel::WebRtcVideoSendStream::GetDegradationPreference() const { // Do not adapt resolution for screen content as this will likely // result in blurry and unreadable text. // |this| acts like a VideoSource to make sure SinkWants are handled on the @@ -1750,12 +1750,12 @@ WebRtcVideoChannel2::WebRtcVideoSendStream::GetDegradationPreference() const { } const std::vector& -WebRtcVideoChannel2::WebRtcVideoSendStream::GetSsrcs() const { +WebRtcVideoChannel::WebRtcVideoSendStream::GetSsrcs() const { return ssrcs_; } -WebRtcVideoChannel2::WebRtcVideoSendStream::AllocatedEncoder -WebRtcVideoChannel2::WebRtcVideoSendStream::CreateVideoEncoder( +WebRtcVideoChannel::WebRtcVideoSendStream::AllocatedEncoder +WebRtcVideoChannel::WebRtcVideoSendStream::CreateVideoEncoder( const VideoCodec& codec, bool force_encoder_allocation) { RTC_DCHECK_RUN_ON(&thread_checker_); @@ -1797,7 +1797,7 @@ WebRtcVideoChannel2::WebRtcVideoSendStream::CreateVideoEncoder( return AllocatedEncoder(NULL, cricket::VideoCodec(), false); } -void WebRtcVideoChannel2::WebRtcVideoSendStream::DestroyVideoEncoder( +void WebRtcVideoChannel::WebRtcVideoSendStream::DestroyVideoEncoder( AllocatedEncoder* encoder) { RTC_DCHECK_RUN_ON(&thread_checker_); if (encoder->external) { @@ -1806,7 +1806,7 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::DestroyVideoEncoder( delete encoder->encoder; } -void WebRtcVideoChannel2::WebRtcVideoSendStream::SetCodec( +void WebRtcVideoChannel::WebRtcVideoSendStream::SetCodec( const VideoCodecSettings& codec_settings, bool force_encoder_allocation) { RTC_DCHECK_RUN_ON(&thread_checker_); @@ -1847,7 +1847,7 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::SetCodec( HasNack(codec_settings.codec) ? kNackHistoryMs : 0; parameters_.codec_settings = - rtc::Optional(codec_settings); + rtc::Optional(codec_settings); LOG(LS_INFO) << "RecreateWebRtcStream (send) because of SetCodec."; RecreateWebRtcStream(); @@ -1857,7 +1857,7 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::SetCodec( } } -void WebRtcVideoChannel2::WebRtcVideoSendStream::SetSendParameters( +void WebRtcVideoChannel::WebRtcVideoSendStream::SetSendParameters( const ChangedSendParameters& params) { RTC_DCHECK_RUN_ON(&thread_checker_); // |recreate_stream| means construction-time parameters have changed and the @@ -1895,7 +1895,7 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::SetSendParameters( } } -bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetRtpParameters( +bool WebRtcVideoChannel::WebRtcVideoSendStream::SetRtpParameters( const webrtc::RtpParameters& new_parameters) { RTC_DCHECK_RUN_ON(&thread_checker_); if (!ValidateRtpParameters(new_parameters)) { @@ -1905,7 +1905,7 @@ bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetRtpParameters( bool reconfigure_encoder = new_parameters.encodings[0].max_bitrate_bps != rtp_parameters_.encodings[0].max_bitrate_bps; rtp_parameters_ = new_parameters; - // Codecs are currently handled at the WebRtcVideoChannel2 level. + // Codecs are currently handled at the WebRtcVideoChannel level. rtp_parameters_.codecs.clear(); if (reconfigure_encoder) { ReconfigureEncoder(); @@ -1916,12 +1916,12 @@ bool WebRtcVideoChannel2::WebRtcVideoSendStream::SetRtpParameters( } webrtc::RtpParameters -WebRtcVideoChannel2::WebRtcVideoSendStream::GetRtpParameters() const { +WebRtcVideoChannel::WebRtcVideoSendStream::GetRtpParameters() const { RTC_DCHECK_RUN_ON(&thread_checker_); return rtp_parameters_; } -bool WebRtcVideoChannel2::WebRtcVideoSendStream::ValidateRtpParameters( +bool WebRtcVideoChannel::WebRtcVideoSendStream::ValidateRtpParameters( const webrtc::RtpParameters& rtp_parameters) { RTC_DCHECK_RUN_ON(&thread_checker_); if (rtp_parameters.encodings.size() != 1) { @@ -1936,7 +1936,7 @@ bool WebRtcVideoChannel2::WebRtcVideoSendStream::ValidateRtpParameters( return true; } -void WebRtcVideoChannel2::WebRtcVideoSendStream::UpdateSendState() { +void WebRtcVideoChannel::WebRtcVideoSendStream::UpdateSendState() { RTC_DCHECK_RUN_ON(&thread_checker_); // TODO(deadbeef): Need to handle more than one encoding in the future. RTC_DCHECK(rtp_parameters_.encodings.size() == 1u); @@ -1951,7 +1951,7 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::UpdateSendState() { } webrtc::VideoEncoderConfig -WebRtcVideoChannel2::WebRtcVideoSendStream::CreateVideoEncoderConfig( +WebRtcVideoChannel::WebRtcVideoSendStream::CreateVideoEncoderConfig( const VideoCodec& codec) const { RTC_DCHECK_RUN_ON(&thread_checker_); webrtc::VideoEncoderConfig encoder_config; @@ -2000,7 +2000,7 @@ WebRtcVideoChannel2::WebRtcVideoSendStream::CreateVideoEncoderConfig( return encoder_config; } -void WebRtcVideoChannel2::WebRtcVideoSendStream::ReconfigureEncoder() { +void WebRtcVideoChannel::WebRtcVideoSendStream::ReconfigureEncoder() { RTC_DCHECK_RUN_ON(&thread_checker_); if (!stream_) { // The webrtc::VideoSendStream |stream_| has not yet been created but other @@ -2026,13 +2026,13 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::ReconfigureEncoder() { parameters_.encoder_config = std::move(encoder_config); } -void WebRtcVideoChannel2::WebRtcVideoSendStream::SetSend(bool send) { +void WebRtcVideoChannel::WebRtcVideoSendStream::SetSend(bool send) { RTC_DCHECK_RUN_ON(&thread_checker_); sending_ = send; UpdateSendState(); } -void WebRtcVideoChannel2::WebRtcVideoSendStream::RemoveSink( +void WebRtcVideoChannel::WebRtcVideoSendStream::RemoveSink( rtc::VideoSinkInterface* sink) { RTC_DCHECK_RUN_ON(&thread_checker_); RTC_DCHECK(encoder_sink_ == sink); @@ -2040,7 +2040,7 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::RemoveSink( source_->RemoveSink(sink); } -void WebRtcVideoChannel2::WebRtcVideoSendStream::AddOrUpdateSink( +void WebRtcVideoChannel::WebRtcVideoSendStream::AddOrUpdateSink( rtc::VideoSinkInterface* sink, const rtc::VideoSinkWants& wants) { if (worker_thread_ == rtc::Thread::Current()) { @@ -2065,7 +2065,7 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::AddOrUpdateSink( } } -VideoSenderInfo WebRtcVideoChannel2::WebRtcVideoSendStream::GetVideoSenderInfo( +VideoSenderInfo WebRtcVideoChannel::WebRtcVideoSendStream::GetVideoSenderInfo( bool log_stats) { VideoSenderInfo info; RTC_DCHECK_RUN_ON(&thread_checker_); @@ -2142,7 +2142,7 @@ VideoSenderInfo WebRtcVideoChannel2::WebRtcVideoSendStream::GetVideoSenderInfo( return info; } -void WebRtcVideoChannel2::WebRtcVideoSendStream::FillBitrateInfo( +void WebRtcVideoChannel::WebRtcVideoSendStream::FillBitrateInfo( BandwidthEstimationInfo* bwe_info) { RTC_DCHECK_RUN_ON(&thread_checker_); if (stream_ == NULL) { @@ -2159,7 +2159,7 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::FillBitrateInfo( bwe_info->actual_enc_bitrate += stats.media_bitrate_bps; } -void WebRtcVideoChannel2::WebRtcVideoSendStream::RecreateWebRtcStream() { +void WebRtcVideoChannel::WebRtcVideoSendStream::RecreateWebRtcStream() { RTC_DCHECK_RUN_ON(&thread_checker_); if (stream_ != NULL) { call_->DestroyVideoSendStream(stream_); @@ -2192,7 +2192,7 @@ void WebRtcVideoChannel2::WebRtcVideoSendStream::RecreateWebRtcStream() { UpdateSendState(); } -WebRtcVideoChannel2::WebRtcVideoReceiveStream::WebRtcVideoReceiveStream( +WebRtcVideoChannel::WebRtcVideoReceiveStream::WebRtcVideoReceiveStream( webrtc::Call* call, const StreamParams& sp, webrtc::VideoReceiveStream::Config config, @@ -2220,7 +2220,7 @@ WebRtcVideoChannel2::WebRtcVideoReceiveStream::WebRtcVideoReceiveStream( RTC_DCHECK(old_decoders.empty()); } -WebRtcVideoChannel2::WebRtcVideoReceiveStream::AllocatedDecoder:: +WebRtcVideoChannel::WebRtcVideoReceiveStream::AllocatedDecoder:: AllocatedDecoder(webrtc::VideoDecoder* decoder, webrtc::VideoCodecType type, bool external) @@ -2235,7 +2235,7 @@ WebRtcVideoChannel2::WebRtcVideoReceiveStream::AllocatedDecoder:: } } -WebRtcVideoChannel2::WebRtcVideoReceiveStream::~WebRtcVideoReceiveStream() { +WebRtcVideoChannel::WebRtcVideoReceiveStream::~WebRtcVideoReceiveStream() { if (flexfec_stream_) { call_->DestroyFlexfecReceiveStream(flexfec_stream_); } @@ -2244,12 +2244,12 @@ WebRtcVideoChannel2::WebRtcVideoReceiveStream::~WebRtcVideoReceiveStream() { } const std::vector& -WebRtcVideoChannel2::WebRtcVideoReceiveStream::GetSsrcs() const { +WebRtcVideoChannel::WebRtcVideoReceiveStream::GetSsrcs() const { return stream_params_.ssrcs; } rtc::Optional -WebRtcVideoChannel2::WebRtcVideoReceiveStream::GetFirstPrimarySsrc() const { +WebRtcVideoChannel::WebRtcVideoReceiveStream::GetFirstPrimarySsrc() const { std::vector primary_ssrcs; stream_params_.GetPrimarySsrcs(&primary_ssrcs); @@ -2261,8 +2261,8 @@ WebRtcVideoChannel2::WebRtcVideoReceiveStream::GetFirstPrimarySsrc() const { } } -WebRtcVideoChannel2::WebRtcVideoReceiveStream::AllocatedDecoder -WebRtcVideoChannel2::WebRtcVideoReceiveStream::CreateOrReuseVideoDecoder( +WebRtcVideoChannel::WebRtcVideoReceiveStream::AllocatedDecoder +WebRtcVideoChannel::WebRtcVideoReceiveStream::CreateOrReuseVideoDecoder( std::vector* old_decoders, const VideoCodec& codec) { webrtc::VideoCodecType type = webrtc::PayloadNameToCodecType(codec.name) @@ -2292,7 +2292,7 @@ WebRtcVideoChannel2::WebRtcVideoReceiveStream::CreateOrReuseVideoDecoder( type, false /* is_external */); } -void WebRtcVideoChannel2::WebRtcVideoReceiveStream::ConfigureCodecs( +void WebRtcVideoChannel::WebRtcVideoReceiveStream::ConfigureCodecs( const std::vector& recv_codecs, std::vector* old_decoders) { *old_decoders = allocated_decoders_; @@ -2323,12 +2323,12 @@ void WebRtcVideoChannel2::WebRtcVideoReceiveStream::ConfigureCodecs( HasNack(recv_codecs.begin()->codec) ? kNackHistoryMs : 0; } -void WebRtcVideoChannel2::WebRtcVideoReceiveStream::ConfigureFlexfecCodec( +void WebRtcVideoChannel::WebRtcVideoReceiveStream::ConfigureFlexfecCodec( int flexfec_payload_type) { flexfec_config_.payload_type = flexfec_payload_type; } -void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetLocalSsrc( +void WebRtcVideoChannel::WebRtcVideoReceiveStream::SetLocalSsrc( uint32_t local_ssrc) { // TODO(pbos): Consider turning this sanity check into a RTC_DCHECK. You // should not be able to create a sender with the same SSRC as a receiver, but @@ -2349,7 +2349,7 @@ void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetLocalSsrc( RecreateWebRtcVideoStream(); } -void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetFeedbackParameters( +void WebRtcVideoChannel::WebRtcVideoReceiveStream::SetFeedbackParameters( bool nack_enabled, bool remb_enabled, bool transport_cc_enabled, @@ -2382,7 +2382,7 @@ void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetFeedbackParameters( RecreateWebRtcVideoStream(); } -void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetRecvParameters( +void WebRtcVideoChannel::WebRtcVideoReceiveStream::SetRecvParameters( const ChangedRecvParameters& params) { bool video_needs_recreation = false; bool flexfec_needs_recreation = false; @@ -2414,7 +2414,7 @@ void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetRecvParameters( } } -void WebRtcVideoChannel2::WebRtcVideoReceiveStream:: +void WebRtcVideoChannel::WebRtcVideoReceiveStream:: RecreateWebRtcVideoStream() { if (stream_) { call_->DestroyVideoReceiveStream(stream_); @@ -2426,7 +2426,7 @@ void WebRtcVideoChannel2::WebRtcVideoReceiveStream:: stream_->Start(); } -void WebRtcVideoChannel2::WebRtcVideoReceiveStream:: +void WebRtcVideoChannel::WebRtcVideoReceiveStream:: MaybeRecreateWebRtcFlexfecStream() { if (flexfec_stream_) { call_->DestroyFlexfecReceiveStream(flexfec_stream_); @@ -2438,7 +2438,7 @@ void WebRtcVideoChannel2::WebRtcVideoReceiveStream:: } } -void WebRtcVideoChannel2::WebRtcVideoReceiveStream::ClearDecoders( +void WebRtcVideoChannel::WebRtcVideoReceiveStream::ClearDecoders( std::vector* allocated_decoders) { for (size_t i = 0; i < allocated_decoders->size(); ++i) { if ((*allocated_decoders)[i].external) { @@ -2450,7 +2450,7 @@ void WebRtcVideoChannel2::WebRtcVideoReceiveStream::ClearDecoders( allocated_decoders->clear(); } -void WebRtcVideoChannel2::WebRtcVideoReceiveStream::OnFrame( +void WebRtcVideoChannel::WebRtcVideoReceiveStream::OnFrame( const webrtc::VideoFrame& frame) { rtc::CritScope crit(&sink_lock_); @@ -2472,18 +2472,18 @@ void WebRtcVideoChannel2::WebRtcVideoReceiveStream::OnFrame( sink_->OnFrame(frame); } -bool WebRtcVideoChannel2::WebRtcVideoReceiveStream::IsDefaultStream() const { +bool WebRtcVideoChannel::WebRtcVideoReceiveStream::IsDefaultStream() const { return default_stream_; } -void WebRtcVideoChannel2::WebRtcVideoReceiveStream::SetSink( +void WebRtcVideoChannel::WebRtcVideoReceiveStream::SetSink( rtc::VideoSinkInterface* sink) { rtc::CritScope crit(&sink_lock_); sink_ = sink; } std::string -WebRtcVideoChannel2::WebRtcVideoReceiveStream::GetCodecNameFromPayloadType( +WebRtcVideoChannel::WebRtcVideoReceiveStream::GetCodecNameFromPayloadType( int payload_type) { for (const webrtc::VideoReceiveStream::Decoder& decoder : config_.decoders) { if (decoder.payload_type == payload_type) { @@ -2494,7 +2494,7 @@ WebRtcVideoChannel2::WebRtcVideoReceiveStream::GetCodecNameFromPayloadType( } VideoReceiverInfo -WebRtcVideoChannel2::WebRtcVideoReceiveStream::GetVideoReceiverInfo( +WebRtcVideoChannel::WebRtcVideoReceiveStream::GetVideoReceiverInfo( bool log_stats) { VideoReceiverInfo info; info.ssrc_groups = stream_params_.ssrc_groups; @@ -2549,30 +2549,30 @@ WebRtcVideoChannel2::WebRtcVideoReceiveStream::GetVideoReceiverInfo( return info; } -WebRtcVideoChannel2::VideoCodecSettings::VideoCodecSettings() +WebRtcVideoChannel::VideoCodecSettings::VideoCodecSettings() : flexfec_payload_type(-1), rtx_payload_type(-1) {} -bool WebRtcVideoChannel2::VideoCodecSettings::operator==( - const WebRtcVideoChannel2::VideoCodecSettings& other) const { +bool WebRtcVideoChannel::VideoCodecSettings::operator==( + const WebRtcVideoChannel::VideoCodecSettings& other) const { return codec == other.codec && ulpfec == other.ulpfec && flexfec_payload_type == other.flexfec_payload_type && rtx_payload_type == other.rtx_payload_type; } -bool WebRtcVideoChannel2::VideoCodecSettings::EqualsDisregardingFlexfec( - const WebRtcVideoChannel2::VideoCodecSettings& a, - const WebRtcVideoChannel2::VideoCodecSettings& b) { +bool WebRtcVideoChannel::VideoCodecSettings::EqualsDisregardingFlexfec( + const WebRtcVideoChannel::VideoCodecSettings& a, + const WebRtcVideoChannel::VideoCodecSettings& b) { return a.codec == b.codec && a.ulpfec == b.ulpfec && a.rtx_payload_type == b.rtx_payload_type; } -bool WebRtcVideoChannel2::VideoCodecSettings::operator!=( - const WebRtcVideoChannel2::VideoCodecSettings& other) const { +bool WebRtcVideoChannel::VideoCodecSettings::operator!=( + const WebRtcVideoChannel::VideoCodecSettings& other) const { return !(*this == other); } -std::vector -WebRtcVideoChannel2::MapCodecs(const std::vector& codecs) { +std::vector +WebRtcVideoChannel::MapCodecs(const std::vector& codecs) { RTC_DCHECK(!codecs.empty()); std::vector video_codecs; diff --git a/webrtc/media/engine/webrtcvideoengine.h b/webrtc/media/engine/webrtcvideoengine.h new file mode 100644 index 0000000000..29c44cecf4 --- /dev/null +++ b/webrtc/media/engine/webrtcvideoengine.h @@ -0,0 +1,528 @@ +/* + * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE_H_ +#define WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE_H_ + +#include +#include +#include +#include +#include + +#include "webrtc/api/call/transport.h" +#include "webrtc/api/video/video_frame.h" +#include "webrtc/base/asyncinvoker.h" +#include "webrtc/base/criticalsection.h" +#include "webrtc/base/networkroute.h" +#include "webrtc/base/optional.h" +#include "webrtc/base/thread_annotations.h" +#include "webrtc/base/thread_checker.h" +#include "webrtc/call/call.h" +#include "webrtc/call/flexfec_receive_stream.h" +#include "webrtc/media/base/mediaengine.h" +#include "webrtc/media/base/videosinkinterface.h" +#include "webrtc/media/base/videosourceinterface.h" +#include "webrtc/media/engine/webrtcvideodecoderfactory.h" +#include "webrtc/media/engine/webrtcvideoencoderfactory.h" +#include "webrtc/video_receive_stream.h" +#include "webrtc/video_send_stream.h" + +namespace webrtc { +class VideoDecoder; +class VideoEncoder; +struct MediaConfig; +} + +namespace rtc { +class Thread; +} // namespace rtc + +namespace cricket { + +class VideoCapturer; +class VideoProcessor; +class VideoRenderer; +class VoiceMediaChannel; +class WebRtcDecoderObserver; +class WebRtcEncoderObserver; +class WebRtcLocalStreamInfo; +class WebRtcRenderAdapter; +class WebRtcVideoChannel; +class WebRtcVideoChannelRecvInfo; +class WebRtcVideoChannelSendInfo; +class WebRtcVoiceEngine; +class WebRtcVoiceMediaChannel; + +struct Device; + +class UnsignalledSsrcHandler { + public: + enum Action { + kDropPacket, + kDeliverPacket, + }; + virtual Action OnUnsignalledSsrc(WebRtcVideoChannel* channel, + uint32_t ssrc) = 0; + virtual ~UnsignalledSsrcHandler() = default; +}; + +// TODO(pbos): Remove, use external handlers only. +class DefaultUnsignalledSsrcHandler : public UnsignalledSsrcHandler { + public: + DefaultUnsignalledSsrcHandler(); + Action OnUnsignalledSsrc(WebRtcVideoChannel* channel, + uint32_t ssrc) override; + + rtc::VideoSinkInterface* GetDefaultSink() const; + void SetDefaultSink(WebRtcVideoChannel* channel, + rtc::VideoSinkInterface* sink); + + virtual ~DefaultUnsignalledSsrcHandler() = default; + + private: + rtc::VideoSinkInterface* default_sink_; +}; + +// WebRtcVideoEngine is used for the new native WebRTC Video API (webrtc:1667). +class WebRtcVideoEngine { + public: + WebRtcVideoEngine(); + virtual ~WebRtcVideoEngine(); + + // Basic video engine implementation. + void Init(); + + WebRtcVideoChannel* CreateChannel(webrtc::Call* call, + const MediaConfig& config, + const VideoOptions& options); + + std::vector codecs() const; + RtpCapabilities GetCapabilities() const; + + // Set a WebRtcVideoDecoderFactory for external decoding. Video engine does + // not take the ownership of |decoder_factory|. The caller needs to make sure + // that |decoder_factory| outlives the video engine. + void SetExternalDecoderFactory(WebRtcVideoDecoderFactory* decoder_factory); + // Set a WebRtcVideoEncoderFactory for external encoding. Video engine does + // not take the ownership of |encoder_factory|. The caller needs to make sure + // that |encoder_factory| outlives the video engine. + virtual void SetExternalEncoderFactory( + WebRtcVideoEncoderFactory* encoder_factory); + + private: + bool initialized_; + + WebRtcVideoDecoderFactory* external_decoder_factory_; + WebRtcVideoEncoderFactory* external_encoder_factory_; + std::unique_ptr simulcast_encoder_factory_; +}; + +class WebRtcVideoChannel : public VideoMediaChannel, public webrtc::Transport { + public: + WebRtcVideoChannel(webrtc::Call* call, + const MediaConfig& config, + const VideoOptions& options, + WebRtcVideoEncoderFactory* external_encoder_factory, + WebRtcVideoDecoderFactory* external_decoder_factory); + ~WebRtcVideoChannel() override; + + // VideoMediaChannel implementation + rtc::DiffServCodePoint PreferredDscp() const override; + + bool SetSendParameters(const VideoSendParameters& params) override; + bool SetRecvParameters(const VideoRecvParameters& params) override; + webrtc::RtpParameters GetRtpSendParameters(uint32_t ssrc) const override; + bool SetRtpSendParameters(uint32_t ssrc, + const webrtc::RtpParameters& parameters) override; + webrtc::RtpParameters GetRtpReceiveParameters(uint32_t ssrc) const override; + bool SetRtpReceiveParameters( + uint32_t ssrc, + const webrtc::RtpParameters& parameters) override; + bool GetSendCodec(VideoCodec* send_codec) override; + bool SetSend(bool send) override; + bool SetVideoSend( + uint32_t ssrc, + bool enable, + const VideoOptions* options, + rtc::VideoSourceInterface* source) override; + bool AddSendStream(const StreamParams& sp) override; + bool RemoveSendStream(uint32_t ssrc) override; + bool AddRecvStream(const StreamParams& sp) override; + bool AddRecvStream(const StreamParams& sp, bool default_stream); + bool RemoveRecvStream(uint32_t ssrc) override; + bool SetSink(uint32_t ssrc, + rtc::VideoSinkInterface* sink) override; + void FillBitrateInfo(BandwidthEstimationInfo* bwe_info) override; + bool GetStats(VideoMediaInfo* info) override; + + void OnPacketReceived(rtc::CopyOnWriteBuffer* packet, + const rtc::PacketTime& packet_time) override; + void OnRtcpReceived(rtc::CopyOnWriteBuffer* packet, + const rtc::PacketTime& packet_time) override; + void OnReadyToSend(bool ready) override; + void OnNetworkRouteChanged(const std::string& transport_name, + const rtc::NetworkRoute& network_route) override; + void OnTransportOverheadChanged(int transport_overhead_per_packet) override; + void SetInterface(NetworkInterface* iface) override; + + // Implemented for VideoMediaChannelTest. + bool sending() const { return sending_; } + + rtc::Optional GetDefaultReceiveStreamSsrc(); + + // AdaptReason is used for expressing why a WebRtcVideoSendStream request + // a lower input frame size than the currently configured camera input frame + // size. There can be more than one reason OR:ed together. + enum AdaptReason { + ADAPTREASON_NONE = 0, + ADAPTREASON_CPU = 1, + ADAPTREASON_BANDWIDTH = 2, + }; + + private: + class WebRtcVideoReceiveStream; + struct VideoCodecSettings { + VideoCodecSettings(); + + // Checks if all members of |*this| are equal to the corresponding members + // of |other|. + bool operator==(const VideoCodecSettings& other) const; + bool operator!=(const VideoCodecSettings& other) const; + + // Checks if all members of |a|, except |flexfec_payload_type|, are equal + // to the corresponding members of |b|. + static bool EqualsDisregardingFlexfec(const VideoCodecSettings& a, + const VideoCodecSettings& b); + + VideoCodec codec; + webrtc::UlpfecConfig ulpfec; + int flexfec_payload_type; + int rtx_payload_type; + }; + + struct ChangedSendParameters { + // These optionals are unset if not changed. + rtc::Optional codec; + rtc::Optional> rtp_header_extensions; + rtc::Optional max_bandwidth_bps; + rtc::Optional conference_mode; + rtc::Optional rtcp_mode; + }; + + struct ChangedRecvParameters { + // These optionals are unset if not changed. + rtc::Optional> codec_settings; + rtc::Optional> rtp_header_extensions; + // Keep track of the FlexFEC payload type separately from |codec_settings|. + // This allows us to recreate the FlexfecReceiveStream separately from the + // VideoReceiveStream when the FlexFEC payload type is changed. + rtc::Optional flexfec_payload_type; + }; + + bool GetChangedSendParameters(const VideoSendParameters& params, + ChangedSendParameters* changed_params) const; + bool GetChangedRecvParameters(const VideoRecvParameters& params, + ChangedRecvParameters* changed_params) const; + + void SetMaxSendBandwidth(int bps); + + void ConfigureReceiverRtp( + webrtc::VideoReceiveStream::Config* config, + webrtc::FlexfecReceiveStream::Config* flexfec_config, + const StreamParams& sp) const; + bool ValidateSendSsrcAvailability(const StreamParams& sp) const + EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); + bool ValidateReceiveSsrcAvailability(const StreamParams& sp) const + EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); + void DeleteReceiveStream(WebRtcVideoReceiveStream* stream) + EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); + + static std::string CodecSettingsVectorToString( + const std::vector& codecs); + + // Wrapper for the sender part. + class WebRtcVideoSendStream + : public rtc::VideoSourceInterface { + public: + WebRtcVideoSendStream( + webrtc::Call* call, + const StreamParams& sp, + webrtc::VideoSendStream::Config config, + const VideoOptions& options, + WebRtcVideoEncoderFactory* external_encoder_factory, + bool enable_cpu_overuse_detection, + int max_bitrate_bps, + const rtc::Optional& codec_settings, + const rtc::Optional>& rtp_extensions, + const VideoSendParameters& send_params); + virtual ~WebRtcVideoSendStream(); + + void SetSendParameters(const ChangedSendParameters& send_params); + bool SetRtpParameters(const webrtc::RtpParameters& parameters); + webrtc::RtpParameters GetRtpParameters() const; + + // Implements rtc::VideoSourceInterface. + // WebRtcVideoSendStream acts as a source to the webrtc::VideoSendStream + // in |stream_|. This is done to proxy VideoSinkWants from the encoder to + // the worker thread. + void AddOrUpdateSink(rtc::VideoSinkInterface* sink, + const rtc::VideoSinkWants& wants) override; + void RemoveSink(rtc::VideoSinkInterface* sink) override; + + bool SetVideoSend(bool mute, + const VideoOptions* options, + rtc::VideoSourceInterface* source); + + void SetSend(bool send); + + const std::vector& GetSsrcs() const; + VideoSenderInfo GetVideoSenderInfo(bool log_stats); + void FillBitrateInfo(BandwidthEstimationInfo* bwe_info); + + private: + // Parameters needed to reconstruct the underlying stream. + // webrtc::VideoSendStream doesn't support setting a lot of options on the + // fly, so when those need to be changed we tear down and reconstruct with + // similar parameters depending on which options changed etc. + struct VideoSendStreamParameters { + VideoSendStreamParameters( + webrtc::VideoSendStream::Config config, + const VideoOptions& options, + int max_bitrate_bps, + const rtc::Optional& codec_settings); + webrtc::VideoSendStream::Config config; + VideoOptions options; + int max_bitrate_bps; + bool conference_mode; + rtc::Optional codec_settings; + // Sent resolutions + bitrates etc. by the underlying VideoSendStream, + // typically changes when setting a new resolution or reconfiguring + // bitrates. + webrtc::VideoEncoderConfig encoder_config; + }; + + struct AllocatedEncoder { + AllocatedEncoder(webrtc::VideoEncoder* encoder, + const cricket::VideoCodec& codec, + bool external); + webrtc::VideoEncoder* encoder; + webrtc::VideoEncoder* external_encoder; + cricket::VideoCodec codec; + bool external; + }; + + rtc::scoped_refptr + ConfigureVideoEncoderSettings(const VideoCodec& codec); + // If force_encoder_allocation is true, a new AllocatedEncoder is always + // created. If false, the allocated encoder may be reused, if the type + // matches. + AllocatedEncoder CreateVideoEncoder(const VideoCodec& codec, + bool force_encoder_allocation); + void DestroyVideoEncoder(AllocatedEncoder* encoder); + void SetCodec(const VideoCodecSettings& codec, + bool force_encoder_allocation); + void RecreateWebRtcStream(); + webrtc::VideoEncoderConfig CreateVideoEncoderConfig( + const VideoCodec& codec) const; + void ReconfigureEncoder(); + bool ValidateRtpParameters(const webrtc::RtpParameters& parameters); + + // Calls Start or Stop according to whether or not |sending_| is true, + // and whether or not the encoding in |rtp_parameters_| is active. + void UpdateSendState(); + + webrtc::VideoSendStream::DegradationPreference GetDegradationPreference() + const EXCLUSIVE_LOCKS_REQUIRED(&thread_checker_); + + rtc::ThreadChecker thread_checker_; + rtc::AsyncInvoker invoker_; + rtc::Thread* worker_thread_; + const std::vector ssrcs_ ACCESS_ON(&thread_checker_); + const std::vector ssrc_groups_ ACCESS_ON(&thread_checker_); + webrtc::Call* const call_; + const bool enable_cpu_overuse_detection_; + rtc::VideoSourceInterface* source_ + ACCESS_ON(&thread_checker_); + WebRtcVideoEncoderFactory* const external_encoder_factory_ + ACCESS_ON(&thread_checker_); + const std::unique_ptr internal_encoder_factory_ + ACCESS_ON(&thread_checker_); + + webrtc::VideoSendStream* stream_ ACCESS_ON(&thread_checker_); + rtc::VideoSinkInterface* encoder_sink_ + ACCESS_ON(&thread_checker_); + // Contains settings that are the same for all streams in the MediaChannel, + // such as codecs, header extensions, and the global bitrate limit for the + // entire channel. + VideoSendStreamParameters parameters_ ACCESS_ON(&thread_checker_); + // Contains settings that are unique for each stream, such as max_bitrate. + // Does *not* contain codecs, however. + // TODO(skvlad): Move ssrcs_ and ssrc_groups_ into rtp_parameters_. + // TODO(skvlad): Combine parameters_ and rtp_parameters_ once we have only + // one stream per MediaChannel. + webrtc::RtpParameters rtp_parameters_ ACCESS_ON(&thread_checker_); + AllocatedEncoder allocated_encoder_ ACCESS_ON(&thread_checker_); + + bool sending_ ACCESS_ON(&thread_checker_); + }; + + // Wrapper for the receiver part, contains configs etc. that are needed to + // reconstruct the underlying VideoReceiveStream. + class WebRtcVideoReceiveStream + : public rtc::VideoSinkInterface { + public: + WebRtcVideoReceiveStream( + webrtc::Call* call, + const StreamParams& sp, + webrtc::VideoReceiveStream::Config config, + WebRtcVideoDecoderFactory* external_decoder_factory, + bool default_stream, + const std::vector& recv_codecs, + const webrtc::FlexfecReceiveStream::Config& flexfec_config); + ~WebRtcVideoReceiveStream(); + + const std::vector& GetSsrcs() const; + rtc::Optional GetFirstPrimarySsrc() const; + + void SetLocalSsrc(uint32_t local_ssrc); + // TODO(deadbeef): Move these feedback parameters into the recv parameters. + void SetFeedbackParameters(bool nack_enabled, + bool remb_enabled, + bool transport_cc_enabled, + webrtc::RtcpMode rtcp_mode); + void SetRecvParameters(const ChangedRecvParameters& recv_params); + + void OnFrame(const webrtc::VideoFrame& frame) override; + bool IsDefaultStream() const; + + void SetSink(rtc::VideoSinkInterface* sink); + + VideoReceiverInfo GetVideoReceiverInfo(bool log_stats); + + private: + struct AllocatedDecoder { + AllocatedDecoder(webrtc::VideoDecoder* decoder, + webrtc::VideoCodecType type, + bool external); + webrtc::VideoDecoder* decoder; + // Decoder wrapped into a fallback decoder to permit software fallback. + webrtc::VideoDecoder* external_decoder; + webrtc::VideoCodecType type; + bool external; + }; + + void RecreateWebRtcVideoStream(); + void MaybeRecreateWebRtcFlexfecStream(); + + void ConfigureCodecs(const std::vector& recv_codecs, + std::vector* old_codecs); + void ConfigureFlexfecCodec(int flexfec_payload_type); + AllocatedDecoder CreateOrReuseVideoDecoder( + std::vector* old_decoder, + const VideoCodec& codec); + void ClearDecoders(std::vector* allocated_decoders); + + std::string GetCodecNameFromPayloadType(int payload_type); + + webrtc::Call* const call_; + StreamParams stream_params_; + + // Both |stream_| and |flexfec_stream_| are managed by |this|. They are + // destroyed by calling call_->DestroyVideoReceiveStream and + // call_->DestroyFlexfecReceiveStream, respectively. + webrtc::VideoReceiveStream* stream_; + const bool default_stream_; + webrtc::VideoReceiveStream::Config config_; + webrtc::FlexfecReceiveStream::Config flexfec_config_; + webrtc::FlexfecReceiveStream* flexfec_stream_; + + WebRtcVideoDecoderFactory* const external_decoder_factory_; + std::vector allocated_decoders_; + + rtc::CriticalSection sink_lock_; + rtc::VideoSinkInterface* sink_ GUARDED_BY(sink_lock_); + // Expands remote RTP timestamps to int64_t to be able to estimate how long + // the stream has been running. + rtc::TimestampWrapAroundHandler timestamp_wraparound_handler_ + GUARDED_BY(sink_lock_); + int64_t first_frame_timestamp_ GUARDED_BY(sink_lock_); + // Start NTP time is estimated as current remote NTP time (estimated from + // RTCP) minus the elapsed time, as soon as remote NTP time is available. + int64_t estimated_remote_start_ntp_time_ms_ GUARDED_BY(sink_lock_); + }; + + void Construct(webrtc::Call* call, WebRtcVideoEngine* engine); + + bool SendRtp(const uint8_t* data, + size_t len, + const webrtc::PacketOptions& options) override; + bool SendRtcp(const uint8_t* data, size_t len) override; + + static std::vector MapCodecs( + const std::vector& codecs); + // Select what video codec will be used for sending, i.e. what codec is used + // for local encoding, based on supported remote codecs. The first remote + // codec that is supported locally will be selected. + rtc::Optional SelectSendVideoCodec( + const std::vector& remote_mapped_codecs) const; + + static bool NonFlexfecReceiveCodecsHaveChanged( + std::vector before, + std::vector after); + + void FillSenderStats(VideoMediaInfo* info, bool log_stats); + void FillReceiverStats(VideoMediaInfo* info, bool log_stats); + void FillBandwidthEstimationStats(const webrtc::Call::Stats& stats, + VideoMediaInfo* info); + void FillSendAndReceiveCodecStats(VideoMediaInfo* video_media_info); + + rtc::ThreadChecker thread_checker_; + + uint32_t rtcp_receiver_report_ssrc_; + bool sending_; + webrtc::Call* const call_; + + DefaultUnsignalledSsrcHandler default_unsignalled_ssrc_handler_; + UnsignalledSsrcHandler* const unsignalled_ssrc_handler_; + + const MediaConfig::Video video_config_; + + rtc::CriticalSection stream_crit_; + // Using primary-ssrc (first ssrc) as key. + std::map send_streams_ + GUARDED_BY(stream_crit_); + std::map receive_streams_ + GUARDED_BY(stream_crit_); + std::set send_ssrcs_ GUARDED_BY(stream_crit_); + std::set receive_ssrcs_ GUARDED_BY(stream_crit_); + + rtc::Optional send_codec_; + rtc::Optional> send_rtp_extensions_; + + WebRtcVideoEncoderFactory* const external_encoder_factory_; + WebRtcVideoDecoderFactory* const external_decoder_factory_; + std::vector recv_codecs_; + std::vector recv_rtp_extensions_; + // See reason for keeping track of the FlexFEC payload type separately in + // comment in WebRtcVideoChannel::ChangedRecvParameters. + int recv_flexfec_payload_type_; + webrtc::Call::Config::BitrateConfig bitrate_config_; + // TODO(deadbeef): Don't duplicate information between + // send_params/recv_params, rtp_extensions, options, etc. + VideoSendParameters send_params_; + VideoOptions default_send_options_; + VideoRecvParameters recv_params_; + int64_t last_stats_log_ms_; +}; + +} // namespace cricket + +#endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE_H_ diff --git a/webrtc/media/engine/webrtcvideoengine2.h b/webrtc/media/engine/webrtcvideoengine2.h index 56431167a8..a123acf8dd 100644 --- a/webrtc/media/engine/webrtcvideoengine2.h +++ b/webrtc/media/engine/webrtcvideoengine2.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -11,518 +11,8 @@ #ifndef WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ #define WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ -#include -#include -#include -#include -#include - -#include "webrtc/api/call/transport.h" -#include "webrtc/api/video/video_frame.h" -#include "webrtc/base/asyncinvoker.h" -#include "webrtc/base/criticalsection.h" -#include "webrtc/base/networkroute.h" -#include "webrtc/base/optional.h" -#include "webrtc/base/thread_annotations.h" -#include "webrtc/base/thread_checker.h" -#include "webrtc/call/call.h" -#include "webrtc/call/flexfec_receive_stream.h" -#include "webrtc/media/base/mediaengine.h" -#include "webrtc/media/base/videosinkinterface.h" -#include "webrtc/media/base/videosourceinterface.h" -#include "webrtc/media/engine/webrtcvideodecoderfactory.h" -#include "webrtc/media/engine/webrtcvideoencoderfactory.h" -#include "webrtc/video_receive_stream.h" -#include "webrtc/video_send_stream.h" - -namespace webrtc { -class VideoDecoder; -class VideoEncoder; -struct MediaConfig; -} - -namespace rtc { -class Thread; -} // namespace rtc - -namespace cricket { - -class VideoCapturer; -class VideoProcessor; -class VideoRenderer; -class VoiceMediaChannel; -class WebRtcDecoderObserver; -class WebRtcEncoderObserver; -class WebRtcLocalStreamInfo; -class WebRtcRenderAdapter; -class WebRtcVideoChannel2; -class WebRtcVideoChannelRecvInfo; -class WebRtcVideoChannelSendInfo; -class WebRtcVoiceEngine; -class WebRtcVoiceMediaChannel; - -struct Device; - -class UnsignalledSsrcHandler { - public: - enum Action { - kDropPacket, - kDeliverPacket, - }; - virtual Action OnUnsignalledSsrc(WebRtcVideoChannel2* channel, - uint32_t ssrc) = 0; - virtual ~UnsignalledSsrcHandler() = default; -}; - -// TODO(pbos): Remove, use external handlers only. -class DefaultUnsignalledSsrcHandler : public UnsignalledSsrcHandler { - public: - DefaultUnsignalledSsrcHandler(); - Action OnUnsignalledSsrc(WebRtcVideoChannel2* channel, - uint32_t ssrc) override; - - rtc::VideoSinkInterface* GetDefaultSink() const; - void SetDefaultSink(WebRtcVideoChannel2* channel, - rtc::VideoSinkInterface* sink); - - virtual ~DefaultUnsignalledSsrcHandler() = default; - - private: - rtc::VideoSinkInterface* default_sink_; -}; - -// WebRtcVideoEngine2 is used for the new native WebRTC Video API (webrtc:1667). -class WebRtcVideoEngine2 { - public: - WebRtcVideoEngine2(); - virtual ~WebRtcVideoEngine2(); - - // Basic video engine implementation. - void Init(); - - WebRtcVideoChannel2* CreateChannel(webrtc::Call* call, - const MediaConfig& config, - const VideoOptions& options); - - std::vector codecs() const; - RtpCapabilities GetCapabilities() const; - - // Set a WebRtcVideoDecoderFactory for external decoding. Video engine does - // not take the ownership of |decoder_factory|. The caller needs to make sure - // that |decoder_factory| outlives the video engine. - void SetExternalDecoderFactory(WebRtcVideoDecoderFactory* decoder_factory); - // Set a WebRtcVideoEncoderFactory for external encoding. Video engine does - // not take the ownership of |encoder_factory|. The caller needs to make sure - // that |encoder_factory| outlives the video engine. - virtual void SetExternalEncoderFactory( - WebRtcVideoEncoderFactory* encoder_factory); - - private: - bool initialized_; - - WebRtcVideoDecoderFactory* external_decoder_factory_; - WebRtcVideoEncoderFactory* external_encoder_factory_; - std::unique_ptr simulcast_encoder_factory_; -}; - -class WebRtcVideoChannel2 : public VideoMediaChannel, public webrtc::Transport { - public: - WebRtcVideoChannel2(webrtc::Call* call, - const MediaConfig& config, - const VideoOptions& options, - WebRtcVideoEncoderFactory* external_encoder_factory, - WebRtcVideoDecoderFactory* external_decoder_factory); - ~WebRtcVideoChannel2() override; - - // VideoMediaChannel implementation - rtc::DiffServCodePoint PreferredDscp() const override; - - bool SetSendParameters(const VideoSendParameters& params) override; - bool SetRecvParameters(const VideoRecvParameters& params) override; - webrtc::RtpParameters GetRtpSendParameters(uint32_t ssrc) const override; - bool SetRtpSendParameters(uint32_t ssrc, - const webrtc::RtpParameters& parameters) override; - webrtc::RtpParameters GetRtpReceiveParameters(uint32_t ssrc) const override; - bool SetRtpReceiveParameters( - uint32_t ssrc, - const webrtc::RtpParameters& parameters) override; - bool GetSendCodec(VideoCodec* send_codec) override; - bool SetSend(bool send) override; - bool SetVideoSend( - uint32_t ssrc, - bool enable, - const VideoOptions* options, - rtc::VideoSourceInterface* source) override; - bool AddSendStream(const StreamParams& sp) override; - bool RemoveSendStream(uint32_t ssrc) override; - bool AddRecvStream(const StreamParams& sp) override; - bool AddRecvStream(const StreamParams& sp, bool default_stream); - bool RemoveRecvStream(uint32_t ssrc) override; - bool SetSink(uint32_t ssrc, - rtc::VideoSinkInterface* sink) override; - void FillBitrateInfo(BandwidthEstimationInfo* bwe_info) override; - bool GetStats(VideoMediaInfo* info) override; - - void OnPacketReceived(rtc::CopyOnWriteBuffer* packet, - const rtc::PacketTime& packet_time) override; - void OnRtcpReceived(rtc::CopyOnWriteBuffer* packet, - const rtc::PacketTime& packet_time) override; - void OnReadyToSend(bool ready) override; - void OnNetworkRouteChanged(const std::string& transport_name, - const rtc::NetworkRoute& network_route) override; - void OnTransportOverheadChanged(int transport_overhead_per_packet) override; - void SetInterface(NetworkInterface* iface) override; - - // Implemented for VideoMediaChannelTest. - bool sending() const { return sending_; } - - rtc::Optional GetDefaultReceiveStreamSsrc(); - - // AdaptReason is used for expressing why a WebRtcVideoSendStream request - // a lower input frame size than the currently configured camera input frame - // size. There can be more than one reason OR:ed together. - enum AdaptReason { - ADAPTREASON_NONE = 0, - ADAPTREASON_CPU = 1, - ADAPTREASON_BANDWIDTH = 2, - }; - - private: - class WebRtcVideoReceiveStream; - struct VideoCodecSettings { - VideoCodecSettings(); - - // Checks if all members of |*this| are equal to the corresponding members - // of |other|. - bool operator==(const VideoCodecSettings& other) const; - bool operator!=(const VideoCodecSettings& other) const; - - // Checks if all members of |a|, except |flexfec_payload_type|, are equal - // to the corresponding members of |b|. - static bool EqualsDisregardingFlexfec(const VideoCodecSettings& a, - const VideoCodecSettings& b); - - VideoCodec codec; - webrtc::UlpfecConfig ulpfec; - int flexfec_payload_type; - int rtx_payload_type; - }; - - struct ChangedSendParameters { - // These optionals are unset if not changed. - rtc::Optional codec; - rtc::Optional> rtp_header_extensions; - rtc::Optional max_bandwidth_bps; - rtc::Optional conference_mode; - rtc::Optional rtcp_mode; - }; - - struct ChangedRecvParameters { - // These optionals are unset if not changed. - rtc::Optional> codec_settings; - rtc::Optional> rtp_header_extensions; - // Keep track of the FlexFEC payload type separately from |codec_settings|. - // This allows us to recreate the FlexfecReceiveStream separately from the - // VideoReceiveStream when the FlexFEC payload type is changed. - rtc::Optional flexfec_payload_type; - }; - - bool GetChangedSendParameters(const VideoSendParameters& params, - ChangedSendParameters* changed_params) const; - bool GetChangedRecvParameters(const VideoRecvParameters& params, - ChangedRecvParameters* changed_params) const; - - void SetMaxSendBandwidth(int bps); - - void ConfigureReceiverRtp( - webrtc::VideoReceiveStream::Config* config, - webrtc::FlexfecReceiveStream::Config* flexfec_config, - const StreamParams& sp) const; - bool ValidateSendSsrcAvailability(const StreamParams& sp) const - EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); - bool ValidateReceiveSsrcAvailability(const StreamParams& sp) const - EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); - void DeleteReceiveStream(WebRtcVideoReceiveStream* stream) - EXCLUSIVE_LOCKS_REQUIRED(stream_crit_); - - static std::string CodecSettingsVectorToString( - const std::vector& codecs); - - // Wrapper for the sender part. - class WebRtcVideoSendStream - : public rtc::VideoSourceInterface { - public: - WebRtcVideoSendStream( - webrtc::Call* call, - const StreamParams& sp, - webrtc::VideoSendStream::Config config, - const VideoOptions& options, - WebRtcVideoEncoderFactory* external_encoder_factory, - bool enable_cpu_overuse_detection, - int max_bitrate_bps, - const rtc::Optional& codec_settings, - const rtc::Optional>& rtp_extensions, - const VideoSendParameters& send_params); - virtual ~WebRtcVideoSendStream(); - - void SetSendParameters(const ChangedSendParameters& send_params); - bool SetRtpParameters(const webrtc::RtpParameters& parameters); - webrtc::RtpParameters GetRtpParameters() const; - - // Implements rtc::VideoSourceInterface. - // WebRtcVideoSendStream acts as a source to the webrtc::VideoSendStream - // in |stream_|. This is done to proxy VideoSinkWants from the encoder to - // the worker thread. - void AddOrUpdateSink(rtc::VideoSinkInterface* sink, - const rtc::VideoSinkWants& wants) override; - void RemoveSink(rtc::VideoSinkInterface* sink) override; - - bool SetVideoSend(bool mute, - const VideoOptions* options, - rtc::VideoSourceInterface* source); - - void SetSend(bool send); - - const std::vector& GetSsrcs() const; - VideoSenderInfo GetVideoSenderInfo(bool log_stats); - void FillBitrateInfo(BandwidthEstimationInfo* bwe_info); - - private: - // Parameters needed to reconstruct the underlying stream. - // webrtc::VideoSendStream doesn't support setting a lot of options on the - // fly, so when those need to be changed we tear down and reconstruct with - // similar parameters depending on which options changed etc. - struct VideoSendStreamParameters { - VideoSendStreamParameters( - webrtc::VideoSendStream::Config config, - const VideoOptions& options, - int max_bitrate_bps, - const rtc::Optional& codec_settings); - webrtc::VideoSendStream::Config config; - VideoOptions options; - int max_bitrate_bps; - bool conference_mode; - rtc::Optional codec_settings; - // Sent resolutions + bitrates etc. by the underlying VideoSendStream, - // typically changes when setting a new resolution or reconfiguring - // bitrates. - webrtc::VideoEncoderConfig encoder_config; - }; - - struct AllocatedEncoder { - AllocatedEncoder(webrtc::VideoEncoder* encoder, - const cricket::VideoCodec& codec, - bool external); - webrtc::VideoEncoder* encoder; - webrtc::VideoEncoder* external_encoder; - cricket::VideoCodec codec; - bool external; - }; - - rtc::scoped_refptr - ConfigureVideoEncoderSettings(const VideoCodec& codec); - // If force_encoder_allocation is true, a new AllocatedEncoder is always - // created. If false, the allocated encoder may be reused, if the type - // matches. - AllocatedEncoder CreateVideoEncoder(const VideoCodec& codec, - bool force_encoder_allocation); - void DestroyVideoEncoder(AllocatedEncoder* encoder); - void SetCodec(const VideoCodecSettings& codec, - bool force_encoder_allocation); - void RecreateWebRtcStream(); - webrtc::VideoEncoderConfig CreateVideoEncoderConfig( - const VideoCodec& codec) const; - void ReconfigureEncoder(); - bool ValidateRtpParameters(const webrtc::RtpParameters& parameters); - - // Calls Start or Stop according to whether or not |sending_| is true, - // and whether or not the encoding in |rtp_parameters_| is active. - void UpdateSendState(); - - webrtc::VideoSendStream::DegradationPreference GetDegradationPreference() - const EXCLUSIVE_LOCKS_REQUIRED(&thread_checker_); - - rtc::ThreadChecker thread_checker_; - rtc::AsyncInvoker invoker_; - rtc::Thread* worker_thread_; - const std::vector ssrcs_ ACCESS_ON(&thread_checker_); - const std::vector ssrc_groups_ ACCESS_ON(&thread_checker_); - webrtc::Call* const call_; - const bool enable_cpu_overuse_detection_; - rtc::VideoSourceInterface* source_ - ACCESS_ON(&thread_checker_); - WebRtcVideoEncoderFactory* const external_encoder_factory_ - ACCESS_ON(&thread_checker_); - const std::unique_ptr internal_encoder_factory_ - ACCESS_ON(&thread_checker_); - - webrtc::VideoSendStream* stream_ ACCESS_ON(&thread_checker_); - rtc::VideoSinkInterface* encoder_sink_ - ACCESS_ON(&thread_checker_); - // Contains settings that are the same for all streams in the MediaChannel, - // such as codecs, header extensions, and the global bitrate limit for the - // entire channel. - VideoSendStreamParameters parameters_ ACCESS_ON(&thread_checker_); - // Contains settings that are unique for each stream, such as max_bitrate. - // Does *not* contain codecs, however. - // TODO(skvlad): Move ssrcs_ and ssrc_groups_ into rtp_parameters_. - // TODO(skvlad): Combine parameters_ and rtp_parameters_ once we have only - // one stream per MediaChannel. - webrtc::RtpParameters rtp_parameters_ ACCESS_ON(&thread_checker_); - AllocatedEncoder allocated_encoder_ ACCESS_ON(&thread_checker_); - - bool sending_ ACCESS_ON(&thread_checker_); - }; - - // Wrapper for the receiver part, contains configs etc. that are needed to - // reconstruct the underlying VideoReceiveStream. - class WebRtcVideoReceiveStream - : public rtc::VideoSinkInterface { - public: - WebRtcVideoReceiveStream( - webrtc::Call* call, - const StreamParams& sp, - webrtc::VideoReceiveStream::Config config, - WebRtcVideoDecoderFactory* external_decoder_factory, - bool default_stream, - const std::vector& recv_codecs, - const webrtc::FlexfecReceiveStream::Config& flexfec_config); - ~WebRtcVideoReceiveStream(); - - const std::vector& GetSsrcs() const; - rtc::Optional GetFirstPrimarySsrc() const; - - void SetLocalSsrc(uint32_t local_ssrc); - // TODO(deadbeef): Move these feedback parameters into the recv parameters. - void SetFeedbackParameters(bool nack_enabled, - bool remb_enabled, - bool transport_cc_enabled, - webrtc::RtcpMode rtcp_mode); - void SetRecvParameters(const ChangedRecvParameters& recv_params); - - void OnFrame(const webrtc::VideoFrame& frame) override; - bool IsDefaultStream() const; - - void SetSink(rtc::VideoSinkInterface* sink); - - VideoReceiverInfo GetVideoReceiverInfo(bool log_stats); - - private: - struct AllocatedDecoder { - AllocatedDecoder(webrtc::VideoDecoder* decoder, - webrtc::VideoCodecType type, - bool external); - webrtc::VideoDecoder* decoder; - // Decoder wrapped into a fallback decoder to permit software fallback. - webrtc::VideoDecoder* external_decoder; - webrtc::VideoCodecType type; - bool external; - }; - - void RecreateWebRtcVideoStream(); - void MaybeRecreateWebRtcFlexfecStream(); - - void ConfigureCodecs(const std::vector& recv_codecs, - std::vector* old_codecs); - void ConfigureFlexfecCodec(int flexfec_payload_type); - AllocatedDecoder CreateOrReuseVideoDecoder( - std::vector* old_decoder, - const VideoCodec& codec); - void ClearDecoders(std::vector* allocated_decoders); - - std::string GetCodecNameFromPayloadType(int payload_type); - - webrtc::Call* const call_; - StreamParams stream_params_; - - // Both |stream_| and |flexfec_stream_| are managed by |this|. They are - // destroyed by calling call_->DestroyVideoReceiveStream and - // call_->DestroyFlexfecReceiveStream, respectively. - webrtc::VideoReceiveStream* stream_; - const bool default_stream_; - webrtc::VideoReceiveStream::Config config_; - webrtc::FlexfecReceiveStream::Config flexfec_config_; - webrtc::FlexfecReceiveStream* flexfec_stream_; - - WebRtcVideoDecoderFactory* const external_decoder_factory_; - std::vector allocated_decoders_; - - rtc::CriticalSection sink_lock_; - rtc::VideoSinkInterface* sink_ GUARDED_BY(sink_lock_); - // Expands remote RTP timestamps to int64_t to be able to estimate how long - // the stream has been running. - rtc::TimestampWrapAroundHandler timestamp_wraparound_handler_ - GUARDED_BY(sink_lock_); - int64_t first_frame_timestamp_ GUARDED_BY(sink_lock_); - // Start NTP time is estimated as current remote NTP time (estimated from - // RTCP) minus the elapsed time, as soon as remote NTP time is available. - int64_t estimated_remote_start_ntp_time_ms_ GUARDED_BY(sink_lock_); - }; - - void Construct(webrtc::Call* call, WebRtcVideoEngine2* engine); - - bool SendRtp(const uint8_t* data, - size_t len, - const webrtc::PacketOptions& options) override; - bool SendRtcp(const uint8_t* data, size_t len) override; - - static std::vector MapCodecs( - const std::vector& codecs); - // Select what video codec will be used for sending, i.e. what codec is used - // for local encoding, based on supported remote codecs. The first remote - // codec that is supported locally will be selected. - rtc::Optional SelectSendVideoCodec( - const std::vector& remote_mapped_codecs) const; - - static bool NonFlexfecReceiveCodecsHaveChanged( - std::vector before, - std::vector after); - - void FillSenderStats(VideoMediaInfo* info, bool log_stats); - void FillReceiverStats(VideoMediaInfo* info, bool log_stats); - void FillBandwidthEstimationStats(const webrtc::Call::Stats& stats, - VideoMediaInfo* info); - void FillSendAndReceiveCodecStats(VideoMediaInfo* video_media_info); - - rtc::ThreadChecker thread_checker_; - - uint32_t rtcp_receiver_report_ssrc_; - bool sending_; - webrtc::Call* const call_; - - DefaultUnsignalledSsrcHandler default_unsignalled_ssrc_handler_; - UnsignalledSsrcHandler* const unsignalled_ssrc_handler_; - - const MediaConfig::Video video_config_; - - rtc::CriticalSection stream_crit_; - // Using primary-ssrc (first ssrc) as key. - std::map send_streams_ - GUARDED_BY(stream_crit_); - std::map receive_streams_ - GUARDED_BY(stream_crit_); - std::set send_ssrcs_ GUARDED_BY(stream_crit_); - std::set receive_ssrcs_ GUARDED_BY(stream_crit_); - - rtc::Optional send_codec_; - rtc::Optional> send_rtp_extensions_; - - WebRtcVideoEncoderFactory* const external_encoder_factory_; - WebRtcVideoDecoderFactory* const external_decoder_factory_; - std::vector recv_codecs_; - std::vector recv_rtp_extensions_; - // See reason for keeping track of the FlexFEC payload type separately in - // comment in WebRtcVideoChannel2::ChangedRecvParameters. - int recv_flexfec_payload_type_; - webrtc::Call::Config::BitrateConfig bitrate_config_; - // TODO(deadbeef): Don't duplicate information between - // send_params/recv_params, rtp_extensions, options, etc. - VideoSendParameters send_params_; - VideoOptions default_send_options_; - VideoRecvParameters recv_params_; - int64_t last_stats_log_ms_; -}; - -} // namespace cricket +// TODO(eladalon): Remove this legacy. +#include "webrtc/media/engine/webrtcvideoengine.h" #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ + diff --git a/webrtc/media/engine/webrtcvideoengine2_unittest.cc b/webrtc/media/engine/webrtcvideoengine_unittest.cc similarity index 92% rename from webrtc/media/engine/webrtcvideoengine2_unittest.cc rename to webrtc/media/engine/webrtcvideoengine_unittest.cc index 3730e3dd04..d13609fb6f 100644 --- a/webrtc/media/engine/webrtcvideoengine2_unittest.cc +++ b/webrtc/media/engine/webrtcvideoengine_unittest.cc @@ -28,7 +28,7 @@ #include "webrtc/media/engine/fakewebrtccall.h" #include "webrtc/media/engine/fakewebrtcvideoengine.h" #include "webrtc/media/engine/simulcast.h" -#include "webrtc/media/engine/webrtcvideoengine2.h" +#include "webrtc/media/engine/webrtcvideoengine.h" #include "webrtc/media/engine/webrtcvoiceengine.h" #include "webrtc/test/field_trial.h" @@ -114,10 +114,10 @@ cricket::MediaConfig GetMediaConfig() { } // namespace namespace cricket { -class WebRtcVideoEngine2Test : public ::testing::Test { +class WebRtcVideoEngineTest : public ::testing::Test { public: - WebRtcVideoEngine2Test() : WebRtcVideoEngine2Test("") {} - explicit WebRtcVideoEngine2Test(const char* field_trials) + WebRtcVideoEngineTest() : WebRtcVideoEngineTest("") {} + explicit WebRtcVideoEngineTest(const char* field_trials) : override_field_trials_(field_trials), call_(webrtc::Call::Create(webrtc::Call::Config(&event_log_))), engine_() { @@ -156,15 +156,15 @@ class WebRtcVideoEngine2Test : public ::testing::Test { webrtc::test::ScopedFieldTrials override_field_trials_; webrtc::RtcEventLogNullImpl event_log_; - // Used in WebRtcVideoEngine2VoiceTest, but defined here so it's properly + // Used in WebRtcVideoEngineVoiceTest, but defined here so it's properly // initialized when the constructor is called. std::unique_ptr call_; - WebRtcVideoEngine2 engine_; + WebRtcVideoEngine engine_; VideoCodec default_codec_; std::map default_apt_rtx_types_; }; -TEST_F(WebRtcVideoEngine2Test, AnnouncesVp9AccordingToBuildFlags) { +TEST_F(WebRtcVideoEngineTest, AnnouncesVp9AccordingToBuildFlags) { bool claims_vp9_support = false; for (const cricket::VideoCodec& codec : engine_.codecs()) { if (codec.name == "VP9") { @@ -179,7 +179,7 @@ TEST_F(WebRtcVideoEngine2Test, AnnouncesVp9AccordingToBuildFlags) { #endif // defined(RTC_DISABLE_VP9) } -TEST_F(WebRtcVideoEngine2Test, DefaultRtxCodecHasAssociatedPayloadTypeSet) { +TEST_F(WebRtcVideoEngineTest, DefaultRtxCodecHasAssociatedPayloadTypeSet) { std::vector engine_codecs = engine_.codecs(); for (size_t i = 0; i < engine_codecs.size(); ++i) { if (engine_codecs[i].name != kRtxCodecName) @@ -193,7 +193,7 @@ TEST_F(WebRtcVideoEngine2Test, DefaultRtxCodecHasAssociatedPayloadTypeSet) { FAIL() << "No RTX codec found among default codecs."; } -TEST_F(WebRtcVideoEngine2Test, SupportsTimestampOffsetHeaderExtension) { +TEST_F(WebRtcVideoEngineTest, SupportsTimestampOffsetHeaderExtension) { RtpCapabilities capabilities = engine_.GetCapabilities(); ASSERT_FALSE(capabilities.header_extensions.empty()); for (const RtpExtension& extension : capabilities.header_extensions) { @@ -205,7 +205,7 @@ TEST_F(WebRtcVideoEngine2Test, SupportsTimestampOffsetHeaderExtension) { FAIL() << "Timestamp offset extension not in header-extension list."; } -TEST_F(WebRtcVideoEngine2Test, SupportsAbsoluteSenderTimeHeaderExtension) { +TEST_F(WebRtcVideoEngineTest, SupportsAbsoluteSenderTimeHeaderExtension) { RtpCapabilities capabilities = engine_.GetCapabilities(); ASSERT_FALSE(capabilities.header_extensions.empty()); for (const RtpExtension& extension : capabilities.header_extensions) { @@ -217,7 +217,7 @@ TEST_F(WebRtcVideoEngine2Test, SupportsAbsoluteSenderTimeHeaderExtension) { FAIL() << "Absolute Sender Time extension not in header-extension list."; } -TEST_F(WebRtcVideoEngine2Test, SupportsTransportSequenceNumberHeaderExtension) { +TEST_F(WebRtcVideoEngineTest, SupportsTransportSequenceNumberHeaderExtension) { RtpCapabilities capabilities = engine_.GetCapabilities(); ASSERT_FALSE(capabilities.header_extensions.empty()); for (const RtpExtension& extension : capabilities.header_extensions) { @@ -229,7 +229,7 @@ TEST_F(WebRtcVideoEngine2Test, SupportsTransportSequenceNumberHeaderExtension) { FAIL() << "Transport sequence number extension not in header-extension list."; } -TEST_F(WebRtcVideoEngine2Test, SupportsVideoRotationHeaderExtension) { +TEST_F(WebRtcVideoEngineTest, SupportsVideoRotationHeaderExtension) { RtpCapabilities capabilities = engine_.GetCapabilities(); ASSERT_FALSE(capabilities.header_extensions.empty()); for (const RtpExtension& extension : capabilities.header_extensions) { @@ -241,7 +241,7 @@ TEST_F(WebRtcVideoEngine2Test, SupportsVideoRotationHeaderExtension) { FAIL() << "Video Rotation extension not in header-extension list."; } -TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionBeforeCapturer) { +TEST_F(WebRtcVideoEngineTest, CVOSetHeaderExtensionBeforeCapturer) { // Allocate the capturer first to prevent early destruction before channel's // dtor is called. cricket::FakeVideoCapturer capturer; @@ -275,7 +275,7 @@ TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionBeforeCapturer) { // TODO(ilnik): Remove this test once field trial is gone. -TEST_F(WebRtcVideoEngine2Test, SupportsVideoContentTypeHeaderExtension) { +TEST_F(WebRtcVideoEngineTest, SupportsVideoContentTypeHeaderExtension) { // Extension shound not be reported outside of the field trial. RtpCapabilities capabilities = engine_.GetCapabilities(); EXPECT_FALSE(capabilities.header_extensions.empty()); @@ -296,7 +296,7 @@ TEST_F(WebRtcVideoEngine2Test, SupportsVideoContentTypeHeaderExtension) { FAIL() << "Video Content Type extension not in header-extension list."; } -TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionBeforeAddSendStream) { +TEST_F(WebRtcVideoEngineTest, CVOSetHeaderExtensionBeforeAddSendStream) { // Allocate the capturer first to prevent early destruction before channel's // dtor is called. cricket::FakeVideoCapturer capturer; @@ -322,7 +322,7 @@ TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionBeforeAddSendStream) { EXPECT_FALSE(capturer.apply_rotation()); } -TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionAfterCapturer) { +TEST_F(WebRtcVideoEngineTest, CVOSetHeaderExtensionAfterCapturer) { cricket::FakeVideoCapturer capturer; cricket::FakeWebRtcVideoEncoderFactory encoder_factory; @@ -359,7 +359,7 @@ TEST_F(WebRtcVideoEngine2Test, CVOSetHeaderExtensionAfterCapturer) { EXPECT_TRUE(capturer.apply_rotation()); } -TEST_F(WebRtcVideoEngine2Test, SetSendFailsBeforeSettingCodecs) { +TEST_F(WebRtcVideoEngineTest, SetSendFailsBeforeSettingCodecs) { engine_.Init(); std::unique_ptr channel( engine_.CreateChannel(call_.get(), GetMediaConfig(), VideoOptions())); @@ -372,7 +372,7 @@ TEST_F(WebRtcVideoEngine2Test, SetSendFailsBeforeSettingCodecs) { << "Channel should be stoppable even without set codecs."; } -TEST_F(WebRtcVideoEngine2Test, GetStatsWithoutSendCodecsSetDoesNotCrash) { +TEST_F(WebRtcVideoEngineTest, GetStatsWithoutSendCodecsSetDoesNotCrash) { engine_.Init(); std::unique_ptr channel( engine_.CreateChannel(call_.get(), GetMediaConfig(), VideoOptions())); @@ -381,7 +381,7 @@ TEST_F(WebRtcVideoEngine2Test, GetStatsWithoutSendCodecsSetDoesNotCrash) { channel->GetStats(&info); } -TEST_F(WebRtcVideoEngine2Test, UseExternalFactoryForVp8WhenSupported) { +TEST_F(WebRtcVideoEngineTest, UseExternalFactoryForVp8WhenSupported) { cricket::FakeWebRtcVideoEncoderFactory encoder_factory; encoder_factory.AddSupportedVideoCodecType("VP8"); @@ -423,7 +423,7 @@ TEST_F(WebRtcVideoEngine2Test, UseExternalFactoryForVp8WhenSupported) { // TODO(deadbeef): Currently this test is only effective if WebRTC is // built with no internal H264 support. This test should be updated // if/when we start adding RTX codecs for unrecognized codec names. -TEST_F(WebRtcVideoEngine2Test, RtxCodecAddedForExternalCodec) { +TEST_F(WebRtcVideoEngineTest, RtxCodecAddedForExternalCodec) { using webrtc::H264::ProfileLevelIdToString; using webrtc::H264::ProfileLevelId; using webrtc::H264::kLevel1; @@ -458,7 +458,7 @@ TEST_F(WebRtcVideoEngine2Test, RtxCodecAddedForExternalCodec) { codecs, FindMatchingCodec(codecs, h264_high)->id)); } -void WebRtcVideoEngine2Test::TestExtendedEncoderOveruse( +void WebRtcVideoEngineTest::TestExtendedEncoderOveruse( bool use_external_encoder) { cricket::FakeWebRtcVideoEncoderFactory encoder_factory; encoder_factory.AddSupportedVideoCodecType("VP8"); @@ -486,16 +486,16 @@ void WebRtcVideoEngine2Test::TestExtendedEncoderOveruse( EXPECT_TRUE(channel->RemoveSendStream(kSsrc)); } -TEST_F(WebRtcVideoEngine2Test, EnablesFullEncoderTimeForExternalEncoders) { +TEST_F(WebRtcVideoEngineTest, EnablesFullEncoderTimeForExternalEncoders) { TestExtendedEncoderOveruse(true); } -TEST_F(WebRtcVideoEngine2Test, DisablesFullEncoderTimeForNonExternalEncoders) { +TEST_F(WebRtcVideoEngineTest, DisablesFullEncoderTimeForNonExternalEncoders) { TestExtendedEncoderOveruse(false); } #if !defined(RTC_DISABLE_VP9) -TEST_F(WebRtcVideoEngine2Test, CanConstructDecoderForVp9EncoderFactory) { +TEST_F(WebRtcVideoEngineTest, CanConstructDecoderForVp9EncoderFactory) { cricket::FakeWebRtcVideoEncoderFactory encoder_factory; encoder_factory.AddSupportedVideoCodecType("VP9"); @@ -507,7 +507,7 @@ TEST_F(WebRtcVideoEngine2Test, CanConstructDecoderForVp9EncoderFactory) { } #endif // !defined(RTC_DISABLE_VP9) -TEST_F(WebRtcVideoEngine2Test, PropagatesInputFrameTimestamp) { +TEST_F(WebRtcVideoEngineTest, PropagatesInputFrameTimestamp) { cricket::FakeWebRtcVideoEncoderFactory encoder_factory; encoder_factory.AddSupportedVideoCodecType("VP8"); FakeCall* fake_call = new FakeCall(webrtc::Call::Config(&event_log_)); @@ -563,7 +563,7 @@ TEST_F(WebRtcVideoEngine2Test, PropagatesInputFrameTimestamp) { EXPECT_TRUE(channel->RemoveSendStream(kSsrc)); } -cricket::VideoCodec WebRtcVideoEngine2Test::GetEngineCodec( +cricket::VideoCodec WebRtcVideoEngineTest::GetEngineCodec( const std::string& name) { for (const cricket::VideoCodec& engine_codec : engine_.codecs()) { if (CodecNamesEq(name, engine_codec.name)) @@ -574,7 +574,7 @@ cricket::VideoCodec WebRtcVideoEngine2Test::GetEngineCodec( return cricket::VideoCodec(); } -VideoMediaChannel* WebRtcVideoEngine2Test::SetUpForExternalEncoderFactory( +VideoMediaChannel* WebRtcVideoEngineTest::SetUpForExternalEncoderFactory( cricket::WebRtcVideoEncoderFactory* encoder_factory) { engine_.SetExternalEncoderFactory(encoder_factory); engine_.Init(); @@ -591,7 +591,7 @@ VideoMediaChannel* WebRtcVideoEngine2Test::SetUpForExternalEncoderFactory( return channel; } -VideoMediaChannel* WebRtcVideoEngine2Test::SetUpForExternalDecoderFactory( +VideoMediaChannel* WebRtcVideoEngineTest::SetUpForExternalDecoderFactory( cricket::WebRtcVideoDecoderFactory* decoder_factory, const std::vector& codecs) { engine_.SetExternalDecoderFactory(decoder_factory); @@ -606,7 +606,7 @@ VideoMediaChannel* WebRtcVideoEngine2Test::SetUpForExternalDecoderFactory( return channel; } -TEST_F(WebRtcVideoEngine2Test, UsesSimulcastAdapterForVp8Factories) { +TEST_F(WebRtcVideoEngineTest, UsesSimulcastAdapterForVp8Factories) { cricket::FakeWebRtcVideoEncoderFactory encoder_factory; encoder_factory.AddSupportedVideoCodecType("VP8"); @@ -645,7 +645,7 @@ TEST_F(WebRtcVideoEngine2Test, UsesSimulcastAdapterForVp8Factories) { ASSERT_EQ(0u, encoder_factory.encoders().size()); } -TEST_F(WebRtcVideoEngine2Test, ChannelWithExternalH264CanChangeToInternalVp8) { +TEST_F(WebRtcVideoEngineTest, ChannelWithExternalH264CanChangeToInternalVp8) { cricket::FakeWebRtcVideoEncoderFactory encoder_factory; encoder_factory.AddSupportedVideoCodecType("H264"); @@ -662,7 +662,7 @@ TEST_F(WebRtcVideoEngine2Test, ChannelWithExternalH264CanChangeToInternalVp8) { ASSERT_EQ(0u, encoder_factory.encoders().size()); } -TEST_F(WebRtcVideoEngine2Test, +TEST_F(WebRtcVideoEngineTest, DontUseExternalEncoderFactoryForUnsupportedCodecs) { cricket::FakeWebRtcVideoEncoderFactory encoder_factory; encoder_factory.AddSupportedVideoCodecType("H264"); @@ -682,7 +682,7 @@ TEST_F(WebRtcVideoEngine2Test, ASSERT_EQ(0u, encoder_factory.encoders().size()); } -TEST_F(WebRtcVideoEngine2Test, +TEST_F(WebRtcVideoEngineTest, UsesSimulcastAdapterForVp8WithCombinedVP8AndH264Factory) { cricket::FakeWebRtcVideoEncoderFactory encoder_factory; encoder_factory.AddSupportedVideoCodecType("VP8"); @@ -722,7 +722,7 @@ TEST_F(WebRtcVideoEngine2Test, EXPECT_EQ(0u, encoder_factory.encoders().size()); } -TEST_F(WebRtcVideoEngine2Test, +TEST_F(WebRtcVideoEngineTest, DestroysNonSimulcastEncoderFromCombinedVP8AndH264Factory) { cricket::FakeWebRtcVideoEncoderFactory encoder_factory; encoder_factory.AddSupportedVideoCodecType("VP8"); @@ -757,7 +757,7 @@ TEST_F(WebRtcVideoEngine2Test, ASSERT_EQ(0u, encoder_factory.encoders().size()); } -TEST_F(WebRtcVideoEngine2Test, SimulcastDisabledForH264) { +TEST_F(WebRtcVideoEngineTest, SimulcastDisabledForH264) { cricket::FakeWebRtcVideoEncoderFactory encoder_factory; encoder_factory.AddSupportedVideoCodecType("H264"); @@ -785,10 +785,10 @@ TEST_F(WebRtcVideoEngine2Test, SimulcastDisabledForH264) { } // Test that the FlexFEC field trial properly alters the output of -// WebRtcVideoEngine2::codecs(), for an existing |engine_| object. +// WebRtcVideoEngine::codecs(), for an existing |engine_| object. // // TODO(brandtr): Remove this test, when the FlexFEC field trial is gone. -TEST_F(WebRtcVideoEngine2Test, +TEST_F(WebRtcVideoEngineTest, Flexfec03SupportedAsInternalCodecBehindFieldTrial) { auto is_flexfec = [](const VideoCodec& codec) { if (codec.name == "flexfec-03") @@ -811,7 +811,7 @@ TEST_F(WebRtcVideoEngine2Test, } // Test that external codecs are added to the end of the supported codec list. -TEST_F(WebRtcVideoEngine2Test, ReportSupportedExternalCodecs) { +TEST_F(WebRtcVideoEngineTest, ReportSupportedExternalCodecs) { cricket::FakeWebRtcVideoEncoderFactory encoder_factory; encoder_factory.AddSupportedVideoCodecType("FakeExternalCodec"); engine_.SetExternalEncoderFactory(&encoder_factory); @@ -829,7 +829,7 @@ TEST_F(WebRtcVideoEngine2Test, ReportSupportedExternalCodecs) { // Test that an external codec that was added after the engine was initialized // does show up in the codec list after it was added. -TEST_F(WebRtcVideoEngine2Test, ReportSupportedExternalCodecsWithAddedCodec) { +TEST_F(WebRtcVideoEngineTest, ReportSupportedExternalCodecsWithAddedCodec) { // Set up external encoder factory with first codec, and initialize engine. cricket::FakeWebRtcVideoEncoderFactory encoder_factory; encoder_factory.AddSupportedVideoCodecType("FakeExternalCodec1"); @@ -847,7 +847,7 @@ TEST_F(WebRtcVideoEngine2Test, ReportSupportedExternalCodecsWithAddedCodec) { EXPECT_EQ("FakeExternalCodec2", codecs_after.back().name); } -TEST_F(WebRtcVideoEngine2Test, RegisterExternalDecodersIfSupported) { +TEST_F(WebRtcVideoEngineTest, RegisterExternalDecodersIfSupported) { cricket::FakeWebRtcVideoDecoderFactory decoder_factory; decoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8); cricket::VideoRecvParameters parameters; @@ -870,7 +870,7 @@ TEST_F(WebRtcVideoEngine2Test, RegisterExternalDecodersIfSupported) { } // Verifies that we can set up decoders that are not internally supported. -TEST_F(WebRtcVideoEngine2Test, RegisterExternalH264DecoderIfSupported) { +TEST_F(WebRtcVideoEngineTest, RegisterExternalH264DecoderIfSupported) { // TODO(pbos): Do not assume that encoder/decoder support is symmetric. We // can't even query the WebRtcVideoDecoderFactory for supported codecs. // For now we add a FakeWebRtcVideoEncoderFactory to add H264 to supported @@ -891,10 +891,10 @@ TEST_F(WebRtcVideoEngine2Test, RegisterExternalH264DecoderIfSupported) { ASSERT_EQ(1u, decoder_factory.decoders().size()); } -class WebRtcVideoChannel2BaseTest - : public VideoMediaChannelTest { +class WebRtcVideoChannelBaseTest + : public VideoMediaChannelTest { protected: - typedef VideoMediaChannelTest Base; + typedef VideoMediaChannelTest Base; cricket::VideoCodec GetEngineCodec(const std::string& name) { for (const cricket::VideoCodec& engine_codec : engine_.codecs()) { @@ -910,7 +910,7 @@ class WebRtcVideoChannel2BaseTest }; // Verifies that id given in stream params is passed to the decoder factory. -TEST_F(WebRtcVideoEngine2Test, StreamParamsIdPassedToDecoderFactory) { +TEST_F(WebRtcVideoEngineTest, StreamParamsIdPassedToDecoderFactory) { cricket::FakeWebRtcVideoDecoderFactory decoder_factory; decoder_factory.AddSupportedVideoCodecType(webrtc::kVideoCodecVP8); cricket::VideoRecvParameters parameters; @@ -929,7 +929,7 @@ TEST_F(WebRtcVideoEngine2Test, StreamParamsIdPassedToDecoderFactory) { EXPECT_EQ(sp.id, params[0].receive_stream_id); } -TEST_F(WebRtcVideoEngine2Test, DISABLED_RecreatesEncoderOnContentTypeChange) { +TEST_F(WebRtcVideoEngineTest, DISABLED_RecreatesEncoderOnContentTypeChange) { cricket::FakeWebRtcVideoEncoderFactory encoder_factory; encoder_factory.AddSupportedVideoCodecType("VP8"); std::unique_ptr fake_call( @@ -992,10 +992,10 @@ TEST_F(WebRtcVideoEngine2Test, DISABLED_RecreatesEncoderOnContentTypeChange) { } #define WEBRTC_BASE_TEST(test) \ - TEST_F(WebRtcVideoChannel2BaseTest, test) { Base::test(); } + TEST_F(WebRtcVideoChannelBaseTest, test) { Base::test(); } #define WEBRTC_DISABLED_BASE_TEST(test) \ - TEST_F(WebRtcVideoChannel2BaseTest, DISABLED_##test) { Base::test(); } + TEST_F(WebRtcVideoChannelBaseTest, DISABLED_##test) { Base::test(); } WEBRTC_BASE_TEST(SetSend); WEBRTC_BASE_TEST(SetSendWithoutCodecs); @@ -1026,19 +1026,19 @@ WEBRTC_BASE_TEST(RejectEmptyStreamParams); WEBRTC_BASE_TEST(MultipleSendStreams); -TEST_F(WebRtcVideoChannel2BaseTest, SendAndReceiveVp8Vga) { +TEST_F(WebRtcVideoChannelBaseTest, SendAndReceiveVp8Vga) { SendAndReceive(GetEngineCodec("VP8")); } -TEST_F(WebRtcVideoChannel2BaseTest, SendAndReceiveVp8Qvga) { +TEST_F(WebRtcVideoChannelBaseTest, SendAndReceiveVp8Qvga) { SendAndReceive(GetEngineCodec("VP8")); } -TEST_F(WebRtcVideoChannel2BaseTest, SendAndReceiveVp8SvcQqvga) { +TEST_F(WebRtcVideoChannelBaseTest, SendAndReceiveVp8SvcQqvga) { SendAndReceive(GetEngineCodec("VP8")); } -TEST_F(WebRtcVideoChannel2BaseTest, TwoStreamsSendAndReceive) { +TEST_F(WebRtcVideoChannelBaseTest, TwoStreamsSendAndReceive) { // Set a high bitrate to not be downscaled by VP8 due to low initial start // bitrates. This currently happens at <250k, and two streams sharing 300k // initially will use QVGA instead of VGA. @@ -1049,11 +1049,11 @@ TEST_F(WebRtcVideoChannel2BaseTest, TwoStreamsSendAndReceive) { Base::TwoStreamsSendAndReceive(codec); } -class WebRtcVideoChannel2Test : public WebRtcVideoEngine2Test { +class WebRtcVideoChannelTest : public WebRtcVideoEngineTest { public: - WebRtcVideoChannel2Test() : WebRtcVideoChannel2Test("") {} - explicit WebRtcVideoChannel2Test(const char* field_trials) - : WebRtcVideoEngine2Test(field_trials), last_ssrc_(0) {} + WebRtcVideoChannelTest() : WebRtcVideoChannelTest("") {} + explicit WebRtcVideoChannelTest(const char* field_trials) + : WebRtcVideoEngineTest(field_trials), last_ssrc_(0) {} void SetUp() override { fake_call_.reset(new FakeCall(webrtc::Call::Config(&event_log_))); engine_.Init(); @@ -1289,7 +1289,7 @@ class WebRtcVideoChannel2Test : public WebRtcVideoEngine2Test { uint32_t last_ssrc_; }; -TEST_F(WebRtcVideoChannel2Test, SetsSyncGroupFromSyncLabel) { +TEST_F(WebRtcVideoChannelTest, SetsSyncGroupFromSyncLabel) { const uint32_t kVideoSsrc = 123; const std::string kSyncLabel = "AvSyncLabel"; @@ -1303,7 +1303,7 @@ TEST_F(WebRtcVideoChannel2Test, SetsSyncGroupFromSyncLabel) { << "SyncGroup should be set based on sync_label"; } -TEST_F(WebRtcVideoChannel2Test, RecvStreamWithSimAndRtx) { +TEST_F(WebRtcVideoChannelTest, RecvStreamWithSimAndRtx) { cricket::VideoSendParameters parameters; parameters.codecs = engine_.codecs(); EXPECT_TRUE(channel_->SetSendParameters(parameters)); @@ -1331,7 +1331,7 @@ TEST_F(WebRtcVideoChannel2Test, RecvStreamWithSimAndRtx) { EXPECT_EQ(rtx_ssrcs[0], recv_stream->GetConfig().rtp.rtx_ssrc); } -TEST_F(WebRtcVideoChannel2Test, RecvStreamWithRtx) { +TEST_F(WebRtcVideoChannelTest, RecvStreamWithRtx) { // Setup one channel with an associated RTX stream. cricket::StreamParams params = cricket::StreamParams::CreateLegacy(kSsrcs1[0]); @@ -1340,7 +1340,7 @@ TEST_F(WebRtcVideoChannel2Test, RecvStreamWithRtx) { EXPECT_EQ(kRtxSsrcs1[0], recv_stream->GetConfig().rtp.rtx_ssrc); } -TEST_F(WebRtcVideoChannel2Test, RecvStreamNoRtx) { +TEST_F(WebRtcVideoChannelTest, RecvStreamNoRtx) { // Setup one channel without an associated RTX stream. cricket::StreamParams params = cricket::StreamParams::CreateLegacy(kSsrcs1[0]); @@ -1348,7 +1348,7 @@ TEST_F(WebRtcVideoChannel2Test, RecvStreamNoRtx) { ASSERT_EQ(0U, recv_stream->GetConfig().rtp.rtx_ssrc); } -TEST_F(WebRtcVideoChannel2Test, NoHeaderExtesionsByDefault) { +TEST_F(WebRtcVideoChannelTest, NoHeaderExtesionsByDefault) { FakeVideoSendStream* send_stream = AddSendStream(cricket::StreamParams::CreateLegacy(kSsrcs1[0])); ASSERT_TRUE(send_stream->GetConfig().rtp.extensions.empty()); @@ -1359,24 +1359,24 @@ TEST_F(WebRtcVideoChannel2Test, NoHeaderExtesionsByDefault) { } // Test support for RTP timestamp offset header extension. -TEST_F(WebRtcVideoChannel2Test, SendRtpTimestampOffsetHeaderExtensions) { +TEST_F(WebRtcVideoChannelTest, SendRtpTimestampOffsetHeaderExtensions) { TestSetSendRtpHeaderExtensions(RtpExtension::kTimestampOffsetUri); } -TEST_F(WebRtcVideoChannel2Test, RecvRtpTimestampOffsetHeaderExtensions) { +TEST_F(WebRtcVideoChannelTest, RecvRtpTimestampOffsetHeaderExtensions) { TestSetRecvRtpHeaderExtensions(RtpExtension::kTimestampOffsetUri); } // Test support for absolute send time header extension. -TEST_F(WebRtcVideoChannel2Test, SendAbsoluteSendTimeHeaderExtensions) { +TEST_F(WebRtcVideoChannelTest, SendAbsoluteSendTimeHeaderExtensions) { TestSetSendRtpHeaderExtensions(RtpExtension::kAbsSendTimeUri); } -TEST_F(WebRtcVideoChannel2Test, RecvAbsoluteSendTimeHeaderExtensions) { +TEST_F(WebRtcVideoChannelTest, RecvAbsoluteSendTimeHeaderExtensions) { TestSetRecvRtpHeaderExtensions(RtpExtension::kAbsSendTimeUri); } -TEST_F(WebRtcVideoChannel2Test, FiltersExtensionsPicksTransportSeqNum) { +TEST_F(WebRtcVideoChannelTest, FiltersExtensionsPicksTransportSeqNum) { // Enable three redundant extensions. std::vector extensions; extensions.push_back(RtpExtension::kAbsSendTimeUri); @@ -1385,7 +1385,7 @@ TEST_F(WebRtcVideoChannel2Test, FiltersExtensionsPicksTransportSeqNum) { TestExtensionFilter(extensions, RtpExtension::kTransportSequenceNumberUri); } -TEST_F(WebRtcVideoChannel2Test, FiltersExtensionsPicksAbsSendTime) { +TEST_F(WebRtcVideoChannelTest, FiltersExtensionsPicksAbsSendTime) { // Enable two redundant extensions. std::vector extensions; extensions.push_back(RtpExtension::kAbsSendTimeUri); @@ -1394,22 +1394,22 @@ TEST_F(WebRtcVideoChannel2Test, FiltersExtensionsPicksAbsSendTime) { } // Test support for transport sequence number header extension. -TEST_F(WebRtcVideoChannel2Test, SendTransportSequenceNumberHeaderExtensions) { +TEST_F(WebRtcVideoChannelTest, SendTransportSequenceNumberHeaderExtensions) { TestSetSendRtpHeaderExtensions(RtpExtension::kTransportSequenceNumberUri); } -TEST_F(WebRtcVideoChannel2Test, RecvTransportSequenceNumberHeaderExtensions) { +TEST_F(WebRtcVideoChannelTest, RecvTransportSequenceNumberHeaderExtensions) { TestSetRecvRtpHeaderExtensions(RtpExtension::kTransportSequenceNumberUri); } // Test support for video rotation header extension. -TEST_F(WebRtcVideoChannel2Test, SendVideoRotationHeaderExtensions) { +TEST_F(WebRtcVideoChannelTest, SendVideoRotationHeaderExtensions) { TestSetSendRtpHeaderExtensions(RtpExtension::kVideoRotationUri); } -TEST_F(WebRtcVideoChannel2Test, RecvVideoRotationHeaderExtensions) { +TEST_F(WebRtcVideoChannelTest, RecvVideoRotationHeaderExtensions) { TestSetRecvRtpHeaderExtensions(RtpExtension::kVideoRotationUri); } -TEST_F(WebRtcVideoChannel2Test, IdenticalSendExtensionsDoesntRecreateStream) { +TEST_F(WebRtcVideoChannelTest, IdenticalSendExtensionsDoesntRecreateStream) { const int kAbsSendTimeId = 1; const int kVideoRotationId = 2; send_parameters_.extensions.push_back( @@ -1439,7 +1439,7 @@ TEST_F(WebRtcVideoChannel2Test, IdenticalSendExtensionsDoesntRecreateStream) { EXPECT_EQ(2, fake_call_->GetNumCreatedSendStreams()); } -TEST_F(WebRtcVideoChannel2Test, IdenticalRecvExtensionsDoesntRecreateStream) { +TEST_F(WebRtcVideoChannelTest, IdenticalRecvExtensionsDoesntRecreateStream) { const int kTOffsetId = 1; const int kAbsSendTimeId = 2; const int kVideoRotationId = 3; @@ -1472,7 +1472,7 @@ TEST_F(WebRtcVideoChannel2Test, IdenticalRecvExtensionsDoesntRecreateStream) { EXPECT_EQ(2, fake_call_->GetNumCreatedReceiveStreams()); } -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, SetSendRtpHeaderExtensionsExcludeUnsupportedExtensions) { const int kUnsupportedId = 1; const int kTOffsetId = 2; @@ -1492,7 +1492,7 @@ TEST_F(WebRtcVideoChannel2Test, send_stream->GetConfig().rtp.extensions[0].uri.c_str()); } -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, SetRecvRtpHeaderExtensionsExcludeUnsupportedExtensions) { const int kUnsupportedId = 1; const int kTOffsetId = 2; @@ -1512,7 +1512,7 @@ TEST_F(WebRtcVideoChannel2Test, recv_stream->GetConfig().rtp.extensions[0].uri.c_str()); } -TEST_F(WebRtcVideoChannel2Test, SetSendRtpHeaderExtensionsRejectsIncorrectIds) { +TEST_F(WebRtcVideoChannelTest, SetSendRtpHeaderExtensionsRejectsIncorrectIds) { const int kIncorrectIds[] = {-2, -1, 0, 15, 16}; for (size_t i = 0; i < arraysize(kIncorrectIds); ++i) { send_parameters_.extensions.push_back( @@ -1522,7 +1522,7 @@ TEST_F(WebRtcVideoChannel2Test, SetSendRtpHeaderExtensionsRejectsIncorrectIds) { } } -TEST_F(WebRtcVideoChannel2Test, SetRecvRtpHeaderExtensionsRejectsIncorrectIds) { +TEST_F(WebRtcVideoChannelTest, SetRecvRtpHeaderExtensionsRejectsIncorrectIds) { const int kIncorrectIds[] = {-2, -1, 0, 15, 16}; for (size_t i = 0; i < arraysize(kIncorrectIds); ++i) { recv_parameters_.extensions.push_back( @@ -1532,7 +1532,7 @@ TEST_F(WebRtcVideoChannel2Test, SetRecvRtpHeaderExtensionsRejectsIncorrectIds) { } } -TEST_F(WebRtcVideoChannel2Test, SetSendRtpHeaderExtensionsRejectsDuplicateIds) { +TEST_F(WebRtcVideoChannelTest, SetSendRtpHeaderExtensionsRejectsDuplicateIds) { const int id = 1; send_parameters_.extensions.push_back( RtpExtension(RtpExtension::kTimestampOffsetUri, id)); @@ -1548,7 +1548,7 @@ TEST_F(WebRtcVideoChannel2Test, SetSendRtpHeaderExtensionsRejectsDuplicateIds) { EXPECT_FALSE(channel_->SetSendParameters(send_parameters_)); } -TEST_F(WebRtcVideoChannel2Test, SetRecvRtpHeaderExtensionsRejectsDuplicateIds) { +TEST_F(WebRtcVideoChannelTest, SetRecvRtpHeaderExtensionsRejectsDuplicateIds) { const int id = 1; recv_parameters_.extensions.push_back( RtpExtension(RtpExtension::kTimestampOffsetUri, id)); @@ -1564,27 +1564,27 @@ TEST_F(WebRtcVideoChannel2Test, SetRecvRtpHeaderExtensionsRejectsDuplicateIds) { EXPECT_FALSE(channel_->SetRecvParameters(recv_parameters_)); } -TEST_F(WebRtcVideoChannel2Test, AddRecvStreamOnlyUsesOneReceiveStream) { +TEST_F(WebRtcVideoChannelTest, AddRecvStreamOnlyUsesOneReceiveStream) { EXPECT_TRUE(channel_->AddRecvStream(cricket::StreamParams::CreateLegacy(1))); EXPECT_EQ(1u, fake_call_->GetVideoReceiveStreams().size()); } -TEST_F(WebRtcVideoChannel2Test, RtcpIsCompoundByDefault) { +TEST_F(WebRtcVideoChannelTest, RtcpIsCompoundByDefault) { FakeVideoReceiveStream* stream = AddRecvStream(); EXPECT_EQ(webrtc::RtcpMode::kCompound, stream->GetConfig().rtp.rtcp_mode); } -TEST_F(WebRtcVideoChannel2Test, RembIsEnabledByDefault) { +TEST_F(WebRtcVideoChannelTest, RembIsEnabledByDefault) { FakeVideoReceiveStream* stream = AddRecvStream(); EXPECT_TRUE(stream->GetConfig().rtp.remb); } -TEST_F(WebRtcVideoChannel2Test, TransportCcIsEnabledByDefault) { +TEST_F(WebRtcVideoChannelTest, TransportCcIsEnabledByDefault) { FakeVideoReceiveStream* stream = AddRecvStream(); EXPECT_TRUE(stream->GetConfig().rtp.transport_cc); } -TEST_F(WebRtcVideoChannel2Test, RembCanBeEnabledAndDisabled) { +TEST_F(WebRtcVideoChannelTest, RembCanBeEnabledAndDisabled) { FakeVideoReceiveStream* stream = AddRecvStream(); EXPECT_TRUE(stream->GetConfig().rtp.remb); @@ -1604,7 +1604,7 @@ TEST_F(WebRtcVideoChannel2Test, RembCanBeEnabledAndDisabled) { EXPECT_TRUE(stream->GetConfig().rtp.remb); } -TEST_F(WebRtcVideoChannel2Test, TransportCcCanBeEnabledAndDisabled) { +TEST_F(WebRtcVideoChannelTest, TransportCcCanBeEnabledAndDisabled) { FakeVideoReceiveStream* stream = AddRecvStream(); EXPECT_TRUE(stream->GetConfig().rtp.transport_cc); @@ -1625,7 +1625,7 @@ TEST_F(WebRtcVideoChannel2Test, TransportCcCanBeEnabledAndDisabled) { EXPECT_TRUE(stream->GetConfig().rtp.transport_cc); } -TEST_F(WebRtcVideoChannel2Test, NackIsEnabledByDefault) { +TEST_F(WebRtcVideoChannelTest, NackIsEnabledByDefault) { VerifyCodecHasDefaultFeedbackParams(default_codec_); cricket::VideoSendParameters parameters; @@ -1648,7 +1648,7 @@ TEST_F(WebRtcVideoChannel2Test, NackIsEnabledByDefault) { recv_stream->GetConfig().rtp.nack.rtp_history_ms); } -TEST_F(WebRtcVideoChannel2Test, NackCanBeEnabledAndDisabled) { +TEST_F(WebRtcVideoChannelTest, NackCanBeEnabledAndDisabled) { FakeVideoSendStream* send_stream = AddSendStream(); FakeVideoReceiveStream* recv_stream = AddRecvStream(); @@ -1680,7 +1680,7 @@ TEST_F(WebRtcVideoChannel2Test, NackCanBeEnabledAndDisabled) { // possible once we start sending. Likely the frames being input are from the // same source that will be sent later, which just means that we're ready // earlier. -TEST_F(WebRtcVideoChannel2Test, ReconfiguresEncodersWhenNotSending) { +TEST_F(WebRtcVideoChannelTest, ReconfiguresEncodersWhenNotSending) { cricket::VideoSendParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); ASSERT_TRUE(channel_->SetSendParameters(parameters)); @@ -1707,7 +1707,7 @@ TEST_F(WebRtcVideoChannel2Test, ReconfiguresEncodersWhenNotSending) { EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr)); } -TEST_F(WebRtcVideoChannel2Test, UsesCorrectSettingsForScreencast) { +TEST_F(WebRtcVideoChannelTest, UsesCorrectSettingsForScreencast) { static const int kScreenshareMinBitrateKbps = 800; cricket::VideoCodec codec = GetEngineCodec("VP8"); cricket::VideoSendParameters parameters; @@ -1772,7 +1772,7 @@ TEST_F(WebRtcVideoChannel2Test, UsesCorrectSettingsForScreencast) { EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr)); } -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, ConferenceModeScreencastConfiguresTemporalLayer) { static const int kConferenceScreencastTemporalBitrateBps = ScreenshareLayerConfig::GetDefault().tl0_bitrate_kbps * 1000; @@ -1811,12 +1811,12 @@ TEST_F(WebRtcVideoChannel2Test, EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr)); } -TEST_F(WebRtcVideoChannel2Test, SuspendBelowMinBitrateDisabledByDefault) { +TEST_F(WebRtcVideoChannelTest, SuspendBelowMinBitrateDisabledByDefault) { FakeVideoSendStream* stream = AddSendStream(); EXPECT_FALSE(stream->GetConfig().suspend_below_min_bitrate); } -TEST_F(WebRtcVideoChannel2Test, SetMediaConfigSuspendBelowMinBitrate) { +TEST_F(WebRtcVideoChannelTest, SetMediaConfigSuspendBelowMinBitrate) { MediaConfig media_config = GetMediaConfig(); media_config.video.suspend_below_min_bitrate = true; @@ -1840,14 +1840,14 @@ TEST_F(WebRtcVideoChannel2Test, SetMediaConfigSuspendBelowMinBitrate) { EXPECT_FALSE(stream->GetConfig().suspend_below_min_bitrate); } -TEST_F(WebRtcVideoChannel2Test, Vp8DenoisingEnabledByDefault) { +TEST_F(WebRtcVideoChannelTest, Vp8DenoisingEnabledByDefault) { FakeVideoSendStream* stream = AddSendStream(); webrtc::VideoCodecVP8 vp8_settings; ASSERT_TRUE(stream->GetVp8Settings(&vp8_settings)) << "No VP8 config set."; EXPECT_TRUE(vp8_settings.denoisingOn); } -TEST_F(WebRtcVideoChannel2Test, VerifyVp8SpecificSettings) { +TEST_F(WebRtcVideoChannelTest, VerifyVp8SpecificSettings) { cricket::VideoSendParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); ASSERT_TRUE(channel_->SetSendParameters(parameters)); @@ -1922,7 +1922,7 @@ TEST_F(WebRtcVideoChannel2Test, VerifyVp8SpecificSettings) { // Test that setting the same options doesn't result in the encoder being // reconfigured. -TEST_F(WebRtcVideoChannel2Test, SetIdenticalOptionsDoesntReconfigureEncoder) { +TEST_F(WebRtcVideoChannelTest, SetIdenticalOptionsDoesntReconfigureEncoder) { VideoOptions options; cricket::FakeVideoCapturer capturer; @@ -1952,11 +1952,11 @@ TEST_F(WebRtcVideoChannel2Test, SetIdenticalOptionsDoesntReconfigureEncoder) { EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr)); } -class Vp9SettingsTest : public WebRtcVideoChannel2Test { +class Vp9SettingsTest : public WebRtcVideoChannelTest { public: Vp9SettingsTest() : Vp9SettingsTest("") {} explicit Vp9SettingsTest(const char* field_trials) - : WebRtcVideoChannel2Test(field_trials) { + : WebRtcVideoChannelTest(field_trials) { encoder_factory_.AddSupportedVideoCodecType("VP9"); } virtual ~Vp9SettingsTest() {} @@ -1965,7 +1965,7 @@ class Vp9SettingsTest : public WebRtcVideoChannel2Test { void SetUp() override { engine_.SetExternalEncoderFactory(&encoder_factory_); - WebRtcVideoChannel2Test::SetUp(); + WebRtcVideoChannelTest::SetUp(); } void TearDown() override { @@ -2097,19 +2097,19 @@ TEST_F(Vp9SettingsTestWith2SL3TLFlag, VerifySettings) { VerifySettings(kNumSpatialLayers, kNumTemporalLayers); } -TEST_F(WebRtcVideoChannel2Test, AdaptsOnOveruse) { +TEST_F(WebRtcVideoChannelTest, AdaptsOnOveruse) { TestCpuAdaptation(true, false); } -TEST_F(WebRtcVideoChannel2Test, DoesNotAdaptOnOveruseWhenDisabled) { +TEST_F(WebRtcVideoChannelTest, DoesNotAdaptOnOveruseWhenDisabled) { TestCpuAdaptation(false, false); } -TEST_F(WebRtcVideoChannel2Test, DoesNotAdaptOnOveruseWhenScreensharing) { +TEST_F(WebRtcVideoChannelTest, DoesNotAdaptOnOveruseWhenScreensharing) { TestCpuAdaptation(true, true); } -TEST_F(WebRtcVideoChannel2Test, AdaptsOnOveruseAndChangeResolution) { +TEST_F(WebRtcVideoChannelTest, AdaptsOnOveruseAndChangeResolution) { cricket::VideoCodec codec = GetEngineCodec("VP8"); cricket::VideoSendParameters parameters; parameters.codecs.push_back(codec); @@ -2189,7 +2189,7 @@ TEST_F(WebRtcVideoChannel2Test, AdaptsOnOveruseAndChangeResolution) { EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr)); } -TEST_F(WebRtcVideoChannel2Test, PreviousAdaptationDoesNotApplyToScreenshare) { +TEST_F(WebRtcVideoChannelTest, PreviousAdaptationDoesNotApplyToScreenshare) { cricket::VideoCodec codec = GetEngineCodec("VP8"); cricket::VideoSendParameters parameters; parameters.codecs.push_back(codec); @@ -2263,8 +2263,8 @@ TEST_F(WebRtcVideoChannel2Test, PreviousAdaptationDoesNotApplyToScreenshare) { EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr)); } -void WebRtcVideoChannel2Test::TestCpuAdaptation(bool enable_overuse, - bool is_screenshare) { +void WebRtcVideoChannelTest::TestCpuAdaptation(bool enable_overuse, + bool is_screenshare) { const int kDefaultFps = 30; cricket::VideoCodec codec = GetEngineCodec("VP8"); cricket::VideoSendParameters parameters; @@ -2369,7 +2369,7 @@ void WebRtcVideoChannel2Test::TestCpuAdaptation(bool enable_overuse, EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr)); } -TEST_F(WebRtcVideoChannel2Test, EstimatesNtpStartTimeCorrectly) { +TEST_F(WebRtcVideoChannelTest, EstimatesNtpStartTimeCorrectly) { // Start at last timestamp to verify that wraparounds are estimated correctly. static const uint32_t kInitialTimestamp = 0xFFFFFFFFu; static const int64_t kInitialNtpTimeMs = 1247891230; @@ -2405,7 +2405,7 @@ TEST_F(WebRtcVideoChannel2Test, EstimatesNtpStartTimeCorrectly) { EXPECT_EQ(kInitialNtpTimeMs, info.receivers[0].capture_start_ntp_time_ms); } -TEST_F(WebRtcVideoChannel2Test, SetDefaultSendCodecs) { +TEST_F(WebRtcVideoChannelTest, SetDefaultSendCodecs) { ASSERT_TRUE(channel_->SetSendParameters(send_parameters_)); VideoCodec codec; @@ -2434,7 +2434,7 @@ TEST_F(WebRtcVideoChannel2Test, SetDefaultSendCodecs) { // when the field trials are not enabled. // TODO(brandtr): Remove or update these tests when FlexFEC _is_ enabled by // default. -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, FlexfecSendCodecWithoutSsrcNotExposedByDefault) { FakeVideoSendStream* stream = AddSendStream(); webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); @@ -2444,7 +2444,7 @@ TEST_F(WebRtcVideoChannel2Test, EXPECT_TRUE(config.rtp.flexfec.protected_media_ssrcs.empty()); } -TEST_F(WebRtcVideoChannel2Test, FlexfecSendCodecWithSsrcNotExposedByDefault) { +TEST_F(WebRtcVideoChannelTest, FlexfecSendCodecWithSsrcNotExposedByDefault) { FakeVideoSendStream* stream = AddSendStream( CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc)); webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); @@ -2454,7 +2454,7 @@ TEST_F(WebRtcVideoChannel2Test, FlexfecSendCodecWithSsrcNotExposedByDefault) { EXPECT_TRUE(config.rtp.flexfec.protected_media_ssrcs.empty()); } -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, FlexfecRecvCodecWithoutSsrcNotExposedByDefault) { AddRecvStream(); @@ -2463,7 +2463,7 @@ TEST_F(WebRtcVideoChannel2Test, EXPECT_TRUE(streams.empty()); } -TEST_F(WebRtcVideoChannel2Test, FlexfecRecvCodecWithSsrcNotExposedByDefault) { +TEST_F(WebRtcVideoChannelTest, FlexfecRecvCodecWithSsrcNotExposedByDefault) { AddRecvStream( CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc)); @@ -2475,19 +2475,19 @@ TEST_F(WebRtcVideoChannel2Test, FlexfecRecvCodecWithSsrcNotExposedByDefault) { // TODO(brandtr): When FlexFEC is no longer behind a field trial, merge all // tests that use this test fixture into the corresponding "non-field trial" // tests. -class WebRtcVideoChannel2FlexfecRecvTest : public WebRtcVideoChannel2Test { +class WebRtcVideoChannelFlexfecRecvTest : public WebRtcVideoChannelTest { public: - WebRtcVideoChannel2FlexfecRecvTest() - : WebRtcVideoChannel2Test("WebRTC-FlexFEC-03-Advertised/Enabled/") {} + WebRtcVideoChannelFlexfecRecvTest() + : WebRtcVideoChannelTest("WebRTC-FlexFEC-03-Advertised/Enabled/") {} }; -TEST_F(WebRtcVideoChannel2FlexfecRecvTest, +TEST_F(WebRtcVideoChannelFlexfecRecvTest, DefaultFlexfecCodecHasTransportCcAndRembFeedbackParam) { EXPECT_TRUE(cricket::HasTransportCc(GetEngineCodec("flexfec-03"))); EXPECT_TRUE(cricket::HasRemb(GetEngineCodec("flexfec-03"))); } -TEST_F(WebRtcVideoChannel2FlexfecRecvTest, SetDefaultRecvCodecsWithoutSsrc) { +TEST_F(WebRtcVideoChannelFlexfecRecvTest, SetDefaultRecvCodecsWithoutSsrc) { AddRecvStream(); const std::vector& streams = @@ -2495,7 +2495,7 @@ TEST_F(WebRtcVideoChannel2FlexfecRecvTest, SetDefaultRecvCodecsWithoutSsrc) { EXPECT_TRUE(streams.empty()); } -TEST_F(WebRtcVideoChannel2FlexfecRecvTest, SetDefaultRecvCodecsWithSsrc) { +TEST_F(WebRtcVideoChannelFlexfecRecvTest, SetDefaultRecvCodecsWithSsrc) { AddRecvStream( CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc)); @@ -2510,7 +2510,7 @@ TEST_F(WebRtcVideoChannel2FlexfecRecvTest, SetDefaultRecvCodecsWithSsrc) { EXPECT_EQ(kSsrcs1[0], config.protected_media_ssrcs[0]); } -TEST_F(WebRtcVideoChannel2FlexfecRecvTest, +TEST_F(WebRtcVideoChannelFlexfecRecvTest, EnablingFlexfecDoesNotRecreateVideoReceiveStream) { cricket::VideoRecvParameters recv_parameters; recv_parameters.codecs.push_back(GetEngineCodec("VP8")); @@ -2532,7 +2532,7 @@ TEST_F(WebRtcVideoChannel2FlexfecRecvTest, << "Enabling FlexFEC should create a single FlexfecReceiveStream."; } -TEST_F(WebRtcVideoChannel2FlexfecRecvTest, +TEST_F(WebRtcVideoChannelFlexfecRecvTest, DisablingFlexfecDoesNotRecreateVideoReceiveStream) { cricket::VideoRecvParameters recv_parameters; recv_parameters.codecs.push_back(GetEngineCodec("VP8")); @@ -2560,15 +2560,15 @@ TEST_F(WebRtcVideoChannel2FlexfecRecvTest, // TODO(brandtr): When FlexFEC is no longer behind a field trial, merge all // tests that use this test fixture into the corresponding "non-field trial" // tests. -class WebRtcVideoChannel2FlexfecSendRecvTest : public WebRtcVideoChannel2Test { +class WebRtcVideoChannelFlexfecSendRecvTest : public WebRtcVideoChannelTest { public: - WebRtcVideoChannel2FlexfecSendRecvTest() - : WebRtcVideoChannel2Test( + WebRtcVideoChannelFlexfecSendRecvTest() + : WebRtcVideoChannelTest( "WebRTC-FlexFEC-03-Advertised/Enabled/WebRTC-FlexFEC-03/Enabled/") { } }; -TEST_F(WebRtcVideoChannel2FlexfecSendRecvTest, +TEST_F(WebRtcVideoChannelFlexfecSendRecvTest, SetDefaultSendCodecsWithoutSsrc) { FakeVideoSendStream* stream = AddSendStream(); webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); @@ -2578,7 +2578,7 @@ TEST_F(WebRtcVideoChannel2FlexfecSendRecvTest, EXPECT_TRUE(config.rtp.flexfec.protected_media_ssrcs.empty()); } -TEST_F(WebRtcVideoChannel2FlexfecSendRecvTest, SetDefaultSendCodecsWithSsrc) { +TEST_F(WebRtcVideoChannelFlexfecSendRecvTest, SetDefaultSendCodecsWithSsrc) { FakeVideoSendStream* stream = AddSendStream( CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc)); webrtc::VideoSendStream::Config config = stream->GetConfig().Copy(); @@ -2589,7 +2589,7 @@ TEST_F(WebRtcVideoChannel2FlexfecSendRecvTest, SetDefaultSendCodecsWithSsrc) { EXPECT_EQ(kSsrcs1[0], config.rtp.flexfec.protected_media_ssrcs[0]); } -TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithoutFec) { +TEST_F(WebRtcVideoChannelTest, SetSendCodecsWithoutFec) { cricket::VideoSendParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); ASSERT_TRUE(channel_->SetSendParameters(parameters)); @@ -2601,7 +2601,7 @@ TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithoutFec) { EXPECT_EQ(-1, config.rtp.ulpfec.red_payload_type); } -TEST_F(WebRtcVideoChannel2FlexfecSendRecvTest, SetSendCodecsWithoutFec) { +TEST_F(WebRtcVideoChannelFlexfecSendRecvTest, SetSendCodecsWithoutFec) { cricket::VideoSendParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); ASSERT_TRUE(channel_->SetSendParameters(parameters)); @@ -2612,7 +2612,7 @@ TEST_F(WebRtcVideoChannel2FlexfecSendRecvTest, SetSendCodecsWithoutFec) { EXPECT_EQ(-1, config.rtp.flexfec.payload_type); } -TEST_F(WebRtcVideoChannel2FlexfecRecvTest, SetRecvCodecsWithFec) { +TEST_F(WebRtcVideoChannelFlexfecRecvTest, SetRecvCodecsWithFec) { AddRecvStream( CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc)); @@ -2654,7 +2654,7 @@ TEST_F(WebRtcVideoChannel2FlexfecRecvTest, SetRecvCodecsWithFec) { // We should not send FlexFEC, even if we advertise it, unless the right // field trial is set. // TODO(brandtr): Remove when FlexFEC is enabled by default. -TEST_F(WebRtcVideoChannel2FlexfecRecvTest, +TEST_F(WebRtcVideoChannelFlexfecRecvTest, SetSendCodecsWithoutSsrcWithFecDoesNotEnableFec) { cricket::VideoSendParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); @@ -2669,7 +2669,7 @@ TEST_F(WebRtcVideoChannel2FlexfecRecvTest, EXPECT_TRUE(config.rtp.flexfec.protected_media_ssrcs.empty()); } -TEST_F(WebRtcVideoChannel2FlexfecRecvTest, +TEST_F(WebRtcVideoChannelFlexfecRecvTest, SetSendCodecsWithSsrcWithFecDoesNotEnableFec) { cricket::VideoSendParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); @@ -2685,7 +2685,7 @@ TEST_F(WebRtcVideoChannel2FlexfecRecvTest, EXPECT_TRUE(config.rtp.flexfec.protected_media_ssrcs.empty()); } -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, SetSendCodecRejectsRtxWithoutAssociatedPayloadType) { const int kUnusedPayloadType = 127; EXPECT_FALSE(FindCodecById(engine_.codecs(), kUnusedPayloadType)); @@ -2697,7 +2697,7 @@ TEST_F(WebRtcVideoChannel2Test, << "RTX codec without associated payload type should be rejected."; } -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, SetSendCodecRejectsRtxWithoutMatchingVideoCodec) { const int kUnusedPayloadType1 = 126; const int kUnusedPayloadType2 = 127; @@ -2722,7 +2722,7 @@ TEST_F(WebRtcVideoChannel2Test, } } -TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithChangedRtxPayloadType) { +TEST_F(WebRtcVideoChannelTest, SetSendCodecsWithChangedRtxPayloadType) { const int kUnusedPayloadType1 = 126; const int kUnusedPayloadType2 = 127; EXPECT_FALSE(FindCodecById(engine_.codecs(), kUnusedPayloadType1)); @@ -2759,7 +2759,7 @@ TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithChangedRtxPayloadType) { EXPECT_EQ(kRtxSsrcs1[0], config_after.rtp.rtx.ssrcs[0]); } -TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithoutFecDisablesFec) { +TEST_F(WebRtcVideoChannelTest, SetSendCodecsWithoutFecDisablesFec) { cricket::VideoSendParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); parameters.codecs.push_back(GetEngineCodec("ulpfec")); @@ -2779,7 +2779,7 @@ TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithoutFecDisablesFec) { << "SetSendCodec without ULPFEC should disable current ULPFEC."; } -TEST_F(WebRtcVideoChannel2FlexfecSendRecvTest, +TEST_F(WebRtcVideoChannelFlexfecSendRecvTest, SetSendCodecsWithoutFecDisablesFec) { cricket::VideoSendParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); @@ -2804,7 +2804,7 @@ TEST_F(WebRtcVideoChannel2FlexfecSendRecvTest, << "SetSendCodec without FlexFEC should disable current FlexFEC."; } -TEST_F(WebRtcVideoChannel2Test, SetSendCodecsChangesExistingStreams) { +TEST_F(WebRtcVideoChannelTest, SetSendCodecsChangesExistingStreams) { cricket::VideoSendParameters parameters; cricket::VideoCodec codec(100, "VP8"); codec.SetParam(kCodecParamMaxQuantization, kDefaultQpMax); @@ -2829,29 +2829,29 @@ TEST_F(WebRtcVideoChannel2Test, SetSendCodecsChangesExistingStreams) { EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr)); } -TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithBitrates) { +TEST_F(WebRtcVideoChannelTest, SetSendCodecsWithBitrates) { SetSendCodecsShouldWorkForBitrates("100", 100000, "150", 150000, "200", 200000); } -TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithHighMaxBitrate) { +TEST_F(WebRtcVideoChannelTest, SetSendCodecsWithHighMaxBitrate) { SetSendCodecsShouldWorkForBitrates("", 0, "", -1, "10000", 10000000); std::vector streams = AddSendStream()->GetVideoStreams(); ASSERT_EQ(1u, streams.size()); EXPECT_EQ(10000000, streams[0].max_bitrate_bps); } -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, SetSendCodecsWithoutBitratesUsesCorrectDefaults) { SetSendCodecsShouldWorkForBitrates( "", 0, "", -1, "", -1); } -TEST_F(WebRtcVideoChannel2Test, SetSendCodecsCapsMinAndStartBitrate) { +TEST_F(WebRtcVideoChannelTest, SetSendCodecsCapsMinAndStartBitrate) { SetSendCodecsShouldWorkForBitrates("-1", 0, "-100", -1, "", -1); } -TEST_F(WebRtcVideoChannel2Test, SetSendCodecsRejectsMaxLessThanMinBitrate) { +TEST_F(WebRtcVideoChannelTest, SetSendCodecsRejectsMaxLessThanMinBitrate) { send_parameters_.codecs[0].params[kCodecParamMinBitrate] = "300"; send_parameters_.codecs[0].params[kCodecParamMaxBitrate] = "200"; EXPECT_FALSE(channel_->SetSendParameters(send_parameters_)); @@ -2859,7 +2859,7 @@ TEST_F(WebRtcVideoChannel2Test, SetSendCodecsRejectsMaxLessThanMinBitrate) { // Test that when both the codec-specific bitrate params and max_bandwidth_bps // are present in the same send parameters, the settings are combined correctly. -TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithBitratesAndMaxSendBandwidth) { +TEST_F(WebRtcVideoChannelTest, SetSendCodecsWithBitratesAndMaxSendBandwidth) { send_parameters_.codecs[0].params[kCodecParamMinBitrate] = "100"; send_parameters_.codecs[0].params[kCodecParamStartBitrate] = "200"; send_parameters_.codecs[0].params[kCodecParamMaxBitrate] = "300"; @@ -2894,7 +2894,7 @@ TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithBitratesAndMaxSendBandwidth) { EXPECT_EQ(300000, fake_call_->GetConfig().bitrate_config.max_bitrate_bps); } -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, SetMaxSendBandwidthShouldPreserveOtherBitrates) { SetSendCodecsShouldWorkForBitrates("100", 100000, "150", 150000, "200", 200000); @@ -2907,7 +2907,7 @@ TEST_F(WebRtcVideoChannel2Test, EXPECT_EQ(300000, fake_call_->GetConfig().bitrate_config.max_bitrate_bps); } -TEST_F(WebRtcVideoChannel2Test, SetMaxSendBandwidthShouldBeRemovable) { +TEST_F(WebRtcVideoChannelTest, SetMaxSendBandwidthShouldBeRemovable) { send_parameters_.max_bandwidth_bps = 300000; EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); EXPECT_EQ(300000, fake_call_->GetConfig().bitrate_config.max_bitrate_bps); @@ -2918,7 +2918,7 @@ TEST_F(WebRtcVideoChannel2Test, SetMaxSendBandwidthShouldBeRemovable) { << "Setting zero max bitrate did not reset start bitrate."; } -TEST_F(WebRtcVideoChannel2Test, SetMaxSendBandwidthAndAddSendStream) { +TEST_F(WebRtcVideoChannelTest, SetMaxSendBandwidthAndAddSendStream) { send_parameters_.max_bandwidth_bps = 99999; FakeVideoSendStream* stream = AddSendStream(); ASSERT_TRUE(channel_->SetSendParameters(send_parameters_)); @@ -2936,7 +2936,7 @@ TEST_F(WebRtcVideoChannel2Test, SetMaxSendBandwidthAndAddSendStream) { stream->GetVideoStreams()[0].max_bitrate_bps); } -TEST_F(WebRtcVideoChannel2Test, SetMaxSendBitrateCanIncreaseSenderBitrate) { +TEST_F(WebRtcVideoChannelTest, SetMaxSendBitrateCanIncreaseSenderBitrate) { cricket::VideoSendParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); ASSERT_TRUE(channel_->SetSendParameters(parameters)); @@ -2962,7 +2962,7 @@ TEST_F(WebRtcVideoChannel2Test, SetMaxSendBitrateCanIncreaseSenderBitrate) { EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr)); } -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, SetMaxSendBitrateCanIncreaseSimulcastSenderBitrate) { cricket::VideoSendParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); @@ -2996,7 +2996,7 @@ TEST_F(WebRtcVideoChannel2Test, EXPECT_TRUE(channel_->SetVideoSend(kSsrcs3[0], true, nullptr, nullptr)); } -TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithMaxQuantization) { +TEST_F(WebRtcVideoChannelTest, SetSendCodecsWithMaxQuantization) { static const char* kMaxQuantization = "21"; cricket::VideoSendParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); @@ -3010,7 +3010,7 @@ TEST_F(WebRtcVideoChannel2Test, SetSendCodecsWithMaxQuantization) { EXPECT_EQ(kMaxQuantization, codec.params[kCodecParamMaxQuantization]); } -TEST_F(WebRtcVideoChannel2Test, SetSendCodecsRejectBadPayloadTypes) { +TEST_F(WebRtcVideoChannelTest, SetSendCodecsRejectBadPayloadTypes) { // TODO(pbos): Should we only allow the dynamic range? static const int kIncorrectPayloads[] = {-2, -1, 128, 129}; cricket::VideoSendParameters parameters; @@ -3022,7 +3022,7 @@ TEST_F(WebRtcVideoChannel2Test, SetSendCodecsRejectBadPayloadTypes) { } } -TEST_F(WebRtcVideoChannel2Test, SetSendCodecsAcceptAllValidPayloadTypes) { +TEST_F(WebRtcVideoChannelTest, SetSendCodecsAcceptAllValidPayloadTypes) { cricket::VideoSendParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); for (int payload_type = 96; payload_type <= 127; ++payload_type) { @@ -3036,7 +3036,7 @@ TEST_F(WebRtcVideoChannel2Test, SetSendCodecsAcceptAllValidPayloadTypes) { // codec doesn't result in the stream being recreated. // This may happen when a subsequent negotiation includes fewer codecs, as a // result of one of the codecs being rejected. -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, SetSendCodecsIdenticalFirstCodecDoesntRecreateStream) { cricket::VideoSendParameters parameters1; parameters1.codecs.push_back(GetEngineCodec("VP8")); @@ -3052,14 +3052,14 @@ TEST_F(WebRtcVideoChannel2Test, EXPECT_EQ(1, fake_call_->GetNumCreatedSendStreams()); } -TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithOnlyVp8) { +TEST_F(WebRtcVideoChannelTest, SetRecvCodecsWithOnlyVp8) { cricket::VideoRecvParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); EXPECT_TRUE(channel_->SetRecvParameters(parameters)); } // Test that we set our inbound RTX codecs properly. -TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithRtx) { +TEST_F(WebRtcVideoChannelTest, SetRecvCodecsWithRtx) { const int kUnusedPayloadType1 = 126; const int kUnusedPayloadType2 = 127; EXPECT_FALSE(FindCodecById(engine_.codecs(), kUnusedPayloadType1)); @@ -3088,7 +3088,7 @@ TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithRtx) { "rejected."; } -TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithChangedRtxPayloadType) { +TEST_F(WebRtcVideoChannelTest, SetRecvCodecsWithChangedRtxPayloadType) { const int kUnusedPayloadType1 = 126; const int kUnusedPayloadType2 = 127; EXPECT_FALSE(FindCodecById(engine_.codecs(), kUnusedPayloadType1)); @@ -3131,14 +3131,14 @@ TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithChangedRtxPayloadType) { EXPECT_EQ(kRtxSsrcs1[0], config_after.rtp.rtx_ssrc); } -TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsDifferentPayloadType) { +TEST_F(WebRtcVideoChannelTest, SetRecvCodecsDifferentPayloadType) { cricket::VideoRecvParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); parameters.codecs[0].id = 99; EXPECT_TRUE(channel_->SetRecvParameters(parameters)); } -TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsAcceptDefaultCodecs) { +TEST_F(WebRtcVideoChannelTest, SetRecvCodecsAcceptDefaultCodecs) { cricket::VideoRecvParameters parameters; parameters.codecs = engine_.codecs(); EXPECT_TRUE(channel_->SetRecvParameters(parameters)); @@ -3149,21 +3149,21 @@ TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsAcceptDefaultCodecs) { EXPECT_EQ(engine_.codecs()[0].id, config.decoders[0].payload_type); } -TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsRejectUnsupportedCodec) { +TEST_F(WebRtcVideoChannelTest, SetRecvCodecsRejectUnsupportedCodec) { cricket::VideoRecvParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); parameters.codecs.push_back(VideoCodec(101, "WTF3")); EXPECT_FALSE(channel_->SetRecvParameters(parameters)); } -TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsAcceptsMultipleVideoCodecs) { +TEST_F(WebRtcVideoChannelTest, SetRecvCodecsAcceptsMultipleVideoCodecs) { cricket::VideoRecvParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); parameters.codecs.push_back(GetEngineCodec("VP9")); EXPECT_TRUE(channel_->SetRecvParameters(parameters)); } -TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithoutFecDisablesFec) { +TEST_F(WebRtcVideoChannelTest, SetRecvCodecsWithoutFecDisablesFec) { cricket::VideoSendParameters send_parameters; send_parameters.codecs.push_back(GetEngineCodec("VP8")); send_parameters.codecs.push_back(GetEngineCodec("red")); @@ -3184,7 +3184,7 @@ TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsWithoutFecDisablesFec) { << "SetSendCodec without ULPFEC should disable current ULPFEC."; } -TEST_F(WebRtcVideoChannel2FlexfecRecvTest, SetRecvParamsWithoutFecDisablesFec) { +TEST_F(WebRtcVideoChannelFlexfecRecvTest, SetRecvParamsWithoutFecDisablesFec) { AddRecvStream( CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc)); const std::vector& streams = @@ -3204,7 +3204,7 @@ TEST_F(WebRtcVideoChannel2FlexfecRecvTest, SetRecvParamsWithoutFecDisablesFec) { << "SetSendCodec without FlexFEC should disable current FlexFEC."; } -TEST_F(WebRtcVideoChannel2Test, SetSendParamsWithFecEnablesFec) { +TEST_F(WebRtcVideoChannelTest, SetSendParamsWithFecEnablesFec) { FakeVideoReceiveStream* stream = AddRecvStream(); EXPECT_EQ(GetEngineCodec("ulpfec").id, stream->GetConfig().rtp.ulpfec.ulpfec_payload_type); @@ -3231,7 +3231,7 @@ TEST_F(WebRtcVideoChannel2Test, SetSendParamsWithFecEnablesFec) { << "ULPFEC should be enabled on the receive stream."; } -TEST_F(WebRtcVideoChannel2FlexfecSendRecvTest, +TEST_F(WebRtcVideoChannelFlexfecSendRecvTest, SetSendRecvParamsWithFecEnablesFec) { AddRecvStream( CreatePrimaryWithFecFrStreamParams("cname", kSsrcs1[0], kFlexfecSsrc)); @@ -3267,7 +3267,7 @@ TEST_F(WebRtcVideoChannel2FlexfecSendRecvTest, stream_with_send_params->GetConfig().protected_media_ssrcs[0]); } -TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsRejectDuplicateFecPayloads) { +TEST_F(WebRtcVideoChannelTest, SetRecvCodecsRejectDuplicateFecPayloads) { cricket::VideoRecvParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); parameters.codecs.push_back(GetEngineCodec("red")); @@ -3275,7 +3275,7 @@ TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsRejectDuplicateFecPayloads) { EXPECT_FALSE(channel_->SetRecvParameters(parameters)); } -TEST_F(WebRtcVideoChannel2FlexfecRecvTest, +TEST_F(WebRtcVideoChannelFlexfecRecvTest, SetRecvCodecsRejectDuplicateFecPayloads) { cricket::VideoRecvParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); @@ -3284,7 +3284,7 @@ TEST_F(WebRtcVideoChannel2FlexfecRecvTest, EXPECT_FALSE(channel_->SetRecvParameters(parameters)); } -TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsRejectDuplicateCodecPayloads) { +TEST_F(WebRtcVideoChannelTest, SetRecvCodecsRejectDuplicateCodecPayloads) { cricket::VideoRecvParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); parameters.codecs.push_back(GetEngineCodec("VP9")); @@ -3292,7 +3292,7 @@ TEST_F(WebRtcVideoChannel2Test, SetRecvCodecsRejectDuplicateCodecPayloads) { EXPECT_FALSE(channel_->SetRecvParameters(parameters)); } -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, SetRecvCodecsAcceptSameCodecOnMultiplePayloadTypes) { cricket::VideoRecvParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); @@ -3303,7 +3303,7 @@ TEST_F(WebRtcVideoChannel2Test, // Test that setting the same codecs but with a different order // doesn't result in the stream being recreated. -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, SetRecvCodecsDifferentOrderDoesntRecreateStream) { cricket::VideoRecvParameters parameters1; parameters1.codecs.push_back(GetEngineCodec("VP8")); @@ -3320,15 +3320,15 @@ TEST_F(WebRtcVideoChannel2Test, EXPECT_EQ(1, fake_call_->GetNumCreatedReceiveStreams()); } -TEST_F(WebRtcVideoChannel2Test, SendStreamNotSendingByDefault) { +TEST_F(WebRtcVideoChannelTest, SendStreamNotSendingByDefault) { EXPECT_FALSE(AddSendStream()->IsSending()); } -TEST_F(WebRtcVideoChannel2Test, ReceiveStreamReceivingByDefault) { +TEST_F(WebRtcVideoChannelTest, ReceiveStreamReceivingByDefault) { EXPECT_TRUE(AddRecvStream()->IsReceiving()); } -TEST_F(WebRtcVideoChannel2Test, SetSend) { +TEST_F(WebRtcVideoChannelTest, SetSend) { FakeVideoSendStream* stream = AddSendStream(); EXPECT_FALSE(stream->IsSending()); @@ -3352,7 +3352,7 @@ TEST_F(WebRtcVideoChannel2Test, SetSend) { } // This test verifies DSCP settings are properly applied on video media channel. -TEST_F(WebRtcVideoChannel2Test, TestSetDscpOptions) { +TEST_F(WebRtcVideoChannelTest, TestSetDscpOptions) { std::unique_ptr network_interface( new cricket::FakeNetworkInterface); MediaConfig config; @@ -3378,7 +3378,7 @@ TEST_F(WebRtcVideoChannel2Test, TestSetDscpOptions) { // This test verifies that the RTCP reduced size mode is properly applied to // send video streams. -TEST_F(WebRtcVideoChannel2Test, TestSetSendRtcpReducedSize) { +TEST_F(WebRtcVideoChannelTest, TestSetSendRtcpReducedSize) { // Create stream, expecting that default mode is "compound". FakeVideoSendStream* stream1 = AddSendStream(); EXPECT_EQ(webrtc::RtcpMode::kCompound, stream1->GetConfig().rtp.rtcp_mode); @@ -3396,7 +3396,7 @@ TEST_F(WebRtcVideoChannel2Test, TestSetSendRtcpReducedSize) { // This test verifies that the RTCP reduced size mode is properly applied to // receive video streams. -TEST_F(WebRtcVideoChannel2Test, TestSetRecvRtcpReducedSize) { +TEST_F(WebRtcVideoChannelTest, TestSetRecvRtcpReducedSize) { // Create stream, expecting that default mode is "compound". FakeVideoReceiveStream* stream1 = AddRecvStream(); EXPECT_EQ(webrtc::RtcpMode::kCompound, stream1->GetConfig().rtp.rtcp_mode); @@ -3414,7 +3414,7 @@ TEST_F(WebRtcVideoChannel2Test, TestSetRecvRtcpReducedSize) { EXPECT_EQ(webrtc::RtcpMode::kReducedSize, stream2->GetConfig().rtp.rtcp_mode); } -TEST_F(WebRtcVideoChannel2Test, OnReadyToSendSignalsNetworkState) { +TEST_F(WebRtcVideoChannelTest, OnReadyToSendSignalsNetworkState) { EXPECT_EQ(webrtc::kNetworkUp, fake_call_->GetNetworkState(webrtc::MediaType::VIDEO)); EXPECT_EQ(webrtc::kNetworkUp, @@ -3433,7 +3433,7 @@ TEST_F(WebRtcVideoChannel2Test, OnReadyToSendSignalsNetworkState) { fake_call_->GetNetworkState(webrtc::MediaType::AUDIO)); } -TEST_F(WebRtcVideoChannel2Test, GetStatsReportsSentCodecName) { +TEST_F(WebRtcVideoChannelTest, GetStatsReportsSentCodecName) { cricket::VideoSendParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); EXPECT_TRUE(channel_->SetSendParameters(parameters)); @@ -3445,7 +3445,7 @@ TEST_F(WebRtcVideoChannel2Test, GetStatsReportsSentCodecName) { EXPECT_EQ("VP8", info.senders[0].codec_name); } -TEST_F(WebRtcVideoChannel2Test, GetStatsReportsEncoderImplementationName) { +TEST_F(WebRtcVideoChannelTest, GetStatsReportsEncoderImplementationName) { FakeVideoSendStream* stream = AddSendStream(); webrtc::VideoSendStream::Stats stats; stats.encoder_implementation_name = "encoder_implementation_name"; @@ -3457,7 +3457,7 @@ TEST_F(WebRtcVideoChannel2Test, GetStatsReportsEncoderImplementationName) { info.senders[0].encoder_implementation_name); } -TEST_F(WebRtcVideoChannel2Test, GetStatsReportsCpuOveruseMetrics) { +TEST_F(WebRtcVideoChannelTest, GetStatsReportsCpuOveruseMetrics) { FakeVideoSendStream* stream = AddSendStream(); webrtc::VideoSendStream::Stats stats; stats.avg_encode_time_ms = 13; @@ -3470,7 +3470,7 @@ TEST_F(WebRtcVideoChannel2Test, GetStatsReportsCpuOveruseMetrics) { EXPECT_EQ(stats.encode_usage_percent, info.senders[0].encode_usage_percent); } -TEST_F(WebRtcVideoChannel2Test, GetStatsReportsFramesEncoded) { +TEST_F(WebRtcVideoChannelTest, GetStatsReportsFramesEncoded) { FakeVideoSendStream* stream = AddSendStream(); webrtc::VideoSendStream::Stats stats; stats.frames_encoded = 13; @@ -3481,7 +3481,7 @@ TEST_F(WebRtcVideoChannel2Test, GetStatsReportsFramesEncoded) { EXPECT_EQ(stats.frames_encoded, info.senders[0].frames_encoded); } -TEST_F(WebRtcVideoChannel2Test, GetStatsReportsQpSum) { +TEST_F(WebRtcVideoChannelTest, GetStatsReportsQpSum) { FakeVideoSendStream* stream = AddSendStream(); webrtc::VideoSendStream::Stats stats; stats.qp_sum = rtc::Optional(13); @@ -3492,7 +3492,7 @@ TEST_F(WebRtcVideoChannel2Test, GetStatsReportsQpSum) { EXPECT_EQ(stats.qp_sum, info.senders[0].qp_sum); } -TEST_F(WebRtcVideoChannel2Test, GetStatsReportsUpperResolution) { +TEST_F(WebRtcVideoChannelTest, GetStatsReportsUpperResolution) { FakeVideoSendStream* stream = AddSendStream(); webrtc::VideoSendStream::Stats stats; stats.substreams[17].width = 123; @@ -3510,7 +3510,7 @@ TEST_F(WebRtcVideoChannel2Test, GetStatsReportsUpperResolution) { EXPECT_EQ(90, info.senders[0].send_frame_height); } -TEST_F(WebRtcVideoChannel2Test, GetStatsReportsPreferredBitrate) { +TEST_F(WebRtcVideoChannelTest, GetStatsReportsPreferredBitrate) { FakeVideoSendStream* stream = AddSendStream(); webrtc::VideoSendStream::Stats stats; stats.preferred_media_bitrate_bps = 5; @@ -3522,7 +3522,7 @@ TEST_F(WebRtcVideoChannel2Test, GetStatsReportsPreferredBitrate) { EXPECT_EQ(5, info.senders[0].preferred_bitrate); } -TEST_F(WebRtcVideoChannel2Test, GetStatsReportsCpuAdaptationStats) { +TEST_F(WebRtcVideoChannelTest, GetStatsReportsCpuAdaptationStats) { FakeVideoSendStream* stream = AddSendStream(); webrtc::VideoSendStream::Stats stats; stats.number_of_cpu_adapt_changes = 2; @@ -3532,11 +3532,11 @@ TEST_F(WebRtcVideoChannel2Test, GetStatsReportsCpuAdaptationStats) { cricket::VideoMediaInfo info; EXPECT_TRUE(channel_->GetStats(&info)); ASSERT_EQ(1U, info.senders.size()); - EXPECT_EQ(WebRtcVideoChannel2::ADAPTREASON_CPU, info.senders[0].adapt_reason); + EXPECT_EQ(WebRtcVideoChannel::ADAPTREASON_CPU, info.senders[0].adapt_reason); EXPECT_EQ(stats.number_of_cpu_adapt_changes, info.senders[0].adapt_changes); } -TEST_F(WebRtcVideoChannel2Test, GetStatsReportsAdaptationAndBandwidthStats) { +TEST_F(WebRtcVideoChannelTest, GetStatsReportsAdaptationAndBandwidthStats) { FakeVideoSendStream* stream = AddSendStream(); webrtc::VideoSendStream::Stats stats; stats.number_of_cpu_adapt_changes = 2; @@ -3547,13 +3547,13 @@ TEST_F(WebRtcVideoChannel2Test, GetStatsReportsAdaptationAndBandwidthStats) { cricket::VideoMediaInfo info; EXPECT_TRUE(channel_->GetStats(&info)); ASSERT_EQ(1U, info.senders.size()); - EXPECT_EQ(WebRtcVideoChannel2::ADAPTREASON_CPU | - WebRtcVideoChannel2::ADAPTREASON_BANDWIDTH, + EXPECT_EQ(WebRtcVideoChannel::ADAPTREASON_CPU | + WebRtcVideoChannel::ADAPTREASON_BANDWIDTH, info.senders[0].adapt_reason); EXPECT_EQ(stats.number_of_cpu_adapt_changes, info.senders[0].adapt_changes); } -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, GetStatsTranslatesBandwidthLimitedResolutionCorrectly) { FakeVideoSendStream* stream = AddSendStream(); webrtc::VideoSendStream::Stats stats; @@ -3563,11 +3563,11 @@ TEST_F(WebRtcVideoChannel2Test, cricket::VideoMediaInfo info; EXPECT_TRUE(channel_->GetStats(&info)); ASSERT_EQ(1U, info.senders.size()); - EXPECT_EQ(WebRtcVideoChannel2::ADAPTREASON_BANDWIDTH, + EXPECT_EQ(WebRtcVideoChannel::ADAPTREASON_BANDWIDTH, info.senders[0].adapt_reason); } -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, GetStatsTranslatesSendRtcpPacketTypesCorrectly) { FakeVideoSendStream* stream = AddSendStream(); webrtc::VideoSendStream::Stats stats; @@ -3588,7 +3588,7 @@ TEST_F(WebRtcVideoChannel2Test, EXPECT_EQ(13, info.senders[0].plis_rcvd); } -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, GetStatsTranslatesReceiveRtcpPacketTypesCorrectly) { FakeVideoReceiveStream* stream = AddRecvStream(); webrtc::VideoReceiveStream::Stats stats; @@ -3607,7 +3607,7 @@ TEST_F(WebRtcVideoChannel2Test, info.receivers[0].plis_sent); } -TEST_F(WebRtcVideoChannel2Test, GetStatsTranslatesDecodeStatsCorrectly) { +TEST_F(WebRtcVideoChannelTest, GetStatsTranslatesDecodeStatsCorrectly) { FakeVideoReceiveStream* stream = AddRecvStream(); webrtc::VideoReceiveStream::Stats stats; stats.decoder_implementation_name = "decoder_implementation_name"; @@ -3647,7 +3647,7 @@ TEST_F(WebRtcVideoChannel2Test, GetStatsTranslatesDecodeStatsCorrectly) { EXPECT_EQ(stats.qp_sum, info.receivers[0].qp_sum); } -TEST_F(WebRtcVideoChannel2Test, GetStatsTranslatesReceivePacketStatsCorrectly) { +TEST_F(WebRtcVideoChannelTest, GetStatsTranslatesReceivePacketStatsCorrectly) { FakeVideoReceiveStream* stream = AddRecvStream(); webrtc::VideoReceiveStream::Stats stats; stats.rtp_stats.transmitted.payload_bytes = 2; @@ -3671,7 +3671,7 @@ TEST_F(WebRtcVideoChannel2Test, GetStatsTranslatesReceivePacketStatsCorrectly) { info.receivers[0].fraction_lost); } -TEST_F(WebRtcVideoChannel2Test, TranslatesCallStatsCorrectly) { +TEST_F(WebRtcVideoChannelTest, TranslatesCallStatsCorrectly) { AddSendStream(); AddSendStream(); webrtc::Call::Stats stats; @@ -3685,7 +3685,7 @@ TEST_F(WebRtcVideoChannel2Test, TranslatesCallStatsCorrectly) { EXPECT_EQ(stats.rtt_ms, info.senders[1].rtt_ms); } -TEST_F(WebRtcVideoChannel2Test, TranslatesSenderBitrateStatsCorrectly) { +TEST_F(WebRtcVideoChannelTest, TranslatesSenderBitrateStatsCorrectly) { FakeVideoSendStream* stream = AddSendStream(); webrtc::VideoSendStream::Stats stats; stats.target_media_bitrate_bps = 156; @@ -3725,7 +3725,7 @@ TEST_F(WebRtcVideoChannel2Test, TranslatesSenderBitrateStatsCorrectly) { << "Bandwidth stats should take all streams into account."; } -TEST_F(WebRtcVideoChannel2Test, DefaultReceiveStreamReconfiguresToUseRtx) { +TEST_F(WebRtcVideoChannelTest, DefaultReceiveStreamReconfiguresToUseRtx) { EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); const std::vector ssrcs = MAKE_VECTOR(kSsrcs1); @@ -3758,7 +3758,7 @@ TEST_F(WebRtcVideoChannel2Test, DefaultReceiveStreamReconfiguresToUseRtx) { EXPECT_EQ(rtx_ssrcs[0], recv_stream->GetConfig().rtp.rtx_ssrc); } -TEST_F(WebRtcVideoChannel2Test, RejectsAddingStreamsWithMissingSsrcsForRtx) { +TEST_F(WebRtcVideoChannelTest, RejectsAddingStreamsWithMissingSsrcsForRtx) { EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); const std::vector ssrcs = MAKE_VECTOR(kSsrcs1); @@ -3772,7 +3772,7 @@ TEST_F(WebRtcVideoChannel2Test, RejectsAddingStreamsWithMissingSsrcsForRtx) { EXPECT_FALSE(channel_->AddRecvStream(sp)); } -TEST_F(WebRtcVideoChannel2Test, RejectsAddingStreamsWithOverlappingRtxSsrcs) { +TEST_F(WebRtcVideoChannelTest, RejectsAddingStreamsWithOverlappingRtxSsrcs) { EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); const std::vector ssrcs = MAKE_VECTOR(kSsrcs1); @@ -3797,7 +3797,7 @@ TEST_F(WebRtcVideoChannel2Test, RejectsAddingStreamsWithOverlappingRtxSsrcs) { EXPECT_TRUE(channel_->AddRecvStream(sp)); } -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, RejectsAddingStreamsWithOverlappingSimulcastSsrcs) { static const uint32_t kFirstStreamSsrcs[] = {1, 2, 3}; static const uint32_t kOverlappingStreamSsrcs[] = {4, 3, 5}; @@ -3823,7 +3823,7 @@ TEST_F(WebRtcVideoChannel2Test, EXPECT_TRUE(channel_->AddRecvStream(sp)); } -TEST_F(WebRtcVideoChannel2Test, ReportsSsrcGroupsInStats) { +TEST_F(WebRtcVideoChannelTest, ReportsSsrcGroupsInStats) { EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); static const uint32_t kSenderSsrcs[] = {4, 7, 10}; @@ -3852,7 +3852,7 @@ TEST_F(WebRtcVideoChannel2Test, ReportsSsrcGroupsInStats) { EXPECT_EQ(receiver_sp.ssrc_groups, info.receivers[0].ssrc_groups); } -TEST_F(WebRtcVideoChannel2Test, MapsReceivedPayloadTypeToCodecName) { +TEST_F(WebRtcVideoChannelTest, MapsReceivedPayloadTypeToCodecName) { FakeVideoReceiveStream* stream = AddRecvStream(); webrtc::VideoReceiveStream::Stats stats; cricket::VideoMediaInfo info; @@ -3875,7 +3875,7 @@ TEST_F(WebRtcVideoChannel2Test, MapsReceivedPayloadTypeToCodecName) { EXPECT_STREQ("", info.receivers[0].codec_name.c_str()); } -void WebRtcVideoChannel2Test::TestReceiveUnsignaledSsrcPacket( +void WebRtcVideoChannelTest::TestReceiveUnsignaledSsrcPacket( uint8_t payload_type, bool expect_created_receive_stream) { // kRedRtxPayloadType must currently be unused. @@ -3909,35 +3909,35 @@ void WebRtcVideoChannel2Test::TestReceiveUnsignaledSsrcPacket( } } -TEST_F(WebRtcVideoChannel2Test, Vp8PacketCreatesUnsignalledStream) { +TEST_F(WebRtcVideoChannelTest, Vp8PacketCreatesUnsignalledStream) { TestReceiveUnsignaledSsrcPacket(GetEngineCodec("VP8").id, true /* expect_created_receive_stream */); } -TEST_F(WebRtcVideoChannel2Test, Vp9PacketCreatesUnsignalledStream) { +TEST_F(WebRtcVideoChannelTest, Vp9PacketCreatesUnsignalledStream) { TestReceiveUnsignaledSsrcPacket(GetEngineCodec("VP9").id, true /* expect_created_receive_stream */); } -TEST_F(WebRtcVideoChannel2Test, RtxPacketDoesntCreateUnsignalledStream) { +TEST_F(WebRtcVideoChannelTest, RtxPacketDoesntCreateUnsignalledStream) { const cricket::VideoCodec vp8 = GetEngineCodec("VP8"); const int rtx_vp8_payload_type = default_apt_rtx_types_[vp8.id]; TestReceiveUnsignaledSsrcPacket(rtx_vp8_payload_type, false /* expect_created_receive_stream */); } -TEST_F(WebRtcVideoChannel2Test, UlpfecPacketDoesntCreateUnsignalledStream) { +TEST_F(WebRtcVideoChannelTest, UlpfecPacketDoesntCreateUnsignalledStream) { TestReceiveUnsignaledSsrcPacket(GetEngineCodec("ulpfec").id, false /* expect_created_receive_stream */); } -TEST_F(WebRtcVideoChannel2FlexfecRecvTest, +TEST_F(WebRtcVideoChannelFlexfecRecvTest, FlexfecPacketDoesntCreateUnsignalledStream) { TestReceiveUnsignaledSsrcPacket(GetEngineCodec("flexfec-03").id, false /* expect_created_receive_stream */); } -TEST_F(WebRtcVideoChannel2Test, RedRtxPacketDoesntCreateUnsignalledStream) { +TEST_F(WebRtcVideoChannelTest, RedRtxPacketDoesntCreateUnsignalledStream) { TestReceiveUnsignaledSsrcPacket(kRedRtxPayloadType, false /* expect_created_receive_stream */); } @@ -3945,7 +3945,7 @@ TEST_F(WebRtcVideoChannel2Test, RedRtxPacketDoesntCreateUnsignalledStream) { // Test that receiving any unsignalled SSRC works even if it changes. // The first unsignalled SSRC received will create a default receive stream. // Any different unsignalled SSRC received will replace the default. -TEST_F(WebRtcVideoChannel2Test, ReceiveDifferentUnsignaledSsrc) { +TEST_F(WebRtcVideoChannelTest, ReceiveDifferentUnsignaledSsrc) { // Allow receiving VP8, VP9, H264 (if enabled). cricket::VideoRecvParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); @@ -4021,7 +4021,7 @@ TEST_F(WebRtcVideoChannel2Test, ReceiveDifferentUnsignaledSsrc) { // This test verifies that when a new default stream is created for a new // unsignaled SSRC, the new stream does not overwrite any old stream that had // been the default receive stream before being properly signaled. -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, NewUnsignaledStreamDoesNotDestroyPreviouslyUnsignaledStream) { cricket::VideoRecvParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); @@ -4067,7 +4067,7 @@ TEST_F(WebRtcVideoChannel2Test, EXPECT_EQ(kSsrcs3[1], recv_stream1->GetConfig().rtp.remote_ssrc); } -TEST_F(WebRtcVideoChannel2Test, CanSentMaxBitrateForExistingStream) { +TEST_F(WebRtcVideoChannelTest, CanSentMaxBitrateForExistingStream) { AddSendStream(); cricket::FakeVideoCapturer capturer; @@ -4099,7 +4099,7 @@ TEST_F(WebRtcVideoChannel2Test, CanSentMaxBitrateForExistingStream) { EXPECT_TRUE(channel_->SetVideoSend(last_ssrc_, true, nullptr, nullptr)); } -TEST_F(WebRtcVideoChannel2Test, CannotSetMaxBitrateForNonexistentStream) { +TEST_F(WebRtcVideoChannelTest, CannotSetMaxBitrateForNonexistentStream) { webrtc::RtpParameters nonexistent_parameters = channel_->GetRtpSendParameters(last_ssrc_); EXPECT_EQ(0, nonexistent_parameters.encodings.size()); @@ -4109,7 +4109,7 @@ TEST_F(WebRtcVideoChannel2Test, CannotSetMaxBitrateForNonexistentStream) { channel_->SetRtpSendParameters(last_ssrc_, nonexistent_parameters)); } -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, CannotSetRtpSendParametersWithIncorrectNumberOfEncodings) { // This test verifies that setting RtpParameters succeeds only if // the structure contains exactly one encoding. @@ -4127,7 +4127,7 @@ TEST_F(WebRtcVideoChannel2Test, } // Changing the SSRC through RtpParameters is not allowed. -TEST_F(WebRtcVideoChannel2Test, CannotSetSsrcInRtpSendParameters) { +TEST_F(WebRtcVideoChannelTest, CannotSetSsrcInRtpSendParameters) { AddSendStream(); webrtc::RtpParameters parameters = channel_->GetRtpSendParameters(last_ssrc_); parameters.encodings[0].ssrc = rtc::Optional(0xdeadbeef); @@ -4138,7 +4138,7 @@ TEST_F(WebRtcVideoChannel2Test, CannotSetSsrcInRtpSendParameters) { // through SetRtpSendParameters. // TODO(deadbeef): Update this test when we start supporting setting parameters // for each encoding individually. -TEST_F(WebRtcVideoChannel2Test, SetRtpSendParametersEncodingsActive) { +TEST_F(WebRtcVideoChannelTest, SetRtpSendParametersEncodingsActive) { FakeVideoSendStream* stream = AddSendStream(); EXPECT_TRUE(channel_->SetSend(true)); EXPECT_TRUE(stream->IsSending()); @@ -4159,7 +4159,7 @@ TEST_F(WebRtcVideoChannel2Test, SetRtpSendParametersEncodingsActive) { // Test that if a stream is reconfigured (due to a codec change or other // change) while its encoding is still inactive, it doesn't start sending. -TEST_F(WebRtcVideoChannel2Test, +TEST_F(WebRtcVideoChannelTest, InactiveStreamDoesntStartSendingWhenReconfigured) { // Set an initial codec list, which will be modified later. cricket::VideoSendParameters parameters1; @@ -4198,7 +4198,7 @@ TEST_F(WebRtcVideoChannel2Test, } // Test that GetRtpSendParameters returns the currently configured codecs. -TEST_F(WebRtcVideoChannel2Test, GetRtpSendParametersCodecs) { +TEST_F(WebRtcVideoChannelTest, GetRtpSendParametersCodecs) { AddSendStream(); cricket::VideoSendParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); @@ -4216,7 +4216,7 @@ TEST_F(WebRtcVideoChannel2Test, GetRtpSendParametersCodecs) { // Test that RtpParameters for send stream has one encoding and it has // the correct SSRC. -TEST_F(WebRtcVideoChannel2Test, GetRtpSendParametersSsrc) { +TEST_F(WebRtcVideoChannelTest, GetRtpSendParametersSsrc) { AddSendStream(); webrtc::RtpParameters rtp_parameters = @@ -4227,7 +4227,7 @@ TEST_F(WebRtcVideoChannel2Test, GetRtpSendParametersSsrc) { } // Test that if we set/get parameters multiple times, we get the same results. -TEST_F(WebRtcVideoChannel2Test, SetAndGetRtpSendParameters) { +TEST_F(WebRtcVideoChannelTest, SetAndGetRtpSendParameters) { AddSendStream(); cricket::VideoSendParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); @@ -4245,7 +4245,7 @@ TEST_F(WebRtcVideoChannel2Test, SetAndGetRtpSendParameters) { } // Test that GetRtpReceiveParameters returns the currently configured codecs. -TEST_F(WebRtcVideoChannel2Test, GetRtpReceiveParametersCodecs) { +TEST_F(WebRtcVideoChannelTest, GetRtpReceiveParametersCodecs) { AddRecvStream(); cricket::VideoRecvParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); @@ -4262,9 +4262,9 @@ TEST_F(WebRtcVideoChannel2Test, GetRtpReceiveParametersCodecs) { } #if defined(WEBRTC_USE_H264) -TEST_F(WebRtcVideoChannel2Test, GetRtpReceiveFmtpSprop) { +TEST_F(WebRtcVideoChannelTest, GetRtpReceiveFmtpSprop) { #else -TEST_F(WebRtcVideoChannel2Test, DISABLED_GetRtpReceiveFmtpSprop) { +TEST_F(WebRtcVideoChannelTest, DISABLED_GetRtpReceiveFmtpSprop) { #endif cricket::VideoRecvParameters parameters; cricket::VideoCodec kH264sprop1(101, "H264"); @@ -4299,7 +4299,7 @@ TEST_F(WebRtcVideoChannel2Test, DISABLED_GetRtpReceiveFmtpSprop) { // Test that RtpParameters for receive stream has one encoding and it has // the correct SSRC. -TEST_F(WebRtcVideoChannel2Test, GetRtpReceiveParametersSsrc) { +TEST_F(WebRtcVideoChannelTest, GetRtpReceiveParametersSsrc) { AddRecvStream(); webrtc::RtpParameters rtp_parameters = @@ -4310,7 +4310,7 @@ TEST_F(WebRtcVideoChannel2Test, GetRtpReceiveParametersSsrc) { } // Test that if we set/get parameters multiple times, we get the same results. -TEST_F(WebRtcVideoChannel2Test, SetAndGetRtpReceiveParameters) { +TEST_F(WebRtcVideoChannelTest, SetAndGetRtpReceiveParameters) { AddRecvStream(); cricket::VideoRecvParameters parameters; parameters.codecs.push_back(GetEngineCodec("VP8")); @@ -4331,7 +4331,7 @@ TEST_F(WebRtcVideoChannel2Test, SetAndGetRtpReceiveParameters) { // Test that GetRtpReceiveParameters returns parameters correctly when SSRCs // aren't signaled. It should always return an empty "RtpEncodingParameters", // even after a packet is received and the unsignaled SSRC is known. -TEST_F(WebRtcVideoChannel2Test, GetRtpReceiveParametersWithUnsignaledSsrc) { +TEST_F(WebRtcVideoChannelTest, GetRtpReceiveParametersWithUnsignaledSsrc) { // Call necessary methods to configure receiving a default stream as // soon as it arrives. cricket::VideoRecvParameters parameters; @@ -4371,7 +4371,7 @@ TEST_F(WebRtcVideoChannel2Test, GetRtpReceiveParametersWithUnsignaledSsrc) { EXPECT_FALSE(rtp_parameters.encodings[0].ssrc); } -void WebRtcVideoChannel2Test::TestReceiverLocalSsrcConfiguration( +void WebRtcVideoChannelTest::TestReceiverLocalSsrcConfiguration( bool receiver_first) { EXPECT_TRUE(channel_->SetSendParameters(send_parameters_)); @@ -4415,17 +4415,17 @@ void WebRtcVideoChannel2Test::TestReceiverLocalSsrcConfiguration( receive_streams[0]->GetConfig().rtp.local_ssrc); } -TEST_F(WebRtcVideoChannel2Test, ConfiguresLocalSsrc) { +TEST_F(WebRtcVideoChannelTest, ConfiguresLocalSsrc) { TestReceiverLocalSsrcConfiguration(false); } -TEST_F(WebRtcVideoChannel2Test, ConfiguresLocalSsrcOnExistingReceivers) { +TEST_F(WebRtcVideoChannelTest, ConfiguresLocalSsrcOnExistingReceivers) { TestReceiverLocalSsrcConfiguration(true); } -class WebRtcVideoChannel2SimulcastTest : public testing::Test { +class WebRtcVideoChannelSimulcastTest : public testing::Test { public: - WebRtcVideoChannel2SimulcastTest() + WebRtcVideoChannelSimulcastTest() : fake_call_(webrtc::Call::Config(&event_log_)), last_ssrc_(0) {} void SetUp() override { @@ -4585,46 +4585,46 @@ class WebRtcVideoChannel2SimulcastTest : public testing::Test { webrtc::RtcEventLogNullImpl event_log_; FakeCall fake_call_; - WebRtcVideoEngine2 engine_; + WebRtcVideoEngine engine_; std::unique_ptr channel_; uint32_t last_ssrc_; }; -TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWith2SimulcastStreams) { +TEST_F(WebRtcVideoChannelSimulcastTest, SetSendCodecsWith2SimulcastStreams) { VerifySimulcastSettings(cricket::VideoCodec("VP8"), 640, 360, 2, 2, false, true); } -TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWith3SimulcastStreams) { +TEST_F(WebRtcVideoChannelSimulcastTest, SetSendCodecsWith3SimulcastStreams) { VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 3, false, true); } // Test that we normalize send codec format size in simulcast. -TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { +TEST_F(WebRtcVideoChannelSimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { VerifySimulcastSettings(cricket::VideoCodec("VP8"), 541, 271, 2, 2, false, true); } -TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsForScreenshare) { +TEST_F(WebRtcVideoChannelSimulcastTest, SetSendCodecsForScreenshare) { VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 1, true, false); } -TEST_F(WebRtcVideoChannel2SimulcastTest, +TEST_F(WebRtcVideoChannelSimulcastTest, SetSendCodecsForConferenceModeScreenshare) { VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 1, true, true); } -TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsForSimulcastScreenshare) { +TEST_F(WebRtcVideoChannelSimulcastTest, SetSendCodecsForSimulcastScreenshare) { webrtc::test::ScopedFieldTrials override_field_trials_( "WebRTC-SimulcastScreenshare/Enabled/"); VerifySimulcastSettings(cricket::VideoCodec("VP8"), 1280, 720, 3, 2, true, true); } -TEST_F(WebRtcVideoChannel2SimulcastTest, +TEST_F(WebRtcVideoChannelSimulcastTest, NoSimulcastScreenshareWithoutConference) { webrtc::test::ScopedFieldTrials override_field_trials_( "WebRTC-SimulcastScreenshare/Enabled/"); diff --git a/webrtc/pc/rtpreceiver.h b/webrtc/pc/rtpreceiver.h index 9853f9824e..b0ea247de2 100644 --- a/webrtc/pc/rtpreceiver.h +++ b/webrtc/pc/rtpreceiver.h @@ -35,7 +35,7 @@ class RtpReceiverInternal : public RtpReceiverInterface { public: virtual void Stop() = 0; // This SSRC is used as an identifier for the receiver between the API layer - // and the WebRtcVideoEngine2, WebRtcVoiceEngine layer. + // and the WebRtcVideoEngine, WebRtcVoiceEngine layer. virtual uint32_t ssrc() const = 0; }; diff --git a/webrtc/pc/webrtcsdp_unittest.cc b/webrtc/pc/webrtcsdp_unittest.cc index 68393d156a..57a7bdb0c0 100644 --- a/webrtc/pc/webrtcsdp_unittest.cc +++ b/webrtc/pc/webrtcsdp_unittest.cc @@ -22,7 +22,7 @@ #include "webrtc/base/stringencode.h" #include "webrtc/base/stringutils.h" #include "webrtc/media/base/mediaconstants.h" -#include "webrtc/media/engine/webrtcvideoengine2.h" +#include "webrtc/media/engine/webrtcvideoengine.h" #include "webrtc/modules/video_coding/codecs/h264/include/h264.h" #include "webrtc/p2p/base/p2pconstants.h" #include "webrtc/pc/mediasession.h"