Revert "Fix the "Failed unprotect audio RTP packet" error when SCTP is bundled with audio."

This reverts commit 56631a14bdae24aa0bfaceeb2b57df729fee1227.

TBR=henrike@webrtc.org
BUG=3235

Review URL: https://webrtc-codereview.appspot.com/19669004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6363 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
jiayl@webrtc.org 2014-06-06 22:32:57 +00:00
parent 013bdf802a
commit e3cdd9959e
5 changed files with 5 additions and 35 deletions

View File

@ -223,15 +223,4 @@ bool SetRtpHeader(void* data, size_t len, const RtpHeader& header) {
SetRtpSsrc(data, len, header.ssrc));
}
bool IsRtpPacket(const void* data, size_t len) {
if (len < kMinRtpPacketLen)
return false;
int version = 0;
if (!GetRtpVersion(data, len, &version))
return false;
return version == kRtpVersion;
}
} // namespace cricket

View File

@ -74,7 +74,6 @@ bool SetRtpSsrc(void* data, size_t len, uint32 value);
// Assumes version 2, no padding, no extensions, no csrcs.
bool SetRtpHeader(void* data, size_t len, const RtpHeader& header);
bool IsRtpPacket(const void* data, size_t len);
} // namespace cricket
#endif // TALK_MEDIA_BASE_RTPUTILS_H_

View File

@ -34,7 +34,6 @@
#include "talk/base/stream.h"
#include "talk/base/sslstreamadapter.h"
#include "talk/base/thread.h"
#include "talk/media/base/rtputils.h"
#include "talk/p2p/base/common.h"
namespace cricket {
@ -42,11 +41,16 @@ namespace cricket {
// We don't pull the RTP constants from rtputils.h, to avoid a layer violation.
static const size_t kDtlsRecordHeaderLen = 13;
static const size_t kMaxDtlsPacketLen = 2048;
static const size_t kMinRtpPacketLen = 12;
static bool IsDtlsPacket(const char* data, size_t len) {
const uint8* u = reinterpret_cast<const uint8*>(data);
return (len >= kDtlsRecordHeaderLen && (u[0] > 19 && u[0] < 64));
}
static bool IsRtpPacket(const char* data, size_t len) {
const uint8* u = reinterpret_cast<const uint8*>(data);
return (len >= kMinRtpPacketLen && (u[0] & 0xC0) == 0x80);
}
talk_base::StreamResult StreamInterfaceChannel::Read(void* buffer,
size_t buffer_len,

View File

@ -47,11 +47,6 @@ bool BundleFilter::DemuxPacket(const char* data, size_t len, bool rtcp) {
// |streams_| is empty, we will allow all rtcp packets pass through provided
// that they are valid rtcp packets in case that they are for early media.
if (!rtcp) {
// It may not be a RTP packet (e.g. SCTP).
if (!IsRtpPacket(data, len)) {
return false;
}
int payload_type = 0;
if (!GetRtpPayloadType(data, len, &payload_type)) {
return false;

View File

@ -105,15 +105,6 @@ static const unsigned char kRtcpPacketNonCompoundRtcpPliFeedback[] = {
0x81, 0xCE, 0x00, 0x0C, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0x11, 0x11,
};
// An SCTP packet.
static const unsigned char kSctpPacket[] = {
0x00, 0x01, 0x00, 0x01,
0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x04,
0x00, 0x00, 0x00, 0x00,
};
TEST(BundleFilterTest, AddRemoveStreamTest) {
cricket::BundleFilter bundle_filter;
EXPECT_FALSE(bundle_filter.HasStreams());
@ -203,11 +194,3 @@ TEST(BundleFilterTest, RtcpPacketTest) {
reinterpret_cast<const char*>(kRtcpPacketSrSsrc2),
sizeof(kRtcpPacketSrSsrc2), true));
}
TEST(BundleFilterTest, InvalidRtpPacket) {
cricket::BundleFilter bundle_filter;
EXPECT_TRUE(bundle_filter.AddStream(StreamParams::CreateLegacy(kSsrc1)));
EXPECT_FALSE(bundle_filter.DemuxPacket(
reinterpret_cast<const char*>(kSctpPacket),
sizeof(kSctpPacket), false));
}