| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include <assert.h> | 11 #include <assert.h> |
| 12 #include <stdlib.h> | 12 #include <stdlib.h> |
| 13 | 13 |
| 14 #include "webrtc/modules/video_capture/device_info_impl.h" | 14 #include "webrtc/modules/video_capture/device_info_impl.h" |
| 15 #include "webrtc/modules/video_capture/video_capture_config.h" | 15 #include "webrtc/modules/video_capture/video_capture_config.h" |
| 16 #include "webrtc/system_wrappers/include/logging.h" | 16 #include "webrtc/system_wrappers/include/logging.h" |
| 17 | 17 |
| 18 #ifndef abs | 18 #ifndef abs |
| 19 #define abs(a) (a>=0?a:-a) | 19 #define abs(a) (a>=0?a:-a) |
| 20 #endif | 20 #endif |
| 21 | 21 |
| 22 namespace webrtc | 22 namespace webrtc |
| 23 { | 23 { |
| 24 namespace videocapturemodule | 24 namespace videocapturemodule |
| 25 { | 25 { |
| 26 DeviceInfoImpl::DeviceInfoImpl(const int32_t id) | 26 DeviceInfoImpl::DeviceInfoImpl() |
| 27 : _id(id), _apiLock(*RWLockWrapper::CreateRWLock()), _lastUsedDeviceName(NUL
L), | 27 : _apiLock(*RWLockWrapper::CreateRWLock()), _lastUsedDeviceName(NULL), |
| 28 _lastUsedDeviceNameLength(0) | 28 _lastUsedDeviceNameLength(0) |
| 29 { | 29 { |
| 30 } | 30 } |
| 31 | 31 |
| 32 DeviceInfoImpl::~DeviceInfoImpl(void) | 32 DeviceInfoImpl::~DeviceInfoImpl(void) |
| 33 { | 33 { |
| 34 _apiLock.AcquireLockExclusive(); | 34 _apiLock.AcquireLockExclusive(); |
| 35 free(_lastUsedDeviceName); | 35 free(_lastUsedDeviceName); |
| 36 _apiLock.ReleaseLockExclusive(); | 36 _apiLock.ReleaseLockExclusive(); |
| 37 | 37 |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 } | 350 } |
| 351 | 351 |
| 352 //Default implementation. This should be overridden by Mobile implementations. | 352 //Default implementation. This should be overridden by Mobile implementations. |
| 353 int32_t DeviceInfoImpl::GetOrientation(const char* deviceUniqueIdUTF8, | 353 int32_t DeviceInfoImpl::GetOrientation(const char* deviceUniqueIdUTF8, |
| 354 VideoRotation& orientation) { | 354 VideoRotation& orientation) { |
| 355 orientation = kVideoRotation_0; | 355 orientation = kVideoRotation_0; |
| 356 return -1; | 356 return -1; |
| 357 } | 357 } |
| 358 } // namespace videocapturemodule | 358 } // namespace videocapturemodule |
| 359 } // namespace webrtc | 359 } // namespace webrtc |
| OLD | NEW |