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

[Code Inclusion] Remove usages of "blacklist" in media/capture.

Replace with more inclusive terms per Chromium Style Guide.

Bug: 1106011
Change-Id: I6b88cb9bfa1e1b7fa004c6e40b2ea6712cd29083
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2335486Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Commit-Queue: mark a. foltz <mfoltz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#794593}
parent b599153c
...@@ -141,7 +141,7 @@ bool IsSpecialControl(int control_id) { ...@@ -141,7 +141,7 @@ bool IsSpecialControl(int control_id) {
#if !defined(V4L2_CID_PANTILT_CMD) #if !defined(V4L2_CID_PANTILT_CMD)
#define V4L2_CID_PANTILT_CMD (V4L2_CID_CAMERA_CLASS_BASE + 34) #define V4L2_CID_PANTILT_CMD (V4L2_CID_CAMERA_CLASS_BASE + 34)
#endif #endif
bool IsBlacklistedControl(int control_id) { bool IsBlockedControl(int control_id) {
switch (control_id) { switch (control_id) {
case V4L2_CID_PAN_RELATIVE: case V4L2_CID_PAN_RELATIVE:
case V4L2_CID_TILT_RELATIVE: case V4L2_CID_TILT_RELATIVE:
...@@ -730,7 +730,7 @@ void V4L2CaptureDelegate::ResetUserAndCameraControlsToDefault() { ...@@ -730,7 +730,7 @@ void V4L2CaptureDelegate::ResetUserAndCameraControlsToDefault() {
if (IsSpecialControl(range.id & ~V4L2_CTRL_FLAG_NEXT_CTRL)) if (IsSpecialControl(range.id & ~V4L2_CTRL_FLAG_NEXT_CTRL))
continue; continue;
if (IsBlacklistedControl(range.id & ~V4L2_CTRL_FLAG_NEXT_CTRL)) if (IsBlockedControl(range.id & ~V4L2_CTRL_FLAG_NEXT_CTRL))
continue; continue;
struct v4l2_ext_control ext_control = {}; struct v4l2_ext_control ext_control = {};
......
...@@ -36,7 +36,7 @@ static struct { ...@@ -36,7 +36,7 @@ static struct {
{V4L2_CID_CAMERA_CLASS_BASE, V4L2_CID_CAMERA_CLASS}}; {V4L2_CID_CAMERA_CLASS_BASE, V4L2_CID_CAMERA_CLASS}};
// Determines if |control_id| is special, i.e. controls another one's state, or // Determines if |control_id| is special, i.e. controls another one's state, or
// if it should be skipped (blacklisted, https://crbug.com/697885). // if it should be denied (see https://crbug.com/697885).
#if !defined(V4L2_CID_PAN_SPEED) #if !defined(V4L2_CID_PAN_SPEED)
#define V4L2_CID_PAN_SPEED (V4L2_CID_CAMERA_CLASS_BASE + 32) #define V4L2_CID_PAN_SPEED (V4L2_CID_CAMERA_CLASS_BASE + 32)
#endif #endif
...@@ -46,7 +46,7 @@ static struct { ...@@ -46,7 +46,7 @@ static struct {
#if !defined(V4L2_CID_PANTILT_CMD) #if !defined(V4L2_CID_PANTILT_CMD)
#define V4L2_CID_PANTILT_CMD (V4L2_CID_CAMERA_CLASS_BASE + 34) #define V4L2_CID_PANTILT_CMD (V4L2_CID_CAMERA_CLASS_BASE + 34)
#endif #endif
static bool IsSpecialOrBlacklistedControl(int control_id) { static bool IsSpecialOrBlockedControl(int control_id) {
switch (control_id) { switch (control_id) {
case V4L2_CID_AUTO_WHITE_BALANCE: case V4L2_CID_AUTO_WHITE_BALANCE:
case V4L2_CID_EXPOSURE_AUTO: case V4L2_CID_EXPOSURE_AUTO:
...@@ -111,7 +111,7 @@ static void SetControlsToMaxValues(int device_fd) { ...@@ -111,7 +111,7 @@ static void SetControlsToMaxValues(int device_fd) {
break; break;
range.id |= V4L2_CTRL_FLAG_NEXT_CTRL; range.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
if (IsSpecialOrBlacklistedControl(range.id & ~V4L2_CTRL_FLAG_NEXT_CTRL)) if (IsSpecialOrBlockedControl(range.id & ~V4L2_CTRL_FLAG_NEXT_CTRL))
continue; continue;
DVLOG(1) << __func__ << " " << range.name << " set to " << range.maximum; DVLOG(1) << __func__ << " " << range.name << " set to " << range.maximum;
...@@ -136,7 +136,7 @@ static void SetControlsToMaxValues(int device_fd) { ...@@ -136,7 +136,7 @@ static void SetControlsToMaxValues(int device_fd) {
break; break;
range.id |= V4L2_CTRL_FLAG_NEXT_CTRL; range.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
if (IsSpecialOrBlacklistedControl(range.id & ~V4L2_CTRL_FLAG_NEXT_CTRL)) if (IsSpecialOrBlockedControl(range.id & ~V4L2_CTRL_FLAG_NEXT_CTRL))
continue; continue;
DVLOG(1) << __func__ << " " << range.name << " set to " << range.maximum; DVLOG(1) << __func__ << " " << range.name << " set to " << range.maximum;
......
...@@ -34,9 +34,9 @@ void EnsureRunsOnCFRunLoopEnabledThread() { ...@@ -34,9 +34,9 @@ void EnsureRunsOnCFRunLoopEnabledThread() {
} }
} }
// Blacklisted devices are identified by a characteristic trailing substring of // Blocked devices are identified by a characteristic trailing substring of
// uniqueId. At the moment these are just Blackmagic devices. // uniqueId. At the moment these are just Blackmagic devices.
const char* kBlacklistedCamerasIdSignature[] = {"-01FDA82C8A9C"}; const char* kBlockedCamerasIdSignature[] = {"-01FDA82C8A9C"};
int32_t get_device_descriptors_retry_count = 0; int32_t get_device_descriptors_retry_count = 0;
...@@ -44,20 +44,18 @@ int32_t get_device_descriptors_retry_count = 0; ...@@ -44,20 +44,18 @@ int32_t get_device_descriptors_retry_count = 0;
namespace media { namespace media {
static bool IsDeviceBlacklisted( static bool IsDeviceBlocked(const VideoCaptureDeviceDescriptor& descriptor) {
const VideoCaptureDeviceDescriptor& descriptor) { bool is_device_blocked = false;
bool is_device_blacklisted = false;
for (size_t i = 0; for (size_t i = 0;
!is_device_blacklisted && i < base::size(kBlacklistedCamerasIdSignature); !is_device_blocked && i < base::size(kBlockedCamerasIdSignature); ++i) {
++i) { is_device_blocked =
is_device_blacklisted = base::EndsWith(descriptor.device_id, kBlockedCamerasIdSignature[i],
base::EndsWith(descriptor.device_id, kBlacklistedCamerasIdSignature[i],
base::CompareCase::INSENSITIVE_ASCII); base::CompareCase::INSENSITIVE_ASCII);
} }
DVLOG_IF(2, is_device_blacklisted) DVLOG_IF(2, is_device_blocked)
<< "Blacklisted camera: " << descriptor.display_name() << "Blocked camera: " << descriptor.display_name()
<< ", id: " << descriptor.device_id; << ", id: " << descriptor.device_id;
return is_device_blacklisted; return is_device_blocked;
} }
VideoCaptureDeviceFactoryMac::VideoCaptureDeviceFactoryMac() { VideoCaptureDeviceFactoryMac::VideoCaptureDeviceFactoryMac() {
...@@ -125,7 +123,7 @@ void VideoCaptureDeviceFactoryMac::GetDevicesInfo( ...@@ -125,7 +123,7 @@ void VideoCaptureDeviceFactoryMac::GetDevicesInfo(
[[[capture_devices valueForKey:key] deviceName] UTF8String], device_id, [[[capture_devices valueForKey:key] deviceName] UTF8String], device_id,
model_id, capture_api, model_id, capture_api,
/*pan_tilt_zoom_supported=*/false, device_transport_type); /*pan_tilt_zoom_supported=*/false, device_transport_type);
if (IsDeviceBlacklisted(descriptor)) if (IsDeviceBlocked(descriptor))
continue; continue;
devices_info.emplace_back(descriptor); devices_info.emplace_back(descriptor);
......
...@@ -1287,8 +1287,8 @@ TEST_F(VideoCaptureDeviceFactoryMFWinTest, GetDevicesInfo) { ...@@ -1287,8 +1287,8 @@ TEST_F(VideoCaptureDeviceFactoryMFWinTest, GetDevicesInfo) {
EXPECT_FALSE(it->descriptor.pan_tilt_zoom_supported()); EXPECT_FALSE(it->descriptor.pan_tilt_zoom_supported());
// Devices that are listed in both MediaFoundation and DirectShow but are // Devices that are listed in both MediaFoundation and DirectShow but are
// blacklisted for use with MediaFoundation are expected to get enumerated // blocked for use with MediaFoundation are expected to get enumerated with
// with VideoCaptureApi::WIN_DIRECT_SHOW. // VideoCaptureApi::WIN_DIRECT_SHOW.
it = FindDeviceInRange(devices_info.begin(), devices_info.end(), it = FindDeviceInRange(devices_info.begin(), devices_info.end(),
base::SysWideToUTF8(kDirectShowDeviceId6)); base::SysWideToUTF8(kDirectShowDeviceId6));
ASSERT_NE(it, devices_info.end()); ASSERT_NE(it, devices_info.end());
......
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