Commit f543ad8b authored by mark a. foltz's avatar mark a. foltz Committed by Commit Bot

[Code Inclusion] Remove usages of "blacklist" from media/{base,filters,gpu}

Replace with more inclusive terms per Chromium style guide.

Bug: 1106011
Change-Id: I815f93eab2c860f191827342e6489b80a717c2e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2335319
Commit-Queue: mark a. foltz <mfoltz@chromium.org>
Reviewed-by: default avatarThomas Guilbert <tguilbert@chromium.org>
Cr-Commit-Position: refs/heads/master@{#794718}
parent 91af65d2
...@@ -197,7 +197,7 @@ class MediaCodecUtil { ...@@ -197,7 +197,7 @@ class MediaCodecUtil {
*/ */
@CalledByNative @CalledByNative
private static boolean canDecode(String mime, boolean isSecure) { private static boolean canDecode(String mime, boolean isSecure) {
// Not supported on blacklisted devices. // Not supported on some devices.
if (!isDecoderSupportedForDevice(mime)) { if (!isDecoderSupportedForDevice(mime)) {
Log.e(TAG, "Decoder for type %s is not supported on this device", mime); Log.e(TAG, "Decoder for type %s is not supported on this device", mime);
return false; return false;
...@@ -340,7 +340,7 @@ class MediaCodecUtil { ...@@ -340,7 +340,7 @@ class MediaCodecUtil {
assert result.mediaCodec == null; assert result.mediaCodec == null;
// Do not create codec for blacklisted devices. // Do not create codec for unsupported devices.
if (!isDecoderSupportedForDevice(mime)) { if (!isDecoderSupportedForDevice(mime)) {
Log.e(TAG, "Decoder for type %s is not supported on this device", mime); Log.e(TAG, "Decoder for type %s is not supported on this device", mime);
return result; return result;
...@@ -392,7 +392,7 @@ class MediaCodecUtil { ...@@ -392,7 +392,7 @@ class MediaCodecUtil {
} }
/** /**
* This is a way to blacklist misbehaving devices. * This is a way to handle misbehaving devices.
* Some devices cannot decode certain codecs, while other codecs work fine. * Some devices cannot decode certain codecs, while other codecs work fine.
* *
* Do not access MediaCodec or MediaCodecList in this function since it's * Do not access MediaCodec or MediaCodecList in this function since it's
...@@ -412,7 +412,7 @@ class MediaCodecUtil { ...@@ -412,7 +412,7 @@ class MediaCodecUtil {
// Samsung Galaxy S4 Mini. // Samsung Galaxy S4 Mini.
// Only GT-I9190 was tested with Android 4.4.2 // Only GT-I9190 was tested with Android 4.4.2
// We blacklist it and the popular GT-I9195 for all Android versions. // We block it and the popular GT-I9195 for all Android versions.
if (Build.MODEL.startsWith("GT-I9190") || Build.MODEL.startsWith("GT-I9195")) { if (Build.MODEL.startsWith("GT-I9190") || Build.MODEL.startsWith("GT-I9195")) {
return false; return false;
} }
...@@ -441,7 +441,7 @@ class MediaCodecUtil { ...@@ -441,7 +441,7 @@ class MediaCodecUtil {
* unusable. For example, the S3 on 4.4.2 returns black and white, tiled * unusable. For example, the S3 on 4.4.2 returns black and white, tiled
* frames when this is enabled. * frames when this is enabled.
*/ */
private static boolean isAdaptivePlaybackBlacklisted(String mime) { private static boolean isAdaptivePlaybackDenied(String mime) {
if (!mime.equals("video/avc") && !mime.equals("video/avc1")) { if (!mime.equals("video/avc") && !mime.equals("video/avc1")) {
return false; return false;
} }
...@@ -474,7 +474,7 @@ class MediaCodecUtil { ...@@ -474,7 +474,7 @@ class MediaCodecUtil {
return false; return false;
} }
if (isAdaptivePlaybackBlacklisted(mime)) { if (isAdaptivePlaybackDenied(mime)) {
return false; return false;
} }
...@@ -582,7 +582,7 @@ class MediaCodecUtil { ...@@ -582,7 +582,7 @@ class MediaCodecUtil {
} }
/** /**
* This is a way to blacklist misbehaving devices. * This is a way to handle misbehaving devices.
* @param mime MIME type as passed to mediaCodec.createEncoderByType(mime). * @param mime MIME type as passed to mediaCodec.createEncoderByType(mime).
* @return true if this codec is supported for encoder on this device. * @return true if this codec is supported for encoder on this device.
*/ */
...@@ -592,7 +592,7 @@ class MediaCodecUtil { ...@@ -592,7 +592,7 @@ class MediaCodecUtil {
} }
/** /**
* Provides a way to blacklist MediaCodec.setOutputSurface() on devices. * Provides a way to avoid calling MediaCodec.setOutputSurface() on unsupported devices.
* @return true if setOutputSurface() is expected to work. * @return true if setOutputSurface() is expected to work.
*/ */
@CalledByNative @CalledByNative
......
...@@ -168,18 +168,18 @@ bool MediaCodecUtil::IsMediaCodecAvailable() { ...@@ -168,18 +168,18 @@ bool MediaCodecUtil::IsMediaCodecAvailable() {
// static // static
bool MediaCodecUtil::IsMediaCodecAvailableFor(int sdk, const char* model) { bool MediaCodecUtil::IsMediaCodecAvailableFor(int sdk, const char* model) {
// We will blacklist the model on any sdk that is as old or older than // We will block the model on any sdk that is as old or older than
// |last_bad_sdk| for the given model. // |last_bad_sdk| for the given model.
struct BlacklistEntry { struct BlocklistEntry {
BlacklistEntry(const char* m, int s) : model(m), last_bad_sdk(s) {} BlocklistEntry(const char* m, int s) : model(m), last_bad_sdk(s) {}
base::StringPiece model; base::StringPiece model;
int last_bad_sdk; int last_bad_sdk;
bool operator==(const BlacklistEntry& other) const { bool operator==(const BlocklistEntry& other) const {
// Search on name only. Ignore |last_bad_sdk|. // Search on name only. Ignore |last_bad_sdk|.
return model == other.model; return model == other.model;
} }
}; };
static const BlacklistEntry blacklist[] = { static const BlocklistEntry blocklist[] = {
// crbug.com/653905 // crbug.com/653905
{"LGMS330", SDK_VERSION_LOLLIPOP_MR1}, {"LGMS330", SDK_VERSION_LOLLIPOP_MR1},
...@@ -199,9 +199,9 @@ bool MediaCodecUtil::IsMediaCodecAvailableFor(int sdk, const char* model) { ...@@ -199,9 +199,9 @@ bool MediaCodecUtil::IsMediaCodecAvailableFor(int sdk, const char* model) {
{"GT-I8552", SDK_VERSION_KITKAT}, {"GT-I8552", SDK_VERSION_KITKAT},
}; };
const BlacklistEntry* iter = std::find( const BlocklistEntry* iter = std::find(
std::begin(blacklist), std::end(blacklist), BlacklistEntry(model, 0)); std::begin(blocklist), std::end(blocklist), BlocklistEntry(model, 0));
return iter == std::end(blacklist) || sdk > iter->last_bad_sdk; return iter == std::end(blocklist) || sdk > iter->last_bad_sdk;
} }
// static // static
...@@ -245,7 +245,7 @@ bool MediaCodecUtil::IsVp8DecoderAvailable() { ...@@ -245,7 +245,7 @@ bool MediaCodecUtil::IsVp8DecoderAvailable() {
// static // static
bool MediaCodecUtil::IsVp8EncoderAvailable() { bool MediaCodecUtil::IsVp8EncoderAvailable() {
// Currently the vp8 encoder and decoder blacklists cover the same devices, // Currently the vp8 encoder and decoder blocklists cover the same devices,
// but we have a second method for clarity in future issues. // but we have a second method for clarity in future issues.
return IsVp8DecoderAvailable(); return IsVp8DecoderAvailable();
} }
...@@ -287,8 +287,8 @@ bool MediaCodecUtil::IsSurfaceViewOutputSupported() { ...@@ -287,8 +287,8 @@ bool MediaCodecUtil::IsSurfaceViewOutputSupported() {
// Disable SurfaceView output for the Samsung Galaxy S3; it does not work // Disable SurfaceView output for the Samsung Galaxy S3; it does not work
// well enough for even 360p24 H264 playback. http://crbug.com/602870. // well enough for even 360p24 H264 playback. http://crbug.com/602870.
// //
// Notably this is codec agnostic at present, so any devices added to // Notably this is codec agnostic at present, so any devices added to the
// the blacklist will avoid trying to play any codecs on SurfaceView. If // disabled list will avoid trying to play any codecs on SurfaceView. If
// needed in the future this can be expanded to be codec specific. // needed in the future this can be expanded to be codec specific.
constexpr const char* kDisabledModels[] = {// Exynos 4 (Mali-400) constexpr const char* kDisabledModels[] = {// Exynos 4 (Mali-400)
"GT-I9300", "GT-I9305", "SHV-E210", "GT-I9300", "GT-I9305", "SHV-E210",
......
...@@ -27,10 +27,10 @@ class MediaCodecUtilTest : public testing::Test { ...@@ -27,10 +27,10 @@ class MediaCodecUtilTest : public testing::Test {
}; };
TEST_F(MediaCodecUtilTest, TestCodecAvailableIfNewerVersion) { TEST_F(MediaCodecUtilTest, TestCodecAvailableIfNewerVersion) {
// Test models that should be available above some sdk level. // Test models that should be available above some sdk level. We probably
// We probably don't need to test them all; we're more concerned that the // don't need to test them all; we're more concerned that the blocklist code
// blacklist code is doing the right thing with the entries it has rather than // is doing the right thing with the entries it has rather than the map
// the map contents are right. // contents are right.
struct { struct {
const char* model; const char* model;
int last_bad_sdk; int last_bad_sdk;
......
...@@ -290,7 +290,7 @@ int GetFirstApiLevel() { ...@@ -290,7 +290,7 @@ int GetFirstApiLevel() {
} // namespace } // namespace
// MediaDrm is not generally usable without MediaCodec. Thus, both the MediaDrm // MediaDrm is not generally usable without MediaCodec. Thus, both the MediaDrm
// APIs and MediaCodec APIs must be enabled and not blacklisted. // APIs and MediaCodec APIs must be enabled and not blocked.
// static // static
bool MediaDrmBridge::IsAvailable() { bool MediaDrmBridge::IsAvailable() {
return AreMediaDrmApisAvailable() && MediaCodecUtil::IsMediaCodecAvailable(); return AreMediaDrmApisAvailable() && MediaCodecUtil::IsMediaCodecAvailable();
......
...@@ -1368,7 +1368,7 @@ TEST_P(VideoDecoderStreamTest, FallbackDecoder_SelectedOnDecodeThenInitErrors) { ...@@ -1368,7 +1368,7 @@ TEST_P(VideoDecoderStreamTest, FallbackDecoder_SelectedOnDecodeThenInitErrors) {
FailDecoderInitOnSelection({1}); FailDecoderInitOnSelection({1});
ReadOneFrame(); ReadOneFrame();
// Decoder 0 should be blacklisted, and decoder 1 fails to initialize, so // Decoder 0 should be blocked, and decoder 1 fails to initialize, so
// |video_decoder_stream_| should have fallen back to decoder 2. // |video_decoder_stream_| should have fallen back to decoder 2.
ASSERT_EQ(GetDecoderName(2), decoder_->GetDisplayName()); ASSERT_EQ(GetDecoderName(2), decoder_->GetDisplayName());
......
...@@ -1048,7 +1048,7 @@ void MediaCodecVideoDecoder::StartDrainingCodec(DrainType drain_type) { ...@@ -1048,7 +1048,7 @@ void MediaCodecVideoDecoder::StartDrainingCodec(DrainType drain_type) {
// Skip the drain if possible. Only VP8 codecs need draining because // Skip the drain if possible. Only VP8 codecs need draining because
// they can hang in release() or flush() otherwise // they can hang in release() or flush() otherwise
// (http://crbug.com/598963). // (http://crbug.com/598963).
// TODO(watk): Strongly consider blacklisting VP8 (or specific MediaCodecs) // TODO(watk): Strongly consider blocking VP8 (or specific MediaCodecs)
// instead. Draining is responsible for a lot of complexity. // instead. Draining is responsible for a lot of complexity.
if (decoder_config_.codec() != kCodecVP8 || !codec_ || codec_->IsFlushed() || if (decoder_config_.codec() != kCodecVP8 || !codec_ || codec_->IsFlushed() ||
codec_->IsDrained() || using_async_api_) { codec_->IsDrained() || using_async_api_) {
......
...@@ -65,13 +65,13 @@ void VideoPlayerTestEnvironment::SetUp() { ...@@ -65,13 +65,13 @@ void VideoPlayerTestEnvironment::SetUp() {
// VP8 they use a different video decoder (V4L2 instead of VAAPI) and don't // VP8 they use a different video decoder (V4L2 instead of VAAPI) and don't
// support import mode. // support import mode.
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
constexpr const char* kImportModeBlacklist[] = { constexpr const char* kImportModeBlocklist[] = {
"buddy", "guado", "guado-cfm", "guado-kernelnext", "nyan_big", "buddy", "guado", "guado-cfm", "guado-kernelnext", "nyan_big",
"nyan_blaze", "nyan_kitty", "rikku", "rikku-cfm"}; "nyan_blaze", "nyan_kitty", "rikku", "rikku-cfm"};
const std::string board = base::SysInfo::GetLsbReleaseBoard(); const std::string board = base::SysInfo::GetLsbReleaseBoard();
import_supported_ = (std::find(std::begin(kImportModeBlacklist), import_supported_ = (std::find(std::begin(kImportModeBlocklist),
std::end(kImportModeBlacklist), std::end(kImportModeBlocklist),
board) == std::end(kImportModeBlacklist)); board) == std::end(kImportModeBlocklist));
#endif // defined(OS_CHROMEOS) #endif // defined(OS_CHROMEOS)
// VideoDecoders always require import mode to be supported. // VideoDecoders always require import mode to be supported.
......
...@@ -1400,7 +1400,7 @@ bool DXVAVideoDecodeAccelerator::InitDecoder(VideoCodecProfile profile) { ...@@ -1400,7 +1400,7 @@ bool DXVAVideoDecodeAccelerator::InitDecoder(VideoCodecProfile profile) {
return false; return false;
} }
// Check version of DLL, version 6.1.7140 is blacklisted due to high crash // Check version of DLL, version 6.1.7140 is blocked due to high crash
// rates in browsers loading that DLL. If that is the version installed we // rates in browsers loading that DLL. If that is the version installed we
// fall back to software decoding. See crbug/403440. // fall back to software decoding. See crbug/403440.
std::unique_ptr<FileVersionInfo> version_info( std::unique_ptr<FileVersionInfo> version_info(
...@@ -1409,7 +1409,7 @@ bool DXVAVideoDecodeAccelerator::InitDecoder(VideoCodecProfile profile) { ...@@ -1409,7 +1409,7 @@ bool DXVAVideoDecodeAccelerator::InitDecoder(VideoCodecProfile profile) {
false); false);
base::string16 file_version = version_info->file_version(); base::string16 file_version = version_info->file_version();
RETURN_ON_FAILURE(file_version.find(L"6.1.7140") == base::string16::npos, RETURN_ON_FAILURE(file_version.find(L"6.1.7140") == base::string16::npos,
"blacklisted version of msmpeg2vdec.dll 6.1.7140", false); "blocked version of msmpeg2vdec.dll 6.1.7140", false);
codec_ = kCodecH264; codec_ = kCodecH264;
clsid = __uuidof(CMSH264DecoderMFT); clsid = __uuidof(CMSH264DecoderMFT);
} else if ((profile >= VP9PROFILE_PROFILE0 && } else if ((profile >= VP9PROFILE_PROFILE0 &&
......
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