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

Unified Diff: webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc

Issue 1725143003: Changed AudioEncoder::Encode to take an rtc::Buffer* instead of uint8_t* and a maximum size. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added more fixes for override hiding in AudioEncoder implementations. Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc
diff --git a/webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc b/webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc
index 4ccebb3e66e84426182a4e9d9ffc07c04f6d001a..2ebd1927bc4de2197656ca4e6fac33a6d843aeea 100644
--- a/webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc
+++ b/webrtc/modules/audio_coding/neteq/test/neteq_isac_quality_test.cc
@@ -44,7 +44,7 @@ class NetEqIsacQualityTest : public NetEqQualityTest {
void SetUp() override;
void TearDown() override;
virtual int EncodeBlock(int16_t* in_data, size_t block_size_samples,
- uint8_t* payload, size_t max_bytes);
+ rtc::Buffer* payload, size_t max_bytes);
private:
ISACFIX_MainStruct* isac_encoder_;
int bit_rate_kbps_;
@@ -78,7 +78,7 @@ void NetEqIsacQualityTest::TearDown() {
int NetEqIsacQualityTest::EncodeBlock(int16_t* in_data,
size_t block_size_samples,
- uint8_t* payload, size_t max_bytes) {
+ rtc::Buffer* payload, size_t max_bytes) {
// ISAC takes 10 ms for every call.
const int subblocks = kIsacBlockDurationMs / 10;
const int subblock_length = 10 * kIsacInputSamplingKhz;
@@ -89,7 +89,11 @@ int NetEqIsacQualityTest::EncodeBlock(int16_t* in_data,
// The Isac encoder does not perform encoding (and returns 0) until it
// receives a sequence of sub-blocks that amount to the frame duration.
EXPECT_EQ(0, value);
- value = WebRtcIsacfix_Encode(isac_encoder_, &in_data[pointer], payload);
+ payload->AppendData(max_bytes, [&] (rtc::ArrayView<uint8_t> payload) {
+ value = WebRtcIsacfix_Encode(isac_encoder_, &in_data[pointer],
+ payload.data());
+ return (value >= 0) ? static_cast<size_t>(value) : 0;
+ });
}
EXPECT_GT(value, 0);
return value;

Powered by Google App Engine
This is Rietveld 408576698