Chromium Code Reviews| Index: webrtc/video/vie_channel.cc |
| diff --git a/webrtc/video/vie_channel.cc b/webrtc/video/vie_channel.cc |
| index 8c67b50c9ed2b5a1d3ad100b07332bb9c7d9f76b..c8a7feaeadf9aecadae97c0083e5672f8bbe536c 100644 |
| --- a/webrtc/video/vie_channel.cc |
| +++ b/webrtc/video/vie_channel.cc |
| @@ -432,26 +432,8 @@ int32_t ViEChannel::SetReceiveCodec(const VideoCodec& video_codec) { |
| return 0; |
| } |
| -void ViEChannel::RegisterExternalDecoder(const uint8_t pl_type, |
| - VideoDecoder* decoder) { |
| - RTC_DCHECK(!sender_); |
| - vcm_->RegisterExternalDecoder(decoder, pl_type); |
| -} |
| - |
| -int32_t ViEChannel::ReceiveCodecStatistics(uint32_t* num_key_frames, |
| - uint32_t* num_delta_frames) { |
| - rtc::CritScope lock(&crit_); |
| - *num_key_frames = receive_frame_counts_.key_frames; |
| - *num_delta_frames = receive_frame_counts_.delta_frames; |
| - return 0; |
| -} |
| - |
| -void ViEChannel::SetExpectedRenderDelay(int delay_ms) { |
| - RTC_DCHECK(!sender_); |
| - vcm_->SetRenderDelay(delay_ms); |
| -} |
| - |
| void ViEChannel::SetRTCPMode(const RtcpMode rtcp_mode) { |
| + RTC_DCHECK(sender_); |
| for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) |
| rtp_rtcp->SetRTCPStatus(rtcp_mode); |
| } |
| @@ -580,10 +562,6 @@ int ViEChannel::SetSendTimestampOffsetStatus(bool enable, int id) { |
| return error; |
| } |
| -int ViEChannel::SetReceiveTimestampOffsetStatus(bool enable, int id) { |
| - return vie_receiver_.SetReceiveTimestampOffsetStatus(enable, id) ? 0 : -1; |
| -} |
| - |
| int ViEChannel::SetSendAbsoluteSendTimeStatus(bool enable, int id) { |
| // Disable any previous registrations of this extension to avoid errors. |
| for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) |
| @@ -599,10 +577,6 @@ int ViEChannel::SetSendAbsoluteSendTimeStatus(bool enable, int id) { |
| return error; |
| } |
| -int ViEChannel::SetReceiveAbsoluteSendTimeStatus(bool enable, int id) { |
| - return vie_receiver_.SetReceiveAbsoluteSendTimeStatus(enable, id) ? 0 : -1; |
| -} |
| - |
| int ViEChannel::SetSendVideoRotationStatus(bool enable, int id) { |
| // Disable any previous registrations of this extension to avoid errors. |
| for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) |
| @@ -618,11 +592,8 @@ int ViEChannel::SetSendVideoRotationStatus(bool enable, int id) { |
| return error; |
| } |
| -int ViEChannel::SetReceiveVideoRotationStatus(bool enable, int id) { |
| - return vie_receiver_.SetReceiveVideoRotationStatus(enable, id) ? 0 : -1; |
| -} |
| - |
| int ViEChannel::SetSendTransportSequenceNumber(bool enable, int id) { |
| + RTC_DCHECK(sender_); |
| // Disable any previous registrations of this extension to avoid errors. |
| for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
| rtp_rtcp->DeregisterSendRtpHeaderExtension( |
| @@ -639,21 +610,10 @@ int ViEChannel::SetSendTransportSequenceNumber(bool enable, int id) { |
| return error; |
| } |
| -int ViEChannel::SetReceiveTransportSequenceNumber(bool enable, int id) { |
| - return vie_receiver_.SetReceiveTransportSequenceNumber(enable, id) ? 0 : -1; |
| -} |
| - |
| -void ViEChannel::SetRtcpXrRrtrStatus(bool enable) { |
| - rtp_rtcp_modules_[0]->SetRtcpXrRrtrStatus(enable); |
| -} |
| - |
| -void ViEChannel::EnableTMMBR(bool enable) { |
| - rtp_rtcp_modules_[0]->SetTMMBRStatus(enable); |
| -} |
| - |
| int32_t ViEChannel::SetSSRC(const uint32_t SSRC, |
| const StreamType usage, |
| const uint8_t simulcast_idx) { |
| + RTC_DCHECK(sender_); |
| RtpRtcp* rtp_rtcp = rtp_rtcp_modules_[simulcast_idx]; |
| if (usage == kViEStreamTypeRtx) { |
| rtp_rtcp->SetRtxSsrc(SSRC); |
| @@ -663,12 +623,6 @@ int32_t ViEChannel::SetSSRC(const uint32_t SSRC, |
| return 0; |
| } |
| -int32_t ViEChannel::SetRemoteSSRCType(const StreamType usage, |
| - const uint32_t SSRC) { |
| - vie_receiver_.SetRtxSsrc(SSRC); |
| - return 0; |
| -} |
| - |
| int32_t ViEChannel::GetLocalSSRC(uint8_t idx, unsigned int* ssrc) { |
| RTC_DCHECK_LE(idx, rtp_rtcp_modules_.size()); |
| *ssrc = rtp_rtcp_modules_[idx]->SSRC(); |
| @@ -676,6 +630,7 @@ int32_t ViEChannel::GetLocalSSRC(uint8_t idx, unsigned int* ssrc) { |
| } |
| uint32_t ViEChannel::GetRemoteSSRC() { |
| + RTC_DCHECK(sender_); |
| return vie_receiver_.GetRemoteSsrc(); |
| } |
| @@ -696,6 +651,7 @@ void ViEChannel::SetRtxSendStatus(bool enable) { |
| void ViEChannel::SetRtxReceivePayloadType(int payload_type, |
| int associated_payload_type) { |
| + RTC_DCHECK(!sender_); |
| vie_receiver_.SetRtxPayloadType(payload_type, associated_payload_type); |
|
stefan-webrtc
2016/02/05 14:35:57
Move this out instead?
pbos-webrtc
2016/02/05 15:15:51
Done.
|
| } |
| @@ -922,19 +878,17 @@ void ViEChannel::StopReceive() { |
| StopDecodeThread(); |
| } |
| -int32_t ViEChannel::ReceivedRTPPacket(const void* rtp_packet, |
| - size_t rtp_packet_length, |
| - const PacketTime& packet_time) { |
| - return vie_receiver_.ReceivedRTPPacket( |
| - rtp_packet, rtp_packet_length, packet_time); |
| -} |
| - |
| int32_t ViEChannel::ReceivedRTCPPacket(const void* rtcp_packet, |
| size_t rtcp_packet_length) { |
| - return vie_receiver_.ReceivedRTCPPacket(rtcp_packet, rtcp_packet_length); |
| + RTC_DCHECK(sender_); |
| + return vie_receiver_.DeliverRtcp( |
| + reinterpret_cast<const uint8_t*>(rtcp_packet), rtcp_packet_length) |
| + ? 0 |
| + : -1; |
| } |
| int32_t ViEChannel::SetMTU(uint16_t mtu) { |
| + RTC_DCHECK(sender_); |
| for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) |
| rtp_rtcp->SetMaxTransferUnit(mtu); |
| return 0; |
| @@ -944,6 +898,10 @@ RtpRtcp* ViEChannel::rtp_rtcp() { |
| return rtp_rtcp_modules_[0]; |
| } |
| +ViEReceiver* ViEChannel::vie_receiver() { |
| + return &vie_receiver_; |
| +} |
| + |
| VCMProtectionCallback* ViEChannel::vcm_protection_callback() { |
| return vcm_protection_callback_.get(); |
| } |
| @@ -1160,16 +1118,11 @@ int32_t ViEChannel::VoiceChannel() { |
| void ViEChannel::RegisterPreRenderCallback( |
| I420FrameCallback* pre_render_callback) { |
| + RTC_DCHECK(!sender_); |
| rtc::CritScope lock(&crit_); |
| pre_render_callback_ = pre_render_callback; |
| } |
| -void ViEChannel::RegisterPreDecodeImageCallback( |
| - EncodedImageCallback* pre_decode_callback) { |
| - RTC_DCHECK(!sender_); |
| - vcm_->RegisterPreDecodeImageCallback(pre_decode_callback); |
| -} |
| - |
| // TODO(pbos): Remove as soon as audio can handle a changing payload type |
| // without this callback. |
| int32_t ViEChannel::OnInitializeDecoder( |