Commit 15099837 authored by Oscar Johansson's avatar Oscar Johansson Committed by Commit Bot

Remove "using namespace" (jumbo, media/capture)

When building using jumbo, files get merged and
the usage of "using namespace..." results in the
error:
using namespace directive in global context in header

This commit solves the issue by removing
"using namespace" and instead write the complete
name when it is used.

Bug: 867350
Change-Id: Iba570fbb737819ed515dc686ba65f9e7f9b47653
Reviewed-on: https://chromium-review.googlesource.com/1154538
Commit-Queue: Chrome Cunningham (In Paris) <chcunningham@chromium.org>
Reviewed-by: default avatarChrome Cunningham (In Paris) <chcunningham@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579380}
parent 4c16b3c4
...@@ -30,11 +30,6 @@ ...@@ -30,11 +30,6 @@
#include "media/capture/video/win/video_capture_device_mf_win.h" #include "media/capture/video/win/video_capture_device_mf_win.h"
#include "media/capture/video/win/video_capture_device_win.h" #include "media/capture/video/win/video_capture_device_win.h"
using namespace ABI::Windows::Devices::Enumeration;
using namespace ABI::Windows::Foundation;
using namespace ABI::Windows::Foundation::Collections;
using namespace Microsoft::WRL;
using Descriptor = media::VideoCaptureDeviceDescriptor; using Descriptor = media::VideoCaptureDeviceDescriptor;
using Descriptors = media::VideoCaptureDeviceDescriptors; using Descriptors = media::VideoCaptureDeviceDescriptors;
using base::win::GetActivationFactory; using base::win::GetActivationFactory;
...@@ -454,7 +449,9 @@ void VideoCaptureDeviceFactoryWin::EnumerateDevicesUWP( ...@@ -454,7 +449,9 @@ void VideoCaptureDeviceFactoryWin::EnumerateDevicesUWP(
base::Unretained(factory), base::Passed(&device_descriptors), base::Unretained(factory), base::Passed(&device_descriptors),
base::Passed(&result_callback)); base::Passed(&result_callback));
auto callback = auto callback =
Callback<IAsyncOperationCompletedHandler<DeviceInformationCollection*>>( Microsoft::WRL::Callback<
ABI::Windows::Foundation::IAsyncOperationCompletedHandler<
DeviceInformationCollection*>>(
[factory, com_thread_runner, device_info_callback]( [factory, com_thread_runner, device_info_callback](
IAsyncOperation<DeviceInformationCollection*>* operation, IAsyncOperation<DeviceInformationCollection*>* operation,
AsyncStatus status) -> HRESULT { AsyncStatus status) -> HRESULT {
...@@ -464,9 +461,10 @@ void VideoCaptureDeviceFactoryWin::EnumerateDevicesUWP( ...@@ -464,9 +461,10 @@ void VideoCaptureDeviceFactoryWin::EnumerateDevicesUWP(
return S_OK; return S_OK;
}); });
ComPtr<IDeviceInformationStatics> dev_info_statics; ComPtr<ABI::Windows::Devices::Enumeration::IDeviceInformationStatics>
dev_info_statics;
HRESULT hr = GetActivationFactory< HRESULT hr = GetActivationFactory<
IDeviceInformationStatics, ABI::Windows::Devices::Enumeration::IDeviceInformationStatics,
RuntimeClass_Windows_Devices_Enumeration_DeviceInformation>( RuntimeClass_Windows_Devices_Enumeration_DeviceInformation>(
&dev_info_statics); &dev_info_statics);
if (FAILED(hr)) { if (FAILED(hr)) {
...@@ -475,8 +473,8 @@ void VideoCaptureDeviceFactoryWin::EnumerateDevicesUWP( ...@@ -475,8 +473,8 @@ void VideoCaptureDeviceFactoryWin::EnumerateDevicesUWP(
} }
IAsyncOperation<DeviceInformationCollection*>* async_op; IAsyncOperation<DeviceInformationCollection*>* async_op;
hr = dev_info_statics->FindAllAsyncDeviceClass(DeviceClass_VideoCapture, hr = dev_info_statics->FindAllAsyncDeviceClass(
&async_op); ABI::Windows::Devices::Enumeration::DeviceClass_VideoCapture, &async_op);
if (FAILED(hr)) { if (FAILED(hr)) {
UWP_ENUM_ERROR_HANDLER(hr, "Find all devices asynchronously failed: "); UWP_ENUM_ERROR_HANDLER(hr, "Find all devices asynchronously failed: ");
return; return;
...@@ -506,14 +504,16 @@ void VideoCaptureDeviceFactoryWin::FoundAllDevicesUWP( ...@@ -506,14 +504,16 @@ void VideoCaptureDeviceFactoryWin::FoundAllDevicesUWP(
return; return;
} }
ComPtr<IVectorView<DeviceInformation*>> devices; ComPtr<ABI::Windows::Foundation::Collections::IVectorView<
ABI::Windows::Devices::Enumeration::DeviceInformation*>>
devices;
operation->GetResults(devices.GetAddressOf()); operation->GetResults(devices.GetAddressOf());
unsigned int count = 0; unsigned int count = 0;
devices->get_Size(&count); devices->get_Size(&count);
for (unsigned int j = 0; j < count; ++j) { for (unsigned int j = 0; j < count; ++j) {
ComPtr<IDeviceInformation> device_info; ComPtr<ABI::Windows::Devices::Enumeration::IDeviceInformation> device_info;
HRESULT hr = devices->GetAt(j, device_info.GetAddressOf()); HRESULT hr = devices->GetAt(j, device_info.GetAddressOf());
if (SUCCEEDED(hr)) { if (SUCCEEDED(hr)) {
HSTRING id; HSTRING id;
...@@ -524,7 +524,8 @@ void VideoCaptureDeviceFactoryWin::FoundAllDevicesUWP( ...@@ -524,7 +524,8 @@ void VideoCaptureDeviceFactoryWin::FoundAllDevicesUWP(
::tolower); ::tolower);
const std::string model_id = GetDeviceModelId(device_id); const std::string model_id = GetDeviceModelId(device_id);
ComPtr<IEnclosureLocation> enclosure_location; ComPtr<ABI::Windows::Devices::Enumeration::IEnclosureLocation>
enclosure_location;
hr = hr =
device_info->get_EnclosureLocation(enclosure_location.GetAddressOf()); device_info->get_EnclosureLocation(enclosure_location.GetAddressOf());
if (FAILED(hr)) { if (FAILED(hr)) {
...@@ -533,16 +534,16 @@ void VideoCaptureDeviceFactoryWin::FoundAllDevicesUWP( ...@@ -533,16 +534,16 @@ void VideoCaptureDeviceFactoryWin::FoundAllDevicesUWP(
VideoFacingMode facing = VideoFacingMode::MEDIA_VIDEO_FACING_NONE; VideoFacingMode facing = VideoFacingMode::MEDIA_VIDEO_FACING_NONE;
if (enclosure_location) { if (enclosure_location) {
Panel panel; ABI::Windows::Devices::Enumeration::Panel panel;
enclosure_location->get_Panel(&panel); enclosure_location->get_Panel(&panel);
switch (panel) { switch (panel) {
case Panel_Unknown: case ABI::Windows::Devices::Enumeration::Panel_Unknown:
facing = VideoFacingMode::MEDIA_VIDEO_FACING_NONE; facing = VideoFacingMode::MEDIA_VIDEO_FACING_NONE;
break; break;
case Panel_Front: case ABI::Windows::Devices::Enumeration::Panel_Front:
facing = VideoFacingMode::MEDIA_VIDEO_FACING_USER; facing = VideoFacingMode::MEDIA_VIDEO_FACING_USER;
break; break;
case Panel_Back: case ABI::Windows::Devices::Enumeration::Panel_Back:
facing = VideoFacingMode::MEDIA_VIDEO_FACING_ENVIRONMENT; facing = VideoFacingMode::MEDIA_VIDEO_FACING_ENVIRONMENT;
break; break;
default: default:
......
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