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

Side by Side 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, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/common/chrome_content_client.h" 5 #include "chrome/common/chrome_content_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/cpu.h" 8 #include "base/cpu.h"
9 #include "base/debug/crash_logging.h" 9 #include "base/debug/crash_logging.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "base/strings/string16.h"
12 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
13 #include "base/strings/string_split.h" 14 #include "base/strings/string_split.h"
14 #include "base/strings/string_util.h" 15 #include "base/strings/string_util.h"
15 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
16 #include "base/strings/utf_string_conversions.h" 17 #include "base/strings/utf_string_conversions.h"
17 #include "build/build_config.h" 18 #include "build/build_config.h"
18 #include "chrome/common/child_process_logging.h" 19 #include "chrome/common/child_process_logging.h"
19 #include "chrome/common/chrome_paths.h" 20 #include "chrome/common/chrome_paths.h"
20 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_switches.h"
21 #include "chrome/common/chrome_version_info.h" 22 #include "chrome/common/chrome_version_info.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 content::PepperPluginInfo widevine_cdm; 283 content::PepperPluginInfo widevine_cdm;
283 widevine_cdm.is_out_of_process = true; 284 widevine_cdm.is_out_of_process = true;
284 widevine_cdm.path = path; 285 widevine_cdm.path = path;
285 widevine_cdm.name = kWidevineCdmDisplayName; 286 widevine_cdm.name = kWidevineCdmDisplayName;
286 widevine_cdm.description = kWidevineCdmDescription; 287 widevine_cdm.description = kWidevineCdmDescription;
287 widevine_cdm.version = WIDEVINE_CDM_VERSION_STRING; 288 widevine_cdm.version = WIDEVINE_CDM_VERSION_STRING;
288 content::WebPluginMimeType widevine_cdm_mime_type( 289 content::WebPluginMimeType widevine_cdm_mime_type(
289 kWidevineCdmPluginMimeType, 290 kWidevineCdmPluginMimeType,
290 kWidevineCdmPluginExtension, 291 kWidevineCdmPluginExtension,
291 kWidevineCdmPluginMimeTypeDescription); 292 kWidevineCdmPluginMimeTypeDescription);
293
294 // Add the supported codecs as if they came from the component manifest.
295 std::vector<std::string> codecs;
296 codecs.push_back(kCdmSupportedCodecVorbis);
297 codecs.push_back(kCdmSupportedCodecVp8);
298 #if defined(USE_PROPRIETARY_CODECS)
299 // TODO(ddorwin): Rename these macros to reflect their real meaning: whether the
300 // CDM Chrome was built [and shipped] with support these types.
301 #if defined(WIDEVINE_CDM_AAC_SUPPORT_AVAILABLE)
302 codecs.push_back(kCdmSupportedCodecAac);
303 #endif
304 #if defined(WIDEVINE_CDM_AVC1_SUPPORT_AVAILABLE)
305 codecs.push_back(kCdmSupportedCodecAvc1);
306 #endif
307 #endif // defined(USE_PROPRIETARY_CODECS)
308 std::string codec_string =
309 JoinString(codecs, kCdmSupportedCodecsValueDelimiter);
310 widevine_cdm_mime_type.additional_param_names.push_back(
311 base::ASCIIToUTF16(kCdmSupportedCodecsParamName));
312 widevine_cdm_mime_type.additional_param_values.push_back(
313 base::ASCIIToUTF16(codec_string));
314
292 widevine_cdm.mime_types.push_back(widevine_cdm_mime_type); 315 widevine_cdm.mime_types.push_back(widevine_cdm_mime_type);
293 widevine_cdm.permissions = kWidevineCdmPluginPermissions; 316 widevine_cdm.permissions = kWidevineCdmPluginPermissions;
294 plugins->push_back(widevine_cdm); 317 plugins->push_back(widevine_cdm);
295 318
296 skip_widevine_cdm_file_check = true; 319 skip_widevine_cdm_file_check = true;
297 } 320 }
298 } 321 }
299 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) && 322 #endif // defined(WIDEVINE_CDM_AVAILABLE) && defined(ENABLE_PEPPER_CDMS) &&
300 // !defined(WIDEVINE_CDM_IS_COMPONENT) 323 // !defined(WIDEVINE_CDM_IS_COMPONENT)
301 324
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 } 557 }
535 return false; 558 return false;
536 } 559 }
537 560
538 std::string ChromeContentClient::GetCarbonInterposePath() const { 561 std::string ChromeContentClient::GetCarbonInterposePath() const {
539 return std::string(kInterposeLibraryPath); 562 return std::string(kInterposeLibraryPath);
540 } 563 }
541 #endif 564 #endif
542 565
543 } // namespace chrome 566 } // namespace chrome
OLDNEW
« 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