Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(875)

Unified Diff: media/base/key_systems.h

Issue 1023863002: Create an interface for KeySystems, migrate WebEncryptedMediaClientImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@robustness
Patch Set: Rebase. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/base/key_systems.h
diff --git a/media/base/key_systems.h b/media/base/key_systems.h
index 6f977cd773466fa7ef912998a1bb9999d56a765a..0e524bbb77c008b739eb89372ebdc40d9ee38699 100644
--- a/media/base/key_systems.h
+++ b/media/base/key_systems.h
@@ -14,6 +14,47 @@
namespace media {
+class MEDIA_EXPORT KeySystems {
+ public:
+ static KeySystems& GetInstance();
ddorwin 2015/03/20 00:55:03 const ref?
sandersd (OOO until July 31) 2015/03/20 22:53:19 No, we may need to provide access to methods that
+
+ // Returns whether the list of codecs are supported together by |key_system|.
+ // TODO(sandersd): Return a rule instead of a bool so that codec selection can
+ // affect other configuration options (namely robustness).
+ virtual bool IsSupportedCodecCombination(
+ const std::string& key_system,
+ EmeMediaType media_type,
+ const std::string& container_mime_type,
+ const std::vector<std::string>& codecs) const = 0;
+
+ // Returns the configuration rule for supporting a robustness requirement.
+ virtual EmeConfigRule GetRobustnessConfigRule(
+ const std::string& key_system,
+ EmeMediaType media_type,
+ EmeRobustness robustness) const = 0;
+
+ // Returns the configuration rule for supporting persistent-license sessions.
+ virtual EmeConfigRule GetPersistentLicenseSessionConfigRule(
+ const std::string& key_system) const = 0;
+
+ // Returns the configuration rule for supporting persistent-release-message
+ // sessions.
+ virtual EmeConfigRule GetPersistentReleaseMessageSessionConfigRule(
+ const std::string& key_system) const = 0;
+
+ // Returns the configuration rule for supporting a persistent state
+ // requirement.
+ virtual EmeConfigRule GetPersistentStateConfigRule(
+ const std::string& key_system,
+ EmeFeatureRequirement requirement) const = 0;
+
+ // Returns the configuration rule for supporting a distinctive identifier
+ // requirement.
+ virtual EmeConfigRule GetDistinctiveIdentifierConfigRule(
+ const std::string& key_system,
+ EmeFeatureRequirement requirement) const = 0;
+};
+
// Prefixed EME API only supports prefixed (webkit-) key system name for
// certain key systems. But internally only unprefixed key systems are
// supported. The following two functions help convert between prefixed and
@@ -85,33 +126,6 @@ MEDIA_EXPORT std::string GetPepperType(
const std::string& concrete_key_system);
#endif
-// Returns the configuration rule for supporting a robustness requirement.
-// TODO(sandersd): Also take a list of codecs, as they may affect the result.
-MEDIA_EXPORT EmeConfigRule GetRobustnessConfigRule(
- const std::string& key_system,
- EmeMediaType media_type,
- EmeRobustness robustness);
-
-// Returns the configuration rule for supporting persistent-license sessions.
-MEDIA_EXPORT EmeConfigRule GetPersistentLicenseSessionConfigRule(
- const std::string& key_system);
-
-// Returns the configuration rule for supporting persistent-release-message
-// sessions.
-MEDIA_EXPORT EmeConfigRule GetPersistentReleaseMessageSessionConfigRule(
- const std::string& key_system);
-
-// Returns the configuration rule for supporting a persistent state requirement.
-MEDIA_EXPORT EmeConfigRule GetPersistentStateConfigRule(
- const std::string& key_system,
- EmeFeatureRequirement requirement);
-
-// Returns the configuration rule for supporting a distinctive identifier
-// requirement.
-MEDIA_EXPORT EmeConfigRule GetDistinctiveIdentifierConfigRule(
- const std::string& key_system,
- EmeFeatureRequirement requirement);
-
#if defined(UNIT_TEST)
// Helper functions to add container/codec types for testing purposes.
MEDIA_EXPORT void AddContainerMask(const std::string& container, uint32 mask);
« no previous file with comments | « media/base/eme_constants.h ('k') | media/base/key_systems.cc » ('j') | media/base/key_systems.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698