| 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 // The avrt namespace encapsulates the details needed to support MMCSS. | 5 // The avrt namespace encapsulates the details needed to support MMCSS. |
| 6 // | 6 // |
| 7 // The Multimedia Class Scheduler service (MMCSS) enables multimedia | 7 // The Multimedia Class Scheduler service (MMCSS) enables multimedia |
| 8 // applications to ensure that their time-sensitive processing receives | 8 // applications to ensure that their time-sensitive processing receives |
| 9 // prioritized access to CPU resources. This service enables multimedia | 9 // prioritized access to CPU resources. This service enables multimedia |
| 10 // applications to utilize as much of the CPU as possible without denying | 10 // applications to utilize as much of the CPU as possible without denying |
| 11 // CPU resources to lower-priority applications. | 11 // CPU resources to lower-priority applications. |
| 12 // MMCSS requires Windows Vista or higher and that the Avrt DLL is loaded. | 12 // MMCSS requires Windows Vista or higher and that the Avrt DLL is loaded. |
| 13 // | 13 // |
| 14 // TODO(henrika): refactor and merge into existing thread implementation | 14 // TODO(henrika): refactor and merge into existing thread implementation |
| 15 // for Windows to ensure that MMCSS can be enabled for all threads. | 15 // for Windows to ensure that MMCSS can be enabled for all threads. |
| 16 // | 16 // |
| 17 #ifndef MEDIA_AUDIO_WIN_AVRT_WRAPPER_WIN_H_ | 17 #ifndef MEDIA_AUDIO_WIN_AVRT_WRAPPER_WIN_H_ |
| 18 #define MEDIA_AUDIO_WIN_AVRT_WRAPPER_WIN_H_ | 18 #define MEDIA_AUDIO_WIN_AVRT_WRAPPER_WIN_H_ |
| 19 | 19 |
| 20 #include <windows.h> | 20 #include <windows.h> |
| 21 #include <avrt.h> | 21 #include <avrt.h> |
| 22 | 22 |
| 23 #include "base/basictypes.h" | |
| 24 | |
| 25 namespace avrt { | 23 namespace avrt { |
| 26 | 24 |
| 27 // Loads the Avrt.dll which is available on Windows Vista and later. | 25 // Loads the Avrt.dll which is available on Windows Vista and later. |
| 28 bool Initialize(); | 26 bool Initialize(); |
| 29 | 27 |
| 30 // Function wrappers for the underlying MMCSS functions. | 28 // Function wrappers for the underlying MMCSS functions. |
| 31 bool AvRevertMmThreadCharacteristics(HANDLE avrt_handle); | 29 bool AvRevertMmThreadCharacteristics(HANDLE avrt_handle); |
| 32 HANDLE AvSetMmThreadCharacteristics(const wchar_t* task_name, | 30 HANDLE AvSetMmThreadCharacteristics(const wchar_t* task_name, |
| 33 DWORD* task_index); | 31 DWORD* task_index); |
| 34 bool AvSetMmThreadPriority(HANDLE avrt_handle, AVRT_PRIORITY priority); | 32 bool AvSetMmThreadPriority(HANDLE avrt_handle, AVRT_PRIORITY priority); |
| 35 | 33 |
| 36 } // namespace avrt | 34 } // namespace avrt |
| 37 | 35 |
| 38 #endif // MEDIA_AUDIO_WIN_AVRT_WRAPPER_WIN_H_ | 36 #endif // MEDIA_AUDIO_WIN_AVRT_WRAPPER_WIN_H_ |
| 39 | 37 |
| OLD | NEW |