1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47

media / cdm / win / test / media_foundation_clear_key_cdm_access.h [blame]

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MEDIA_CDM_WIN_TEST_MEDIA_FOUNDATION_CLEAR_KEY_CDM_ACCESS_H_
#define MEDIA_CDM_WIN_TEST_MEDIA_FOUNDATION_CLEAR_KEY_CDM_ACCESS_H_

#include <mfcontentdecryptionmodule.h>
#include <mfidl.h>
#include <wrl/client.h>
#include <wrl/implements.h>

#include "base/threading/thread_checker.h"

namespace media {

class MediaFoundationClearKeyCdmAccess final
    : public Microsoft::WRL::RuntimeClass<
          Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>,
          IMFContentDecryptionModuleAccess,
          Microsoft::WRL::FtmBase> {
 public:
  MediaFoundationClearKeyCdmAccess();
  MediaFoundationClearKeyCdmAccess(const MediaFoundationClearKeyCdmAccess&) =
      delete;
  MediaFoundationClearKeyCdmAccess& operator=(
      const MediaFoundationClearKeyCdmAccess&) = delete;
  ~MediaFoundationClearKeyCdmAccess() override;

  HRESULT RuntimeClassInitialize();

  // IMFContentDecryptionModuleAccess
  STDMETHODIMP CreateContentDecryptionModule(
      _In_opt_ IPropertyStore* properties,
      _COM_Outptr_ IMFContentDecryptionModule** cdm) override;
  STDMETHODIMP GetConfiguration(_COM_Outptr_ IPropertyStore** config) override;
  STDMETHODIMP GetKeySystem(_COM_Outptr_ LPWSTR* key_system) override;

 private:
  // Thread checker to enforce that this object is used on a specific thread.
  // Some methods may get called from MF work queue threads.
  THREAD_CHECKER(thread_checker_);
};

}  // namespace media

#endif  // MEDIA_CDM_WIN_TEST_MEDIA_FOUNDATION_CLEAR_KEY_CDM_ACCESS_H_