Commit 01411024 authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

media: Remove ppapi/ dependency from media/

Less dependency is better. Media code should not need to know
third_party plugins (ppapi/). This CL removes ppapi/ dependency from
media/ to enforce this.

Bug: 772160
Change-Id: Ib4e1bf6b6a5a87dde16e5130830e589769a2ca89
Reviewed-on: https://chromium-review.googlesource.com/974574
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#544978}
parent a7dfbd28
...@@ -105,9 +105,6 @@ component("media") { ...@@ -105,9 +105,6 @@ component("media") {
public_deps += [ public_deps += [
":media_features", ":media_features",
":shared_memory_support", ":shared_memory_support",
# media_switches.h needs ppapi/features/features.h.
"//ppapi/features",
"//ui/gfx:color_space", "//ui/gfx:color_space",
] ]
......
...@@ -8,7 +8,6 @@ include_rules = [ ...@@ -8,7 +8,6 @@ include_rules = [
"+gpu", "+gpu",
"+jni", "+jni",
"+mojo/public/cpp/bindings/callback_helpers.h", "+mojo/public/cpp/bindings/callback_helpers.h",
"+ppapi/features",
"+skia/ext", "+skia/ext",
"+third_party/ffmpeg", "+third_party/ffmpeg",
"+third_party/libaom", "+third_party/libaom",
......
...@@ -286,7 +286,6 @@ source_set("base") { ...@@ -286,7 +286,6 @@ source_set("base") {
deps = [ deps = [
"//base/allocator:buildflags", "//base/allocator:buildflags",
"//gpu/command_buffer/common", "//gpu/command_buffer/common",
"//ppapi/features",
"//skia", "//skia",
"//third_party/libaom:av1_features", "//third_party/libaom:av1_features",
"//third_party/libyuv", "//third_party/libyuv",
......
...@@ -19,7 +19,7 @@ namespace media { ...@@ -19,7 +19,7 @@ namespace media {
// Helps convert CdmPromises to an integer identifier and vice versa. The // Helps convert CdmPromises to an integer identifier and vice versa. The
// integer identifier is needed where we cannot pass CdmPromises through, such // integer identifier is needed where we cannot pass CdmPromises through, such
// as PPAPI, IPC and JNI. // as IPC and JNI.
class MEDIA_EXPORT CdmPromiseAdapter { class MEDIA_EXPORT CdmPromiseAdapter {
public: public:
CdmPromiseAdapter(); CdmPromiseAdapter();
......
...@@ -73,18 +73,14 @@ const char kUseCras[] = "use-cras"; ...@@ -73,18 +73,14 @@ const char kUseCras[] = "use-cras";
const char kUnsafelyAllowProtectedMediaIdentifierForDomain[] = const char kUnsafelyAllowProtectedMediaIdentifierForDomain[] =
"unsafely-allow-protected-media-identifier-for-domain"; "unsafely-allow-protected-media-identifier-for-domain";
#if !defined(OS_ANDROID) || BUILDFLAG(ENABLE_PLUGINS)
// Enable a internal audio focus management between tabs in such a way that two // Enable a internal audio focus management between tabs in such a way that two
// tabs can't play on top of each other. // tabs can't play on top of each other.
// The allowed values are: "" (empty) or |kEnableAudioFocusDuckFlash|. // The allowed values are: "" (empty) or |kEnableAudioFocusDuckFlash|.
const char kEnableAudioFocus[] = "enable-audio-focus"; const char kEnableAudioFocus[] = "enable-audio-focus";
#endif // !defined(OS_ANDROID) || BUILDFLAG(ENABLE_PLUGINS)
#if BUILDFLAG(ENABLE_PLUGINS)
// This value is used as an option for |kEnableAudioFocus|. Flash will // This value is used as an option for |kEnableAudioFocus|. Flash will
// be ducked when losing audio focus. // be ducked when losing audio focus.
const char kEnableAudioFocusDuckFlash[] = "duck-flash"; const char kEnableAudioFocusDuckFlash[] = "duck-flash";
#endif // BUILDFLAG(ENABLE_PLUGINS)
#if BUILDFLAG(ENABLE_RUNTIME_MEDIA_RENDERER_SELECTION) #if BUILDFLAG(ENABLE_RUNTIME_MEDIA_RENDERER_SELECTION)
// Rather than use the renderer hosted remotely in the media service, fall back // Rather than use the renderer hosted remotely in the media service, fall back
...@@ -350,13 +346,11 @@ std::string GetEffectiveAutoplayPolicy(const base::CommandLine& command_line) { ...@@ -350,13 +346,11 @@ std::string GetEffectiveAutoplayPolicy(const base::CommandLine& command_line) {
#endif #endif
} }
#if BUILDFLAG(ENABLE_PLUGINS)
MEDIA_EXPORT bool IsAudioFocusDuckFlashEnabled() { MEDIA_EXPORT bool IsAudioFocusDuckFlashEnabled() {
return base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( return base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kEnableAudioFocus) == switches::kEnableAudioFocus) ==
switches::kEnableAudioFocusDuckFlash; switches::kEnableAudioFocusDuckFlash;
} }
#endif // BUILDFLAG(ENABLE_PLUGINS)
// Adds icons to the overflow menu on the native media controls. // Adds icons to the overflow menu on the native media controls.
const base::Feature kOverflowIconsForMediaControls{ const base::Feature kOverflowIconsForMediaControls{
......
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "media/base/media_export.h" #include "media/base/media_export.h"
#include "media/media_features.h" #include "media/media_features.h"
#include "ppapi/features/features.h"
namespace base { namespace base {
class CommandLine; class CommandLine;
...@@ -53,13 +52,8 @@ MEDIA_EXPORT extern const char kUseCras[]; ...@@ -53,13 +52,8 @@ MEDIA_EXPORT extern const char kUseCras[];
MEDIA_EXPORT extern const char MEDIA_EXPORT extern const char
kUnsafelyAllowProtectedMediaIdentifierForDomain[]; kUnsafelyAllowProtectedMediaIdentifierForDomain[];
#if !defined(OS_ANDROID) || BUILDFLAG(ENABLE_PLUGINS)
MEDIA_EXPORT extern const char kEnableAudioFocus[]; MEDIA_EXPORT extern const char kEnableAudioFocus[];
#endif // !defined(OS_ANDROID) || BUILDFLAG(ENABLE_PLUGINS)
#if BUILDFLAG(ENABLE_PLUGINS)
MEDIA_EXPORT extern const char kEnableAudioFocusDuckFlash[]; MEDIA_EXPORT extern const char kEnableAudioFocusDuckFlash[];
#endif // BUILDFLAG(ENABLE_PLUGINS)
#if BUILDFLAG(ENABLE_RUNTIME_MEDIA_RENDERER_SELECTION) #if BUILDFLAG(ENABLE_RUNTIME_MEDIA_RENDERER_SELECTION)
MEDIA_EXPORT extern const char kDisableMojoRenderer[]; MEDIA_EXPORT extern const char kDisableMojoRenderer[];
...@@ -158,11 +152,9 @@ MEDIA_EXPORT extern const base::Feature kMediaFoundationVideoCapture; ...@@ -158,11 +152,9 @@ MEDIA_EXPORT extern const base::Feature kMediaFoundationVideoCapture;
MEDIA_EXPORT std::string GetEffectiveAutoplayPolicy( MEDIA_EXPORT std::string GetEffectiveAutoplayPolicy(
const base::CommandLine& command_line); const base::CommandLine& command_line);
#if BUILDFLAG(ENABLE_PLUGINS)
// Based on the command line of the current process, determine if // Based on the command line of the current process, determine if
// audio focus duck flash should be enabled. // audio focus duck flash should be enabled.
MEDIA_EXPORT bool IsAudioFocusDuckFlashEnabled(); MEDIA_EXPORT bool IsAudioFocusDuckFlashEnabled();
#endif // BUILDFLAG(ENABLE_PLUGINS)
} // namespace media } // namespace media
......
include_rules = [ include_rules = [
"+components/crash/core/common/crash_key.h", "+components/crash/core/common/crash_key.h",
"+crypto", "+crypto",
"+ppapi/cpp/logging.h",
] ]
...@@ -5,9 +5,6 @@ ...@@ -5,9 +5,6 @@
import("//build/config/chrome_build.gni") import("//build/config/chrome_build.gni")
import("//build/config/chromecast_build.gni") import("//build/config/chromecast_build.gni")
import("//build/config/features.gni") import("//build/config/features.gni")
# TODO(xhwang): Remove this once pepper CDM support is removed.
import("//ppapi/features/features.gni")
import("//testing/libfuzzer/fuzzer_test.gni") import("//testing/libfuzzer/fuzzer_test.gni")
# Do not expand this list without double-checking with OWNERS, this is a list of # Do not expand this list without double-checking with OWNERS, this is a list of
...@@ -124,8 +121,7 @@ declare_args() { ...@@ -124,8 +121,7 @@ declare_args() {
# Enables the use of library CDMs that implements the interface defined at # Enables the use of library CDMs that implements the interface defined at
# media/cdm/api/content_decryption_module.h. If true, the actually library CDM # media/cdm/api/content_decryption_module.h. If true, the actually library CDM
# will be hosted in the mojo CDM service running in the CDM (utility) process. # will be hosted in the mojo CDM service running in the CDM (utility) process.
# TODO(xhwang): Remove |enable_plugins| once pepper CDM support is removed. enable_library_cdms = (is_linux && !is_chromecast) || is_mac || is_win
enable_library_cdms = enable_plugins && (is_linux || is_mac || is_win)
declare_args() { declare_args() {
# Experiment to enable mojo media services (e.g. "renderer", "cdm", see # Experiment to enable mojo media services (e.g. "renderer", "cdm", see
......
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
namespace media { namespace media {
// This is a CdmAllocator that creates buffers using mojo shared memory. // This is a CdmAllocator that creates buffers using mojo shared memory.
// The internal logic is similar to ppapi_cdm_buffer.cc.
class MEDIA_MOJO_EXPORT MojoCdmAllocator : public CdmAllocator { class MEDIA_MOJO_EXPORT MojoCdmAllocator : public CdmAllocator {
public: public:
MojoCdmAllocator(); MojoCdmAllocator();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment