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

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

Issue 2491613004: Make base::Timer sequence-friendly. (Closed)
Patch Set: add back commented out DCHECK in Stop() Created 3 years, 6 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
« no previous file with comments | « media/base/android/media_codec_loop_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <cmath> 7 #include <cmath>
8 8
9 #include "base/android/build_info.h" 9 #include "base/android/build_info.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 jobject media_crypto_obj = media_crypto_ ? media_crypto_->obj() : nullptr; 133 jobject media_crypto_obj = media_crypto_ ? media_crypto_->obj() : nullptr;
134 std::unique_ptr<MediaCodecBridge> audio_codec_bridge( 134 std::unique_ptr<MediaCodecBridge> audio_codec_bridge(
135 MediaCodecBridgeImpl::CreateAudioDecoder(config_, media_crypto_obj)); 135 MediaCodecBridgeImpl::CreateAudioDecoder(config_, media_crypto_obj));
136 if (!audio_codec_bridge) { 136 if (!audio_codec_bridge) {
137 DLOG(ERROR) << __func__ << " failed: cannot create MediaCodecBridge"; 137 DLOG(ERROR) << __func__ << " failed: cannot create MediaCodecBridge";
138 return false; 138 return false;
139 } 139 }
140 140
141 codec_loop_.reset( 141 codec_loop_.reset(
142 new MediaCodecLoop(base::android::BuildInfo::GetInstance()->sdk_int(), 142 new MediaCodecLoop(base::android::BuildInfo::GetInstance()->sdk_int(),
143 this, std::move(audio_codec_bridge))); 143 this, std::move(audio_codec_bridge),
144 scoped_refptr<base::SingleThreadTaskRunner>()));
144 145
145 return true; 146 return true;
146 } 147 }
147 148
148 void MediaCodecAudioDecoder::Decode(const scoped_refptr<DecoderBuffer>& buffer, 149 void MediaCodecAudioDecoder::Decode(const scoped_refptr<DecoderBuffer>& buffer,
149 const DecodeCB& decode_cb) { 150 const DecodeCB& decode_cb) {
150 DecodeCB bound_decode_cb = BindToCurrentLoop(decode_cb); 151 DecodeCB bound_decode_cb = BindToCurrentLoop(decode_cb);
151 152
152 if (!buffer->end_of_stream() && buffer->timestamp() == kNoTimestamp) { 153 if (!buffer->end_of_stream() && buffer->timestamp() == kNoTimestamp) {
153 DVLOG(2) << __func__ << " " << buffer->AsHumanReadableString() 154 DVLOG(2) << __func__ << " " << buffer->AsHumanReadableString()
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 RETURN_STRING(STATE_READY); 514 RETURN_STRING(STATE_READY);
514 RETURN_STRING(STATE_ERROR); 515 RETURN_STRING(STATE_ERROR);
515 } 516 }
516 NOTREACHED() << "Unknown state " << state; 517 NOTREACHED() << "Unknown state " << state;
517 return nullptr; 518 return nullptr;
518 } 519 }
519 520
520 #undef RETURN_STRING 521 #undef RETURN_STRING
521 522
522 } // namespace media 523 } // namespace media
OLDNEW
« no previous file with comments | « media/base/android/media_codec_loop_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698