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

Side by Side 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: Removed strings and added enum classes 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_
12 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ 12 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_
13 13
14 #include <algorithm> 14 #include <algorithm>
15 #include <vector> 15 #include <vector>
16 16
17 #include "webrtc/base/array_view.h" 17 #include "webrtc/base/array_view.h"
18 #include "webrtc/base/buffer.h" 18 #include "webrtc/base/buffer.h"
19 #include "webrtc/base/deprecation.h" 19 #include "webrtc/base/deprecation.h"
20 #include "webrtc/typedefs.h" 20 #include "webrtc/typedefs.h"
21 21
22 namespace webrtc { 22 namespace webrtc {
23 23
24 // This is the interface class for encoders in AudioCoding module. Each codec 24 // This is the interface class for encoders in AudioCoding module. Each codec
25 // type must have an implementation of this class. 25 // type must have an implementation of this class.
26 class AudioEncoder { 26 class AudioEncoder {
27 public: 27 public:
28 // Used for UMA logging of codec usage.
ossu 2016/05/12 15:18:46 I think you should mention that they must match wh
aleloi 2016/05/12 15:30:14 Acknowledged.
29 enum class CodecType {
30 // kOther stands for no name, other or unknown codec
31 kOther = 0,
32 kOpus,
33 kIsac,
34 kPcmA,
35 kPcmU,
36 kG722,
37 kIlbc,
38
39 // Number of histogram bins in the UMA logging of codec types. The
40 // total number of different codecs that are logged cannot exceed this
41 // numbers.
ossu 2016/05/12 15:18:46 number (remove the s)
aleloi 2016/05/12 15:30:14 Acknowledged.
42 kMaxLoggedAudioCodecNames = 64
43 };
44
28 struct EncodedInfoLeaf { 45 struct EncodedInfoLeaf {
29 size_t encoded_bytes = 0; 46 size_t encoded_bytes = 0;
30 uint32_t encoded_timestamp = 0; 47 uint32_t encoded_timestamp = 0;
31 int payload_type = 0; 48 int payload_type = 0;
32 bool send_even_if_empty = false; 49 bool send_even_if_empty = false;
33 bool speech = true; 50 bool speech = true;
51 CodecType encoder_type = CodecType::kOther;
34 }; 52 };
35 53
36 // This is the main struct for auxiliary encoding information. Each encoded 54 // This is the main struct for auxiliary encoding information. Each encoded
37 // packet should be accompanied by one EncodedInfo struct, containing the 55 // packet should be accompanied by one EncodedInfo struct, containing the
38 // total number of |encoded_bytes|, the |encoded_timestamp| and the 56 // total number of |encoded_bytes|, the |encoded_timestamp| and the
39 // |payload_type|. If the packet contains redundant encodings, the |redundant| 57 // |payload_type|. If the packet contains redundant encodings, the |redundant|
40 // vector will be populated with EncodedInfoLeaf structs. Each struct in the 58 // vector will be populated with EncodedInfoLeaf structs. Each struct in the
41 // vector represents one encoding; the order of structs in the vector is the 59 // vector represents one encoding; the order of structs in the vector is the
42 // same as the order in which the actual payloads are written to the byte 60 // same as the order in which the actual payloads are written to the byte
43 // stream. When EncoderInfoLeaf structs are present in the vector, the main 61 // stream. When EncoderInfoLeaf structs are present in the vector, the main
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // This function is deprecated. It was used to return the maximum number of 158 // This function is deprecated. It was used to return the maximum number of
141 // bytes that can be produced by the encoder at each Encode() call. Since the 159 // bytes that can be produced by the encoder at each Encode() call. Since the
142 // Encode interface was changed to use rtc::Buffer, this is no longer 160 // Encode interface was changed to use rtc::Buffer, this is no longer
143 // applicable. It is only kept in to avoid breaking subclasses that still have 161 // applicable. It is only kept in to avoid breaking subclasses that still have
144 // it implemented (with the override attribute). It will be removed as soon 162 // it implemented (with the override attribute). It will be removed as soon
145 // as these subclasses have been given a chance to change. 163 // as these subclasses have been given a chance to change.
146 virtual size_t MaxEncodedBytes() const; 164 virtual size_t MaxEncodedBytes() const;
147 }; 165 };
148 } // namespace webrtc 166 } // namespace webrtc
149 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ 167 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698