Commit 6abd9187 authored by Rintaro Kuroiwa's avatar Rintaro Kuroiwa Committed by Commit Bot

Add CdmProxy mojom bare bones

- With typemap to media/cdm/cdm_proxy.h types.
- No methods are added yet.

Bug: 785563, 641132
Change-Id: I9012cc81bb52be694d004673881aedad8b8abb09
Reviewed-on: https://chromium-review.googlesource.com/772863
Commit-Queue: Rintaro Kuroiwa <rkuroiwa@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarXiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521437}
parent e7fc11e9
......@@ -31,8 +31,13 @@
#include "media/base/video_rotation.h"
#include "media/base/video_types.h"
#include "media/base/watch_time_keys.h"
#include "media/media_features.h"
#include "ui/gfx/ipc/color/gfx_param_traits_macros.h"
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
#include "media/cdm/cdm_proxy.h" // nogncheck
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
// Enum traits.
IPC_ENUM_TRAITS_MAX_VALUE(media::AudioCodec, media::AudioCodec::kAudioCodecMax)
......@@ -55,6 +60,17 @@ IPC_ENUM_TRAITS_MAX_VALUE(media::CdmMessageType,
IPC_ENUM_TRAITS_MAX_VALUE(media::CdmPromise::Exception,
media::CdmPromise::Exception::EXCEPTION_MAX)
#if BUILDFLAG(ENABLE_LIBRARY_CDMS)
IPC_ENUM_TRAITS_MAX_VALUE(media::CdmProxy::Function,
media::CdmProxy::Function::kMax)
IPC_ENUM_TRAITS_MAX_VALUE(media::CdmProxy::Protocol,
media::CdmProxy::Protocol::kMax)
IPC_ENUM_TRAITS_MAX_VALUE(media::CdmProxy::Status,
media::CdmProxy::Status::kMax)
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
IPC_ENUM_TRAITS_MAX_VALUE(media::CdmSessionType,
media::CdmSessionType::SESSION_TYPE_MAX)
......
......@@ -6,7 +6,7 @@
namespace media {
KeyInfo::KeyInfo() = default;
KeyInfo::~KeyInfo() = default;
CdmProxyKeyInfo::CdmProxyKeyInfo() = default;
CdmProxyKeyInfo::~CdmProxyKeyInfo() = default;
} // namespace media
\ No newline at end of file
......@@ -16,9 +16,9 @@
namespace media {
// Key information structure containing data necessary to decrypt/decode media.
struct MEDIA_EXPORT KeyInfo {
KeyInfo();
~KeyInfo();
struct MEDIA_EXPORT CdmProxyKeyInfo {
CdmProxyKeyInfo();
~CdmProxyKeyInfo();
// Crypto session for decryption.
uint32_t crypto_session_id = 0;
// ID of the key.
......@@ -49,6 +49,7 @@ class MEDIA_EXPORT CdmProxy {
enum class Status {
kOk,
kFail,
kMax = kFail,
};
enum class Protocol {
......@@ -56,6 +57,7 @@ class MEDIA_EXPORT CdmProxy {
kIntelConvergedSecurityAndManageabilityEngine,
// There will be more values in the future e.g. kD3D11RsaHardware,
// kD3D11RsaSoftware to use the D3D11 RSA method.
kMax = kIntelConvergedSecurityAndManageabilityEngine,
};
enum class Function {
......@@ -63,6 +65,7 @@ class MEDIA_EXPORT CdmProxy {
// ID3D11VideoContext::NegotiateCryptoSessionKeyExchange.
kIntelNegotiateCryptoSessionKeyExchange,
// There will be more values in the future e.g. for D3D11 RSA method.
kMax = kIntelNegotiateCryptoSessionKeyExchange,
};
CdmProxy() {}
......@@ -109,7 +112,7 @@ class MEDIA_EXPORT CdmProxy {
CreateMediaCryptoSessionCB create_media_crypto_session_cb) = 0;
// Send multiple key information to the proxy.
virtual void SetKeyInfo(const std::vector<KeyInfo>& key_infos) = 0;
virtual void SetKeyInfo(const std::vector<CdmProxyKeyInfo>& key_infos) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(CdmProxy);
......
......@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//media/media_options.gni")
import("//mojo/public/tools/bindings/mojom.gni")
mojom("interfaces") {
......@@ -29,6 +30,10 @@ mojom("interfaces") {
"watch_time_recorder.mojom",
]
if (enable_library_cdms) {
sources += [ "cdm_proxy.mojom" ]
}
if (is_android) {
sources += [ "media_drm_storage.mojom" ]
}
......
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module media.mojom;
// In general, the interpretation of the method and callback parameters are
// protocol dependent.
// CdmProxy implemenation is hosted in the GPU process.
interface CdmProxy {
// See media/cdm/cdm_proxy.h.
[Native]
enum Status;
// See media/cdm/cdm_proxy.h.
[Native]
enum Protocol;
// See media/cdm/cdm_proxy.h.
[Native]
enum Function;
// TODO(xhwang): Add methods for this interface so that they match
// the methods in media/cdm/cdm_proxy.h.
};
// Client of CdmProxy.
// CdmProxyClient is running in CDM utility process.
interface CdmProxyClient {
// Notifies the client that there has been a hardware reset.
NotifyHardwareReset();
};
\ No newline at end of file
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
mojom = "//media/mojo/interfaces/cdm_proxy.mojom"
public_headers = [ "//media/cdm/cdm_proxy.h" ]
public_deps = [
"//media",
]
deps = [
"//media/base/ipc",
]
type_mappings = [
"media.mojom.CdmProxy.Status=media::CdmProxy::Status",
"media.mojom.CdmProxy.Protocol=media::CdmProxy::Protocol",
"media.mojom.CdmProxy.Function=media::CdmProxy::Function",
]
......@@ -5,6 +5,7 @@
typemaps = [
"//media/mojo/interfaces/audio_decoder_config.typemap",
"//media/mojo/interfaces/audio_parameters.typemap",
"//media/mojo/interfaces/cdm_proxy.typemap",
"//media/mojo/interfaces/content_decryption_module.typemap",
"//media/mojo/interfaces/decryptor.typemap",
"//media/mojo/interfaces/demuxer_stream.typemap",
......
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