summaryrefslogtreecommitdiffstats
path: root/content/browser
diff options
context:
space:
mode:
authorxhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-05 02:21:25 +0000
committerxhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-09-05 02:21:25 +0000
commit00a5890250f45236a8373f6ec033bd7fff3c69b3 (patch)
tree212ccd2d43e159dfa80a3a479b1780ff72dc8c79 /content/browser
parentb5449c06d9457e1e1b2a4425fe115d439627f512 (diff)
downloadchromium_src-00a5890250f45236a8373f6ec033bd7fff3c69b3.zip
chromium_src-00a5890250f45236a8373f6ec033bd7fff3c69b3.tar.gz
chromium_src-00a5890250f45236a8373f6ec033bd7fff3c69b3.tar.bz2
EME: Handle NO_KEY and resume playback after key is added.
- Now we can notify demuxer ready as soon as the demuxer is ready. We don't need to wait for a key to be added if the stream is encrypted. - QueueSeureInputBuffer() et al return MediaCodecStatus to pass detailed status. - If no key is available the media pipeline pauses. - After a key is added we try to resume the media pipeline playback. BUG=277211,255781,281663 TEST=Start decoding without key is added and see no crash. After key is added playback resumes. R=acolwell@chromium.org, jschuh@chromium.org, qinmin@chromium.org Review URL: https://codereview.chromium.org/23545029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221331 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser')
-rw-r--r--content/browser/android/browser_media_player_manager.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/content/browser/android/browser_media_player_manager.cc b/content/browser/android/browser_media_player_manager.cc
index ec5c2b4..daba884 100644
--- a/content/browser/android/browser_media_player_manager.cc
+++ b/content/browser/android/browser_media_player_manager.cc
@@ -474,10 +474,17 @@ void BrowserMediaPlayerManager::OnAddKey(int media_keys_id,
const std::vector<uint8>& init_data,
const std::string& session_id) {
MediaDrmBridge* drm_bridge = GetDrmBridge(media_keys_id);
- if (drm_bridge) {
- drm_bridge->AddKey(&key[0], key.size(), &init_data[0], init_data.size(),
- session_id);
- }
+ if (!drm_bridge)
+ return;
+
+ drm_bridge->AddKey(&key[0], key.size(), &init_data[0], init_data.size(),
+ session_id);
+ // In EME v0.1b MediaKeys lives in the media element. So the |media_keys_id|
+ // is the same as the |player_id|.
+ // TODO(xhwang): Separate |media_keys_id| and |player_id|.
+ MediaPlayerAndroid* player = GetPlayer(media_keys_id);
+ if (player)
+ player->OnKeyAdded();
}
void BrowserMediaPlayerManager::OnCancelKeyRequest(