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 |
(...skipping 18 matching lines...) Expand all Loading... |
29 | 29 |
30 #include <windows.h> | 30 #include <windows.h> |
31 #include <comdef.h> | 31 #include <comdef.h> |
32 #include <dmo.h> | 32 #include <dmo.h> |
33 #include <Functiondiscoverykeys_devpkey.h> | 33 #include <Functiondiscoverykeys_devpkey.h> |
34 #include <mmsystem.h> | 34 #include <mmsystem.h> |
35 #include <strsafe.h> | 35 #include <strsafe.h> |
36 #include <uuids.h> | 36 #include <uuids.h> |
37 | 37 |
38 #include "webrtc/base/platform_thread.h" | 38 #include "webrtc/base/platform_thread.h" |
39 #include "webrtc/system_wrappers/interface/sleep.h" | 39 #include "webrtc/system_wrappers/include/sleep.h" |
40 #include "webrtc/system_wrappers/interface/trace.h" | 40 #include "webrtc/system_wrappers/include/trace.h" |
41 | 41 |
42 // Macro that calls a COM method returning HRESULT value. | 42 // Macro that calls a COM method returning HRESULT value. |
43 #define EXIT_ON_ERROR(hres) do { if (FAILED(hres)) goto Exit; } while(0) | 43 #define EXIT_ON_ERROR(hres) do { if (FAILED(hres)) goto Exit; } while(0) |
44 | 44 |
45 // Macro that continues to a COM error. | 45 // Macro that continues to a COM error. |
46 #define CONTINUE_ON_ERROR(hres) do { if (FAILED(hres)) goto Next; } while(0) | 46 #define CONTINUE_ON_ERROR(hres) do { if (FAILED(hres)) goto Next; } while(0) |
47 | 47 |
48 // Macro that releases a COM object if not NULL. | 48 // Macro that releases a COM object if not NULL. |
49 #define SAFE_RELEASE(p) do { if ((p)) { (p)->Release(); (p) = NULL; } } whil
e(0) | 49 #define SAFE_RELEASE(p) do { if ((p)) { (p)->Release(); (p) = NULL; } } whil
e(0) |
50 | 50 |
(...skipping 5046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5097 int key_down = 0; | 5097 int key_down = 0; |
5098 for (int key = VK_SPACE; key < VK_NUMLOCK; key++) { | 5098 for (int key = VK_SPACE; key < VK_NUMLOCK; key++) { |
5099 short res = GetAsyncKeyState(key); | 5099 short res = GetAsyncKeyState(key); |
5100 key_down |= res & 0x1; // Get the LSB | 5100 key_down |= res & 0x1; // Get the LSB |
5101 } | 5101 } |
5102 return (key_down > 0); | 5102 return (key_down > 0); |
5103 } | 5103 } |
5104 } // namespace webrtc | 5104 } // namespace webrtc |
5105 | 5105 |
5106 #endif // WEBRTC_WINDOWS_CORE_AUDIO_BUILD | 5106 #endif // WEBRTC_WINDOWS_CORE_AUDIO_BUILD |
OLD | NEW |