cdm_manifest.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2019 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 COMPONENTS_CDM_COMMON_CDM_MANIFEST_H_
  5. #define COMPONENTS_CDM_COMMON_CDM_MANIFEST_H_
  6. namespace base {
  7. class FilePath;
  8. class Value;
  9. class Version;
  10. } // namespace base
  11. namespace media {
  12. struct CdmCapability;
  13. }
  14. // Returns whether the CDM's API versions, as specified in the manifest, are
  15. // supported in this Chrome binary and not disabled at run time.
  16. // Checks the module API, CDM interface API, and Host API.
  17. // This should never fail except in rare cases where the component has not been
  18. // updated recently or the user downgrades Chrome.
  19. bool IsCdmManifestCompatibleWithChrome(const base::Value& manifest);
  20. // Extracts the necessary information from |manifest| and updates |capability|.
  21. // Returns true on success, false if there are errors in the manifest.
  22. // If this method returns false, |capability| may or may not be updated.
  23. bool ParseCdmManifest(const base::Value& manifest,
  24. media::CdmCapability* capability);
  25. // Reads the file |manifest_path| which is assumed to be a CDM manifest and
  26. // extracts the necessary information from it to update |version| and
  27. // |capability|. This also verifies that the read CDM manifest is compatible
  28. // with Chrome (by calling IsCdmManifestCompatibleWithChrome()). Returns true on
  29. // success, false if there are errors in the file or the manifest is not
  30. // compatible with this version of Chrome. If this method returns false,
  31. // |version| and |capability| may or may not be updated.
  32. bool ParseCdmManifestFromPath(const base::FilePath& manifest_path,
  33. base::Version* version,
  34. media::CdmCapability* capability);
  35. #endif // COMPONENTS_CDM_COMMON_CDM_MANIFEST_H_