Chromium Code Reviews
|
| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 // | |
| 5 // The AvrtWrapper class encapsulates the details needed to support MMCSS. | |
|
scherkus (not reviewing)
2011/10/18 21:12:30
out of curiosity does Avrt stand for anything?
henrika (OOO until Aug 14)
2011/10/19 15:42:43
It's a jolly good question and I actually don't kn
| |
| 6 // | |
| 7 // The Multimedia Class Scheduler service (MMCSS) enables multimedia | |
| 8 // applications to ensure that their time-sensitive processing receives | |
| 9 // prioritized access to CPU resources. This service enables multimedia | |
| 10 // applications to utilize as much of the CPU as possible without denying | |
| 11 // CPU resources to lower-priority applications. | |
| 12 // MMCSS requires Windows Vista or higher and that the Avrt DLL is loaded. | |
| 13 // | |
| 14 #ifndef MEDIA_AUDIO_WIN_AVRT_WRAPPER_WIN_H_ | |
| 15 #define MEDIA_AUDIO_WIN_AVRT_WRAPPER_WIN_H_ | |
| 16 | |
| 17 #include <windows.h> | |
| 18 #include <avrt.h> | |
|
scherkus (not reviewing)
2011/10/18 21:12:30
can <avrt.h> get moved into the .cc ?
doesn't loo
henrika (OOO until Aug 14)
2011/10/19 15:42:43
Need it for AVRT_PRIORITY
| |
| 19 | |
| 20 #include "base/basictypes.h" | |
| 21 | |
| 22 class AvrtWrapper { | |
|
scherkus (not reviewing)
2011/10/18 21:12:30
there's nothing in here that warrants a class -- i
henrika (OOO until Aug 14)
2011/10/19 15:42:43
Agree, and so does Tommi. Will refactor.
| |
| 23 public: | |
| 24 AvrtWrapper() {} | |
| 25 ~AvrtWrapper() {} | |
| 26 | |
| 27 // Loads the Avrt.dll which is available on Windows Vista and later. | |
| 28 bool Initialize(); | |
| 29 | |
| 30 // Function wrappers for the underlying MMCSS functions. | |
| 31 bool AvRevertMmThreadCharacteristics(HANDLE avrt_handle); | |
| 32 HANDLE AvSetMmThreadCharacteristics(const char* task_name, DWORD* task_index); | |
| 33 bool AvSetMmThreadPriority(HANDLE avrt_handle, AVRT_PRIORITY priority); | |
| 34 | |
| 35 private: | |
| 36 DISALLOW_COPY_AND_ASSIGN(AvrtWrapper); | |
| 37 }; | |
| 38 | |
| 39 #endif // MEDIA_AUDIO_WIN_AVRT_WRAPPER_WIN_H_ | |
| 40 | |
|
scherkus (not reviewing)
2011/10/18 21:12:30
nit: remove blank line
henrika (OOO until Aug 14)
2011/10/19 15:42:43
Done.
| |
| OLD | NEW |