Skip to content

Commit

Permalink
Remove flags to enable/disable AImageReader.
Browse files Browse the repository at this point in the history
Remove the flags to disable AImageReader on android media path. This is
because AImageReader has been enabled by default on chrome starting M76.

Change-Id: Iddb8d112095d59479d337feae4abee59289690f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2036354
Reviewed-by: Khushal <khushalsagar@chromium.org>
Reviewed-by: Frank Liberato <liberato@chromium.org>
Commit-Queue: vikas soni <vikassoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738326}
  • Loading branch information
vikaschromie authored and Commit Bot committed Feb 4, 2020
1 parent 3ff3d8d commit 463fa0f
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 25 deletions.
5 changes: 0 additions & 5 deletions gpu/command_buffer/service/image_reader_gl_owner_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@
#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"
Expand All @@ -32,8 +30,6 @@ 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);
Expand Down Expand Up @@ -73,7 +69,6 @@ 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;

Expand Down
4 changes: 0 additions & 4 deletions gpu/config/gpu_finch_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
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};
Expand Down
1 change: 0 additions & 1 deletion gpu/config/gpu_finch_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ 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;
#endif // defined(OS_ANDROID)

Expand Down
10 changes: 2 additions & 8 deletions gpu/ipc/service/stream_texture_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,8 @@ TextureOwner::Mode GetTextureOwnerMode() {
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 && base::FeatureList::IsEnabled(
features::kAImageReaderMediaPlayer)
? TextureOwner::Mode::kAImageReaderInsecure
: TextureOwner::Mode::kSurfaceTextureInsecure;
return a_image_reader_supported ? TextureOwner::Mode::kAImageReaderInsecure
: TextureOwner::Mode::kSurfaceTextureInsecure;
}

} // namespace
Expand Down
4 changes: 0 additions & 4 deletions media/base/media_switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,6 @@ 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{
Expand Down
1 change: 0 additions & 1 deletion media/base/media_switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ 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;
Expand Down
3 changes: 1 addition & 2 deletions media/gpu/android/video_frame_factory_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ gpu::TextureOwner::Mode GetTextureOwnerMode(
switch (overlay_mode) {
case VideoFrameFactory::OverlayMode::kDontRequestPromotionHints:
case VideoFrameFactory::OverlayMode::kRequestPromotionHints:
return a_image_reader_supported && base::FeatureList::IsEnabled(
media::kAImageReaderVideoOutput)
return a_image_reader_supported
? gpu::TextureOwner::Mode::kAImageReaderInsecure
: gpu::TextureOwner::Mode::kSurfaceTextureInsecure;
case VideoFrameFactory::OverlayMode::kSurfaceControlSecure:
Expand Down

0 comments on commit 463fa0f

Please sign in to comment.