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();
|
||||
}
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/typedefs.h"
|
||||
|
||||
namespace webrtc {
|
||||
@ -63,14 +62,7 @@ class AudioEncoder {
|
||||
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;
|
||||
}
|
||||
EncodedInfo* info);
|
||||
|
||||
// Return the input sample rate in Hz and the number of input channels.
|
||||
// These are constants set at instantiation time.
|
||||
|
@ -12,6 +12,7 @@
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/g711/include/g711_interface.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
@ -11,6 +11,7 @@
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_INTERFACE_AUDIO_ENCODER_ISACFIX_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_INTERFACE_AUDIO_ENCODER_ISACFIX_H_
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/isac/fix/interface/isacfix.h"
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_INTERFACE_AUDIO_ENCODER_ISAC_H_
|
||||
#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_INTERFACE_AUDIO_ENCODER_ISAC_H_
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/isac/main/interface/isac.h"
|
||||
|
||||
|
@ -12,6 +12,8 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "webrtc/base/checks.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
AudioEncoderCopyRed::AudioEncoderCopyRed(const Config& config)
|
||||
|
@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "webrtc/base/checks.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.h"
|
||||
#include "webrtc/modules/audio_coding/codecs/mock/mock_audio_encoder.h"
|
||||
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
|
||||
|
Reference in New Issue
Block a user