cdm_message_filter_android.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // Copyright 2014 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_BROWSER_CDM_MESSAGE_FILTER_ANDROID_H_
  5. #define COMPONENTS_CDM_BROWSER_CDM_MESSAGE_FILTER_ANDROID_H_
  6. #include "content/public/browser/browser_message_filter.h"
  7. struct SupportedKeySystemRequest;
  8. struct SupportedKeySystemResponse;
  9. namespace base {
  10. class SequencedTaskRunner;
  11. }
  12. namespace cdm {
  13. // Message filter for EME on Android. It is responsible for getting the
  14. // SupportedKeySystems information and passing it back to renderer.
  15. // TODO(xhwang): Convert this to a mojo interface or merge this with
  16. // desktop Chromium's IsPepperCdmAvailable() path.
  17. class CdmMessageFilterAndroid : public content::BrowserMessageFilter {
  18. public:
  19. CdmMessageFilterAndroid(bool can_persist_data,
  20. bool force_to_support_secure_codecs);
  21. CdmMessageFilterAndroid(const CdmMessageFilterAndroid&) = delete;
  22. CdmMessageFilterAndroid& operator=(const CdmMessageFilterAndroid&) = delete;
  23. private:
  24. ~CdmMessageFilterAndroid() override;
  25. // BrowserMessageFilter implementation.
  26. bool OnMessageReceived(const IPC::Message& message) override;
  27. scoped_refptr<base::SequencedTaskRunner> OverrideTaskRunnerForMessage(
  28. const IPC::Message& message) override;
  29. // Query the key system information.
  30. void OnQueryKeySystemSupport(const SupportedKeySystemRequest& request,
  31. SupportedKeySystemResponse* response);
  32. void OnGetPlatformKeySystemNames(std::vector<std::string>* key_systems);
  33. const scoped_refptr<base::SequencedTaskRunner> task_runner_;
  34. // Whether any data can be persisted by Chromium or by MediaDrm (e.g. false in
  35. // incognito mode).
  36. const bool can_persist_data_;
  37. // By default, rendering of secure codecs is supported when AndroidOverlay is
  38. // enabled. However, on platforms like Cast on Android, secure codecs are
  39. // always supported. This flag is used to force secure codecs support on such
  40. // platforms.
  41. // TODO(yucliu): Remove this and completely switch to the Clank model.
  42. const bool force_to_support_secure_codecs_;
  43. };
  44. } // namespace cdm
  45. #endif // COMPONENTS_CDM_BROWSER_CDM_MESSAGE_FILTER_ANDROID_H_