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

Unified Diff: chrome/common/chrome_content_client.cc

Issue 42003002: Extract supported codecs from CDM component manifest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added includes; removed DLOG Created 7 years, 2 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: chrome/common/chrome_content_client.cc
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
index e380249862956a24008df18c2b8dfc5014e7febc..a054b8d55cd9210f47e1b9d273401126617bc928 100644
--- a/chrome/common/chrome_content_client.cc
+++ b/chrome/common/chrome_content_client.cc
@@ -9,6 +9,7 @@
#include "base/debug/crash_logging.h"
#include "base/file_util.h"
#include "base/path_service.h"
+#include "base/strings/string16.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
@@ -289,6 +290,28 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) {
kWidevineCdmPluginMimeType,
kWidevineCdmPluginExtension,
kWidevineCdmPluginMimeTypeDescription);
+
+ // Add the supported codecs as if they came from the component manifest.
+ std::vector<std::string> codecs;
+ codecs.push_back(kCdmSupportedCodecVorbis);
+ codecs.push_back(kCdmSupportedCodecVp8);
+#if defined(USE_PROPRIETARY_CODECS)
+// TODO(ddorwin): Rename these macros to reflect their real meaning: whether the
+// CDM Chrome was built [and shipped] with support these types.
+#if defined(WIDEVINE_CDM_AAC_SUPPORT_AVAILABLE)
+ codecs.push_back(kCdmSupportedCodecAac);
+#endif
+#if defined(WIDEVINE_CDM_AVC1_SUPPORT_AVAILABLE)
+ codecs.push_back(kCdmSupportedCodecAvc1);
+#endif
+#endif // defined(USE_PROPRIETARY_CODECS)
+ std::string codec_string =
+ JoinString(codecs, kCdmSupportedCodecsValueDelimiter);
+ widevine_cdm_mime_type.additional_param_names.push_back(
+ base::ASCIIToUTF16(kCdmSupportedCodecsParamName));
+ widevine_cdm_mime_type.additional_param_values.push_back(
+ base::ASCIIToUTF16(codec_string));
+
widevine_cdm.mime_types.push_back(widevine_cdm_mime_type);
widevine_cdm.permissions = kWidevineCdmPluginPermissions;
plugins->push_back(widevine_cdm);
« no previous file with comments | « chrome/browser/component_updater/widevine_cdm_component_installer.cc ('k') | third_party/widevine/cdm/widevine_cdm_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698