Report total bitrate for all streams in GetStats.

This regression wasn't caught because I accidentally disabled multiple
streams for EndToEndTest.GetStats in a refactoring.

R=stefan@webrtc.org, xians@webrtc.org
BUG=1667

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7701 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pbos@webrtc.org 2014-11-14 11:52:04 +00:00
parent 35c1ace185
commit ece3890d3a
24 changed files with 22 additions and 470 deletions

View File

@ -1220,8 +1220,6 @@ class FakeWebRtcVideoEngine
WEBRTC_STUB(StopRTPDump, (const int, webrtc::RTPDirections));
WEBRTC_STUB(RegisterRTPObserver, (const int, webrtc::ViERTPObserver&));
WEBRTC_STUB(DeregisterRTPObserver, (const int));
WEBRTC_STUB(RegisterRTCPObserver, (const int, webrtc::ViERTCPObserver&));
WEBRTC_STUB(DeregisterRTCPObserver, (const int));
// webrtc::ViEImageProcess
WEBRTC_STUB(RegisterCaptureEffectFilter, (const int,

View File

@ -883,9 +883,6 @@ class FakeWebRtcVoiceEngine
WEBRTC_STUB(RegisterRTPObserver, (int channel,
webrtc::VoERTPObserver& observer));
WEBRTC_STUB(DeRegisterRTPObserver, (int channel));
WEBRTC_STUB(RegisterRTCPObserver, (int channel,
webrtc::VoERTCPObserver& observer));
WEBRTC_STUB(DeRegisterRTCPObserver, (int channel));
WEBRTC_FUNC(SetLocalSSRC, (int channel, unsigned int ssrc)) {
WEBRTC_CHECK_CHANNEL(channel);
channels_[channel]->send_ssrc = ssrc;

View File

@ -42,8 +42,6 @@ class RtpRtcp : public Module {
* will do nothing.
* outgoing_transport - Transport object that will be called when packets
* are ready to be sent out on the network
* rtcp_feedback - Callback object that will receive the incoming
* RTCP messages.
* intra_frame_callback - Called when the receiver request a intra frame.
* bandwidth_callback - Called when we receive a changed estimate from
* the receiver of out stream.
@ -60,7 +58,6 @@ class RtpRtcp : public Module {
RtpRtcp* default_module;
ReceiveStatistics* receive_statistics;
Transport* outgoing_transport;
RtcpFeedback* rtcp_feedback;
RtcpIntraFrameObserver* intra_frame_callback;
RtcpBandwidthObserver* bandwidth_callback;
RtcpRttStats* rtt_stats;

View File

@ -227,26 +227,6 @@ public:
int packet_length) = 0;
};
class RtcpFeedback
{
public:
virtual void OnApplicationDataReceived(const int32_t /*id*/,
const uint8_t /*subType*/,
const uint32_t /*name*/,
const uint16_t /*length*/,
const uint8_t* /*data*/) {};
virtual void OnXRVoIPMetricReceived(
const int32_t /*id*/,
const RTCPVoIPMetric* /*metric*/) {};
virtual void OnReceiveReportReceived(const int32_t id,
const uint32_t senderSSRC) {};
protected:
virtual ~RtcpFeedback() {}
};
class RtpFeedback
{
public:

View File

@ -136,10 +136,9 @@ class MockRtpRtcp : public RtpRtcp {
int(int bytes));
MOCK_CONST_METHOD2(GetSendSideDelay,
bool(int* avg_send_delay_ms, int* max_send_delay_ms));
MOCK_METHOD3(RegisterRtcpObservers,
MOCK_METHOD2(RegisterRtcpObservers,
void(RtcpIntraFrameObserver* intraFrameCallback,
RtcpBandwidthObserver* bandwidthCallback,
RtcpFeedback* callback));
RtcpBandwidthObserver* bandwidthCallback));
MOCK_CONST_METHOD0(RTCP,
RTCPMethod());
MOCK_METHOD1(SetRTCPStatus,

View File

@ -38,7 +38,6 @@ RTCPReceiver::RTCPReceiver(const int32_t id, Clock* clock,
_rtpRtcp(*owner),
_criticalSectionFeedbacks(
CriticalSectionWrapper::CreateCriticalSection()),
_cbRtcpFeedback(NULL),
_cbRtcpBandwidthObserver(NULL),
_cbRtcpIntraFrameObserver(NULL),
_criticalSectionRTCPReceiver(
@ -145,12 +144,10 @@ uint32_t RTCPReceiver::RemoteSSRC() const {
void RTCPReceiver::RegisterRtcpObservers(
RtcpIntraFrameObserver* intra_frame_callback,
RtcpBandwidthObserver* bandwidth_callback,
RtcpFeedback* feedback_callback) {
RtcpBandwidthObserver* bandwidth_callback) {
CriticalSectionScoped lock(_criticalSectionFeedbacks);
_cbRtcpIntraFrameObserver = intra_frame_callback;
_cbRtcpBandwidthObserver = bandwidth_callback;
_cbRtcpFeedback = feedback_callback;
}
void RTCPReceiver::SetSsrcs(uint32_t main_ssrc,
@ -1442,23 +1439,6 @@ void RTCPReceiver::TriggerCallbacksFromRTCPPacket(
now);
}
}
if(_cbRtcpFeedback) {
if(!(rtcpPacketInformation.rtcpPacketTypeFlags & kRtcpSr)) {
_cbRtcpFeedback->OnReceiveReportReceived(_id,
rtcpPacketInformation.remoteSSRC);
}
if(rtcpPacketInformation.rtcpPacketTypeFlags & kRtcpXrVoipMetric) {
_cbRtcpFeedback->OnXRVoIPMetricReceived(_id,
rtcpPacketInformation.VoIPMetric);
}
if(rtcpPacketInformation.rtcpPacketTypeFlags & kRtcpApp) {
_cbRtcpFeedback->OnApplicationDataReceived(_id,
rtcpPacketInformation.applicationSubType,
rtcpPacketInformation.applicationName,
rtcpPacketInformation.applicationLength,
rtcpPacketInformation.applicationData);
}
}
}
{

View File

@ -49,8 +49,7 @@ public:
uint32_t RelaySSRC() const;
void RegisterRtcpObservers(RtcpIntraFrameObserver* intra_frame_callback,
RtcpBandwidthObserver* bandwidth_callback,
RtcpFeedback* feedback_callback);
RtcpBandwidthObserver* bandwidth_callback);
int32_t IncomingRTCPPacket(
RTCPHelp::RTCPPacketInformation& rtcpPacketInformation,
@ -228,7 +227,6 @@ protected:
ModuleRtpRtcpImpl& _rtpRtcp;
CriticalSectionWrapper* _criticalSectionFeedbacks;
RtcpFeedback* _cbRtcpFeedback;
RtcpBandwidthObserver* _cbRtcpBandwidthObserver;
RtcpIntraFrameObserver* _cbRtcpIntraFrameObserver;

View File

@ -31,7 +31,6 @@ RtpRtcp::Configuration::Configuration()
default_module(NULL),
receive_statistics(NullObjectReceiveStatistics()),
outgoing_transport(NULL),
rtcp_feedback(NULL),
intra_frame_callback(NULL),
bandwidth_callback(NULL),
rtt_stats(NULL),
@ -102,8 +101,7 @@ ModuleRtpRtcpImpl::ModuleRtpRtcpImpl(const Configuration& configuration)
}
// TODO(pwestin) move to constructors of each rtp/rtcp sender/receiver object.
rtcp_receiver_.RegisterRtcpObservers(configuration.intra_frame_callback,
configuration.bandwidth_callback,
configuration.rtcp_feedback);
configuration.bandwidth_callback);
rtcp_sender_.RegisterSendTransport(configuration.outgoing_transport);
// Make sure that RTCP objects are aware of our SSRC.

View File

@ -24,7 +24,7 @@ using namespace webrtc;
const uint64_t kTestPictureId = 12345678;
class RtcpCallback : public RtcpFeedback, public RtcpIntraFrameObserver {
class RtcpCallback : public RtcpIntraFrameObserver {
public:
void SetModule(RtpRtcp* module) {
_rtpRtcpModule = module;
@ -34,27 +34,6 @@ class RtcpCallback : public RtcpFeedback, public RtcpIntraFrameObserver {
virtual void OnLipSyncUpdate(const int32_t id,
const int32_t audioVideoOffset) {
};
virtual void OnXRVoIPMetricReceived(
const int32_t id,
const RTCPVoIPMetric* metric) {
};
virtual void OnApplicationDataReceived(const int32_t id,
const uint8_t subType,
const uint32_t name,
const uint16_t length,
const uint8_t* data) {
char print_name[5];
print_name[0] = static_cast<char>(name >> 24);
print_name[1] = static_cast<char>(name >> 16);
print_name[2] = static_cast<char>(name >> 8);
print_name[3] = static_cast<char>(name);
print_name[4] = 0;
EXPECT_STRCASEEQ("test", print_name);
};
virtual void OnReceiveReportReceived(const int32_t id,
const uint32_t senderSSRC) {
};
virtual void OnReceivedIntraFrameRequest(uint32_t ssrc) {
};
virtual void OnReceivedSLI(uint32_t ssrc,
@ -112,7 +91,6 @@ class RtpRtcpRtcpTest : public ::testing::Test {
configuration.clock = &fake_clock;
configuration.receive_statistics = receive_statistics1_.get();
configuration.outgoing_transport = transport1;
configuration.rtcp_feedback = myRTCPFeedback1;
configuration.intra_frame_callback = myRTCPFeedback1;
rtp_payload_registry1_.reset(new RTPPayloadRegistry(
@ -131,7 +109,6 @@ class RtpRtcpRtcpTest : public ::testing::Test {
configuration.receive_statistics = receive_statistics2_.get();
configuration.id = test_id + 1;
configuration.outgoing_transport = transport2;
configuration.rtcp_feedback = myRTCPFeedback2;
configuration.intra_frame_callback = myRTCPFeedback2;
module2 = RtpRtcp::CreateRtpRtcp(configuration);

View File

@ -1578,6 +1578,8 @@ TEST_F(EndToEndTest, GetStats) {
expected_cname_ = send_config->rtp.c_name;
}
virtual size_t GetNumStreams() const OVERRIDE { return kNumSsrcs; }
virtual void OnStreamsCreated(
VideoSendStream* send_stream,
const std::vector<VideoReceiveStream*>& receive_streams) OVERRIDE {

View File

@ -69,25 +69,6 @@ class WEBRTC_DLLEXPORT ViERTPObserver {
virtual ~ViERTPObserver() {}
};
// This class declares an abstract interface for a user defined observer. It is
// up to the VideoEngine user to implement a derived class which implements the
// observer class. The observer is registered using RegisterRTCPObserver() and
// deregistered using DeregisterRTCPObserver().
class WEBRTC_DLLEXPORT ViERTCPObserver {
public:
// This method is called if a application-defined RTCP packet has been
// received.
virtual void OnApplicationDataReceived(
const int video_channel,
const unsigned char sub_type,
const unsigned int name,
const char* data,
const unsigned short data_length_in_bytes) = 0;
protected:
virtual ~ViERTCPObserver() {}
};
class WEBRTC_DLLEXPORT ViERTP_RTCP {
public:
enum { KDefaultDeltaTransmitTimeSeconds = 15 };
@ -468,13 +449,6 @@ class WEBRTC_DLLEXPORT ViERTP_RTCP {
// Removes a registered instance of ViERTPObserver.
virtual int DeregisterRTPObserver(const int video_channel) = 0;
// Registers an instance of a user implementation of the ViERTCPObserver.
virtual int RegisterRTCPObserver(const int video_channel,
ViERTCPObserver& observer) = 0;
// Removes a registered instance of ViERTCPObserver.
virtual int DeregisterRTCPObserver(const int video_channel) = 0;
// Registers and instance of a user implementation of ViEFrameCountObserver
virtual int RegisterSendFrameCountObserver(
int video_channel, FrameCountObserver* observer) = 0;

View File

@ -52,9 +52,4 @@ TEST_F(DISABLED_ON_MAC(ViEExtendedIntegrationTest),
tests_->ViERenderExtendedTest();
}
TEST_F(DISABLED_ON_MAC(ViEExtendedIntegrationTest),
DISABLED_RunsRtpRtcpTestWithoutErrors) {
tests_->ViERtpRtcpExtendedTest();
}
} // namespace

View File

@ -100,7 +100,6 @@ public:
// vie_autotest_rtp_rtcp.cc
void ViERtpRtcpStandardTest();
void ViERtpRtcpExtendedTest();
void ViERtpRtcpAPITest();
private:

View File

@ -76,7 +76,6 @@ void ViEAutoTest::ViEExtendedTest()
ViECodecExtendedTest();
ViEImageProcessExtendedTest();
ViERenderExtendedTest();
ViERtpRtcpExtendedTest();
}
void ViEAutoTest::ViEAPITest()

View File

@ -150,7 +150,8 @@ int ViEAutoTestAndroid::RunAutotest(int testSelection, int subTestSelection,
break;
case 8: // RTP/RTCP
vieAutoTest.ViERtpRtcpExtendedTest();
// Note that this test is removed. It hasn't been properly cleaned up
// because this hopefully going away soon.
break;
default:

View File

@ -40,52 +40,6 @@ public:
}
};
class ViERtcpObserver: public webrtc::ViERTCPObserver
{
public:
int _channel;
unsigned char _subType;
unsigned int _name;
char* _data;
unsigned short _dataLength;
ViERtcpObserver() :
_channel(-1),
_subType(0),
_name(0),
_data(NULL),
_dataLength(0)
{
}
~ViERtcpObserver()
{
if (_data)
{
delete[] _data;
}
}
virtual void OnApplicationDataReceived(
const int videoChannel, const unsigned char subType,
const unsigned int name, const char* data,
const unsigned short dataLengthInBytes)
{
_channel = videoChannel;
_subType = subType;
_name = name;
if (dataLengthInBytes > _dataLength)
{
delete[] _data;
_data = NULL;
}
if (_data == NULL)
{
_data = new char[dataLengthInBytes];
}
memcpy(_data, data, dataLengthInBytes);
_dataLength = dataLengthInBytes;
}
};
void ViEAutoTest::ViERtpRtcpStandardTest()
{
// ***************************************************************
@ -630,70 +584,6 @@ void ViEAutoTest::ViERtpRtcpStandardTest()
//***************************************************************
}
void ViEAutoTest::ViERtpRtcpExtendedTest()
{
//***************************************************************
// Begin create/initialize WebRTC Video Engine for testing
//***************************************************************
// Create VIE
TbInterfaces ViE("ViERtpRtcpExtendedTest");
// Create a video channel
TbVideoChannel tbChannel(ViE, webrtc::kVideoCodecVP8);
// Create a capture device
TbCaptureDevice tbCapture(ViE);
tbCapture.ConnectTo(tbChannel.videoChannel);
//tbChannel.StartReceive(rtpPort);
//tbChannel.StartSend(rtpPort);
TbExternalTransport myTransport(*(ViE.network), tbChannel.videoChannel,
NULL);
EXPECT_EQ(0, ViE.network->DeregisterSendTransport(tbChannel.videoChannel));
EXPECT_EQ(0, ViE.network->RegisterSendTransport(
tbChannel.videoChannel, myTransport));
EXPECT_EQ(0, ViE.base->StartReceive(tbChannel.videoChannel));
EXPECT_EQ(0, ViE.base->StartSend(tbChannel.videoChannel));
//***************************************************************
// Engine ready. Begin testing class
//***************************************************************
//
// Application specific RTCP
//
//
ViERtcpObserver rtcpObserver;
EXPECT_EQ(0, ViE.rtp_rtcp->RegisterRTCPObserver(
tbChannel.videoChannel, rtcpObserver));
unsigned char subType = 3;
unsigned int name = static_cast<unsigned int> (0x41424344); // 'ABCD';
const char* data = "ViEAutoTest Data of length 32 -\0";
const unsigned short numBytes = 32;
EXPECT_EQ(0, ViE.rtp_rtcp->SendApplicationDefinedRTCPPacket(
tbChannel.videoChannel, subType, name, data, numBytes));
ViETest::Log("Sending RTCP application data...\n");
AutoTestSleep(kAutoTestSleepTimeMs);
EXPECT_EQ(subType, rtcpObserver._subType);
EXPECT_STRCASEEQ(data, rtcpObserver._data);
EXPECT_EQ(name, rtcpObserver._name);
EXPECT_EQ(numBytes, rtcpObserver._dataLength);
ViETest::Log("\t RTCP application data received\n");
//***************************************************************
// Testing finished. Tear down Video Engine
//***************************************************************
EXPECT_EQ(0, ViE.base->StopReceive(tbChannel.videoChannel));
EXPECT_EQ(0, ViE.base->StopSend(tbChannel.videoChannel));
EXPECT_EQ(0, ViE.network->DeregisterSendTransport(tbChannel.videoChannel));
}
void ViEAutoTest::ViERtpRtcpAPITest()
{
//***************************************************************
@ -853,16 +743,6 @@ void ViEAutoTest::ViERtpRtcpAPITest()
tbChannel.videoChannel));
EXPECT_NE(0, ViE.rtp_rtcp->DeregisterRTPObserver(
tbChannel.videoChannel));
ViERtcpObserver rtcpObserver;
EXPECT_EQ(0, ViE.rtp_rtcp->RegisterRTCPObserver(
tbChannel.videoChannel, rtcpObserver));
EXPECT_NE(0, ViE.rtp_rtcp->RegisterRTCPObserver(
tbChannel.videoChannel, rtcpObserver));
EXPECT_EQ(0, ViE.rtp_rtcp->DeregisterRTCPObserver(
tbChannel.videoChannel));
EXPECT_NE(0, ViE.rtp_rtcp->DeregisterRTCPObserver(
tbChannel.videoChannel));
}
//
// PLI

View File

@ -130,7 +130,6 @@ ViEChannel::ViEChannel(int32_t channel_id,
codec_observer_(NULL),
do_key_frame_callbackRequest_(false),
rtp_observer_(NULL),
rtcp_observer_(NULL),
intra_frame_observer_(intra_frame_observer),
rtt_stats_(rtt_stats),
paced_sender_(paced_sender),
@ -150,22 +149,9 @@ ViEChannel::ViEChannel(int32_t channel_id,
max_nack_reordering_threshold_(kMaxPacketAgeToNack),
pre_render_callback_(NULL),
start_ms_(Clock::GetRealTimeClock()->TimeInMilliseconds()) {
RtpRtcp::Configuration configuration;
configuration.id = ViEModuleId(engine_id, channel_id);
configuration.audio = false;
configuration.default_module = default_rtp_rtcp;
configuration.outgoing_transport = &vie_sender_;
configuration.rtcp_feedback = this;
configuration.intra_frame_callback = intra_frame_observer;
configuration.bandwidth_callback = bandwidth_observer;
configuration.rtt_stats = rtt_stats;
RtpRtcp::Configuration configuration = CreateRtpRtcpConfiguration();
configuration.remote_bitrate_estimator = remote_bitrate_estimator;
configuration.paced_sender = paced_sender;
configuration.receive_statistics = vie_receiver_.GetReceiveStatistics();
configuration.send_bitrate_observer = &send_bitrate_observer_;
configuration.send_frame_count_observer = &send_frame_count_observer_;
configuration.send_side_delay_observer = &send_side_delay_observer_;
rtp_rtcp_.reset(RtpRtcp::CreateRtpRtcp(configuration));
vie_receiver_.SetRtpRtcpModule(rtp_rtcp_.get());
vcm_->SetNackSettings(kMaxNackListSize, max_nack_reordering_threshold_, 0);
@ -1013,20 +999,6 @@ int32_t ViEChannel::RegisterRtpObserver(ViERTPObserver* observer) {
return 0;
}
int32_t ViEChannel::RegisterRtcpObserver(ViERTCPObserver* observer) {
CriticalSectionScoped cs(callback_cs_.get());
if (observer) {
if (rtcp_observer_) {
LOG_F(LS_ERROR) << "Observer already registered.";
return -1;
}
rtcp_observer_ = observer;
} else {
rtcp_observer_ = NULL;
}
return 0;
}
int32_t ViEChannel::SendApplicationDefinedRTCPPacket(
const uint8_t sub_type,
uint32_t name,
@ -1640,19 +1612,25 @@ RtpRtcp* ViEChannel::GetRtpRtcpModule(size_t index) const {
return *it;
}
RtpRtcp* ViEChannel::CreateRtpRtcpModule() {
RtpRtcp::Configuration ViEChannel::CreateRtpRtcpConfiguration() {
RtpRtcp::Configuration configuration;
configuration.id = ViEModuleId(engine_id_, channel_id_);
configuration.audio = false; // Video.
configuration.audio = false;
configuration.default_module = default_rtp_rtcp_;
configuration.outgoing_transport = &vie_sender_;
configuration.intra_frame_callback = intra_frame_observer_;
configuration.bandwidth_callback = bandwidth_observer_.get();
configuration.rtt_stats = rtt_stats_;
configuration.paced_sender = paced_sender_;
configuration.send_bitrate_observer = &send_bitrate_observer_;
configuration.send_frame_count_observer = &send_frame_count_observer_;
configuration.send_side_delay_observer = &send_side_delay_observer_;
return RtpRtcp::CreateRtpRtcp(configuration);
return configuration;
}
RtpRtcp* ViEChannel::CreateRtpRtcpModule() {
return RtpRtcp::CreateRtpRtcp(CreateRtpRtcpConfiguration());
}
int32_t ViEChannel::StartDecodeThread() {
@ -1732,24 +1710,6 @@ void ViEChannel::RegisterPreDecodeImageCallback(
vcm_->RegisterPreDecodeImageCallback(pre_decode_callback);
}
void ViEChannel::OnApplicationDataReceived(const int32_t id,
const uint8_t sub_type,
const uint32_t name,
const uint16_t length,
const uint8_t* data) {
if (channel_id_ != ChannelId(id)) {
return;
}
CriticalSectionScoped cs(callback_cs_.get());
{
if (rtcp_observer_) {
rtcp_observer_->OnApplicationDataReceived(
channel_id_, sub_type, name, reinterpret_cast<const char*>(data),
length);
}
}
}
int32_t ViEChannel::OnInitializeDecoder(
const int32_t id,
const int8_t payload_type,

View File

@ -14,6 +14,7 @@
#include <list>
#include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h"
#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h"
#include "webrtc/modules/video_coding/main/interface/video_coding_defines.h"
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
@ -39,11 +40,9 @@ class I420FrameCallback;
class PacedSender;
class ProcessThread;
class RtcpRttStats;
class RtpRtcp;
class ThreadWrapper;
class ViEDecoderObserver;
class ViEEffectFilter;
class ViERTCPObserver;
class ViERTPObserver;
class VideoCodingModule;
class VideoDecoder;
@ -56,7 +55,6 @@ class ViEChannel
public VCMReceiveStatisticsCallback,
public VCMDecoderTimingCallback,
public VCMPacketRequestCallback,
public RtcpFeedback,
public RtpFeedback,
public ViEFrameProviderBase {
public:
@ -162,7 +160,6 @@ class ViEChannel
// Gets the CName of the incoming stream.
int32_t GetRemoteRTCPCName(char rtcp_cname[]);
int32_t RegisterRtpObserver(ViERTPObserver* observer);
int32_t RegisterRtcpObserver(ViERTCPObserver* observer);
int32_t SendApplicationDefinedRTCPPacket(
const uint8_t sub_type,
uint32_t name,
@ -226,13 +223,6 @@ class ViEChannel
RTPDirections direction);
int32_t StopRTPDump(RTPDirections direction);
// Implements RtcpFeedback.
// TODO(pwestin) Depricate this functionality.
virtual void OnApplicationDataReceived(const int32_t id,
const uint8_t sub_type,
const uint32_t name,
const uint16_t length,
const uint8_t* data);
// Implements RtpFeedback.
virtual int32_t OnInitializeDecoder(
const int32_t id,
@ -370,6 +360,7 @@ class ViEChannel
EXCLUSIVE_LOCKS_REQUIRED(rtp_rtcp_cs_);
RtpRtcp* GetRtpRtcpModule(size_t simulcast_idx) const
EXCLUSIVE_LOCKS_REQUIRED(rtp_rtcp_cs_);
RtpRtcp::Configuration CreateRtpRtcpConfiguration();
RtpRtcp* CreateRtpRtcpModule();
// Assumed to be protected.
int32_t StartDecodeThread();
@ -475,7 +466,6 @@ class ViEChannel
ViEDecoderObserver* codec_observer_;
bool do_key_frame_callbackRequest_;
ViERTPObserver* rtp_observer_;
ViERTCPObserver* rtcp_observer_;
RtcpIntraFrameObserver* intra_frame_observer_;
RtcpRttStats* rtt_stats_;
PacedSender* paced_sender_;

View File

@ -906,37 +906,6 @@ int ViERTP_RTCPImpl::DeregisterRTPObserver(const int video_channel) {
return 0;
}
int ViERTP_RTCPImpl::RegisterRTCPObserver(const int video_channel,
ViERTCPObserver& observer) {
LOG_F(LS_INFO) << "channel " << video_channel;
ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
ViEChannel* vie_channel = cs.Channel(video_channel);
if (!vie_channel) {
shared_data_->SetLastError(kViERtpRtcpInvalidChannelId);
return -1;
}
if (vie_channel->RegisterRtcpObserver(&observer) != 0) {
shared_data_->SetLastError(kViERtpRtcpObserverAlreadyRegistered);
return -1;
}
return 0;
}
int ViERTP_RTCPImpl::DeregisterRTCPObserver(const int video_channel) {
LOG_F(LS_INFO) << "channel " << video_channel;
ViEChannelManagerScoped cs(*(shared_data_->channel_manager()));
ViEChannel* vie_channel = cs.Channel(video_channel);
if (!vie_channel) {
shared_data_->SetLastError(kViERtpRtcpInvalidChannelId);
return -1;
}
if (vie_channel->RegisterRtcpObserver(NULL) != 0) {
shared_data_->SetLastError(kViERtpRtcpObserverNotRegistered);
return -1;
}
return 0;
}
int ViERTP_RTCPImpl::RegisterSendChannelRtcpStatisticsCallback(
int video_channel, RtcpStatisticsCallback* callback) {
LOG_F(LS_INFO) << "channel " << video_channel;

View File

@ -133,9 +133,6 @@ class ViERTP_RTCPImpl
virtual int RegisterRTPObserver(const int video_channel,
ViERTPObserver& observer);
virtual int DeregisterRTPObserver(const int video_channel);
virtual int RegisterRTCPObserver(const int video_channel,
ViERTCPObserver& observer);
virtual int DeregisterRTCPObserver(const int video_channel);
virtual int RegisterSendChannelRtcpStatisticsCallback(
int channel, RtcpStatisticsCallback* callback);

View File

@ -323,36 +323,6 @@ void Channel::ResetStatistics(uint32_t ssrc) {
statistics_proxy_->ResetStatistics();
}
void
Channel::OnApplicationDataReceived(int32_t id,
uint8_t subType,
uint32_t name,
uint16_t length,
const uint8_t* data)
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::OnApplicationDataReceived(id=%d, subType=%u,"
" name=%u, length=%u)",
id, subType, name, length);
int32_t channel = VoEChannelId(id);
assert(channel == _channelId);
if (_rtcpObserver)
{
CriticalSectionScoped cs(&_callbackCritSect);
if (_rtcpObserverPtr)
{
_rtcpObserverPtr->OnApplicationDataReceived(channel,
subType,
name,
data,
length);
}
}
}
int32_t
Channel::OnInitializeDecoder(
int32_t id,
@ -790,10 +760,8 @@ Channel::Channel(int32_t channelId,
_rxVadObserverPtr(NULL),
_oldVadDecision(-1),
_sendFrameType(0),
_rtcpObserverPtr(NULL),
_externalMixing(false),
_mixFileWithMicrophone(false),
_rtcpObserver(false),
_mute(false),
_panLeft(1.0f),
_panRight(1.0f),
@ -832,7 +800,6 @@ Channel::Channel(int32_t channelId,
configuration.id = VoEModuleId(instanceId, channelId);
configuration.audio = true;
configuration.outgoing_transport = this;
configuration.rtcp_feedback = this;
configuration.audio_messages = this;
configuration.receive_statistics = rtp_receive_statistics_.get();
configuration.bandwidth_callback = rtcp_bandwidth_observer_.get();
@ -2871,48 +2838,6 @@ Channel::GetRxNsStatus(bool& enabled, NsModes& mode)
#endif // #ifdef WEBRTC_VOICE_ENGINE_NR
int
Channel::RegisterRTCPObserver(VoERTCPObserver& observer)
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId,_channelId),
"Channel::RegisterRTCPObserver()");
CriticalSectionScoped cs(&_callbackCritSect);
if (_rtcpObserverPtr)
{
_engineStatisticsPtr->SetLastError(
VE_INVALID_OPERATION, kTraceError,
"RegisterRTCPObserver() observer already enabled");
return -1;
}
_rtcpObserverPtr = &observer;
_rtcpObserver = true;
return 0;
}
int
Channel::DeRegisterRTCPObserver()
{
WEBRTC_TRACE(kTraceInfo, kTraceVoice, VoEId(_instanceId, _channelId),
"Channel::DeRegisterRTCPObserver()");
CriticalSectionScoped cs(&_callbackCritSect);
if (!_rtcpObserverPtr)
{
_engineStatisticsPtr->SetLastError(
VE_INVALID_OPERATION, kTraceWarning,
"DeRegisterRTCPObserver() observer already disabled");
return 0;
}
_rtcpObserver = false;
_rtcpObserverPtr = NULL;
return 0;
}
int
Channel::SetLocalSSRC(unsigned int ssrc)
{

View File

@ -59,7 +59,6 @@ class RtpRtcp;
class TelephoneEventHandler;
class ViENetwork;
class VoEMediaProcess;
class VoERTCPObserver;
class VoERTPObserver;
class VoiceEngineObserver;
@ -156,7 +155,6 @@ private:
class Channel:
public RtpData,
public RtpFeedback,
public RtcpFeedback,
public FileCallback, // receiving notification from file player & recorder
public Transport,
public RtpAudioFeedback,
@ -314,8 +312,6 @@ public:
#endif
// VoERTP_RTCP
int RegisterRTCPObserver(VoERTCPObserver& observer);
int DeRegisterRTCPObserver();
int SetLocalSSRC(unsigned int ssrc);
int GetLocalSSRC(unsigned int& ssrc);
int GetRemoteSSRC(unsigned int& ssrc);
@ -386,13 +382,6 @@ public:
uint32_t CSRC, bool added) OVERRIDE;
virtual void ResetStatistics(uint32_t ssrc) OVERRIDE;
// From RtcpFeedback in the RTP/RTCP module
virtual void OnApplicationDataReceived(int32_t id,
uint8_t subType,
uint32_t name,
uint16_t length,
const uint8_t* data) OVERRIDE;
// From RtpAudioFeedback in the RTP/RTCP module
virtual void OnPlayTelephoneEvent(int32_t id,
uint8_t event,
@ -565,11 +554,9 @@ private:
VoERxVadCallback* _rxVadObserverPtr;
int32_t _oldVadDecision;
int32_t _sendFrameType; // Send data is voice, 1-voice, 0-otherwise
VoERTCPObserver* _rtcpObserverPtr;
// VoEBase
bool _externalMixing;
bool _mixFileWithMicrophone;
bool _rtcpObserver;
// VoEVolumeControl
bool _mute;
float _panLeft;

View File

@ -61,19 +61,6 @@ protected:
virtual ~VoERTPObserver() {}
};
// VoERTCPObserver
class WEBRTC_DLLEXPORT VoERTCPObserver
{
public:
virtual void OnApplicationDataReceived(
int channel, unsigned char subType,
unsigned int name, const unsigned char* data,
unsigned short dataLengthInBytes) = 0;
protected:
virtual ~VoERTCPObserver() {}
};
// CallStatistics
struct CallStatistics
{
@ -268,9 +255,6 @@ public:
virtual int RegisterRTPObserver(int channel,
VoERTPObserver& observer) { return -1; };
virtual int DeRegisterRTPObserver(int channel) { return -1; };
virtual int RegisterRTCPObserver(
int channel, VoERTCPObserver& observer) { return -1; };
virtual int DeRegisterRTCPObserver(int channel) { return -1; };
virtual int GetRemoteCSRCs(int channel,
unsigned int arrCSRC[15]) { return -1; };
virtual int InsertExtraRTPPacket(

View File

@ -55,23 +55,6 @@ void TestRtpObserver::OnIncomingSSRCChanged(int channel,
}
}
class RtcpAppHandler : public webrtc::VoERTCPObserver {
public:
RtcpAppHandler() : length_in_bytes_(0), sub_type_(0), name_(0) {}
void OnApplicationDataReceived(int channel,
unsigned char sub_type,
unsigned int name,
const unsigned char* data,
unsigned short length_in_bytes);
void Reset();
~RtcpAppHandler() {}
unsigned short length_in_bytes_;
unsigned char data_[256];
unsigned char sub_type_;
unsigned int name_;
};
static const char* const RTCP_CNAME = "Whatever";
class RtpRtcpTest : public AfterStreamingFixture {
@ -104,23 +87,6 @@ class RtpRtcpTest : public AfterStreamingFixture {
LoopBackTransport* transport_;
};
void RtcpAppHandler::OnApplicationDataReceived(
const int /*channel*/, unsigned char sub_type,
unsigned int name, const unsigned char* data,
unsigned short length_in_bytes) {
length_in_bytes_ = length_in_bytes;
memcpy(data_, &data[0], length_in_bytes);
sub_type_ = sub_type;
name_ = name;
}
void RtcpAppHandler::Reset() {
length_in_bytes_ = 0;
memset(data_, 0, sizeof(data_));
sub_type_ = 0;
name_ = 0;
}
TEST_F(RtpRtcpTest, RemoteRtcpCnameHasPropagatedToRemoteSide) {
if (!FLAGS_include_timing_dependent_tests) {
TEST_LOG("Skipping test - running in slow execution environment...\n");