Skip to content

Commit

Permalink
Revert of Convert Widevine and Android platform key systems to KeySys…
Browse files Browse the repository at this point in the history
…temProperties (patchset chromium#6 id:100001 of https://codereview.chromium.org/1926533002/ )

Reason for revert:
Broke Google Chrome Mac bot.

Original issue's description:
> Convert Widevine and Android platform key systems to KeySystemProperties
>
> WidevineKeySystemProperties replaces the use of KeySystemInfo +
> InfoBasedKeySystemProperties for widevine (logic is essentially copied).
> Also updated Android platform key systems as it's simpler to convert the
> APIs in android_key_systems together.
>
> BUG=457438

TBR=xhwang@chromium.org,michaelbai@chromium.org,sky@chromium.org,ddorwin@chromium.org,halliwell@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=457438

Review-Url: https://codereview.chromium.org/1932893004
Cr-Commit-Position: refs/heads/master@{#390579}
  • Loading branch information
justindonnelly authored and Commit bot committed Apr 29, 2016
1 parent b777c6f commit ee270d6
Show file tree
Hide file tree
Showing 21 changed files with 196 additions and 429 deletions.
4 changes: 2 additions & 2 deletions android_webview/renderer/aw_content_renderer_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ bool AwContentRendererClient::IsLinkVisited(unsigned long long link_hash) {
return visited_link_slave_->IsVisited(link_hash);
}

void AwContentRendererClient::AddSupportedKeySystems(
std::vector<std::unique_ptr<::media::KeySystemProperties>>* key_systems) {
void AwContentRendererClient::AddKeySystems(
std::vector<media::KeySystemInfo>* key_systems) {
AwAddKeySystems(key_systems);
}

Expand Down
4 changes: 1 addition & 3 deletions android_webview/renderer/aw_content_renderer_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ class AwContentRendererClient : public content::ContentRendererClient {
unsigned long long VisitedLinkHash(const char* canonical_url,
size_t length) override;
bool IsLinkVisited(unsigned long long link_hash) override;
void AddSupportedKeySystems(
std::vector<std::unique_ptr<::media::KeySystemProperties>>* key_systems)
override;
void AddKeySystems(std::vector<media::KeySystemInfo>* key_systems) override;

bool HandleNavigation(content::RenderFrame* render_frame,
bool is_content_initiated,
Expand Down
8 changes: 4 additions & 4 deletions android_webview/renderer/aw_key_systems.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

namespace android_webview {

void AwAddKeySystems(std::vector<std::unique_ptr<media::KeySystemProperties>>*
key_systems_properties) {
cdm::AddAndroidWidevine(key_systems_properties);
cdm::AddAndroidPlatformKeySystems(key_systems_properties);
void AwAddKeySystems(
std::vector<media::KeySystemInfo>* key_systems_info) {
cdm::AddAndroidWidevine(key_systems_info);
cdm::AddAndroidPlatformKeySystems(key_systems_info);
}

} // namespace android_webview
6 changes: 2 additions & 4 deletions android_webview/renderer/aw_key_systems.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
#ifndef ANDROID_WEBVIEW_RENDERER_AW_KEY_SYSTEMS_H_
#define ANDROID_WEBVIEW_RENDERER_AW_KEY_SYSTEMS_H_

#include <memory>
#include <vector>

#include "media/base/key_system_properties.h"
#include "media/base/key_system_info.h"

namespace android_webview {

void AwAddKeySystems(std::vector<std::unique_ptr<media::KeySystemProperties>>*
key_systems_properties);
void AwAddKeySystems(std::vector<media::KeySystemInfo>* key_systems_info);

} // namespace android_webview

Expand Down
5 changes: 0 additions & 5 deletions chrome/renderer/chrome_content_renderer_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1243,11 +1243,6 @@ bool ChromeContentRendererClient::AllowPepperMediaStreamAPI(

void ChromeContentRendererClient::AddKeySystems(
std::vector<media::KeySystemInfo>* key_systems) {
AddChromeKeySystemsInfo(key_systems);
}

void ChromeContentRendererClient::AddSupportedKeySystems(
std::vector<std::unique_ptr<::media::KeySystemProperties>>* key_systems) {
AddChromeKeySystems(key_systems);
}

Expand Down
3 changes: 0 additions & 3 deletions chrome/renderer/chrome_content_renderer_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,6 @@ class ChromeContentRendererClient : public content::ContentRendererClient {
blink::WebFrame* frame) override;
bool AllowPepperMediaStreamAPI(const GURL& url) override;
void AddKeySystems(std::vector<media::KeySystemInfo>* key_systems) override;
void AddSupportedKeySystems(
std::vector<std::unique_ptr<::media::KeySystemProperties>>* key_systems)
override;
bool IsPluginAllowedToUseDevChannelAPIs() override;
bool IsPluginAllowedToUseCameraDeviceAPI(const GURL& url) override;
bool IsPluginAllowedToUseCompositorAPI(const GURL& url) override;
Expand Down
33 changes: 13 additions & 20 deletions chrome/renderer/media/chrome_key_systems.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/common/render_messages.h"
#include "components/cdm/renderer/widevine_key_systems.h"
#include "content/public/renderer/render_thread.h"
#include "media/base/eme_constants.h"
#include "media/base/key_system_info.h"
#include "media/base/key_system_properties.h"

#include "media/media_features.h"

#if defined(OS_ANDROID)
Expand All @@ -36,7 +34,6 @@
#endif

using media::KeySystemInfo;
using media::KeySystemProperties;
using media::SupportedCodecs;

#if defined(ENABLE_PEPPER_CDMS)
Expand Down Expand Up @@ -153,7 +150,7 @@ void GetSupportedCodecsForPepperCdm(
}

static void AddPepperBasedWidevine(
std::vector<std::unique_ptr<KeySystemProperties>>* concrete_key_systems) {
std::vector<KeySystemInfo>* concrete_key_systems) {
#if defined(WIDEVINE_CDM_MIN_GLIBC_VERSION)
Version glibc_version(gnu_get_libc_version());
DCHECK(glibc_version.IsValid());
Expand Down Expand Up @@ -201,45 +198,41 @@ static void AddPepperBasedWidevine(
#endif // defined(USE_PROPRIETARY_CODECS)
}

concrete_key_systems->emplace_back(new cdm::WidevineKeySystemProperties(
cdm::AddWidevineWithCodecs(
supported_codecs,
#if defined(OS_CHROMEOS)
media::EmeRobustness::HW_SECURE_ALL, // Maximum audio robustness.
media::EmeRobustness::HW_SECURE_ALL, // Maximim video robustness.
media::EmeSessionTypeSupport::
SUPPORTED_WITH_IDENTIFIER, // Persistent-license.
media::EmeSessionTypeSupport::
NOT_SUPPORTED, // Persistent-release-message.
media::EmeFeatureSupport::REQUESTABLE, // Persistent state.
media::EmeFeatureSupport::REQUESTABLE)); // Distinctive identifier.
NOT_SUPPORTED, // Persistent-release-message.
media::EmeFeatureSupport::REQUESTABLE, // Persistent state.
media::EmeFeatureSupport::REQUESTABLE, // Distinctive identifier.
#else // (Desktop)
media::EmeRobustness::SW_SECURE_CRYPTO, // Maximum audio robustness.
media::EmeRobustness::SW_SECURE_DECODE, // Maximum video robustness.
media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license.
media::EmeSessionTypeSupport::
NOT_SUPPORTED, // persistent-release-message.
media::EmeFeatureSupport::REQUESTABLE, // Persistent state.
media::EmeFeatureSupport::NOT_SUPPORTED)); // Distinctive identifier.
NOT_SUPPORTED, // persistent-release-message.
media::EmeFeatureSupport::REQUESTABLE, // Persistent state.
media::EmeFeatureSupport::NOT_SUPPORTED, // Distinctive identifier.
#endif // defined(OS_CHROMEOS)
concrete_key_systems);
}
#endif // defined(WIDEVINE_CDM_AVAILABLE)
#endif // defined(ENABLE_PEPPER_CDMS)

void AddChromeKeySystemsInfo(std::vector<KeySystemInfo>* key_systems_info) {
void AddChromeKeySystems(std::vector<KeySystemInfo>* key_systems_info) {
#if defined(ENABLE_PEPPER_CDMS)
AddExternalClearKey(key_systems_info);
#endif
}

void AddChromeKeySystems(
std::vector<std::unique_ptr<KeySystemProperties>>* key_systems_properties) {
#if defined(ENABLE_PEPPER_CDMS)
#if defined(WIDEVINE_CDM_AVAILABLE)
AddPepperBasedWidevine(key_systems_properties);
AddPepperBasedWidevine(key_systems_info);
#endif // defined(WIDEVINE_CDM_AVAILABLE)
#endif // defined(ENABLE_PEPPER_CDMS)

#if defined(OS_ANDROID)
cdm::AddAndroidWidevine(key_systems_properties);
cdm::AddAndroidWidevine(key_systems_info);
#endif // defined(OS_ANDROID)
}
17 changes: 2 additions & 15 deletions chrome/renderer/media/chrome_key_systems.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,10 @@
#ifndef CHROME_RENDERER_MEDIA_CHROME_KEY_SYSTEMS_H_
#define CHROME_RENDERER_MEDIA_CHROME_KEY_SYSTEMS_H_

#include <memory>
#include <vector>

namespace media {
struct KeySystemInfo;
class KeySystemProperties;
}
#include "media/base/key_system_info.h"

// DEPRECATED: Register the key systems supported by populating
// |key_systems_info|. TODO(halliwell): move all key systems to
// KeySystemProperties API.
void AddChromeKeySystemsInfo(
std::vector<media::KeySystemInfo>* key_systems_info);

// Register the key systems supported by populating |key_systems_properties|.
void AddChromeKeySystems(
std::vector<std::unique_ptr<media::KeySystemProperties>>*
key_systems_properties);
void AddChromeKeySystems(std::vector<media::KeySystemInfo>* key_systems_info);

#endif // CHROME_RENDERER_MEDIA_CHROME_KEY_SYSTEMS_H_
10 changes: 2 additions & 8 deletions chromecast/renderer/cast_content_renderer_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,8 @@ void CastContentRendererClient::RenderViewCreated(
}

void CastContentRendererClient::AddKeySystems(
std::vector<::media::KeySystemInfo>* key_systems_info) {
AddChromecastKeySystemsInfo(key_systems_info);
}

void CastContentRendererClient::AddSupportedKeySystems(
std::vector<std::unique_ptr<::media::KeySystemProperties>>*
key_systems_properties) {
AddChromecastKeySystems(key_systems_properties);
std::vector< ::media::KeySystemInfo>* key_systems) {
AddChromecastKeySystems(key_systems);
}

#if !defined(OS_ANDROID)
Expand Down
5 changes: 1 addition & 4 deletions chromecast/renderer/cast_content_renderer_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ class CastContentRendererClient : public content::ContentRendererClient {
void RenderThreadStarted() override;
void RenderViewCreated(content::RenderView* render_view) override;
void AddKeySystems(
std::vector<::media::KeySystemInfo>* key_systems_info) override;
void AddSupportedKeySystems(
std::vector<std::unique_ptr<::media::KeySystemProperties>>*
key_systems_properties) override;
std::vector< ::media::KeySystemInfo>* key_systems) override;
#if !defined(OS_ANDROID)
std::unique_ptr<::media::RendererFactory> CreateMediaRendererFactory(
content::RenderFrame* render_frame,
Expand Down
43 changes: 19 additions & 24 deletions chromecast/renderer/key_systems_cast.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "base/logging.h"
#include "build/build_config.h"
#include "chromecast/media/base/key_systems_common.h"
#include "components/cdm/renderer/widevine_key_system_properties.h"
#include "components/cdm/renderer/widevine_key_systems.h"
#include "media/base/eme_constants.h"

#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
Expand All @@ -21,9 +21,7 @@ using ::media::EmeSessionTypeSupport;

namespace chromecast {
namespace shell {
namespace {

#if defined(PLAYREADY_CDM_AVAILABLE)
void AddKeySystemWithCodecs(
const std::string& key_system_name,
std::vector<::media::KeySystemInfo>* key_systems_info) {
Expand All @@ -32,47 +30,44 @@ void AddKeySystemWithCodecs(
info.supported_init_data_types = ::media::kInitDataTypeMaskCenc;
info.supported_codecs =
::media::EME_CODEC_MP4_AAC | ::media::EME_CODEC_MP4_AVC1;
info.max_audio_robustness = EmeRobustness::EMPTY;
info.max_video_robustness = EmeRobustness::EMPTY;
info.max_audio_robustness = ::media::EmeRobustness::EMPTY;
info.max_video_robustness = ::media::EmeRobustness::EMPTY;
#if defined(OS_ANDROID)
info.persistent_license_support = EmeSessionTypeSupport::NOT_SUPPORTED;
info.persistent_license_support =
::media::EmeSessionTypeSupport::NOT_SUPPORTED;
#else
info.persistent_license_support = EmeSessionTypeSupport::SUPPORTED;
info.persistent_license_support =
::media::EmeSessionTypeSupport::SUPPORTED;
#endif
info.persistent_release_message_support =
EmeSessionTypeSupport::NOT_SUPPORTED;
info.persistent_state_support = EmeFeatureSupport::ALWAYS_ENABLED;
info.distinctive_identifier_support = EmeFeatureSupport::ALWAYS_ENABLED;
::media::EmeSessionTypeSupport::NOT_SUPPORTED;
info.persistent_state_support = ::media::EmeFeatureSupport::ALWAYS_ENABLED;
info.distinctive_identifier_support =
::media::EmeFeatureSupport::ALWAYS_ENABLED;
key_systems_info->push_back(info);
}
#endif // defined(PLAYREADY_CDM_AVAILABLE)

} // namespace

void AddChromecastKeySystems(
std::vector<std::unique_ptr<::media::KeySystemProperties>>*
key_systems_properties) {
std::vector<::media::KeySystemInfo>* key_systems_info) {
#if defined(WIDEVINE_CDM_AVAILABLE)
::media::SupportedCodecs codecs =
::media::EME_CODEC_MP4_AAC | ::media::EME_CODEC_MP4_AVC1 |
::media::EME_CODEC_WEBM_VP8 | ::media::EME_CODEC_WEBM_VP9;
key_systems_properties->emplace_back(new cdm::WidevineKeySystemProperties(
codecs, // Regular codecs.
cdm::AddWidevineWithCodecs(
codecs, // Regular codecs.
#if defined(OS_ANDROID)
codecs, // Hardware-secure codecs.
#endif
codecs, // Hardware-secure codecs.
#endif // defined(OS_ANDROID)
EmeRobustness::HW_SECURE_ALL, // Max audio robustness.
EmeRobustness::HW_SECURE_ALL, // Max video robustness.
EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license.
EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-release-message.
// Note: On Chromecast, all CDMs may have persistent state.
EmeFeatureSupport::ALWAYS_ENABLED, // Persistent state.
EmeFeatureSupport::ALWAYS_ENABLED)); // Distinctive identifier.
EmeFeatureSupport::ALWAYS_ENABLED, // Persistent state.
EmeFeatureSupport::ALWAYS_ENABLED, // Distinctive identifier.
key_systems_info);
#endif // defined(WIDEVINE_CDM_AVAILABLE)
}

void AddChromecastKeySystemsInfo(
std::vector<::media::KeySystemInfo>* key_systems_info) {
#if defined(PLAYREADY_CDM_AVAILABLE)
AddKeySystemWithCodecs(media::kChromecastPlayreadyKeySystem,
key_systems_info);
Expand Down
13 changes: 7 additions & 6 deletions chromecast/renderer/key_systems_cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@
#ifndef CHROMECAST_RENDERER_KEY_SYSTEMS_CAST_H_
#define CHROMECAST_RENDERER_KEY_SYSTEMS_CAST_H_

#include <memory>
#include <vector>

#include "media/base/key_system_info.h"
#include "media/base/key_system_properties.h"

namespace chromecast {
namespace shell {

void AddChromecastKeySystems(
std::vector<std::unique_ptr<::media::KeySystemProperties>>*
key_systems_properties);
// Adds a single key system by name.
// TODO(gunsch): modify this API to accept specifying different supported
// features, and/or APIs per key system type.
void AddKeySystemWithCodecs(
const std::string& key_system_name,
std::vector<::media::KeySystemInfo>* concrete_key_systems);

void AddChromecastKeySystemsInfo(
void AddChromecastKeySystems(
std::vector<::media::KeySystemInfo>* key_systems_info);

} // namespace shell
Expand Down
6 changes: 3 additions & 3 deletions components/cdm.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
'../third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h',
],
'include_dirs': [
# Needed by widevine_key_system_properties.cc.
# Needed by widevine_key_systems.cc.
'<(SHARED_INTERMEDIATE_DIR)',
],
'sources': [
'cdm/renderer/widevine_key_system_properties.cc',
'cdm/renderer/widevine_key_system_properties.h',
'cdm/renderer/widevine_key_systems.cc',
'cdm/renderer/widevine_key_systems.h',
],
'conditions': [
['OS == "android"', {
Expand Down
4 changes: 2 additions & 2 deletions components/cdm/renderer/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

static_library("renderer") {
sources = [
"widevine_key_system_properties.cc",
"widevine_key_system_properties.h",
"widevine_key_systems.cc",
"widevine_key_systems.h",
]

if (is_android) {
Expand Down
Loading

0 comments on commit ee270d6

Please sign in to comment.