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

Side by Side Diff: media/base/android/media_codec_audio_decoder.cc

Issue 1242913004: MediaCodecPlayer implementation (stage 3 - browser seek and surface change) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mtplayer-seek
Patch Set: Addressed Min comments, added unit tests. Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/android/media_codec_audio_decoder.h" 5 #include "media/base/android/media_codec_audio_decoder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "media/base/android/media_codec_bridge.h" 9 #include "media/base/android/media_codec_bridge.h"
10 #include "media/base/audio_timestamp_helper.h" 10 #include "media/base/audio_timestamp_helper.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 curr.audio_extra_data.size() != next.audio_extra_data.size() || 100 curr.audio_extra_data.size() != next.audio_extra_data.size() ||
101 !std::equal(curr.audio_extra_data.begin(), curr.audio_extra_data.end(), 101 !std::equal(curr.audio_extra_data.begin(), curr.audio_extra_data.end(),
102 next.audio_extra_data.begin()); 102 next.audio_extra_data.begin());
103 } 103 }
104 104
105 MediaCodecDecoder::ConfigStatus MediaCodecAudioDecoder::ConfigureInternal() { 105 MediaCodecDecoder::ConfigStatus MediaCodecAudioDecoder::ConfigureInternal() {
106 DCHECK(media_task_runner_->BelongsToCurrentThread()); 106 DCHECK(media_task_runner_->BelongsToCurrentThread());
107 107
108 DVLOG(1) << class_name() << "::" << __FUNCTION__; 108 DVLOG(1) << class_name() << "::" << __FUNCTION__;
109 109
110 if (configs_.audio_codec == kUnknownAudioCodec) {
111 DVLOG(0) << class_name() << "::" << __FUNCTION__
112 << " configuration parameters are required";
113 return CONFIG_FAILURE;
114 }
115
110 media_codec_bridge_.reset(AudioCodecBridge::Create(configs_.audio_codec)); 116 media_codec_bridge_.reset(AudioCodecBridge::Create(configs_.audio_codec));
111 if (!media_codec_bridge_) 117 if (!media_codec_bridge_)
112 return CONFIG_FAILURE; 118 return CONFIG_FAILURE;
113 119
114 if (!(static_cast<AudioCodecBridge*>(media_codec_bridge_.get())) 120 if (!(static_cast<AudioCodecBridge*>(media_codec_bridge_.get()))
115 ->Start( 121 ->Start(
116 configs_.audio_codec, 122 configs_.audio_codec,
117 configs_.audio_sampling_rate, 123 configs_.audio_sampling_rate,
118 configs_.audio_channels, 124 configs_.audio_channels,
119 &configs_.audio_extra_data[0], 125 &configs_.audio_extra_data[0],
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 if (audio_timestamp_helper_) 213 if (audio_timestamp_helper_)
208 base_timestamp_ = audio_timestamp_helper_->GetTimestamp(); 214 base_timestamp_ = audio_timestamp_helper_->GetTimestamp();
209 215
210 audio_timestamp_helper_.reset( 216 audio_timestamp_helper_.reset(
211 new AudioTimestampHelper(configs_.audio_sampling_rate)); 217 new AudioTimestampHelper(configs_.audio_sampling_rate));
212 218
213 audio_timestamp_helper_->SetBaseTimestamp(base_timestamp_); 219 audio_timestamp_helper_->SetBaseTimestamp(base_timestamp_);
214 } 220 }
215 221
216 } // namespace media 222 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | media/base/android/media_codec_decoder.h » ('j') | media/base/android/media_codec_decoder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698