Skip to main content

moq_vaapi/
usage_hint.rs

1// Copyright 2022 The ChromiumOS Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use bitflags::bitflags;
6
7use crate::bindings;
8
9bitflags! {
10	/// Gives the driver a hint of intended usage to optimize allocation (e.g. tiling).
11	#[derive(Debug, Clone, Copy)]
12	pub struct UsageHint: u32 {
13		/// Surface used by video decoder.
14		const USAGE_HINT_DECODER = bindings::VA_SURFACE_ATTRIB_USAGE_HINT_DECODER;
15		/// Surface used by video encoder.
16		const USAGE_HINT_ENCODER = bindings::VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER;
17		/// Surface read by video post-processing.
18		const USAGE_HINT_VPP_READ = bindings::VA_SURFACE_ATTRIB_USAGE_HINT_VPP_READ;
19		/// Surface written by video post-processing.
20		const USAGE_HINT_VPP_WRITE = bindings::VA_SURFACE_ATTRIB_USAGE_HINT_VPP_WRITE;
21		/// Surface used for display.
22		const USAGE_HINT_DISPLAY = bindings::VA_SURFACE_ATTRIB_USAGE_HINT_DISPLAY;
23		/// Surface used for export to third-party APIs, e.g. via `vaExportSurfaceHandle()`.
24		const USAGE_HINT_EXPORT = bindings::VA_SURFACE_ATTRIB_USAGE_HINT_EXPORT;
25	}
26}