start work on nihed-cros-libva
[nihav-player.git] / nihed-cros-libva / src / usage_hint.rs
CommitLineData
68362724
KS
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::constants;
8
9bitflags! {
10 /// Gives the driver a hint of intended usage to optimize allocation (e.g. tiling).
11 pub struct UsageHint: u32 {
12 /// Surface usage not indicated.
13 const USAGE_HINT_GENERIC = constants::VA_SURFACE_ATTRIB_USAGE_HINT_GENERIC;
14 /// Surface used by video decoder.
15 const USAGE_HINT_DECODER = constants::VA_SURFACE_ATTRIB_USAGE_HINT_DECODER;
16 /// Surface used by video encoder.
17 const USAGE_HINT_ENCODER = constants::VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER;
18 /// Surface read by video post-processing.
19 const USAGE_HINT_VPP_READ = constants::VA_SURFACE_ATTRIB_USAGE_HINT_VPP_READ;
20 /// Surface written by video post-processing.
21 const USAGE_HINT_VPP_WRITE = constants::VA_SURFACE_ATTRIB_USAGE_HINT_VPP_WRITE;
22 /// Surface used for display.
23 const USAGE_HINT_DISPLAY = constants::VA_SURFACE_ATTRIB_USAGE_HINT_DISPLAY;
24 /// Surface used for export to third-party APIs, e.g. via `vaExportSurfaceHandle()`.
25 const USAGE_HINT_EXPORT = constants::VA_SURFACE_ATTRIB_USAGE_HINT_EXPORT;
26 }
27}