Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Unified Diff: media/audio/win/avrt_wrapper_win.h

Issue 8283032: Low-latency AudioInputStream implementation based on WASAPI for Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fixes in AVRT wrapper based on review by tommi Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/audio/win/avrt_wrapper_win.h
===================================================================
--- media/audio/win/avrt_wrapper_win.h (revision 0)
+++ media/audio/win/avrt_wrapper_win.h (revision 0)
@@ -0,0 +1,40 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// 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
+//
+// The Multimedia Class Scheduler service (MMCSS) enables multimedia
+// applications to ensure that their time-sensitive processing receives
+// prioritized access to CPU resources. This service enables multimedia
+// applications to utilize as much of the CPU as possible without denying
+// CPU resources to lower-priority applications.
+// MMCSS requires Windows Vista or higher and that the Avrt DLL is loaded.
+//
+#ifndef MEDIA_AUDIO_WIN_AVRT_WRAPPER_WIN_H_
+#define MEDIA_AUDIO_WIN_AVRT_WRAPPER_WIN_H_
+
+#include <windows.h>
+#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
+
+#include "base/basictypes.h"
+
+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.
+ public:
+ AvrtWrapper() {}
+ ~AvrtWrapper() {}
+
+ // Loads the Avrt.dll which is available on Windows Vista and later.
+ bool Initialize();
+
+ // Function wrappers for the underlying MMCSS functions.
+ bool AvRevertMmThreadCharacteristics(HANDLE avrt_handle);
+ HANDLE AvSetMmThreadCharacteristics(const char* task_name, DWORD* task_index);
+ bool AvSetMmThreadPriority(HANDLE avrt_handle, AVRT_PRIORITY priority);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(AvrtWrapper);
+};
+
+#endif // MEDIA_AUDIO_WIN_AVRT_WRAPPER_WIN_H_
+
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.
Property changes on: media\audio\win\avrt_wrapper_win.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698