From 12d6a49e97701eebc753e13822355b823190ef4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Thu, 22 Mar 2018 12:41:48 +0100 Subject: [PATCH] Add payload_name and payload_type to VideoSendStream::Config::Rtp. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Another step of the transition needed to reland cl https://webrtc-review.googlesource.com/62062, and move payload_name and payload_type out of VideoSendStream::Config::EncoderSettings. If the new fields are set, values of the old fields are ignored. Bug: webrtc:8830 Change-Id: I1f0cd56fd6b13b05608b284afc92523707887e25 Reviewed-on: https://webrtc-review.googlesource.com/64101 Reviewed-by: Erik Språng Commit-Queue: Niels Moller Cr-Commit-Position: refs/heads/master@{#22562} --- call/video_send_stream.h | 12 ++++++++++++ video/video_send_stream.cc | 12 +++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/call/video_send_stream.h b/call/video_send_stream.h index 440b62e4a8..9be604a602 100644 --- a/call/video_send_stream.h +++ b/call/video_send_stream.h @@ -120,6 +120,8 @@ class VideoSendStream { encoder(encoder) {} std::string ToString() const; + // TODO(nisse): About to be deleted. Unused if the corresponding + // fields in the below Rtp struct are set. std::string payload_name; int payload_type = -1; @@ -159,6 +161,16 @@ class VideoSendStream { // RTP header extensions to use for this send stream. std::vector extensions; + // TODO(nisse): For now, these are fixed, but we'd like to support + // changing codec without recreating the VideoSendStream. Then these + // fields must be removed, and association between payload type and codec + // must move above the per-stream level. Ownership could be with + // RtpTransportControllerSend, with a reference from PayloadRouter, where + // the latter would be responsible for mapping the codec type of encoded + // images to the right payload type. + std::string payload_name; + int payload_type = -1; + // See NackConfig for description. NackConfig nack; diff --git a/video/video_send_stream.cc b/video/video_send_stream.cc index a51a5ae68d..1a50c5e190 100644 --- a/video/video_send_stream.cc +++ b/video/video_send_stream.cc @@ -731,7 +731,9 @@ VideoSendStreamImpl::VideoSendStreamImpl( transport->keepalive_config())), payload_router_(rtp_rtcp_modules_, config_->rtp.ssrcs, - config_->encoder_settings.payload_type, + config_->rtp.payload_type != -1 + ? config_->rtp.payload_type + : config_->encoder_settings.payload_type, suspended_payload_states), weak_ptr_factory_(this), overhead_bytes_per_packet_(0), @@ -828,8 +830,12 @@ VideoSendStreamImpl::VideoSendStreamImpl( rtp_rtcp->RegisterSendChannelRtpStatisticsCallback(stats_proxy_); rtp_rtcp->SetMaxRtpPacketSize(config_->rtp.max_packet_size); rtp_rtcp->RegisterVideoSendPayload( - config_->encoder_settings.payload_type, - config_->encoder_settings.payload_name.c_str()); + config_->rtp.payload_type != -1 + ? config_->rtp.payload_type + : config_->encoder_settings.payload_type, + !config_->rtp.payload_name.empty() + ? config_->rtp.payload_name.c_str() + : config_->encoder_settings.payload_name.c_str()); } fec_controller_->SetProtectionCallback(this);