diff options
Diffstat (limited to 'webrtc/modules/audio_coding/codecs/audio_encoder.h')
-rw-r--r-- | webrtc/modules/audio_coding/codecs/audio_encoder.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/webrtc/modules/audio_coding/codecs/audio_encoder.h b/webrtc/modules/audio_coding/codecs/audio_encoder.h index 27b9f2ffdd..5b81509b26 100644 --- a/webrtc/modules/audio_coding/codecs/audio_encoder.h +++ b/webrtc/modules/audio_coding/codecs/audio_encoder.h @@ -12,6 +12,7 @@ #define WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ #include <algorithm> +#include <vector> #include "webrtc/base/checks.h" #include "webrtc/typedefs.h" @@ -19,17 +20,35 @@ namespace webrtc { // This is the interface class for encoders in AudioCoding module. Each codec -// codec type must have an implementation of this class. +// type must have an implementation of this class. class AudioEncoder { public: - struct EncodedInfo { - EncodedInfo() : encoded_bytes(0), encoded_timestamp(0), payload_type(0) {} + struct EncodedInfoLeaf { + EncodedInfoLeaf() + : encoded_bytes(0), encoded_timestamp(0), payload_type(0) {} size_t encoded_bytes; uint32_t encoded_timestamp; int payload_type; }; + // This is the main struct for auxiliary encoding information. Each encoded + // packet should be accompanied by one EncodedInfo struct, containing the + // total number of |encoded_bytes|, the |encoded_timestamp| and the + // |payload_type|. If the packet contains redundant encodings, the |redundant| + // vector will be populated with EncodedInfoLeaf structs. Each struct in the + // vector represents one encoding; the order of structs in the vector is the + // same as the order in which the actual payloads are written to the byte + // stream. When EncoderInfoLeaf structs are present in the vector, the main + // struct's |encoded_bytes| will be the sum of all the |encoded_bytes| in the + // vector. + struct EncodedInfo : public EncodedInfoLeaf { + EncodedInfo(); + ~EncodedInfo(); + + std::vector<EncodedInfoLeaf> redundant; + }; + virtual ~AudioEncoder() {} // Accepts one 10 ms block of input audio (i.e., sample_rate_hz() / 100 * |