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

Unified Diff: media/filters/android/media_codec_audio_decoder.cc

Issue 2697643003: media: Clean up MediaCodecBridge and remove subclasses (Closed)
Patch Set: rebase Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/video_codecs.h ('k') | media/gpu/android/media_codec_video_decoder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/android/media_codec_audio_decoder.cc
diff --git a/media/filters/android/media_codec_audio_decoder.cc b/media/filters/android/media_codec_audio_decoder.cc
index a82a377991b7679908e325954b11b45ebf61e745..be3d2c97b64bb541078c9111d97d81b4f51daec9 100644
--- a/media/filters/android/media_codec_audio_decoder.cc
+++ b/media/filters/android/media_codec_audio_decoder.cc
@@ -72,10 +72,9 @@ void MediaCodecAudioDecoder::Initialize(const AudioDecoderConfig& config,
return;
}
- // We can support only the codecs that AudioCodecBridge can decode.
- // TODO(xhwang): Get this list from AudioCodecBridge or just rely on
- // AudioCodecBridge::ConfigureAndStart() to determine whether the codec is
- // supported.
+ // We can support only the codecs that MediaCodecBridge can decode.
+ // TODO(xhwang): Get this list from MediaCodecBridge or just rely on
+ // attempting to create one to determine whether the codec is supported.
const bool is_codec_supported = config.codec() == kCodecVorbis ||
config.codec() == kCodecAAC ||
config.codec() == kCodecOpus;
@@ -117,19 +116,11 @@ bool MediaCodecAudioDecoder::CreateMediaCodecLoop() {
DVLOG(1) << __func__ << ": config:" << config_.AsHumanReadableString();
codec_loop_.reset();
-
- std::unique_ptr<AudioCodecBridge> audio_codec_bridge(
- AudioCodecBridge::Create(config_.codec()));
- if (!audio_codec_bridge) {
- DLOG(ERROR) << __func__ << " failed: cannot create AudioCodecBridge";
- return false;
- }
-
jobject media_crypto_obj = media_crypto_ ? media_crypto_->obj() : nullptr;
-
- if (!audio_codec_bridge->ConfigureAndStart(config_, media_crypto_obj)) {
- DLOG(ERROR) << __func__ << " failed: cannot configure audio codec for "
- << config_.AsHumanReadableString();
+ std::unique_ptr<MediaCodecBridge> audio_codec_bridge(
+ MediaCodecBridgeImpl::CreateAudioDecoder(config_, media_crypto_obj));
+ if (!audio_codec_bridge) {
+ DLOG(ERROR) << __func__ << " failed: cannot create MediaCodecBridge";
return false;
}
« no previous file with comments | « media/base/video_codecs.h ('k') | media/gpu/android/media_codec_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698