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

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

Issue 1344133002: MediaCodecPlayer implementation - stage 7 (DRM) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mtplayer-drm-prepare
Patch Set: Renamed a variable Created 5 years, 3 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/android/media_codec_audio_decoder.h ('k') | media/base/android/media_codec_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/android/media_codec_audio_decoder.cc
diff --git a/media/base/android/media_codec_audio_decoder.cc b/media/base/android/media_codec_audio_decoder.cc
index 5d6803e7cae5cafffee6299739bba266d60a5ad2..503fb39223ccdd913707f459941f6698d5112eee 100644
--- a/media/base/android/media_codec_audio_decoder.cc
+++ b/media/base/android/media_codec_audio_decoder.cc
@@ -25,6 +25,7 @@ MediaCodecAudioDecoder::MediaCodecAudioDecoder(
const base::Closure& starvation_cb,
const base::Closure& decoder_drained_cb,
const base::Closure& stop_done_cb,
+ const base::Closure& waiting_for_decryption_key_cb,
const base::Closure& error_cb,
const SetTimeCallback& update_current_time_cb)
: MediaCodecDecoder(media_task_runner,
@@ -32,6 +33,7 @@ MediaCodecAudioDecoder::MediaCodecAudioDecoder(
starvation_cb,
decoder_drained_cb,
stop_done_cb,
+ waiting_for_decryption_key_cb,
error_cb,
"AudioDecoder"),
volume_(-1.0),
@@ -65,6 +67,12 @@ void MediaCodecAudioDecoder::SetDemuxerConfigs(const DemuxerConfigs& configs) {
output_sampling_rate_ = configs.audio_sampling_rate;
}
+bool MediaCodecAudioDecoder::IsContentEncrypted() const {
+ // Make sure SetDemuxerConfigs() as been called.
+ DCHECK(configs_.audio_codec != kUnknownAudioCodec);
+ return configs_.is_audio_encrypted;
+}
+
void MediaCodecAudioDecoder::ReleaseDecoderResources() {
DCHECK(media_task_runner_->BelongsToCurrentThread());
DVLOG(1) << class_name() << "::" << __FUNCTION__;
@@ -109,14 +117,15 @@ bool MediaCodecAudioDecoder::IsCodecReconfigureNeeded(
return configs_.audio_codec != next.audio_codec ||
configs_.audio_channels != next.audio_channels ||
configs_.audio_sampling_rate != next.audio_sampling_rate ||
- next.is_audio_encrypted != next.is_audio_encrypted ||
+ configs_.is_audio_encrypted != next.is_audio_encrypted ||
configs_.audio_extra_data.size() != next.audio_extra_data.size() ||
!std::equal(configs_.audio_extra_data.begin(),
configs_.audio_extra_data.end(),
next.audio_extra_data.begin());
}
-MediaCodecDecoder::ConfigStatus MediaCodecAudioDecoder::ConfigureInternal() {
+MediaCodecDecoder::ConfigStatus MediaCodecAudioDecoder::ConfigureInternal(
+ jobject media_crypto) {
DCHECK(media_task_runner_->BelongsToCurrentThread());
DVLOG(1) << class_name() << "::" << __FUNCTION__;
@@ -141,7 +150,7 @@ MediaCodecDecoder::ConfigStatus MediaCodecAudioDecoder::ConfigureInternal() {
configs_.audio_codec_delay_ns,
configs_.audio_seek_preroll_ns,
true,
- GetMediaCrypto().obj())) {
+ media_crypto)) {
DVLOG(0) << class_name() << "::" << __FUNCTION__
<< " failed: cannot start audio codec";
« no previous file with comments | « media/base/android/media_codec_audio_decoder.h ('k') | media/base/android/media_codec_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698