Remove RTP data implementation

Bug: webrtc:6625
Change-Id: Ie68d7a938d8b7be95a01cca74a176104e4e44e1b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215321
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33759}
This commit is contained in:
Harald Alvestrand
2021-04-16 11:12:14 +00:00
committed by Commit Bot
parent f981cb3d2e
commit 7af57c6e48
41 changed files with 87 additions and 3487 deletions

View File

@ -471,104 +471,6 @@ class VideoChannel : public BaseChannel {
VideoRecvParameters last_recv_params_;
};
// RtpDataChannel is a specialization for data.
class RtpDataChannel : public BaseChannel {
public:
RtpDataChannel(rtc::Thread* worker_thread,
rtc::Thread* network_thread,
rtc::Thread* signaling_thread,
std::unique_ptr<DataMediaChannel> channel,
const std::string& content_name,
bool srtp_required,
webrtc::CryptoOptions crypto_options,
rtc::UniqueRandomIdGenerator* ssrc_generator);
~RtpDataChannel();
// TODO(zhihuang): Remove this once the RtpTransport can be shared between
// BaseChannels.
void Init_w(DtlsTransportInternal* rtp_dtls_transport,
DtlsTransportInternal* rtcp_dtls_transport,
rtc::PacketTransportInternal* rtp_packet_transport,
rtc::PacketTransportInternal* rtcp_packet_transport);
void Init_w(webrtc::RtpTransportInternal* rtp_transport) override;
virtual bool SendData(const SendDataParams& params,
const rtc::CopyOnWriteBuffer& payload,
SendDataResult* result);
// Should be called on the signaling thread only.
bool ready_to_send_data() const { return ready_to_send_data_; }
sigslot::signal2<const ReceiveDataParams&, const rtc::CopyOnWriteBuffer&>
SignalDataReceived;
// Signal for notifying when the channel becomes ready to send data.
// That occurs when the channel is enabled, the transport is writable,
// both local and remote descriptions are set, and the channel is unblocked.
sigslot::signal1<bool> SignalReadyToSendData;
cricket::MediaType media_type() const override {
return cricket::MEDIA_TYPE_DATA;
}
protected:
// downcasts a MediaChannel.
DataMediaChannel* media_channel() const override {
return static_cast<DataMediaChannel*>(BaseChannel::media_channel());
}
private:
struct SendDataMessageData : public rtc::MessageData {
SendDataMessageData(const SendDataParams& params,
const rtc::CopyOnWriteBuffer* payload,
SendDataResult* result)
: params(params), payload(payload), result(result), succeeded(false) {}
const SendDataParams& params;
const rtc::CopyOnWriteBuffer* payload;
SendDataResult* result;
bool succeeded;
};
struct DataReceivedMessageData : public rtc::MessageData {
// We copy the data because the data will become invalid after we
// handle DataMediaChannel::SignalDataReceived but before we fire
// SignalDataReceived.
DataReceivedMessageData(const ReceiveDataParams& params,
const char* data,
size_t len)
: params(params), payload(data, len) {}
const ReceiveDataParams params;
const rtc::CopyOnWriteBuffer payload;
};
typedef rtc::TypedMessageData<bool> DataChannelReadyToSendMessageData;
// overrides from BaseChannel
// Checks that data channel type is RTP.
bool CheckDataChannelTypeFromContent(const MediaContentDescription* content,
std::string* error_desc);
bool SetLocalContent_w(const MediaContentDescription* content,
webrtc::SdpType type,
std::string* error_desc) override;
bool SetRemoteContent_w(const MediaContentDescription* content,
webrtc::SdpType type,
std::string* error_desc) override;
void UpdateMediaSendRecvState_w() override;
void OnMessage(rtc::Message* pmsg) override;
void OnDataReceived(const ReceiveDataParams& params,
const char* data,
size_t len);
void OnDataChannelReadyToSend(bool writable);
bool ready_to_send_data_ = false;
// Last DataSendParameters sent down to the media_channel() via
// SetSendParameters.
DataSendParameters last_send_params_;
// Last DataRecvParameters sent down to the media_channel() via
// SetRecvParameters.
DataRecvParameters last_recv_params_;
};
} // namespace cricket
#endif // PC_CHANNEL_H_