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

Unified Diff: media/cast/audio_receiver/audio_decoder.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.h ('k') | media/cast/audio_receiver/audio_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/audio_receiver/audio_decoder.cc
diff --git a/media/cast/audio_receiver/audio_decoder.cc b/media/cast/audio_receiver/audio_decoder.cc
index 4e75473a6bcb14967aa2f5498a12c9b909cc89fe..b76797125c7119d9d1a76af05182b4ac94c55dac 100644
--- a/media/cast/audio_receiver/audio_decoder.cc
+++ b/media/cast/audio_receiver/audio_decoder.cc
@@ -9,7 +9,6 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
-#include "base/stl_util.h"
#include "base/sys_byteorder.h"
#include "media/cast/cast_defines.h"
#include "third_party/opus/src/include/opus.h"
@@ -40,20 +39,10 @@ class AudioDecoder::ImplBase
return cast_initialization_status_;
}
- void DecodeFrame(scoped_ptr<transport::EncodedAudioFrame> encoded_frame,
+ void DecodeFrame(scoped_ptr<transport::EncodedFrame> encoded_frame,
const DecodeFrameCallback& callback) {
DCHECK_EQ(cast_initialization_status_, STATUS_AUDIO_INITIALIZED);
- scoped_ptr<AudioBus> decoded_audio;
- if (encoded_frame->codec != codec_) {
- NOTREACHED();
- cast_environment_->PostTask(CastEnvironment::MAIN,
- FROM_HERE,
- base::Bind(callback,
- base::Passed(&decoded_audio),
- false));
- }
-
COMPILE_ASSERT(sizeof(encoded_frame->frame_id) == sizeof(last_frame_id_),
size_of_frame_id_types_do_not_match);
bool is_continuous = true;
@@ -68,8 +57,8 @@ class AudioDecoder::ImplBase
}
last_frame_id_ = encoded_frame->frame_id;
- decoded_audio = Decode(
- reinterpret_cast<uint8*>(string_as_array(&encoded_frame->data)),
+ scoped_ptr<AudioBus> decoded_audio = Decode(
+ encoded_frame->mutable_bytes(),
static_cast<int>(encoded_frame->data.size()));
cast_environment_->PostTask(CastEnvironment::MAIN,
FROM_HERE,
@@ -239,7 +228,7 @@ CastInitializationStatus AudioDecoder::InitializationResult() const {
}
void AudioDecoder::DecodeFrame(
- scoped_ptr<transport::EncodedAudioFrame> encoded_frame,
+ scoped_ptr<transport::EncodedFrame> encoded_frame,
const DecodeFrameCallback& callback) {
DCHECK(encoded_frame.get());
DCHECK(!callback.is_null());
« no previous file with comments | « media/cast/audio_receiver/audio_decoder.h ('k') | media/cast/audio_receiver/audio_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698