aboutsummaryrefslogtreecommitdiff
path: root/modules/audio_coding/codecs/red/audio_encoder_copy_red.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/audio_coding/codecs/red/audio_encoder_copy_red.h')
-rw-r--r--modules/audio_coding/codecs/red/audio_encoder_copy_red.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/modules/audio_coding/codecs/red/audio_encoder_copy_red.h b/modules/audio_coding/codecs/red/audio_encoder_copy_red.h
index 9acb9b842c..d5b1bf6868 100644
--- a/modules/audio_coding/codecs/red/audio_encoder_copy_red.h
+++ b/modules/audio_coding/codecs/red/audio_encoder_copy_red.h
@@ -14,6 +14,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <list>
#include <memory>
#include <utility>
@@ -26,10 +27,12 @@
namespace webrtc {
-// This class implements redundant audio coding. The class object will have an
-// underlying AudioEncoder object that performs the actual encodings. The
-// current class will gather the two latest encodings from the underlying codec
-// into one packet.
+// This class implements redundant audio coding as described in
+// https://tools.ietf.org/html/rfc2198
+// The class object will have an underlying AudioEncoder object that performs
+// the actual encodings. The current class will gather the N latest encodings
+// from the underlying codec into one packet. Currently N is hard-coded to 2.
+
class AudioEncoderCopyRed final : public AudioEncoder {
public:
struct Config {
@@ -84,15 +87,11 @@ class AudioEncoderCopyRed final : public AudioEncoder {
rtc::Buffer* encoded) override;
private:
- size_t CalculateHeaderLength(size_t encoded_bytes) const;
-
std::unique_ptr<AudioEncoder> speech_encoder_;
+ rtc::Buffer primary_encoded_;
size_t max_packet_length_;
int red_payload_type_;
- rtc::Buffer secondary_encoded_;
- EncodedInfoLeaf secondary_info_;
- rtc::Buffer tertiary_encoded_;
- EncodedInfoLeaf tertiary_info_;
+ std::list<std::pair<EncodedInfo, rtc::Buffer>> redundant_encodings_;
RTC_DISALLOW_COPY_AND_ASSIGN(AudioEncoderCopyRed);
};