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

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

Issue 1708963002: Ensure ADTS for AAC for MediaCodecAudioDecoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/filters/android/media_codec_audio_decoder.h" 5 #include "media/filters/android/media_codec_audio_decoder.h"
6 6
7 #include "base/android/build_info.h" 7 #include "base/android/build_info.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 media_codec_.reset(); 169 media_codec_.reset();
170 media_codec_ = CreateMediaCodec(config_); 170 media_codec_ = CreateMediaCodec(config_);
171 success = !!media_codec_; 171 success = !!media_codec_;
172 } 172 }
173 173
174 SetState(success ? STATE_READY : STATE_ERROR); 174 SetState(success ? STATE_READY : STATE_ERROR);
175 175
176 task_runner_->PostTask(FROM_HERE, closure); 176 task_runner_->PostTask(FROM_HERE, closure);
177 } 177 }
178 178
179 bool MediaCodecAudioDecoder::NeedsBitstreamConversion() const {
180 // An AAC stream needs to be converted as ADTS stream.
181 DCHECK_NE(config_.codec(), kUnknownAudioCodec);
182 return config_.codec() == kCodecAAC;
183 }
184
179 void MediaCodecAudioDecoder::OnKeyAdded() { 185 void MediaCodecAudioDecoder::OnKeyAdded() {
180 DVLOG(1) << __FUNCTION__; 186 DVLOG(1) << __FUNCTION__;
181 187
182 if (state_ == STATE_WAITING_FOR_KEY) 188 if (state_ == STATE_WAITING_FOR_KEY)
183 SetState(STATE_READY); 189 SetState(STATE_READY);
184 190
185 DoIOTask(); 191 DoIOTask();
186 } 192 }
187 193
188 void MediaCodecAudioDecoder::DoIOTask() { 194 void MediaCodecAudioDecoder::DoIOTask() {
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 RETURN_STRING(STATE_DRAINED); 546 RETURN_STRING(STATE_DRAINED);
541 RETURN_STRING(STATE_ERROR); 547 RETURN_STRING(STATE_ERROR);
542 } 548 }
543 NOTREACHED() << "Unknown state " << state; 549 NOTREACHED() << "Unknown state " << state;
544 return nullptr; 550 return nullptr;
545 } 551 }
546 552
547 #undef RETURN_STRING 553 #undef RETURN_STRING
548 554
549 } // namespace media 555 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698