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 @@
#include "media/capture/video/win/video_capture_device_mf_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 Descriptors = media::VideoCaptureDeviceDescriptors;
using base::win::GetActivationFactory;
......@@ -454,7 +449,9 @@ void VideoCaptureDeviceFactoryWin::EnumerateDevicesUWP(
base::Unretained(factory), base::Passed(&device_descriptors),
base::Passed(&result_callback));
auto callback =
Callback<IAsyncOperationCompletedHandler<DeviceInformationCollection*>>(
Microsoft::WRL::Callback<
ABI::Windows::Foundation::IAsyncOperationCompletedHandler<
DeviceInformationCollection*>>(
[factory, com_thread_runner, device_info_callback](
IAsyncOperation<DeviceInformationCollection*>* operation,
AsyncStatus status) -> HRESULT {
......@@ -464,9 +461,10 @@ void VideoCaptureDeviceFactoryWin::EnumerateDevicesUWP(
return S_OK;
});
ComPtr<IDeviceInformationStatics> dev_info_statics;
ComPtr<ABI::Windows::Devices::Enumeration::IDeviceInformationStatics>
dev_info_statics;
HRESULT hr = GetActivationFactory<
IDeviceInformationStatics,
ABI::Windows::Devices::Enumeration::IDeviceInformationStatics,
RuntimeClass_Windows_Devices_Enumeration_DeviceInformation>(
&dev_info_statics);
if (FAILED(hr)) {
......@@ -475,8 +473,8 @@ void VideoCaptureDeviceFactoryWin::EnumerateDevicesUWP(
}
IAsyncOperation<DeviceInformationCollection*>* async_op;
hr = dev_info_statics->FindAllAsyncDeviceClass(DeviceClass_VideoCapture,
&async_op);
hr = dev_info_statics->FindAllAsyncDeviceClass(
ABI::Windows::Devices::Enumeration::DeviceClass_VideoCapture, &async_op);
if (FAILED(hr)) {
UWP_ENUM_ERROR_HANDLER(hr, "Find all devices asynchronously failed: ");
return;
......@@ -506,14 +504,16 @@ void VideoCaptureDeviceFactoryWin::FoundAllDevicesUWP(
return;
}
ComPtr<IVectorView<DeviceInformation*>> devices;
ComPtr<ABI::Windows::Foundation::Collections::IVectorView<
ABI::Windows::Devices::Enumeration::DeviceInformation*>>
devices;
operation->GetResults(devices.GetAddressOf());
unsigned int count = 0;
devices->get_Size(&count);
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());
if (SUCCEEDED(hr)) {
HSTRING id;
......@@ -524,7 +524,8 @@ void VideoCaptureDeviceFactoryWin::FoundAllDevicesUWP(
::tolower);
const std::string model_id = GetDeviceModelId(device_id);
ComPtr<IEnclosureLocation> enclosure_location;
ComPtr<ABI::Windows::Devices::Enumeration::IEnclosureLocation>
enclosure_location;
hr =
device_info->get_EnclosureLocation(enclosure_location.GetAddressOf());
if (FAILED(hr)) {
......@@ -533,16 +534,16 @@ void VideoCaptureDeviceFactoryWin::FoundAllDevicesUWP(
VideoFacingMode facing = VideoFacingMode::MEDIA_VIDEO_FACING_NONE;
if (enclosure_location) {
Panel panel;
ABI::Windows::Devices::Enumeration::Panel panel;
enclosure_location->get_Panel(&panel);
switch (panel) {
case Panel_Unknown:
case ABI::Windows::Devices::Enumeration::Panel_Unknown:
facing = VideoFacingMode::MEDIA_VIDEO_FACING_NONE;
break;
case Panel_Front:
case ABI::Windows::Devices::Enumeration::Panel_Front:
facing = VideoFacingMode::MEDIA_VIDEO_FACING_USER;
break;
case Panel_Back:
case ABI::Windows::Devices::Enumeration::Panel_Back:
facing = VideoFacingMode::MEDIA_VIDEO_FACING_ENVIRONMENT;
break;
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