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

Unified Diff: media/base/android/media_codec_decoder.h

Issue 1344133002: MediaCodecPlayer implementation - stage 7 (DRM) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mtplayer-drm-prepare
Patch Set: Rebased 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
Index: media/base/android/media_codec_decoder.h
diff --git a/media/base/android/media_codec_decoder.h b/media/base/android/media_codec_decoder.h
index d22744fabc8dbae19e2fe0b767054ddcf3d0aa54..72cbf1000100c24db50db5a9c972cfda44d53dd6 100644
--- a/media/base/android/media_codec_decoder.h
+++ b/media/base/android/media_codec_decoder.h
@@ -118,6 +118,7 @@ class MediaCodecDecoder {
enum ConfigStatus {
kConfigFailure = 0,
kConfigOk,
+ kConfigNoCrypto,
kConfigKeyFrameRequired,
};
@@ -162,6 +163,7 @@ class MediaCodecDecoder {
const base::Closure& starvation_cb,
const base::Closure& decoder_drained_cb,
const base::Closure& stop_done_cb,
+ const base::Closure& key_required_cb,
const base::Closure& error_cb,
const char* decoder_thread_name);
virtual ~MediaCodecDecoder();
@@ -177,6 +179,10 @@ class MediaCodecDecoder {
// Stores configuration for the use of upcoming Configure()
virtual void SetDemuxerConfigs(const DemuxerConfigs& configs) = 0;
+ // Returns true if the DemuxerConfigs announce that content is encrypted and
+ // that MediaCrypto is required for configuration.
+ virtual bool IsContentEncrypted() const = 0;
+
// Stops decoder thread, releases the MediaCodecBridge and other resources.
virtual void ReleaseDecoderResources() = 0;
@@ -193,17 +199,18 @@ class MediaCodecDecoder {
bool IsCompleted() const;
bool NotCompletedAndNeedsPreroll() const;
+ // Forces reconfiguraton on the next Configure().
+ void SetNeedsReconfigure();
+
// Sets preroll timestamp and requests preroll.
void SetPrerollTimestamp(base::TimeDelta preroll_ts);
- base::android::ScopedJavaLocalRef<jobject> GetMediaCrypto();
-
// Starts prefetching: accumulates enough data in AccessUnitQueue.
// Decoder thread is not running.
void Prefetch(const base::Closure& prefetch_done_cb);
// Configures MediaCodec.
- ConfigStatus Configure();
+ ConfigStatus Configure(jobject media_crypto);
// Starts the decoder for prerolling. This method starts the decoder thread.
bool Preroll(const base::Closure& preroll_done_cb);
@@ -254,7 +261,7 @@ class MediaCodecDecoder {
// Does the part of MediaCodecBridge configuration that is specific
// to audio or video.
- virtual ConfigStatus ConfigureInternal() = 0;
+ virtual ConfigStatus ConfigureInternal(jobject media_crypto) = 0;
// Associates PTS with device time so we can calculate delays.
// We use delays for video decoder only.
@@ -388,6 +395,7 @@ class MediaCodecDecoder {
base::Closure preroll_done_cb_;
base::Closure decoder_drained_cb_;
base::Closure stop_done_cb_;
+ base::Closure key_required_cb_;
base::Closure error_cb_;
// Data request callback that is posted by decoder internally.
@@ -412,6 +420,10 @@ class MediaCodecDecoder {
// Flag is set when the EOS is enqueued into MediaCodec. Reset by Flush.
bool eos_enqueued_;
+ // Flag is set when NO_KEY error is received from QueueSecureInputBuffer.
+ // Reset after we stop.
+ bool key_request_posted_;
+
// Flag is set when the EOS is received in MediaCodec output. Reset by Flush.
bool completed_;

Powered by Google App Engine
This is Rietveld 408576698