OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "media/audio/win/avrt_wrapper_win.h" | 5 #include "media/audio/win/avrt_wrapper_win.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/macros.h" |
8 | 9 |
9 namespace avrt { | 10 namespace avrt { |
10 | 11 |
11 // Function pointers | 12 // Function pointers |
12 typedef BOOL (WINAPI *AvRevertMmThreadCharacteristicsFn)(HANDLE); | 13 typedef BOOL (WINAPI *AvRevertMmThreadCharacteristicsFn)(HANDLE); |
13 typedef HANDLE (WINAPI *AvSetMmThreadCharacteristicsFn)(LPCWSTR, LPDWORD); | 14 typedef HANDLE (WINAPI *AvSetMmThreadCharacteristicsFn)(LPCWSTR, LPDWORD); |
14 typedef BOOL (WINAPI *AvSetMmThreadPriorityFn)(HANDLE, AVRT_PRIORITY); | 15 typedef BOOL (WINAPI *AvSetMmThreadPriorityFn)(HANDLE, AVRT_PRIORITY); |
15 | 16 |
16 HMODULE g_avrt = NULL; | 17 HMODULE g_avrt = NULL; |
17 AvRevertMmThreadCharacteristicsFn g_revert_mm_thread_characteristics = NULL; | 18 AvRevertMmThreadCharacteristicsFn g_revert_mm_thread_characteristics = NULL; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 g_set_mm_thread_characteristics(task_name, task_index) : NULL); | 56 g_set_mm_thread_characteristics(task_name, task_index) : NULL); |
56 } | 57 } |
57 | 58 |
58 bool AvSetMmThreadPriority(HANDLE avrt_handle, AVRT_PRIORITY priority) { | 59 bool AvSetMmThreadPriority(HANDLE avrt_handle, AVRT_PRIORITY priority) { |
59 DCHECK(g_set_mm_thread_priority); | 60 DCHECK(g_set_mm_thread_priority); |
60 return (g_set_mm_thread_priority && | 61 return (g_set_mm_thread_priority && |
61 g_set_mm_thread_priority(avrt_handle, priority)); | 62 g_set_mm_thread_priority(avrt_handle, priority)); |
62 } | 63 } |
63 | 64 |
64 } // namespace avrt | 65 } // namespace avrt |
OLD | NEW |