Reland 8749: AudioEncoder: return EncodedInfo from Encode() and EncodeInternal()
Old review at: https://webrtc-codereview.appspot.com/43839004/ R=kwiberg@webrtc.org Review URL: https://webrtc-codereview.appspot.com/45769004 Cr-Commit-Position: refs/heads/master@{#8788} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8788 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -58,16 +58,15 @@ class AudioEncoder {
|
||||
|
||||
// Accepts one 10 ms block of input audio (i.e., sample_rate_hz() / 100 *
|
||||
// num_channels() samples). Multi-channel audio must be sample-interleaved.
|
||||
// The encoder produces zero or more bytes of output in |encoded|,
|
||||
// and provides additional encoding information in |info|.
|
||||
// The encoder produces zero or more bytes of output in |encoded| and
|
||||
// returns additional encoding information.
|
||||
// The caller is responsible for making sure that |max_encoded_bytes| is
|
||||
// not smaller than the number of bytes actually produced by the encoder.
|
||||
void Encode(uint32_t rtp_timestamp,
|
||||
const int16_t* audio,
|
||||
size_t num_samples_per_channel,
|
||||
size_t max_encoded_bytes,
|
||||
uint8_t* encoded,
|
||||
EncodedInfo* info);
|
||||
EncodedInfo Encode(uint32_t rtp_timestamp,
|
||||
const int16_t* audio,
|
||||
size_t num_samples_per_channel,
|
||||
size_t max_encoded_bytes,
|
||||
uint8_t* encoded);
|
||||
|
||||
// Return the input sample rate in Hz and the number of input channels.
|
||||
// These are constants set at instantiation time.
|
||||
@ -107,11 +106,10 @@ class AudioEncoder {
|
||||
virtual void SetProjectedPacketLossRate(double fraction) {}
|
||||
|
||||
protected:
|
||||
virtual void EncodeInternal(uint32_t rtp_timestamp,
|
||||
const int16_t* audio,
|
||||
size_t max_encoded_bytes,
|
||||
uint8_t* encoded,
|
||||
EncodedInfo* info) = 0;
|
||||
virtual EncodedInfo EncodeInternal(uint32_t rtp_timestamp,
|
||||
const int16_t* audio,
|
||||
size_t max_encoded_bytes,
|
||||
uint8_t* encoded) = 0;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
Reference in New Issue
Block a user