135 lines
6.6 KiB
Diff
135 lines
6.6 KiB
Diff
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
|
Date: Tue, 5 May 2020 07:26:55 +0200
|
|
Subject: Revert "Remove flags to enable/disable AImageReader."
|
|
|
|
This reverts commit 463fa0f2e3b9e418bc26e2c8954463f0b0f76634.
|
|
---
|
|
.../service/image_reader_gl_owner_unittest.cc | 5 +++++
|
|
gpu/config/gpu_finch_features.cc | 4 ++++
|
|
gpu/config/gpu_finch_features.h | 1 +
|
|
gpu/ipc/service/stream_texture_android.cc | 10 ++++++++--
|
|
media/base/media_switches.cc | 4 ++++
|
|
media/base/media_switches.h | 1 +
|
|
media/gpu/android/video_frame_factory_impl.cc | 3 ++-
|
|
7 files changed, 25 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/gpu/command_buffer/service/image_reader_gl_owner_unittest.cc b/gpu/command_buffer/service/image_reader_gl_owner_unittest.cc
|
|
--- a/gpu/command_buffer/service/image_reader_gl_owner_unittest.cc
|
|
+++ b/gpu/command_buffer/service/image_reader_gl_owner_unittest.cc
|
|
@@ -8,10 +8,12 @@
|
|
#include <memory>
|
|
#include <utility>
|
|
|
|
+#include "base/test/scoped_feature_list.h"
|
|
#include "base/test/task_environment.h"
|
|
#include "gpu/command_buffer/service/abstract_texture.h"
|
|
#include "gpu/command_buffer/service/image_reader_gl_owner.h"
|
|
#include "gpu/command_buffer/service/mock_abstract_texture.h"
|
|
+#include "media/base/media_switches.h"
|
|
#include "testing/gtest/include/gtest/gtest.h"
|
|
#include "ui/gl/gl_bindings.h"
|
|
#include "ui/gl/gl_context_egl.h"
|
|
@@ -30,6 +32,8 @@ class ImageReaderGLOwnerTest : public testing::Test {
|
|
if (!IsImageReaderSupported())
|
|
return;
|
|
|
|
+ scoped_feature_list_.InitAndEnableFeature(media::kAImageReaderVideoOutput);
|
|
+
|
|
gl::init::InitializeStaticGLBindingsImplementation(
|
|
gl::kGLImplementationEGLGLES2, false);
|
|
gl::init::InitializeGLOneOffPlatformImplementation(false, false, true);
|
|
@@ -69,6 +73,7 @@ class ImageReaderGLOwnerTest : public testing::Test {
|
|
return base::android::AndroidImageReader::GetInstance().IsSupported();
|
|
}
|
|
|
|
+ base::test::ScopedFeatureList scoped_feature_list_;
|
|
scoped_refptr<TextureOwner> image_reader_;
|
|
GLuint texture_id_ = 0;
|
|
|
|
diff --git a/gpu/config/gpu_finch_features.cc b/gpu/config/gpu_finch_features.cc
|
|
--- a/gpu/config/gpu_finch_features.cc
|
|
+++ b/gpu/config/gpu_finch_features.cc
|
|
@@ -13,6 +13,10 @@
|
|
namespace features {
|
|
|
|
#if defined(OS_ANDROID)
|
|
+// Use android AImageReader when playing videos with MediaPlayer.
|
|
+const base::Feature kAImageReaderMediaPlayer{"AImageReaderMediaPlayer",
|
|
+ base::FEATURE_ENABLED_BY_DEFAULT};
|
|
+
|
|
// Used only by webview to disable SurfaceControl.
|
|
const base::Feature kDisableSurfaceControlForWebview{
|
|
"DisableSurfaceControlForWebview", base::FEATURE_DISABLED_BY_DEFAULT};
|
|
diff --git a/gpu/config/gpu_finch_features.h b/gpu/config/gpu_finch_features.h
|
|
--- a/gpu/config/gpu_finch_features.h
|
|
+++ b/gpu/config/gpu_finch_features.h
|
|
@@ -17,6 +17,7 @@ namespace features {
|
|
// All features in alphabetical order. The features should be documented
|
|
// alongside the definition of their values in the .cc file.
|
|
#if defined(OS_ANDROID)
|
|
+GPU_EXPORT extern const base::Feature kAImageReaderMediaPlayer;
|
|
GPU_EXPORT extern const base::Feature kDisableSurfaceControlForWebview;
|
|
|
|
GPU_EXPORT extern const base::Feature kUseGles2ForOopR;
|
|
diff --git a/gpu/ipc/service/stream_texture_android.cc b/gpu/ipc/service/stream_texture_android.cc
|
|
--- a/gpu/ipc/service/stream_texture_android.cc
|
|
+++ b/gpu/ipc/service/stream_texture_android.cc
|
|
@@ -51,8 +51,14 @@ TextureOwner::Mode GetTextureOwnerMode() {
|
|
const bool a_image_reader_supported =
|
|
base::android::AndroidImageReader::GetInstance().IsSupported();
|
|
|
|
- return a_image_reader_supported ? TextureOwner::Mode::kAImageReaderInsecure
|
|
- : TextureOwner::Mode::kSurfaceTextureInsecure;
|
|
+ // TODO(vikassoni) : Currently we have 2 different flags to enable/disable
|
|
+ // AImageReader - one for MCVD and other for MediaPlayer here. Merge those 2
|
|
+ // flags into a single flag. Keeping the 2 flags separate for now since finch
|
|
+ // experiment using this flag is in progress.
|
|
+ return a_image_reader_supported && base::FeatureList::IsEnabled(
|
|
+ features::kAImageReaderMediaPlayer)
|
|
+ ? TextureOwner::Mode::kAImageReaderInsecure
|
|
+ : TextureOwner::Mode::kSurfaceTextureInsecure;
|
|
}
|
|
|
|
} // namespace
|
|
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
|
|
--- a/media/base/media_switches.cc
|
|
+++ b/media/base/media_switches.cc
|
|
@@ -542,6 +542,10 @@ const base::Feature kMediaDrmPreprovisioning{"MediaDrmPreprovisioning",
|
|
const base::Feature kMediaDrmPreprovisioningAtStartup{
|
|
"MediaDrmPreprovisioningAtStartup", base::FEATURE_ENABLED_BY_DEFAULT};
|
|
|
|
+// Enables the Android Image Reader path for Video decoding(for AVDA and MCVD)
|
|
+const base::Feature kAImageReaderVideoOutput{"AImageReaderVideoOutput",
|
|
+ base::FEATURE_ENABLED_BY_DEFAULT};
|
|
+
|
|
// Prevents using SurfaceLayer for videos. This is meant to be used by embedders
|
|
// that cannot support SurfaceLayer at the moment.
|
|
const base::Feature kDisableSurfaceLayerForVideo{
|
|
diff --git a/media/base/media_switches.h b/media/base/media_switches.h
|
|
--- a/media/base/media_switches.h
|
|
+++ b/media/base/media_switches.h
|
|
@@ -186,6 +186,7 @@ MEDIA_EXPORT extern const base::Feature kMediaControlsExpandGesture;
|
|
MEDIA_EXPORT extern const base::Feature kMediaDrmPersistentLicense;
|
|
MEDIA_EXPORT extern const base::Feature kMediaDrmPreprovisioning;
|
|
MEDIA_EXPORT extern const base::Feature kMediaDrmPreprovisioningAtStartup;
|
|
+MEDIA_EXPORT extern const base::Feature kAImageReaderVideoOutput;
|
|
MEDIA_EXPORT extern const base::Feature kDisableSurfaceLayerForVideo;
|
|
MEDIA_EXPORT extern const base::Feature kCanPlayHls;
|
|
MEDIA_EXPORT extern const base::Feature kPictureInPictureAPI;
|
|
diff --git a/media/gpu/android/video_frame_factory_impl.cc b/media/gpu/android/video_frame_factory_impl.cc
|
|
--- a/media/gpu/android/video_frame_factory_impl.cc
|
|
+++ b/media/gpu/android/video_frame_factory_impl.cc
|
|
@@ -41,7 +41,8 @@ gpu::TextureOwner::Mode GetTextureOwnerMode(
|
|
switch (overlay_mode) {
|
|
case VideoFrameFactory::OverlayMode::kDontRequestPromotionHints:
|
|
case VideoFrameFactory::OverlayMode::kRequestPromotionHints:
|
|
- return a_image_reader_supported
|
|
+ return a_image_reader_supported && base::FeatureList::IsEnabled(
|
|
+ media::kAImageReaderVideoOutput)
|
|
? gpu::TextureOwner::Mode::kAImageReaderInsecure
|
|
: gpu::TextureOwner::Mode::kSurfaceTextureInsecure;
|
|
case VideoFrameFactory::OverlayMode::kSurfaceControlSecure:
|
|
--
|
|
2.17.1
|
|
|