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

Unified Diff: media/cast/audio_receiver/audio_receiver.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_receiver.h ('k') | media/cast/audio_receiver/audio_receiver_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_receiver.cc
diff --git a/media/cast/audio_receiver/audio_receiver.cc b/media/cast/audio_receiver/audio_receiver.cc
index 212419c81d616180cd868debab7c9f1dc0f13bab..ab06c5379d769f86e26db8575663d85fde9134d9 100644
--- a/media/cast/audio_receiver/audio_receiver.cc
+++ b/media/cast/audio_receiver/audio_receiver.cc
@@ -114,15 +114,15 @@ void AudioReceiver::GetRawAudioFrame(
void AudioReceiver::DecodeEncodedAudioFrame(
const AudioFrameDecodedCallback& callback,
- scoped_ptr<transport::EncodedAudioFrame> encoded_frame,
- const base::TimeTicks& playout_time) {
+ scoped_ptr<transport::EncodedFrame> encoded_frame) {
DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
if (!encoded_frame) {
- callback.Run(make_scoped_ptr<AudioBus>(NULL), playout_time, false);
+ callback.Run(make_scoped_ptr<AudioBus>(NULL), base::TimeTicks(), false);
return;
}
const uint32 frame_id = encoded_frame->frame_id;
const uint32 rtp_timestamp = encoded_frame->rtp_timestamp;
+ const base::TimeTicks playout_time = encoded_frame->reference_time;
audio_decoder_->DecodeFrame(encoded_frame.Pass(),
base::Bind(&AudioReceiver::EmitRawAudioFrame,
cast_environment_,
@@ -153,8 +153,7 @@ void AudioReceiver::EmitRawAudioFrame(
callback.Run(audio_bus.Pass(), playout_time, is_continuous);
}
-void AudioReceiver::GetEncodedAudioFrame(
- const AudioFrameEncodedCallback& callback) {
+void AudioReceiver::GetEncodedAudioFrame(const FrameEncodedCallback& callback) {
DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
frame_request_queue_.push_back(callback);
EmitAvailableEncodedFrames();
@@ -167,8 +166,8 @@ void AudioReceiver::EmitAvailableEncodedFrames() {
// Attempt to peek at the next completed frame from the |framer_|.
// TODO(miu): We should only be peeking at the metadata, and not copying the
// payload yet! Or, at least, peek using a StringPiece instead of a copy.
- scoped_ptr<transport::EncodedAudioFrame> encoded_frame(
- new transport::EncodedAudioFrame());
+ scoped_ptr<transport::EncodedFrame> encoded_frame(
+ new transport::EncodedFrame());
bool is_consecutively_next_frame = false;
if (!framer_.GetEncodedAudioFrame(encoded_frame.get(),
&is_consecutively_next_frame)) {
@@ -216,14 +215,13 @@ void AudioReceiver::EmitAvailableEncodedFrames() {
encoded_frame->data.swap(decrypted_audio_data);
}
- // At this point, we have a decrypted EncodedAudioFrame ready to be emitted.
- encoded_frame->codec = codec_;
+ // At this point, we have a decrypted EncodedFrame ready to be emitted.
+ encoded_frame->reference_time = playout_time;
framer_.ReleaseFrame(encoded_frame->frame_id);
cast_environment_->PostTask(CastEnvironment::MAIN,
FROM_HERE,
base::Bind(frame_request_queue_.front(),
- base::Passed(&encoded_frame),
- playout_time));
+ base::Passed(&encoded_frame)));
frame_request_queue_.pop_front();
}
}
« no previous file with comments | « media/cast/audio_receiver/audio_receiver.h ('k') | media/cast/audio_receiver/audio_receiver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698