diff --git a/media/base/mediachannel.h b/media/base/mediachannel.h index 6cee218400..5b75329390 100644 --- a/media/base/mediachannel.h +++ b/media/base/mediachannel.h @@ -982,27 +982,6 @@ struct AudioRecvParameters : RtpParameters { class VoiceMediaChannel : public MediaChannel { public: - enum Error { - ERROR_NONE = 0, // No error. - ERROR_OTHER, // Other errors. - ERROR_REC_DEVICE_OPEN_FAILED = 100, // Could not open mic. - ERROR_REC_DEVICE_MUTED, // Mic was muted by OS. - ERROR_REC_DEVICE_SILENT, // No background noise picked up. - ERROR_REC_DEVICE_SATURATION, // Mic input is clipping. - ERROR_REC_DEVICE_REMOVED, // Mic was removed while active. - ERROR_REC_RUNTIME_ERROR, // Processing is encountering errors. - ERROR_REC_SRTP_ERROR, // Generic SRTP failure. - ERROR_REC_SRTP_AUTH_FAILED, // Failed to authenticate packets. - ERROR_REC_TYPING_NOISE_DETECTED, // Typing noise is detected. - ERROR_PLAY_DEVICE_OPEN_FAILED = 200, // Could not open playout. - ERROR_PLAY_DEVICE_MUTED, // Playout muted by OS. - ERROR_PLAY_DEVICE_REMOVED, // Playout removed while active. - ERROR_PLAY_RUNTIME_ERROR, // Errors in voice processing. - ERROR_PLAY_SRTP_ERROR, // Generic SRTP failure. - ERROR_PLAY_SRTP_AUTH_FAILED, // Failed to authenticate packets. - ERROR_PLAY_SRTP_REPLAY, // Packet replay detected. - }; - VoiceMediaChannel() {} explicit VoiceMediaChannel(const MediaConfig& config) : MediaChannel(config) {} @@ -1075,21 +1054,6 @@ struct VideoRecvParameters : RtpParameters { class VideoMediaChannel : public MediaChannel { public: - enum Error { - ERROR_NONE = 0, // No error. - ERROR_OTHER, // Other errors. - ERROR_REC_DEVICE_OPEN_FAILED = 100, // Could not open camera. - ERROR_REC_DEVICE_NO_DEVICE, // No camera. - ERROR_REC_DEVICE_IN_USE, // Device is in already use. - ERROR_REC_DEVICE_REMOVED, // Device is removed. - ERROR_REC_SRTP_ERROR, // Generic sender SRTP failure. - ERROR_REC_SRTP_AUTH_FAILED, // Failed to authenticate packets. - ERROR_REC_CPU_MAX_CANT_DOWNGRADE, // Can't downgrade capture anymore. - ERROR_PLAY_SRTP_ERROR = 200, // Generic receiver SRTP failure. - ERROR_PLAY_SRTP_AUTH_FAILED, // Failed to authenticate packets. - ERROR_PLAY_SRTP_REPLAY, // Packet replay detected. - }; - VideoMediaChannel() {} explicit VideoMediaChannel(const MediaConfig& config) : MediaChannel(config) {} @@ -1222,16 +1186,6 @@ struct DataRecvParameters : RtpParameters { class DataMediaChannel : public MediaChannel { public: - enum Error { - ERROR_NONE = 0, // No error. - ERROR_OTHER, // Other errors. - ERROR_SEND_SRTP_ERROR = 200, // Generic SRTP failure. - ERROR_SEND_SRTP_AUTH_FAILED, // Failed to authenticate packets. - ERROR_RECV_SRTP_ERROR, // Generic SRTP failure. - ERROR_RECV_SRTP_AUTH_FAILED, // Failed to authenticate packets. - ERROR_RECV_SRTP_REPLAY, // Packet replay detected. - }; - DataMediaChannel() {} explicit DataMediaChannel(const MediaConfig& config) : MediaChannel(config) {} virtual ~DataMediaChannel() {} diff --git a/media/base/testutils.h b/media/base/testutils.h index c31a339e2e..2cee107b30 100644 --- a/media/base/testutils.h +++ b/media/base/testutils.h @@ -103,20 +103,6 @@ class VideoCapturerListener bool resolution_changed_; }; -class VideoMediaErrorCatcher : public sigslot::has_slots<> { - public: - VideoMediaErrorCatcher() : ssrc_(0), error_(VideoMediaChannel::ERROR_NONE) { } - uint32_t ssrc() const { return ssrc_; } - VideoMediaChannel::Error error() const { return error_; } - void OnError(uint32_t ssrc, VideoMediaChannel::Error error) { - ssrc_ = ssrc; - error_ = error; - } - private: - uint32_t ssrc_; - VideoMediaChannel::Error error_; -}; - // Checks whether |codecs| contains |codec|; checks using Codec::Matches(). template bool ContainsMatchingCodec(const std::vector& codecs, const C& codec) { diff --git a/media/base/videoengine_unittest.h b/media/base/videoengine_unittest.h index d49f73b206..acbfc8d69a 100644 --- a/media/base/videoengine_unittest.h +++ b/media/base/videoengine_unittest.h @@ -92,7 +92,6 @@ class VideoMediaChannelTest : public testing::Test, EXPECT_TRUE(channel_.get() != NULL); network_interface_.SetDestination(channel_.get()); channel_->SetInterface(&network_interface_); - media_error_ = cricket::VideoMediaChannel::ERROR_NONE; cricket::VideoRecvParameters parameters; parameters.codecs = engine_.codecs(); channel_->SetRecvParameters(parameters); @@ -344,11 +343,6 @@ class VideoMediaChannelTest : public testing::Test, return true; } - void OnVideoChannelError(uint32_t ssrc, - cricket::VideoMediaChannel::Error error) { - media_error_ = error; - } - // Test that SetSend works. void SetSend() { EXPECT_FALSE(channel_->sending()); @@ -942,7 +936,6 @@ class VideoMediaChannelTest : public testing::Test, std::unique_ptr channel_; cricket::FakeNetworkInterface network_interface_; cricket::FakeVideoRenderer renderer_; - cricket::VideoMediaChannel::Error media_error_; // Used by test cases where 2 streams are run on the same channel. cricket::FakeVideoRenderer renderer2_; diff --git a/pc/channel.cc b/pc/channel.cc index 283c624059..14ab3df5e2 100644 --- a/pc/channel.cc +++ b/pc/channel.cc @@ -57,7 +57,6 @@ enum { MSG_EARLYMEDIATIMEOUT = 1, MSG_SEND_RTP_PACKET, MSG_SEND_RTCP_PACKET, - MSG_CHANNEL_ERROR, MSG_READYTOSENDDATA, MSG_DATARECEIVED, MSG_FIRSTPACKETRECEIVED, @@ -69,30 +68,6 @@ static void SafeSetError(const std::string& message, std::string* error_desc) { } } -struct VoiceChannelErrorMessageData : public rtc::MessageData { - VoiceChannelErrorMessageData(uint32_t in_ssrc, - VoiceMediaChannel::Error in_error) - : ssrc(in_ssrc), error(in_error) {} - uint32_t ssrc; - VoiceMediaChannel::Error error; -}; - -struct VideoChannelErrorMessageData : public rtc::MessageData { - VideoChannelErrorMessageData(uint32_t in_ssrc, - VideoMediaChannel::Error in_error) - : ssrc(in_ssrc), error(in_error) {} - uint32_t ssrc; - VideoMediaChannel::Error error; -}; - -struct DataChannelErrorMessageData : public rtc::MessageData { - DataChannelErrorMessageData(uint32_t in_ssrc, - DataMediaChannel::Error in_error) - : ssrc(in_ssrc), error(in_error) {} - uint32_t ssrc; - DataMediaChannel::Error error; -}; - static bool ValidPacket(bool rtcp, const rtc::CopyOnWriteBuffer* packet) { // Check the packet size. We could check the header too if needed. return packet && IsValidRtpRtcpPacketSize(rtcp, packet->size()); @@ -1538,12 +1513,6 @@ void VoiceChannel::OnMessage(rtc::Message *pmsg) { case MSG_EARLYMEDIATIMEOUT: HandleEarlyMediaTimeout(); break; - case MSG_CHANNEL_ERROR: { - VoiceChannelErrorMessageData* data = - static_cast(pmsg->pdata); - delete data; - break; - } default: BaseChannel::OnMessage(pmsg); break; @@ -1799,20 +1768,6 @@ bool VideoChannel::SetRemoteContent_w(const MediaContentDescription* content, return true; } -void VideoChannel::OnMessage(rtc::Message *pmsg) { - switch (pmsg->message_id) { - case MSG_CHANNEL_ERROR: { - const VideoChannelErrorMessageData* data = - static_cast(pmsg->pdata); - delete data; - break; - } - default: - BaseChannel::OnMessage(pmsg); - break; - } -} - void VideoChannel::OnConnectionMonitorUpdate( ConnectionMonitor* monitor, const std::vector &infos) { SignalConnectionMonitor(this, infos); @@ -2043,12 +1998,6 @@ void RtpDataChannel::OnMessage(rtc::Message* pmsg) { delete data; break; } - case MSG_CHANNEL_ERROR: { - const DataChannelErrorMessageData* data = - static_cast(pmsg->pdata); - delete data; - break; - } default: BaseChannel::OnMessage(pmsg); break; @@ -2091,13 +2040,6 @@ void RtpDataChannel::OnDataReceived(const ReceiveDataParams& params, signaling_thread()->Post(RTC_FROM_HERE, this, MSG_DATARECEIVED, msg); } -void RtpDataChannel::OnDataChannelError(uint32_t ssrc, - DataMediaChannel::Error err) { - DataChannelErrorMessageData* data = new DataChannelErrorMessageData( - ssrc, err); - signaling_thread()->Post(RTC_FROM_HERE, this, MSG_CHANNEL_ERROR, data); -} - void RtpDataChannel::OnDataChannelReadyToSend(bool writable) { // This is usded for congestion control to indicate that the stream is ready // to send by the MediaChannel, as opposed to OnReadyToSend, which indicates diff --git a/pc/channel.h b/pc/channel.h index 04c3d6e285..a7d140e479 100644 --- a/pc/channel.h +++ b/pc/channel.h @@ -627,7 +627,6 @@ class VideoChannel : public BaseChannel { bool SetRtpReceiveParameters_w(uint32_t ssrc, webrtc::RtpParameters parameters); - void OnMessage(rtc::Message* pmsg) override; void OnConnectionMonitorUpdate( ConnectionMonitor* monitor, const std::vector& infos) override; @@ -745,7 +744,6 @@ class RtpDataChannel : public BaseChannel { const DataMediaInfo& info); void OnDataReceived( const ReceiveDataParams& params, const char* data, size_t len); - void OnDataChannelError(uint32_t ssrc, DataMediaChannel::Error error); void OnDataChannelReadyToSend(bool writable); std::unique_ptr media_monitor_;