Reland r8248 "Introduce ACMGenericCodecWrapper"
This effectively reverts r8249. This new class inherits from ACMGenericCodec. The purpose is to wrap AudioEncoder objects into an ACMGenericCodec interface. This is a temporary construction that will be used during the ACM redesign work. BUG=4228 COAUTHOR=kwiberg@webrtc.org TBR=tina.legrand@webrtc.org Review URL: https://webrtc-codereview.appspot.com/38919004 Cr-Commit-Position: refs/heads/master@{#8255} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8255 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#include "webrtc/modules/audio_coding/codecs/audio_encoder.h"
|
||||
#include "webrtc/base/checks.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
@ -18,6 +19,20 @@ AudioEncoder::EncodedInfo::EncodedInfo() : EncodedInfoLeaf() {
|
||||
AudioEncoder::EncodedInfo::~EncodedInfo() {
|
||||
}
|
||||
|
||||
bool AudioEncoder::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) {
|
||||
CHECK_EQ(num_samples_per_channel,
|
||||
static_cast<size_t>(sample_rate_hz() / 100));
|
||||
bool ret =
|
||||
EncodeInternal(rtp_timestamp, audio, max_encoded_bytes, encoded, info);
|
||||
CHECK_LE(info->encoded_bytes, max_encoded_bytes);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int AudioEncoder::rtp_timestamp_rate_hz() const {
|
||||
return sample_rate_hz();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user