blob: 306dd49650bdd1f6552f0bb2a6d76f6091deb904 [file] [log] [blame]
// Copyright 2016 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.
#include "media/base/cdm_context.h"
namespace media {
namespace remoting {
class RemotingCdm;
class SharedSession;
// TODO(xjz): Merge this with erickung's implementation.
// TODO(miu): This class should just be merged into RemotingCdm and implement
// both the CDM and CdmContext interfaces. Also, replace the GetSharedSession()
// accessor and move it to a new SharedSession::FromCdmContext() function. Then,
// neither the controller nor renderer can gain direct access to the CDM impl.
// See discussion in for more info.
class RemotingCdmContext : public CdmContext {
explicit RemotingCdmContext(RemotingCdm* remoting_cdm);
~RemotingCdmContext() override;
// If |cdm_context| is an instance of RemotingCdmContext, return a type-casted
// pointer to it. Otherwise, return nullptr.
static RemotingCdmContext* From(CdmContext* cdm_context);
SharedSession* GetSharedSession() const;
// CdmContext implementations.
Decryptor* GetDecryptor() override;
int GetCdmId() const override;
void* GetClassIdentifier() const override;
RemotingCdm* const remoting_cdm_; // Outlives this class.
} // namespace remoting
} // namespace media