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

Unified Diff: media/cast/audio_receiver/audio_decoder_unittest.cc

Issue 288103002: [Cast] EncodedAudioFrame+EncodedVideoFrame+reference_time --> EncodedFrame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 7 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
« no previous file with comments | « media/cast/audio_receiver/audio_decoder.cc ('k') | media/cast/audio_receiver/audio_receiver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « media/cast/audio_receiver/audio_decoder.cc ('k') | media/cast/audio_receiver/audio_receiver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698