blob: 465f874b4f6dd2174a68b38d243ac58a8937a591 [file] [log] [blame]
// 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
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. 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.
RegisterHandlerWithCapacity(resource struct {
thread_handle zx.handle:THREAD;
name string:64;
period zx.duration;
capacity float32;
}) -> (struct {
period zx.duration;
capacity zx.duration;
});
/// Reset a thread's scheduling profile to the default.
UnregisterHandler(resource struct {
thread_handle zx.handle:THREAD;
name string:64;
}) -> ();
};