OLD | NEW |
---|---|
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 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 // implementation does the latter). | 129 // implementation does the latter). |
130 virtual void SetTargetBitrate(int target_bps); | 130 virtual void SetTargetBitrate(int target_bps); |
131 | 131 |
132 protected: | 132 protected: |
133 // Subclasses implement this to perform the actual encoding. Called by | 133 // Subclasses implement this to perform the actual encoding. Called by |
134 // Encode(). | 134 // Encode(). |
135 virtual EncodedInfo EncodeImpl(uint32_t rtp_timestamp, | 135 virtual EncodedInfo EncodeImpl(uint32_t rtp_timestamp, |
136 rtc::ArrayView<const int16_t> audio, | 136 rtc::ArrayView<const int16_t> audio, |
137 rtc::Buffer* encoded) = 0; | 137 rtc::Buffer* encoded) = 0; |
138 | 138 |
139 // Subclasses implements this and return a name, e.g. "Opus" or "iSAC". | |
kwiberg-webrtc
2016/05/11 00:47:00
Despite the example set by EncodeImpl, you probabl
hlundin-webrtc
2016/05/11 08:27:26
I'm not sure we should promise statically allocate
kwiberg-webrtc
2016/05/11 08:52:24
OK. What lifetime should we promise, then? That of
hlundin-webrtc
2016/05/11 08:59:18
That seems reasonable, but promising the correct v
kwiberg-webrtc
2016/05/11 09:49:43
I think it's problematic if we have an interface t
hlundin-webrtc
2016/05/11 10:37:20
I too was thinking of a "small set" of statically
kwiberg-webrtc
2016/05/11 10:46:21
But the complete set of strings possibly returned
hlundin-webrtc
2016/05/11 11:01:37
Acknowledged.
aleloi
2016/05/11 11:16:13
Can a C++ string be returned dynamically instead?
The Sun (google.com)
2016/05/11 11:36:44
A string returned by value will likely require hea
kwiberg-webrtc
2016/05/11 12:00:41
I agree. We definitely want to return a pointer to
| |
140 virtual const char* GetCodecName() const; | |
141 | |
139 private: | 142 private: |
140 // This function is deprecated. It was used to return the maximum number of | 143 // 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 | 144 // 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 | 145 // 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 | 146 // 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 | 147 // it implemented (with the override attribute). It will be removed as soon |
145 // as these subclasses have been given a chance to change. | 148 // as these subclasses have been given a chance to change. |
146 virtual size_t MaxEncodedBytes() const; | 149 virtual size_t MaxEncodedBytes() const; |
147 }; | 150 }; |
148 } // namespace webrtc | 151 } // namespace webrtc |
149 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ | 152 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_AUDIO_ENCODER_H_ |
OLD | NEW |