aboutsummaryrefslogtreecommitdiff
path: root/webrtc/modules/audio_coding/codecs/isac/main/interface/audio_encoder_isac.h
diff options
context:
space:
mode:
authorKarl Wiberg <kwiberg@webrtc.org>2015-05-07 12:35:12 +0200
committerKarl Wiberg <kwiberg@webrtc.org>2015-05-07 10:35:18 +0000
commitdcccab3ebb623df74fbb1425da2cb9d9a42439fa (patch)
treeb895b8c79cbd4186fc675e435848a1f7a8c1160d /webrtc/modules/audio_coding/codecs/isac/main/interface/audio_encoder_isac.h
parent81ea54eaac82b36b7208a02fd37a469d7d0bd9d0 (diff)
downloadwebrtc-dcccab3ebb623df74fbb1425da2cb9d9a42439fa.tar.gz
New interface: AudioEncoderMutable
With implementations for all codecs. It has no users yet. This new interface is the same as AudioEncoder (in fact it is a subclass) but it allows changing some parameters after construction. COAUTHOR=henrik.lundin@webrtc.org BUG=4228 R=jmarusic@webrtc.org, minyue@webrtc.org Review URL: https://webrtc-codereview.appspot.com/51679004 Cr-Commit-Position: refs/heads/master@{#9149}
Diffstat (limited to 'webrtc/modules/audio_coding/codecs/isac/main/interface/audio_encoder_isac.h')
-rw-r--r--webrtc/modules/audio_coding/codecs/isac/main/interface/audio_encoder_isac.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/webrtc/modules/audio_coding/codecs/isac/main/interface/audio_encoder_isac.h b/webrtc/modules/audio_coding/codecs/isac/main/interface/audio_encoder_isac.h
index 7d8ac7951b..5a75807469 100644
--- a/webrtc/modules/audio_coding/codecs/isac/main/interface/audio_encoder_isac.h
+++ b/webrtc/modules/audio_coding/codecs/isac/main/interface/audio_encoder_isac.h
@@ -12,6 +12,8 @@
#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_INTERFACE_AUDIO_ENCODER_ISAC_H_
#include "webrtc/base/checks.h"
+#include "webrtc/base/scoped_ptr.h"
+#include "webrtc/modules/audio_coding/codecs/audio_encoder_mutable_impl.h"
#include "webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t.h"
#include "webrtc/modules/audio_coding/codecs/isac/main/interface/isac.h"
@@ -102,5 +104,45 @@ struct IsacFloat {
typedef AudioEncoderDecoderIsacT<IsacFloat> AudioEncoderDecoderIsac;
+struct CodecInst;
+
+class AudioEncoderDecoderMutableIsacFloat
+ : public AudioEncoderMutableImpl<AudioEncoderDecoderIsac,
+ AudioEncoderDecoderMutableIsac> {
+ public:
+ explicit AudioEncoderDecoderMutableIsacFloat(const CodecInst& codec_inst);
+ void UpdateSettings(const CodecInst& codec_inst) override;
+ void SetMaxPayloadSize(int max_payload_size_bytes) override;
+ void SetMaxRate(int max_rate_bps) override;
+
+ // From AudioDecoder.
+ int Decode(const uint8_t* encoded,
+ size_t encoded_len,
+ int sample_rate_hz,
+ size_t max_decoded_bytes,
+ int16_t* decoded,
+ SpeechType* speech_type) override;
+ int DecodeRedundant(const uint8_t* encoded,
+ size_t encoded_len,
+ int sample_rate_hz,
+ size_t max_decoded_bytes,
+ int16_t* decoded,
+ SpeechType* speech_type) override;
+ bool HasDecodePlc() const override;
+ int DecodePlc(int num_frames, int16_t* decoded) override;
+ int Init() override;
+ int IncomingPacket(const uint8_t* payload,
+ size_t payload_len,
+ uint16_t rtp_sequence_number,
+ uint32_t rtp_timestamp,
+ uint32_t arrival_timestamp) override;
+ int ErrorCode() override;
+ int PacketDuration(const uint8_t* encoded, size_t encoded_len) const override;
+ int PacketDurationRedundant(const uint8_t* encoded,
+ size_t encoded_len) const override;
+ bool PacketHasFec(const uint8_t* encoded, size_t encoded_len) const override;
+ size_t Channels() const override;
+};
+
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_INTERFACE_AUDIO_ENCODER_ISAC_H_