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") {
public_deps += [
":media_features",
":shared_memory_support",
# media_switches.h needs ppapi/features/features.h.
"//ppapi/features",
"//ui/gfx:color_space",
]
......
......@@ -8,7 +8,6 @@ include_rules = [
"+gpu",
"+jni",
"+mojo/public/cpp/bindings/callback_helpers.h",
"+ppapi/features",
"+skia/ext",
"+third_party/ffmpeg",
"+third_party/libaom",
......
......@@ -286,7 +286,6 @@ source_set("base") {
deps = [
"//base/allocator:buildflags",
"//gpu/command_buffer/common",
"//ppapi/features",
"//skia",
"//third_party/libaom:av1_features",
"//third_party/libyuv",
......
......@@ -19,7 +19,7 @@ namespace media {
// Helps convert CdmPromises to an integer identifier and vice versa. The
// integer identifier is needed where we cannot pass CdmPromises through, such
// as PPAPI, IPC and JNI.
// as IPC and JNI.
class MEDIA_EXPORT CdmPromiseAdapter {
public:
CdmPromiseAdapter();
......
......@@ -73,18 +73,14 @@ const char kUseCras[] = "use-cras";
const char kUnsafelyAllowProtectedMediaIdentifierForDomain[] =
"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
// tabs can't play on top of each other.
// The allowed values are: "" (empty) or |kEnableAudioFocusDuckFlash|.
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
// be ducked when losing audio focus.
const char kEnableAudioFocusDuckFlash[] = "duck-flash";
#endif // BUILDFLAG(ENABLE_PLUGINS)
#if BUILDFLAG(ENABLE_RUNTIME_MEDIA_RENDERER_SELECTION)
// 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) {
#endif
}
#if BUILDFLAG(ENABLE_PLUGINS)
MEDIA_EXPORT bool IsAudioFocusDuckFlashEnabled() {
return base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kEnableAudioFocus) ==
switches::kEnableAudioFocusDuckFlash;
}
#endif // BUILDFLAG(ENABLE_PLUGINS)
// Adds icons to the overflow menu on the native media controls.
const base::Feature kOverflowIconsForMediaControls{
......
......@@ -13,7 +13,6 @@
#include "build/build_config.h"
#include "media/base/media_export.h"
#include "media/media_features.h"
#include "ppapi/features/features.h"
namespace base {
class CommandLine;
......@@ -53,13 +52,8 @@ MEDIA_EXPORT extern const char kUseCras[];
MEDIA_EXPORT extern const char
kUnsafelyAllowProtectedMediaIdentifierForDomain[];
#if !defined(OS_ANDROID) || BUILDFLAG(ENABLE_PLUGINS)
MEDIA_EXPORT extern const char kEnableAudioFocus[];
#endif // !defined(OS_ANDROID) || BUILDFLAG(ENABLE_PLUGINS)
#if BUILDFLAG(ENABLE_PLUGINS)
MEDIA_EXPORT extern const char kEnableAudioFocusDuckFlash[];
#endif // BUILDFLAG(ENABLE_PLUGINS)
#if BUILDFLAG(ENABLE_RUNTIME_MEDIA_RENDERER_SELECTION)
MEDIA_EXPORT extern const char kDisableMojoRenderer[];
......@@ -158,11 +152,9 @@ MEDIA_EXPORT extern const base::Feature kMediaFoundationVideoCapture;
MEDIA_EXPORT std::string GetEffectiveAutoplayPolicy(
const base::CommandLine& command_line);
#if BUILDFLAG(ENABLE_PLUGINS)
// Based on the command line of the current process, determine if
// audio focus duck flash should be enabled.
MEDIA_EXPORT bool IsAudioFocusDuckFlashEnabled();
#endif // BUILDFLAG(ENABLE_PLUGINS)
} // namespace media
......
include_rules = [
"+components/crash/core/common/crash_key.h",
"+crypto",
"+ppapi/cpp/logging.h",
]
......@@ -5,9 +5,6 @@
import("//build/config/chrome_build.gni")
import("//build/config/chromecast_build.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")
# Do not expand this list without double-checking with OWNERS, this is a list of
......@@ -124,8 +121,7 @@ declare_args() {
# 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
# 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 = enable_plugins && (is_linux || is_mac || is_win)
enable_library_cdms = (is_linux && !is_chromecast) || is_mac || is_win
declare_args() {
# Experiment to enable mojo media services (e.g. "renderer", "cdm", see
......
......@@ -21,7 +21,6 @@
namespace media {
// 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 {
public:
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