cdm_paths.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // Copyright 2016 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef MEDIA_CDM_CDM_PATHS_H_
  5. #define MEDIA_CDM_CDM_PATHS_H_
  6. #include <string>
  7. #include "base/files/file_path.h"
  8. #include "base/unguessable_token.h"
  9. #include "build/build_config.h"
  10. #include "media/cdm/cdm_type.h"
  11. #include "media/media_buildflags.h"
  12. #if !BUILDFLAG(ENABLE_LIBRARY_CDMS)
  13. #error This file only applies to builds that enable_library_cdms.
  14. #endif
  15. namespace media {
  16. // Name of the ClearKey CDM library.
  17. extern const char kClearKeyCdmLibraryName[];
  18. extern const char kClearKeyCdmBaseDirectory[];
  19. // Display name for Clear Key CDM.
  20. extern const char kClearKeyCdmDisplayName[];
  21. // The default GUID for Clear Key Cdm.
  22. extern const CdmType kClearKeyCdmType;
  23. // A different GUID for Clear Key Cdm for testing running different types of
  24. // CDMs in the system.
  25. extern const CdmType kClearKeyCdmDifferentCdmType;
  26. // Returns the path of a CDM relative to DIR_COMPONENTS.
  27. // On platforms where a platform specific path is used, returns
  28. // |cdm_base_path|/_platform_specific/<platform>_<arch>
  29. // e.g. WidevineCdm/_platform_specific/win_x64
  30. // Otherwise, returns an empty path.
  31. // TODO(xhwang): Use this function in Widevine CDM component installer.
  32. base::FilePath GetPlatformSpecificDirectory(
  33. const base::FilePath& cdm_base_path);
  34. base::FilePath GetPlatformSpecificDirectory(const std::string& cdm_base_path);
  35. #if BUILDFLAG(IS_WIN)
  36. // Returns the "CDM store path" to be passed to `MediaFoundationCdm`. The
  37. // `cdm_store_path_root` is typically the path to the Chrome user's profile,
  38. // e.g.
  39. // C:\Users\<user>\AppData\Local\Google\Chrome\Default\MediaFoundationCdmStore\x86_x64
  40. base::FilePath GetCdmStorePath(const base::FilePath& cdm_store_path_root,
  41. const base::UnguessableToken& cdm_origin_id,
  42. const std::string& key_system);
  43. #endif // BUILDFLAG(IS_WIN)
  44. } // namespace media
  45. #endif // MEDIA_CDM_CDM_PATHS_H_