| // Copyright 2020 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| library fuchsia.media; |
| |
| using zx; |
| |
| [Discoverable, ForDeprecatedCBindings] |
| protocol ProfileProvider { |
| /// Register a thread as a media thread. This notifies the media subsystem |
| /// that this thread should have an elevated scheduling profile applied to |
| /// it in order to meet audio or video deadlines. |
| /// |
| /// `name` is the name of the component requesting the profile. |
| /// `period` is the suggested interval to be scheduled at. |
| /// |
| /// Returns the period and capacity that was applied, if a deadline profile |
| /// was selected. Returns 0 if no deadline profile was selected. |
| RegisterHandler(zx.handle:THREAD thread_handle, string:64 name, zx.duration period) |
| -> (zx.duration period, zx.duration capacity); |
| |
| /// Register a thread as a media thread. This notifies the media subsystem that this thread |
| /// should have an elevated scheduling profile applied to it in order to meet audio or video |
| /// deadlines. |
| /// |
| /// `name` is the name of the component requesting the profile. `period` is the suggested |
| /// interval to be scheduled at. If `period` is 0, then the server will select an appropriate |
| /// interval in an implemenation dependent way. `capacity` is the suggested CPU capacity to |
| /// reserve for `thread_handle`. For example, with a 0.1 capacity, 10% of a core will be |
| /// reserved for the thread. For heterogeneous systems, this capacity should be planned against |
| /// the highest performance processor(s) in the system. |
| /// |
| /// Returns the period and capacity that was applied, if a deadline profile was selected. |
| /// Returns 0 if no deadline profile was selected. |
| [Transitional] |
| RegisterHandlerWithCapacity(zx.handle:THREAD thread_handle, string:64 name, zx.duration period, float32 capacity) |
| -> (zx.duration period, zx.duration capacity); |
| }; |