This CL is to adding feedback of packet loss rate to encoder in voice engine. A direct reason for doing it is to make use of Opus FEC, which can adapt itself to changes in the packet loss rate.
This CL is going to be combined with another CL in ACM, which is to be landed.
TEST=passed_try_bots
BUG=
R=stefan@webrtc.org, xians@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/13449004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@6262 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/voice_engine/channel.h b/webrtc/voice_engine/channel.h
index 2eba91e..7c8a3e2 100644
--- a/webrtc/voice_engine/channel.h
+++ b/webrtc/voice_engine/channel.h
@@ -16,6 +16,7 @@
#include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"
#include "webrtc/modules/audio_conference_mixer/interface/audio_conference_mixer_defines.h"
#include "webrtc/modules/audio_processing/rms_level.h"
+#include "webrtc/modules/bitrate_controller/include/bitrate_controller.h"
#include "webrtc/modules/rtp_rtcp/interface/rtp_header_parser.h"
#include "webrtc/modules/rtp_rtcp/interface/rtp_rtcp.h"
#include "webrtc/modules/utility/interface/file_player.h"
@@ -335,8 +336,10 @@
unsigned int& discardedPackets);
int GetRemoteRTCPReportBlocks(std::vector<ReportBlock>* report_blocks);
int GetRTPStatistics(CallStatistics& stats);
- int SetFECStatus(bool enable, int redPayloadtype);
- int GetFECStatus(bool& enabled, int& redPayloadtype);
+ int SetREDStatus(bool enable, int redPayloadtype);
+ int GetREDStatus(bool& enabled, int& redPayloadtype);
+ int SetCodecFECStatus(bool enable);
+ bool GetCodecFECStatus();
void SetNACKStatus(bool enable, int maxNumberOfPackets);
int StartRTPDump(const char fileNameUTF8[1024], RTPDirections direction);
int StopRTPDump(RTPDirections direction);
@@ -471,6 +474,11 @@
uint32_t PrepareEncodeAndSend(int mixingFrequency);
uint32_t EncodeAndSend();
+ // From BitrateObserver (called by the RTP/RTCP module).
+ void OnNetworkChanged(const uint32_t bitrate_bps,
+ const uint8_t fraction_lost, // 0 - 255.
+ const uint32_t rtt);
+
private:
bool ReceivePacket(const uint8_t* packet, int packet_length,
const RTPHeader& header, bool in_order);
@@ -603,6 +611,10 @@
bool _rxAgcIsEnabled;
bool _rxNsIsEnabled;
bool restored_packet_in_use_;
+ // RtcpBandwidthObserver
+ scoped_ptr<BitrateController> bitrate_controller_;
+ scoped_ptr<RtcpBandwidthObserver> rtcp_bandwidth_observer_;
+ scoped_ptr<BitrateObserver> send_bitrate_observer_;
};
} // namespace voe