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

Unified Diff: webrtc/modules/audio_coding/codecs/audio_encoder.h

Issue 2528933002: Adding OnReceivedOverhead to AudioEncoder. (Closed)
Patch Set: fixing and adding unittest Created 4 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/codecs/audio_encoder.h
diff --git a/webrtc/modules/audio_coding/codecs/audio_encoder.h b/webrtc/modules/audio_coding/codecs/audio_encoder.h
index 2c8d9ce5ece0bf97fa35820087ad0773f827c641..c4d239f0c00eeb45d1ebae8722e6233f12a1a85b 100644
--- a/webrtc/modules/audio_coding/codecs/audio_encoder.h
+++ b/webrtc/modules/audio_coding/codecs/audio_encoder.h
@@ -17,6 +17,7 @@
#include "webrtc/base/array_view.h"
#include "webrtc/base/buffer.h"
#include "webrtc/base/deprecation.h"
+#include "webrtc/base/optional.h"
#include "webrtc/typedefs.h"
namespace webrtc {
@@ -76,7 +77,8 @@ class AudioEncoder {
std::vector<EncodedInfoLeaf> redundant;
};
- virtual ~AudioEncoder() = default;
+ AudioEncoder();
+ virtual ~AudioEncoder();
// Returns the input sample rate in Hz and the number of input channels.
// These are constants set at instantiation time.
@@ -184,6 +186,10 @@ class AudioEncoder {
// Provides RTT to this encoder to allow it to adapt.
virtual void OnReceivedRtt(int rtt_ms);
+ // Provides overhead size to this encoder for it to determine the bitrate
+ // for the payload.
+ virtual void OnReceivedOverhead(size_t overhead_bytes_per_packet);
+
// To allow encoder to adapt its frame length, it must be provided the frame
// length range that receivers can accept.
virtual void SetReceiverFrameLengthRange(int min_frame_length_ms,
@@ -195,6 +201,7 @@ class AudioEncoder {
virtual EncodedInfo EncodeImpl(uint32_t rtp_timestamp,
rtc::ArrayView<const int16_t> audio,
rtc::Buffer* encoded) = 0;
+ rtc::Optional<size_t> overhead_bytes_per_packet_;
};
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_

Powered by Google App Engine
This is Rietveld 408576698