| Index: media/cast/audio_receiver/audio_decoder_unittest.cc
|
| diff --git a/media/cast/audio_receiver/audio_decoder_unittest.cc b/media/cast/audio_receiver/audio_decoder_unittest.cc
|
| index d32dbe19b7acdd596dacdfdc110103d6d9b84508..ee7846c90db14bf4defa0e258f7d94ca61a920d8 100644
|
| --- a/media/cast/audio_receiver/audio_decoder_unittest.cc
|
| +++ b/media/cast/audio_receiver/audio_decoder_unittest.cc
|
| @@ -4,7 +4,6 @@
|
|
|
| #include "base/bind.h"
|
| #include "base/bind_helpers.h"
|
| -#include "base/stl_util.h"
|
| #include "base/synchronization/condition_variable.h"
|
| #include "base/synchronization/lock.h"
|
| #include "base/sys_byteorder.h"
|
| @@ -71,15 +70,16 @@ class AudioDecoderTest : public ::testing::TestWithParam<TestScenario> {
|
| total_audio_decoded_ = base::TimeDelta();
|
| }
|
|
|
| - // Called from the unit test thread to create another EncodedAudioFrame and
|
| - // push it into the decoding pipeline.
|
| + // Called from the unit test thread to create another EncodedFrame and push it
|
| + // into the decoding pipeline.
|
| void FeedMoreAudio(const base::TimeDelta& duration,
|
| int num_dropped_frames) {
|
| - // Prepare a simulated EncodedAudioFrame to feed into the AudioDecoder.
|
| - scoped_ptr<transport::EncodedAudioFrame> encoded_frame(
|
| - new transport::EncodedAudioFrame());
|
| - encoded_frame->codec = GetParam().codec;
|
| + // Prepare a simulated EncodedFrame to feed into the AudioDecoder.
|
| + scoped_ptr<transport::EncodedFrame> encoded_frame(
|
| + new transport::EncodedFrame());
|
| + encoded_frame->dependency = transport::EncodedFrame::KEY;
|
| encoded_frame->frame_id = last_frame_id_ + 1 + num_dropped_frames;
|
| + encoded_frame->referenced_frame_id = encoded_frame->frame_id;
|
| last_frame_id_ = encoded_frame->frame_id;
|
|
|
| const scoped_ptr<AudioBus> audio_bus(
|
| @@ -93,7 +93,7 @@ class AudioDecoderTest : public ::testing::TestWithParam<TestScenario> {
|
| if (GetParam().codec == transport::kPcm16) {
|
| encoded_frame->data.resize(num_elements * sizeof(int16));
|
| int16* const pcm_data =
|
| - reinterpret_cast<int16*>(string_as_array(&encoded_frame->data));
|
| + reinterpret_cast<int16*>(encoded_frame->mutable_bytes());
|
| for (size_t i = 0; i < interleaved.size(); ++i)
|
| pcm_data[i] = static_cast<int16>(base::HostToNet16(interleaved[i]));
|
| } else if (GetParam().codec == transport::kOpus) {
|
| @@ -105,8 +105,7 @@ class AudioDecoderTest : public ::testing::TestWithParam<TestScenario> {
|
| opus_encode(opus_encoder,
|
| &interleaved.front(),
|
| audio_bus->frames(),
|
| - reinterpret_cast<unsigned char*>(
|
| - string_as_array(&encoded_frame->data)),
|
| + encoded_frame->mutable_bytes(),
|
| encoded_frame->data.size());
|
| CHECK_GT(payload_size, 1);
|
| encoded_frame->data.resize(payload_size);
|
|
|