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

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

Issue 1967503002: Audio codec usage statistics (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: CL attempt 2. Added/responded to most comments Created 4 years, 7 months 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 a0f1839e73393c4ad017c6d6d5393a740187f64d..001a120649a20c6a7ef8b6de0fe15a47275ee49e 100644
--- a/webrtc/modules/audio_coding/codecs/audio_encoder.h
+++ b/webrtc/modules/audio_coding/codecs/audio_encoder.h
@@ -54,6 +54,8 @@ class AudioEncoder {
std::vector<EncodedInfoLeaf> redundant;
};
+ AudioEncoder();
+
virtual ~AudioEncoder() = default;
// Returns the input sample rate in Hz and the number of input channels.
@@ -136,6 +138,11 @@ class AudioEncoder {
rtc::ArrayView<const int16_t> audio,
rtc::Buffer* encoded) = 0;
+ // Returns a pointer to a statically allocated string with the codec
+ // name, e.g. "Opus" or "iSAC". The default implementation returns
+ // null, which means no name
+ virtual const char* GetCodecName() const;
+
private:
// This function is deprecated. It was used to return the maximum number of
// bytes that can be produced by the encoder at each Encode() call. Since the
@@ -144,6 +151,12 @@ class AudioEncoder {
// it implemented (with the override attribute). It will be removed as soon
// as these subclasses have been given a chance to change.
virtual size_t MaxEncodedBytes() const;
+
+ // Every time AudioEncoder::Encode() is called, this number is
+ // incremented. Every 500 increments, this number is set to zero and
+ // a value is logged to the UMA histogram
+ // "WebRTC.Audio.Encoder.CodecType"
+ size_t encoded_packets;
};
} // namespace webrtc
#endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_

Powered by Google App Engine
This is Rietveld 408576698