Commit 98b092ab authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Commit Bot

Migrate CdmProxy to new Mojo types

This CL converts old Mojo types to new Mojo types
in CdmProxy interface. CdmProxy::Initialize applies
pending_associated_remote to the first argument.

Bug: 955171
Change-Id: I6d777b123809c9e56bd25d8204d71ee4d0c8999c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1827102Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Reviewed-by: default avatarOksana Zhuravlova <oksamyt@chromium.org>
Reviewed-by: default avatarChrome Cunningham <chcunningham@chromium.org>
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Cr-Commit-Position: refs/heads/master@{#701437}
parent 328d94dd
...@@ -27,10 +27,11 @@ interface CdmProxy { ...@@ -27,10 +27,11 @@ interface CdmProxy {
// If the proxy created a crypto session, then the ID for the crypto session // If the proxy created a crypto session, then the ID for the crypto session
// is |crypto_session_id|. // is |crypto_session_id|.
// |cdm_id| can be used to connect the remote media pipeline and CdmProxy. // |cdm_id| can be used to connect the remote media pipeline and CdmProxy.
Initialize(associated CdmProxyClient client) => (Status status, Initialize(pending_associated_remote<CdmProxyClient> client)
Protocol protocol, => (Status status,
uint32 crypto_session_id, Protocol protocol,
int32 cdm_id); uint32 crypto_session_id,
int32 cdm_id);
// Processes and updates the state of the proxy. // Processes and updates the state of the proxy.
// |func| specifies what type of function to use. // |func| specifies what type of function to use.
......
...@@ -27,7 +27,7 @@ MojoCdmProxyService::~MojoCdmProxyService() { ...@@ -27,7 +27,7 @@ MojoCdmProxyService::~MojoCdmProxyService() {
} }
void MojoCdmProxyService::Initialize( void MojoCdmProxyService::Initialize(
mojom::CdmProxyClientAssociatedPtrInfo client, mojo::PendingAssociatedRemote<mojom::CdmProxyClient> client,
InitializeCallback callback) { InitializeCallback callback) {
DVLOG(2) << __func__; DVLOG(2) << __func__;
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include "media/cdm/cdm_proxy.h" #include "media/cdm/cdm_proxy.h"
#include "media/mojo/mojom/cdm_proxy.mojom.h" #include "media/mojo/mojom/cdm_proxy.mojom.h"
#include "media/mojo/services/media_mojo_export.h" #include "media/mojo/services/media_mojo_export.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "mojo/public/cpp/bindings/pending_associated_remote.h"
namespace media { namespace media {
...@@ -31,7 +33,7 @@ class MEDIA_MOJO_EXPORT MojoCdmProxyService : public mojom::CdmProxy, ...@@ -31,7 +33,7 @@ class MEDIA_MOJO_EXPORT MojoCdmProxyService : public mojom::CdmProxy,
~MojoCdmProxyService() final; ~MojoCdmProxyService() final;
// mojom::CdmProxy implementation. // mojom::CdmProxy implementation.
void Initialize(mojom::CdmProxyClientAssociatedPtrInfo client, void Initialize(mojo::PendingAssociatedRemote<mojom::CdmProxyClient> client,
InitializeCallback callback) final; InitializeCallback callback) final;
void Process(media::CdmProxy::Function function, void Process(media::CdmProxy::Function function,
uint32_t crypto_session_id, uint32_t crypto_session_id,
...@@ -69,7 +71,7 @@ class MEDIA_MOJO_EXPORT MojoCdmProxyService : public mojom::CdmProxy, ...@@ -69,7 +71,7 @@ class MEDIA_MOJO_EXPORT MojoCdmProxyService : public mojom::CdmProxy,
std::unique_ptr<::media::CdmProxy> cdm_proxy_; std::unique_ptr<::media::CdmProxy> cdm_proxy_;
MojoCdmServiceContext* const context_ = nullptr; MojoCdmServiceContext* const context_ = nullptr;
mojom::CdmProxyClientAssociatedPtr client_; mojo::AssociatedRemote<mojom::CdmProxyClient> client_;
// Set to a valid CDM ID if the |cdm_proxy_| is successfully initialized. // Set to a valid CDM ID if the |cdm_proxy_| is successfully initialized.
int cdm_id_ = CdmContext::kInvalidCdmId; int cdm_id_ = CdmContext::kInvalidCdmId;
......
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