Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: webrtc/modules/audio_coding/main/acm2/rent_a_codec.h

Issue 1410333015: Let Rent-A-Codec™ create and own speech encoders (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@rac5
Patch Set: comment fix Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/main/acm2/rent_a_codec.h
diff --git a/webrtc/modules/audio_coding/main/acm2/rent_a_codec.h b/webrtc/modules/audio_coding/main/acm2/rent_a_codec.h
index 2c85bcf51c042fa744b9ce0478362f37d12b78f9..e74ad089963af918b358e89026457dcdc7ae360b 100644
--- a/webrtc/modules/audio_coding/main/acm2/rent_a_codec.h
+++ b/webrtc/modules/audio_coding/main/acm2/rent_a_codec.h
@@ -14,8 +14,21 @@
#include <stddef.h>
#include "webrtc/base/array_view.h"
+#include "webrtc/base/constructormagic.h"
#include "webrtc/base/maybe.h"
+#include "webrtc/base/scoped_ptr.h"
#include "webrtc/typedefs.h"
+#include "webrtc/modules/audio_coding/codecs/audio_encoder.h"
+#include "webrtc/modules/audio_coding/codecs/audio_decoder.h"
+
+#if defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)
+#include "webrtc/modules/audio_coding/codecs/isac/locked_bandwidth_info.h"
+#else
+// Dummy implementation, for when we don't have iSAC.
+namespace webrtc {
+class LockedIsacBandwidthInfo {};
+}
+#endif
namespace webrtc {
@@ -165,6 +178,26 @@ class RentACodec {
static rtc::Maybe<NetEqDecoder> NetEqDecoderFromCodecId(CodecId codec_id,
int num_channels);
+
+ RentACodec();
+ ~RentACodec();
+
+ // Creates and returns an audio encoder built to the given specification.
+ // Returns null in case of error. The returned encoder is live until the next
+ // successful call to this function, or until the Rent-A-Codec is destroyed.
+ AudioEncoder* RentEncoder(const CodecInst& codec_inst);
+
+ // Creates and returns an iSAC decoder, which will remain live until the
+ // Rent-A-Codec is destroyed. Subsequent calls will simply return the same
+ // object.
+ AudioDecoder* RentIsacDecoder();
+
+ private:
+ rtc::scoped_ptr<AudioEncoder> encoder_;
+ rtc::scoped_ptr<AudioDecoder> isac_decoder_;
+ LockedIsacBandwidthInfo isac_bandwidth_info_;
+
+ RTC_DISALLOW_COPY_AND_ASSIGN(RentACodec);
};
} // namespace acm2
« no previous file with comments | « webrtc/modules/audio_coding/main/acm2/codec_owner.cc ('k') | webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698