95 lines
4.4 KiB
Diff
95 lines
4.4 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.
|
|
---
|
|
gpu/config/gpu_finch_features.cc | 4 ++++
|
|
gpu/config/gpu_finch_features.h | 1 +
|
|
gpu/ipc/service/stream_texture_android.cc | 11 ++++++++++-
|
|
media/base/media_switches.cc | 4 ++++
|
|
media/base/media_switches.h | 1 +
|
|
5 files changed, 20 insertions(+), 1 deletion(-)
|
|
|
|
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 {
|
|
|
|
+// Use android AImageReader when playing videos with MediaPlayer.
|
|
+const base::Feature kAImageReaderMediaPlayer{"AImageReaderMediaPlayer",
|
|
+ base::FEATURE_ENABLED_BY_DEFAULT};
|
|
+
|
|
#if defined(OS_ANDROID)
|
|
// Used to limit GL version to 2.0 for skia raster on Android.
|
|
const base::Feature kUseGles2ForOopR{"UseGles2ForOopR",
|
|
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 kUseGles2ForOopR;
|
|
GPU_EXPORT extern const base::Feature kAndroidSurfaceControl;
|
|
GPU_EXPORT extern const base::Feature kAImageReader;
|
|
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
|
|
@@ -6,6 +6,7 @@
|
|
|
|
#include <string.h>
|
|
|
|
+#include "base/android/android_image_reader_compat.h"
|
|
#include "base/android/scoped_hardware_buffer_fence_sync.h"
|
|
#include "base/bind.h"
|
|
#include "base/feature_list.h"
|
|
@@ -47,7 +48,15 @@ std::unique_ptr<ui::ScopedMakeCurrent> MakeCurrent(
|
|
}
|
|
|
|
TextureOwner::Mode GetTextureOwnerMode() {
|
|
- return features::IsAImageReaderEnabled()
|
|
+ const bool a_image_reader_supported =
|
|
+ base::android::AndroidImageReader::GetInstance().IsSupported();
|
|
+
|
|
+ // 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 && features::IsAImageReaderEnabled() &&
|
|
+ base::FeatureList::IsEnabled(features::kAImageReaderMediaPlayer)
|
|
? TextureOwner::Mode::kAImageReaderInsecure
|
|
: TextureOwner::Mode::kSurfaceTextureInsecure;
|
|
}
|
|
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
|
|
@@ -566,6 +566,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
|
|
@@ -198,6 +198,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;
|
|
--
|
|
2.17.1
|
|
|