Commit 290bce09 authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

media: Do not allow both Decryptor and CDM ID on Android in MojoCdm

Bug: 801245
TBR: dalecurtis@chromium.org
Change-Id: I05658d14ca57daf24b012f047c3d3df13c3037a7
Reviewed-on: https://chromium-review.googlesource.com/954336
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542068}
parent 3e2247dd
......@@ -14,9 +14,11 @@
#include "base/metrics/histogram_macros.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "media/base/cdm_context.h"
#include "media/base/cdm_key_information.h"
#include "media/base/cdm_promise.h"
#include "media/media_features.h"
#include "media/mojo/clients/mojo_decryptor.h"
#include "media/mojo/common/media_type_converters.h"
#include "media/mojo/interfaces/decryptor.mojom.h"
......@@ -317,6 +319,15 @@ Decryptor* MojoCdm::GetDecryptor() {
int MojoCdm::GetCdmId() const {
// Can be called on a different thread.
base::AutoLock auto_lock(lock_);
#if defined(OS_ANDROID)
// TODO(xhwang): On Android, we always assume the remote CDM is a
// MediaDrmBridge. If it supports a Decryptor here, then it's not a
// MediaDrmBridge, and we should not provide the CDM ID.
if (decryptor_ptr_info_.is_valid() || decryptor_)
return CdmContext::kInvalidCdmId;
#endif
DVLOG(2) << __func__ << ": cdm_id = " << cdm_id_;
return cdm_id_;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment