From f32137486e239a78257922636ec2c4b1db6f047c Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 27 Nov 2026 05:21:00 -0800 Subject: [PATCH 1/3] chore(nix): follow quest's nixpkgs so dev shells share one C compiler mbx keys build scripts, proc-macros, and every crate built on them by the C compiler's store path, so repositories whose nixpkgs pins give different compilers share none of them. Taking nixpkgs from quest, whose release every repository locks, gives every dev shell the same one. Co-Authored-By: Claude Opus 5.5 --- flake.lock | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++--- flake.nix | 9 ++++- 2 files changed, 100 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 3fe7c28..5f7e96f 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1781454065, - "narHash": "sha256-d2xfDjnfRuf/xYGdu9VVRHiav/2w5hDL/5cw2TuVAXw=", + "lastModified": 1794644783, + "narHash": "sha256-3GnIGIy15bMduoS9RnWqKTmsJLWThla42UFtm0S7+us=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9eac87a12312b8f60dd52e1c6e1a265f6fc7f5fc", + "rev": "5d2b81a7a3be3e2f832879028e4d60abbf58e9a0", "type": "github" }, "original": { @@ -34,10 +34,70 @@ "type": "github" } }, + "nixpkgs-bun": { + "locked": { + "lastModified": 1794644783, + "narHash": "sha256-3GnIGIy15bMduoS9RnWqKTmsJLWThla42UFtm0S7+us=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5d2b81a7a3be3e2f832879028e4d60abbf58e9a0", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "quest": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": "nixpkgs", + "nixpkgs-bun": "nixpkgs-bun", + "quest-pinned": "quest-pinned", + "token-max": "token-max" + }, + "locked": { + "lastModified": 1795723351, + "narHash": "sha256-HKNemeY0ivchWxtlZt/+mowohXR8UOdMd8H6doj0zzA=", + "owner": "kixel-ai", + "repo": "quest", + "rev": "d6bba97706420e409ba235b86212bff172af7a6c", + "type": "github" + }, + "original": { + "owner": "kixel-ai", + "repo": "quest", + "type": "github" + } + }, + "quest-pinned": { + "flake": false, + "locked": { + "lastModified": 1795644737, + "narHash": "sha256-pBIdZ9uKOU8so/VNeKk5RvQnfJmXKoBYwJfgHIbQtog=", + "owner": "kixel-ai", + "repo": "quest", + "rev": "8bb9506515a99a2002ee596df6ab2b294948210c", + "type": "github" + }, + "original": { + "owner": "kixel-ai", + "repo": "quest", + "type": "github" + } + }, "root": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", + "nixpkgs": [ + "quest", + "nixpkgs" + ], + "quest": "quest", "rust-overlay": "rust-overlay" } }, @@ -75,6 +135,34 @@ "repo": "default", "type": "github" } + }, + "token-max": { + "inputs": { + "flake-utils": [ + "quest", + "flake-utils" + ], + "nixpkgs": [ + "quest", + "nixpkgs" + ], + "quest": [ + "quest" + ] + }, + "locked": { + "lastModified": 1795488772, + "narHash": "sha256-/GnevX/eNInFQjVjNyUtoxv4bvQvHTxdGnSKMEk8yJc=", + "owner": "kixel-ai", + "repo": "token-max", + "rev": "ae533b8de79be21d5019f4098e96a302fabcaff2", + "type": "github" + }, + "original": { + "owner": "kixel-ai", + "repo": "token-max", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 48a793f..296891b 100644 --- a/flake.nix +++ b/flake.nix @@ -2,12 +2,19 @@ description = "moq-vaapi - VA-API hardware video codecs (vendored libva)"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + # quest's nixpkgs, so every repository's dev shell gets the same C compiler and mbx + # shares build scripts, proc-macros, and the crates built on them across repositories. + nixpkgs.follows = "quest/nixpkgs"; flake-utils.url = "github:numtide/flake-utils"; rust-overlay = { url = "github:oxalica/rust-overlay"; inputs.nixpkgs.follows = "nixpkgs"; }; + # Only its nixpkgs is used. + quest = { + url = "github:kixel-ai/quest"; + inputs.flake-utils.follows = "flake-utils"; + }; }; outputs = From 44a362637f893fde1fdac996a738fbaa67a1b44b Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 27 Nov 2026 07:04:15 -0800 Subject: [PATCH 2/3] chore(bindings): regenerate with quest's nixpkgs' libclang, which keeps header doc comments Co-Authored-By: Claude Opus 5.5 --- src/bindings/libva.rs | 256 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 256 insertions(+) diff --git a/src/bindings/libva.rs b/src/bindings/libva.rs index 4897ab4..4653464 100644 --- a/src/bindings/libva.rs +++ b/src/bindings/libva.rs @@ -166,11 +166,17 @@ impl ::std::fmt::Debug for __IncompleteArrayField { fmt.write_str("__IncompleteArrayField") } } +#[doc = " VA_MAJOR_VERSION:\n\n The major version of VA-API (1, if %VA_VERSION is 1.2.3)"] pub const VA_MAJOR_VERSION: u32 = 1; +#[doc = " VA_MINOR_VERSION:\n\n The minor version of VA-API (2, if %VA_VERSION is 1.2.3)"] pub const VA_MINOR_VERSION: u32 = 23; +#[doc = " VA_MICRO_VERSION:\n\n The micro version of VA-API (3, if %VA_VERSION is 1.2.3)"] pub const VA_MICRO_VERSION: u32 = 0; +#[doc = " VA_VERSION_S:\n\n The full version of VA-API, in string form (suited for string\n concatenation)"] pub const VA_VERSION_S: &[u8; 7] = b"1.23.0\0"; +#[doc = " VA_VERSION_HEX:\n\n Numerically encoded version of VA-API, like 0x010203"] pub const VA_VERSION_HEX: u32 = 18284544; +#[doc = " Return status type from functions */\n/** Values for the return status"] pub const VA_STATUS_SUCCESS: u32 = 0; pub const VA_STATUS_ERROR_OPERATION_FAILED: u32 = 1; pub const VA_STATUS_ERROR_ALLOCATION_FAILED: u32 = 2; @@ -196,156 +202,279 @@ pub const VA_STATUS_ERROR_SURFACE_IN_DISPLAYING: u32 = 21; pub const VA_STATUS_ERROR_INVALID_IMAGE_FORMAT: u32 = 22; pub const VA_STATUS_ERROR_DECODING_ERROR: u32 = 23; pub const VA_STATUS_ERROR_ENCODING_ERROR: u32 = 24; +#[doc = " \\brief An invalid/unsupported value was supplied.\n\n This is a catch-all error code for invalid or unsupported values.\n e.g. value exceeding the valid range, invalid type in the context\n of generic attribute values."] pub const VA_STATUS_ERROR_INVALID_VALUE: u32 = 25; +#[doc = " \\brief An unsupported filter was supplied."] pub const VA_STATUS_ERROR_UNSUPPORTED_FILTER: u32 = 32; +#[doc = " \\brief An invalid filter chain was supplied."] pub const VA_STATUS_ERROR_INVALID_FILTER_CHAIN: u32 = 33; +#[doc = " \\brief Indicate HW busy (e.g. run multiple encoding simultaneously)."] pub const VA_STATUS_ERROR_HW_BUSY: u32 = 34; +#[doc = " \\brief An unsupported memory type was supplied."] pub const VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE: u32 = 36; +#[doc = " \\brief Indicate allocated buffer size is not enough for input or output."] pub const VA_STATUS_ERROR_NOT_ENOUGH_BUFFER: u32 = 37; +#[doc = " \\brief Indicate an operation isn't completed because time-out interval elapsed."] pub const VA_STATUS_ERROR_TIMEDOUT: u32 = 38; pub const VA_STATUS_ERROR_UNKNOWN: u32 = 4294967295; +#[doc = " 1. De-interlacing flags for vaPutSurface()\n 2. Surface sample type for input/output surface flag\n - Progressive: VA_FRAME_PICTURE\n - Interleaved: VA_TOP_FIELD_FIRST, VA_BOTTOM_FIELD_FIRST\n - Field: VA_TOP_FIELD, VA_BOTTOM_FIELD"] pub const VA_FRAME_PICTURE: u32 = 0; pub const VA_TOP_FIELD: u32 = 1; pub const VA_BOTTOM_FIELD: u32 = 2; pub const VA_TOP_FIELD_FIRST: u32 = 4; pub const VA_BOTTOM_FIELD_FIRST: u32 = 8; +#[doc = " Enabled the positioning/cropping/blending feature:\n 1, specify the video playback position in the isurface\n 2, specify the cropping info for video playback\n 3, encoded video will blend with background color"] pub const VA_ENABLE_BLEND: u32 = 4; +#[doc = " Clears the drawable with background color.\n for hardware overlay based implementation this flag\n can be used to turn off the overlay"] pub const VA_CLEAR_DRAWABLE: u32 = 8; +#[doc = " Color space conversion flags for vaPutSurface()"] pub const VA_SRC_COLOR_MASK: u32 = 240; pub const VA_SRC_BT601: u32 = 16; pub const VA_SRC_BT709: u32 = 32; pub const VA_SRC_SMPTE_240: u32 = 64; +#[doc = " Scaling flags for vaPutSurface()"] pub const VA_FILTER_SCALING_DEFAULT: u32 = 0; pub const VA_FILTER_SCALING_FAST: u32 = 256; pub const VA_FILTER_SCALING_HQ: u32 = 512; pub const VA_FILTER_SCALING_NL_ANAMORPHIC: u32 = 768; pub const VA_FILTER_SCALING_MASK: u32 = 3840; +#[doc = " Interpolation method for scaling"] pub const VA_FILTER_INTERPOLATION_DEFAULT: u32 = 0; pub const VA_FILTER_INTERPOLATION_NEAREST_NEIGHBOR: u32 = 4096; pub const VA_FILTER_INTERPOLATION_BILINEAR: u32 = 8192; pub const VA_FILTER_INTERPOLATION_ADVANCED: u32 = 12288; pub const VA_FILTER_INTERPOLATION_MASK: u32 = 61440; +#[doc = " Padding size in 4-bytes"] pub const VA_PADDING_LOW: u32 = 4; pub const VA_PADDING_MEDIUM: u32 = 8; pub const VA_PADDING_HIGH: u32 = 16; pub const VA_PADDING_LARGE: u32 = 32; +#[doc = " operation options */\n/** synchronization, block call, output should be ready after execution function return"] pub const VA_EXEC_SYNC: u32 = 0; +#[doc = " asynchronization,application should call additonal sync operation to access output"] pub const VA_EXEC_ASYNC: u32 = 1; +#[doc = " operation mode"] pub const VA_EXEC_MODE_DEFAULT: u32 = 0; pub const VA_EXEC_MODE_POWER_SAVING: u32 = 1; pub const VA_EXEC_MODE_PERFORMANCE: u32 = 2; +#[doc = " The feature is not supported by the device.\n\n Any corresponding feature flag must not be set."] pub const VA_FEATURE_NOT_SUPPORTED: u32 = 0; +#[doc = " The feature is supported by the device.\n\n The user may decide whether or not to use this feature.\n\n Note that support for a feature only indicates that the hardware\n is able to use it; whether it is actually a positive change to\n enable it in a given situation will depend on other factors\n including the input provided by the user."] pub const VA_FEATURE_SUPPORTED: u32 = 1; +#[doc = " The feature is required by the device.\n\n The device does not support not enabling this feature, so any\n corresponding feature flag must be set and any additional\n configuration needed by the feature must be supplied."] pub const VA_FEATURE_REQUIRED: u32 = 2; +#[doc = "< YUV 4:2:0 8-bit."] pub const VA_RT_FORMAT_YUV420: u32 = 1; +#[doc = "< YUV 4:2:2 8-bit."] pub const VA_RT_FORMAT_YUV422: u32 = 2; +#[doc = "< YUV 4:4:4 8-bit."] pub const VA_RT_FORMAT_YUV444: u32 = 4; +#[doc = "< YUV 4:1:1 8-bit."] pub const VA_RT_FORMAT_YUV411: u32 = 8; +#[doc = "< Greyscale 8-bit."] pub const VA_RT_FORMAT_YUV400: u32 = 16; +#[doc = "< YUV 4:2:0 10-bit."] pub const VA_RT_FORMAT_YUV420_10: u32 = 256; +#[doc = "< YUV 4:2:2 10-bit."] pub const VA_RT_FORMAT_YUV422_10: u32 = 512; +#[doc = "< YUV 4:4:4 10-bit."] pub const VA_RT_FORMAT_YUV444_10: u32 = 1024; +#[doc = "< YUV 4:2:0 12-bit."] pub const VA_RT_FORMAT_YUV420_12: u32 = 4096; +#[doc = "< YUV 4:2:2 12-bit."] pub const VA_RT_FORMAT_YUV422_12: u32 = 8192; +#[doc = "< YUV 4:4:4 12-bit."] pub const VA_RT_FORMAT_YUV444_12: u32 = 16384; +#[doc = "< Packed RGB, 16 bits per pixel."] pub const VA_RT_FORMAT_RGB16: u32 = 65536; +#[doc = "< Packed RGB, 32 bits per pixel, 8 bits per colour sample."] pub const VA_RT_FORMAT_RGB32: u32 = 131072; +#[doc = "< Planar RGB, 8 bits per sample."] pub const VA_RT_FORMAT_RGBP: u32 = 1048576; +#[doc = "< Packed RGB, 32 bits per pixel, 10 bits per colour sample."] pub const VA_RT_FORMAT_RGB32_10: u32 = 2097152; pub const VA_RT_FORMAT_PROTECTED: u32 = 2147483648; +#[doc = "< @deprecated use VA_RT_FORMAT_RGB32_10 instead."] pub const VA_RT_FORMAT_RGB32_10BPP: u32 = 2097152; +#[doc = "< @deprecated use VA_RT_FORMAT_YUV420_10 instead."] pub const VA_RT_FORMAT_YUV420_10BPP: u32 = 256; +#[doc = " @name Attribute values for VAConfigAttribRateControl */\n/**@{*/\n/** \\brief Driver does not support any form of rate control."] pub const VA_RC_NONE: u32 = 1; +#[doc = " \\brief Constant bitrate."] pub const VA_RC_CBR: u32 = 2; +#[doc = " \\brief Variable bitrate."] pub const VA_RC_VBR: u32 = 4; +#[doc = " \\brief Video conference mode."] pub const VA_RC_VCM: u32 = 8; +#[doc = " \\brief Constant QP."] pub const VA_RC_CQP: u32 = 16; +#[doc = " \\brief Variable bitrate with peak rate higher than average bitrate."] pub const VA_RC_VBR_CONSTRAINED: u32 = 32; +#[doc = " \\brief Intelligent Constant Quality. Provided an initial ICQ_quality_factor,\n adjusts QP at a frame and MB level based on motion to improve subjective quality."] pub const VA_RC_ICQ: u32 = 64; +#[doc = " \\brief Macroblock based rate control. Per MB control is decided\n internally in the encoder. It may be combined with other RC modes, except CQP."] pub const VA_RC_MB: u32 = 128; +#[doc = " \\brief Constant Frame Size, it is used for small tolerent"] pub const VA_RC_CFS: u32 = 256; +#[doc = " \\brief Parallel BRC, for hierachical B.\n\n For hierachical B, B frames can be refered by other B frames.\n Currently three layers of hierachy are defined:\n B0 - regular B, no reference to other B frames.\n B1 - reference to only I, P and regular B0 frames.\n B2 - reference to any other frames, including B1.\n In Hierachical B structure, B frames on the same layer can be processed\n simultaneously. And BRC would adjust accordingly. This is so called\n Parallel BRC."] pub const VA_RC_PARALLEL: u32 = 512; +#[doc = " \\brief Quality defined VBR\n Use Quality factor to determine the good enough QP for each MB such that\n good enough quality can be obtained without waste of bits\n for this BRC mode, you must set all legacy VBR parameters\n and reuse quality_factor in \\c VAEncMiscParameterRateControl"] pub const VA_RC_QVBR: u32 = 1024; +#[doc = " \\brief Average VBR\n Average variable bitrate control algorithm focuses on overall encoding\n quality while meeting the specified target bitrate, within the accuracy\n range, after a convergence period.\n bits_per_second in VAEncMiscParameterRateControl is target bitrate for AVBR.\n Convergence is specified in the unit of frame.\n window_size in VAEncMiscParameterRateControl is equal to convergence for AVBR.\n Accuracy is in the range of [1,100], 1 means one percent, and so on.\n target_percentage in VAEncMiscParameterRateControl is equal to accuracy for AVBR."] pub const VA_RC_AVBR: u32 = 2048; +#[doc = " \\brief Transport Controlled BRC\n Specific bitrate control for real time streaming.\n TCBRC can instantly react to channel change to remove or significantly reduce the delay.\n Application (transport) provides channel feedback to driver through TargetFrameSize.\n When channel condition is very good (almost no constraint on instant frame size),\n the app should set target frame size as zero. Otherwise, channel capacity divided by fps\n should be used."] pub const VA_RC_TCBRC: u32 = 4096; +#[doc = " @name Attribute values for VAConfigAttribDecSliceMode */\n/**@{*/\n/** \\brief Driver supports normal mode for slice decoding"] pub const VA_DEC_SLICE_MODE_NORMAL: u32 = 1; +#[doc = " \\brief Driver supports base mode for slice decoding"] pub const VA_DEC_SLICE_MODE_BASE: u32 = 2; +#[doc = " @name Attribute values for VAConfigAttribDecProcessing */\n/**@{*/\n/** \\brief No decoding + processing in a single decoding call."] pub const VA_DEC_PROCESSING_NONE: u32 = 0; +#[doc = " \\brief Decode + processing in a single decoding call."] pub const VA_DEC_PROCESSING: u32 = 1; +#[doc = " @name Attribute values for VAConfigAttribEncPackedHeaders */\n/**@{*/\n/** \\brief Driver does not support any packed headers mode."] pub const VA_ENC_PACKED_HEADER_NONE: u32 = 0; +#[doc = " \\brief Driver supports packed sequence headers. e.g. SPS for H.264.\n\n Application must provide it to driver once this flag is returned through\n vaGetConfigAttributes()"] pub const VA_ENC_PACKED_HEADER_SEQUENCE: u32 = 1; +#[doc = " \\brief Driver supports packed picture headers. e.g. PPS for H.264.\n\n Application must provide it to driver once this falg is returned through\n vaGetConfigAttributes()"] pub const VA_ENC_PACKED_HEADER_PICTURE: u32 = 2; +#[doc = " \\brief Driver supports packed slice headers. e.g. slice_header() for H.264.\n\n Application must provide it to driver once this flag is returned through\n vaGetConfigAttributes()"] pub const VA_ENC_PACKED_HEADER_SLICE: u32 = 4; +#[doc = " \\brief Driver supports misc packed headers. e.g. SEI for H.264.\n\n @deprecated\n This is a deprecated packed header flag, All applications can use\n \\c VA_ENC_PACKED_HEADER_RAW_DATA to pass the corresponding packed\n header data buffer to the driver"] pub const VA_ENC_PACKED_HEADER_MISC: u32 = 8; +#[doc = " \\brief Driver supports raw packed header, see VAEncPackedHeaderRawData"] pub const VA_ENC_PACKED_HEADER_RAW_DATA: u32 = 16; +#[doc = " @name Attribute values for VAConfigAttribEncInterlaced */\n/**@{*/\n/** \\brief Driver does not support interlaced coding."] pub const VA_ENC_INTERLACED_NONE: u32 = 0; +#[doc = " \\brief Driver supports interlaced frame coding."] pub const VA_ENC_INTERLACED_FRAME: u32 = 1; +#[doc = " \\brief Driver supports interlaced field coding."] pub const VA_ENC_INTERLACED_FIELD: u32 = 2; +#[doc = " \\brief Driver supports macroblock adaptive frame field coding."] pub const VA_ENC_INTERLACED_MBAFF: u32 = 4; +#[doc = " \\brief Driver supports picture adaptive frame field coding."] pub const VA_ENC_INTERLACED_PAFF: u32 = 8; +#[doc = " @name Attribute values for VAConfigAttribEncSliceStructure */\n/**@{*/\n/** \\brief Driver supports a power-of-two number of rows per slice."] pub const VA_ENC_SLICE_STRUCTURE_POWER_OF_TWO_ROWS: u32 = 1; +#[doc = " \\brief Driver supports an arbitrary number of macroblocks per slice."] pub const VA_ENC_SLICE_STRUCTURE_ARBITRARY_MACROBLOCKS: u32 = 2; +#[doc = " \\brief Driver support 1 row per slice"] pub const VA_ENC_SLICE_STRUCTURE_EQUAL_ROWS: u32 = 4; +#[doc = " \\brief Driver support max encoded slice size per slice"] pub const VA_ENC_SLICE_STRUCTURE_MAX_SLICE_SIZE: u32 = 8; +#[doc = " \\brief Driver supports an arbitrary number of rows per slice."] pub const VA_ENC_SLICE_STRUCTURE_ARBITRARY_ROWS: u32 = 16; +#[doc = " \\brief Driver supports any number of rows per slice but they must be the same\n for all slices except for the last one, which must be equal or smaller\n to the previous slices."] pub const VA_ENC_SLICE_STRUCTURE_EQUAL_MULTI_ROWS: u32 = 32; +#[doc = " @name Attribute values for VAConfigAttribEncQuantization */\n/**@{*/\n/** \\brief Driver does not support special types of quantization"] pub const VA_ENC_QUANTIZATION_NONE: u32 = 0; +#[doc = " \\brief Driver supports trellis quantization"] pub const VA_ENC_QUANTIZATION_TRELLIS_SUPPORTED: u32 = 1; +#[doc = " @name Attribute values for VAConfigAttribPredictionDirection */\n/**@{*/\n/** \\brief Driver support forward reference frame (inter frame for vpx, P frame for H26x MPEG)\n can work with the VAConfigAttribEncMaxRefFrames. for example: low delay B frame of HEVC.\n these value can be OR'd together. typical value should be VA_PREDICTION_DIRECTION_PREVIOUS\n or VA_PREDICTION_DIRECTION_PREVIOUS | VA_PREDICTION_DIRECTION_FUTURE, theoretically, there\n are no stream only include future reference frame."] pub const VA_PREDICTION_DIRECTION_PREVIOUS: u32 = 1; +#[doc = " \\brief Driver support backward prediction frame/slice"] pub const VA_PREDICTION_DIRECTION_FUTURE: u32 = 2; +#[doc = " \\brief Dirver require both reference list must be not empty for inter frame"] pub const VA_PREDICTION_DIRECTION_BI_NOT_EMPTY: u32 = 4; +#[doc = " @name Attribute values for VAConfigAttribEncIntraRefresh */\n/**@{*/\n/** \\brief Driver does not support intra refresh"] pub const VA_ENC_INTRA_REFRESH_NONE: u32 = 0; +#[doc = " \\brief Driver supports column based rolling intra refresh"] pub const VA_ENC_INTRA_REFRESH_ROLLING_COLUMN: u32 = 1; +#[doc = " \\brief Driver supports row based rolling intra refresh"] pub const VA_ENC_INTRA_REFRESH_ROLLING_ROW: u32 = 2; +#[doc = " \\brief Driver supports adaptive intra refresh"] pub const VA_ENC_INTRA_REFRESH_ADAPTIVE: u32 = 16; +#[doc = " \\brief Driver supports cyclic intra refresh"] pub const VA_ENC_INTRA_REFRESH_CYCLIC: u32 = 32; +#[doc = " \\brief Driver supports intra refresh of P frame"] pub const VA_ENC_INTRA_REFRESH_P_FRAME: u32 = 65536; +#[doc = " \\brief Driver supports intra refresh of B frame"] pub const VA_ENC_INTRA_REFRESH_B_FRAME: u32 = 131072; +#[doc = " \\brief Driver supports intra refresh of multiple reference encoder"] pub const VA_ENC_INTRA_REFRESH_MULTI_REF: u32 = 262144; +#[doc = " @name Attribute values for VAConfigAttribProtectedContentCipherAlgorithm */\n/** \\brief AES cipher"] pub const VA_PC_CIPHER_AES: u32 = 1; +#[doc = " @name Attribute values for VAConfigAttribProtectedContentCipherBlockSize */\n/** \\brief 128 bits block size"] pub const VA_PC_BLOCK_SIZE_128: u32 = 1; +#[doc = " \\brief 192 bits block size"] pub const VA_PC_BLOCK_SIZE_192: u32 = 2; +#[doc = " \\brief 256 bits block size"] pub const VA_PC_BLOCK_SIZE_256: u32 = 4; +#[doc = " @name Attribute values for VAConfigAttribProtectedContentCipherMode */\n/** \\brief AES ECB"] pub const VA_PC_CIPHER_MODE_ECB: u32 = 1; +#[doc = " \\brief AES CBC"] pub const VA_PC_CIPHER_MODE_CBC: u32 = 2; +#[doc = " \\brief AES CTR"] pub const VA_PC_CIPHER_MODE_CTR: u32 = 4; +#[doc = " @name Attribute values for VAConfigAttribProtectedContentCipherSampleType */\n/** \\brief Full sample"] pub const VA_PC_SAMPLE_TYPE_FULLSAMPLE: u32 = 1; +#[doc = " \\brief Sub sample"] pub const VA_PC_SAMPLE_TYPE_SUBSAMPLE: u32 = 2; +#[doc = " @name Attribute values for VAConfigAttribProtectedContentUsage */\n/** \\brief Default usage"] pub const VA_PC_USAGE_DEFAULT: u32 = 0; +#[doc = " \\brief Widevine"] pub const VA_PC_USAGE_WIDEVINE: u32 = 1; +#[doc = " @name Attribute values for VAConfigAttribProcessingRate. */\n/**@{*/\n/** \\brief Driver does not support processing rate report"] pub const VA_PROCESSING_RATE_NONE: u32 = 0; +#[doc = " \\brief Driver supports encode processing rate report"] pub const VA_PROCESSING_RATE_ENCODE: u32 = 1; +#[doc = " \\brief Driver supports decode processing rate report"] pub const VA_PROCESSING_RATE_DECODE: u32 = 2; +#[doc = " @name segment ID map block size */\n/**@{*/\n/** \\brief each segmentID represent a 16x16 block"] pub const VA_SEGID_BLOCK_16X16: u32 = 0; +#[doc = " \\brief each segmentID represent a 32x32 block"] pub const VA_SEGID_BLOCK_32X32: u32 = 1; +#[doc = " \\brief each segmentID represent a 64x64 block"] pub const VA_SEGID_BLOCK_64X64: u32 = 2; +#[doc = " \\brief each segmentID represent a 8x8 block"] pub const VA_SEGID_BLOCK_8X8: u32 = 3; +#[doc = " if an attribute is not applicable for a given\n profile/entrypoint pair, then set the value to the following"] pub const VA_ATTRIB_NOT_SUPPORTED: u32 = 2147483648; pub const VA_INVALID_ID: u32 = 4294967295; pub const VA_INVALID_SURFACE: u32 = 4294967295; +#[doc = " @name Surface attribute flags */\n/**@{*/\n/** \\brief Surface attribute is not supported."] pub const VA_SURFACE_ATTRIB_NOT_SUPPORTED: u32 = 0; +#[doc = " \\brief Surface attribute can be got through vaQuerySurfaceAttributes()."] pub const VA_SURFACE_ATTRIB_GETTABLE: u32 = 1; +#[doc = " \\brief Surface attribute can be set through vaCreateSurfaces()."] pub const VA_SURFACE_ATTRIB_SETTABLE: u32 = 2; +#[doc = " @name VASurfaceAttribMemoryType values in bit fields.\n Bits 0:7 are reserved for generic types. Bits 31:28 are reserved for\n Linux DRM. Bits 23:20 are reserved for Android. Bits 19:16 are reserved for Win32.\n DRM, Android and Win32 specific types are defined in respective va_*.h header files.\n/\n/**@{*/\n/** \\brief VA memory type (default) is supported."] pub const VA_SURFACE_ATTRIB_MEM_TYPE_VA: u32 = 1; +#[doc = " \\brief V4L2 buffer memory type is supported."] pub const VA_SURFACE_ATTRIB_MEM_TYPE_V4L2: u32 = 2; +#[doc = " \\brief User pointer memory type is supported."] pub const VA_SURFACE_ATTRIB_MEM_TYPE_USER_PTR: u32 = 4; +#[doc = " @name VASurfaceAttribExternalBuffers flags */\n/**@{*/\n/** \\brief Enable memory tiling"] pub const VA_SURFACE_EXTBUF_DESC_ENABLE_TILING: u32 = 1; +#[doc = " \\brief Memory is cacheable"] pub const VA_SURFACE_EXTBUF_DESC_CACHED: u32 = 2; +#[doc = " \\brief Memory is non-cacheable"] pub const VA_SURFACE_EXTBUF_DESC_UNCACHED: u32 = 4; +#[doc = " \\brief Memory is write-combined"] pub const VA_SURFACE_EXTBUF_DESC_WC: u32 = 8; +#[doc = " \\brief Memory is protected"] pub const VA_SURFACE_EXTBUF_DESC_PROTECTED: u32 = 2147483648; +#[doc = " @name VASurfaceAttribUsageHint attribute usage hint flags */\n/**@{*/\n/** \\brief Surface usage not indicated."] pub const VA_SURFACE_ATTRIB_USAGE_HINT_GENERIC: u32 = 0; +#[doc = " \\brief Surface used by video decoder."] pub const VA_SURFACE_ATTRIB_USAGE_HINT_DECODER: u32 = 1; +#[doc = " \\brief Surface used by video encoder."] pub const VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER: u32 = 2; +#[doc = " \\brief Surface read by video post-processing."] pub const VA_SURFACE_ATTRIB_USAGE_HINT_VPP_READ: u32 = 4; +#[doc = " \\brief Surface written by video post-processing."] pub const VA_SURFACE_ATTRIB_USAGE_HINT_VPP_WRITE: u32 = 8; +#[doc = " \\brief Surface used for display."] pub const VA_SURFACE_ATTRIB_USAGE_HINT_DISPLAY: u32 = 16; +#[doc = " \\brief Surface used for export to third-party APIs, e.g. via\n vaExportSurfaceHandle()."] pub const VA_SURFACE_ATTRIB_USAGE_HINT_EXPORT: u32 = 32; pub const VA_PROGRESSIVE: u32 = 1; +#[doc = " These ENCRYPTION_TYPEs are used for the attribute values for\n \\c VAConfigAttribEncryption and for encryption_type in\n VAEncryptionParameters.\n\n When used for \\c VAConfigAttribEncryption, it be used via\n vaQueryConfigEntrypoints to check which type are supported for specific\n profile or not.\n\n When used for encryption_type in VAEncryptionParameters, it tells driver\n the parameters in VAEncryptionParameters are used for which encryption type."] pub const VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR: u32 = 1; pub const VA_ENCRYPTION_TYPE_FULLSAMPLE_CBC: u32 = 2; pub const VA_ENCRYPTION_TYPE_SUBSAMPLE_CTR: u32 = 4; pub const VA_ENCRYPTION_TYPE_SUBSAMPLE_CBC: u32 = 8; +#[doc = " There will be cases where the bitstream buffer will not have enough room to hold\n the data for the entire slice, and the following flags will be used in the slice\n parameter to signal to the server for the possible cases.\n If a slice parameter buffer and slice data buffer pair is sent to the server with\n the slice data partially in the slice data buffer (BEGIN and MIDDLE cases below),\n then a slice parameter and data buffer needs to be sent again to complete this slice."] pub const VA_SLICE_DATA_FLAG_ALL: u32 = 0; pub const VA_SLICE_DATA_FLAG_BEGIN: u32 = 1; pub const VA_SLICE_DATA_FLAG_MIDDLE: u32 = 2; @@ -359,99 +488,176 @@ pub const VA_PICTURE_H264_TOP_FIELD: u32 = 2; pub const VA_PICTURE_H264_BOTTOM_FIELD: u32 = 4; pub const VA_PICTURE_H264_SHORT_TERM_REFERENCE: u32 = 8; pub const VA_PICTURE_H264_LONG_TERM_REFERENCE: u32 = 16; +#[doc = " device independent data structure for codedbuffer"] pub const VA_CODED_BUF_STATUS_PICTURE_AVE_QP_MASK: u32 = 255; pub const VA_CODED_BUF_STATUS_LARGE_SLICE_MASK: u32 = 256; pub const VA_CODED_BUF_STATUS_SLICE_OVERFLOW_MASK: u32 = 512; pub const VA_CODED_BUF_STATUS_BITRATE_OVERFLOW: u32 = 1024; pub const VA_CODED_BUF_STATUS_BITRATE_HIGH: u32 = 2048; +#[doc = " \\brief The frame has exceeded the maximum requested size.\n\n This flag indicates that the encoded frame size exceeds the value\n specified through a misc parameter buffer of type\n #VAEncMiscParameterTypeMaxFrameSize."] pub const VA_CODED_BUF_STATUS_FRAME_SIZE_OVERFLOW: u32 = 4096; +#[doc = " \\brief the bitstream is bad or corrupt."] pub const VA_CODED_BUF_STATUS_BAD_BITSTREAM: u32 = 32768; pub const VA_CODED_BUF_STATUS_AIR_MB_OVER_THRESHOLD: u32 = 16711680; +#[doc = " \\brief The coded buffer segment status contains frame encoding passes number\n\n This is the mask to get the number of encoding passes from the coded\n buffer segment status.\n NUMBER_PASS(bit24~bit27): the number for encoding passes executed for the coded frame.\n"] pub const VA_CODED_BUF_STATUS_NUMBER_PASSES_MASK: u32 = 251658240; +#[doc = " \\brief The coded buffer segment contains a single NAL unit.\n\n This flag indicates that the coded buffer segment contains a\n single NAL unit. This flag might be useful to the user for\n processing the coded buffer."] pub const VA_CODED_BUF_STATUS_SINGLE_NALU: u32 = 268435456; +#[doc = " \\brief VA_MAPBUFFER_FLAG_DEFAULT is used when there are no flag specified\n same as VA_MAPBUFFER_FLAG_READ | VA_MAPBUFFER_FLAG_WRITE."] pub const VA_MAPBUFFER_FLAG_DEFAULT: u32 = 0; +#[doc = " \\brief application will read the surface after map"] pub const VA_MAPBUFFER_FLAG_READ: u32 = 1; +#[doc = " \\brief application will write the surface after map"] pub const VA_MAPBUFFER_FLAG_WRITE: u32 = 2; +#[doc = " @name vaExportSurfaceHandle() flags\n\n @{\n/\n/** Export surface to be read by external API."] pub const VA_EXPORT_SURFACE_READ_ONLY: u32 = 1; +#[doc = " Export surface to be written by external API."] pub const VA_EXPORT_SURFACE_WRITE_ONLY: u32 = 2; +#[doc = " Export surface to be both read and written by external API."] pub const VA_EXPORT_SURFACE_READ_WRITE: u32 = 3; +#[doc = " Export surface with separate layers.\n\n For example, NV12 surfaces should be exported as two separate\n planes for luma and chroma."] pub const VA_EXPORT_SURFACE_SEPARATE_LAYERS: u32 = 4; +#[doc = " Export surface with composed layers.\n\n For example, NV12 surfaces should be exported as a single NV12\n composed object."] pub const VA_EXPORT_SURFACE_COMPOSED_LAYERS: u32 = 8; +#[doc = " \\brief Indicates an infinite timeout."] pub const VA_TIMEOUT_INFINITE: i32 = -1; +#[doc = " NV12: two-plane 8-bit YUV 4:2:0.\n The first plane contains Y, the second plane contains U and V in pairs of bytes."] pub const VA_FOURCC_NV12: u32 = 842094158; +#[doc = " NV21: two-plane 8-bit YUV 4:2:0.\n Same as NV12, but with U and V swapped."] pub const VA_FOURCC_NV21: u32 = 825382478; +#[doc = " AI44: packed 4-bit YA.\n\n The bottom half of each byte contains luma, the top half contains alpha."] pub const VA_FOURCC_AI44: u32 = 875839817; +#[doc = " RGBA: packed 8-bit RGBA.\n\n Four bytes per pixel: red, green, blue, alpha."] pub const VA_FOURCC_RGBA: u32 = 1094862674; +#[doc = " RGBX: packed 8-bit RGB.\n\n Four bytes per pixel: red, green, blue, unspecified."] pub const VA_FOURCC_RGBX: u32 = 1480738642; +#[doc = " BGRA: packed 8-bit RGBA.\n\n Four bytes per pixel: blue, green, red, alpha."] pub const VA_FOURCC_BGRA: u32 = 1095911234; +#[doc = " BGRX: packed 8-bit RGB.\n\n Four bytes per pixel: blue, green, red, unspecified."] pub const VA_FOURCC_BGRX: u32 = 1481787202; +#[doc = " ARGB: packed 8-bit RGBA.\n\n Four bytes per pixel: alpha, red, green, blue."] pub const VA_FOURCC_ARGB: u32 = 1111970369; +#[doc = " XRGB: packed 8-bit RGB.\n\n Four bytes per pixel: unspecified, red, green, blue."] pub const VA_FOURCC_XRGB: u32 = 1111970392; +#[doc = " ABGR: packed 8-bit RGBA.\n\n Four bytes per pixel: alpha, blue, green, red."] pub const VA_FOURCC_ABGR: u32 = 1380401729; +#[doc = " XBGR: packed 8-bit RGB.\n\n Four bytes per pixel: unspecified, blue, green, red."] pub const VA_FOURCC_XBGR: u32 = 1380401752; +#[doc = " UYUV: packed 8-bit YUV 4:2:2.\n\n Four bytes per pair of pixels: U, Y, U, V."] pub const VA_FOURCC_UYVY: u32 = 1498831189; +#[doc = " YUY2: packed 8-bit YUV 4:2:2.\n\n Four bytes per pair of pixels: Y, U, Y, V."] pub const VA_FOURCC_YUY2: u32 = 844715353; +#[doc = " AYUV: packed 8-bit YUVA 4:4:4.\n\n Four bytes per pixel: A, Y, U, V."] pub const VA_FOURCC_AYUV: u32 = 1448433985; +#[doc = " NV11: two-plane 8-bit YUV 4:1:1.\n\n The first plane contains Y, the second plane contains U and V in pairs of bytes."] pub const VA_FOURCC_NV11: u32 = 825316942; +#[doc = " YV12: three-plane 8-bit YUV 4:2:0.\n\n The three planes contain Y, V and U respectively."] pub const VA_FOURCC_YV12: u32 = 842094169; +#[doc = " P208: two-plane 8-bit YUV 4:2:2.\n\n The first plane contains Y, the second plane contains U and V in pairs of bytes."] pub const VA_FOURCC_P208: u32 = 942682704; +#[doc = " I420: three-plane 8-bit YUV 4:2:0.\n\n The three planes contain Y, U and V respectively."] pub const VA_FOURCC_I420: u32 = 808596553; +#[doc = " YV24: three-plane 8-bit YUV 4:4:4.\n\n The three planes contain Y, V and U respectively."] pub const VA_FOURCC_YV24: u32 = 875714137; +#[doc = " YV32: four-plane 8-bit YUVA 4:4:4\n\n The four planes contain Y, V, U and A respectively."] pub const VA_FOURCC_YV32: u32 = 842225241; +#[doc = " Y800: 8-bit greyscale."] pub const VA_FOURCC_Y800: u32 = 808466521; +#[doc = " IMC3: three-plane 8-bit YUV 4:2:0.\n\n Equivalent to YV12, but with the additional constraint that the pitch of all three planes\n must be the same."] pub const VA_FOURCC_IMC3: u32 = 860048713; +#[doc = " 411P: three-plane 8-bit YUV 4:1:1.\n\n The three planes contain Y, U and V respectively."] pub const VA_FOURCC_411P: u32 = 1345401140; +#[doc = " 411R: three-plane 8-bit YUV.\n\n The subsampling is the transpose of 4:1:1 - full chroma appears on every fourth line.\n The three planes contain Y, U and V respectively."] pub const VA_FOURCC_411R: u32 = 1378955572; +#[doc = " 422H: three-plane 8-bit YUV 4:2:2.\n\n The three planes contain Y, U and V respectively."] pub const VA_FOURCC_422H: u32 = 1211249204; +#[doc = " 422V: three-plane 8-bit YUV 4:4:0.\n\n The three planes contain Y, U and V respectively."] pub const VA_FOURCC_422V: u32 = 1446130228; +#[doc = " 444P: three-plane 8-bit YUV 4:4:4.\n\n The three planes contain Y, U and V respectively."] pub const VA_FOURCC_444P: u32 = 1345598516; +#[doc = " RGBP: three-plane 8-bit RGB.\n\n The three planes contain red, green and blue respectively."] pub const VA_FOURCC_RGBP: u32 = 1346520914; +#[doc = " BGRP: three-plane 8-bit RGB.\n\n The three planes contain blue, green and red respectively."] pub const VA_FOURCC_BGRP: u32 = 1347569474; +#[doc = " RG16: packed 5/6-bit RGB.\n\n Each pixel is a two-byte little-endian value.\n Red, green and blue are found in bits 15:11, 10:5, 4:0 respectively."] pub const VA_FOURCC_RGB565: u32 = 909199186; +#[doc = " BG16: packed 5/6-bit RGB.\n\n Each pixel is a two-byte little-endian value.\n Blue, green and red are found in bits 15:11, 10:5, 4:0 respectively."] pub const VA_FOURCC_BGR565: u32 = 909199170; +#[doc = " Y210: packed 10-bit YUV 4:2:2.\n\n Eight bytes represent a pair of pixels. Each sample is a two-byte little-endian value,\n with the bottom six bits ignored. The samples are in the order Y, U, Y, V."] pub const VA_FOURCC_Y210: u32 = 808530521; +#[doc = " Y212: packed 12-bit YUV 4:2:2.\n\n Eight bytes represent a pair of pixels. Each sample is a two-byte little-endian value.\n The samples are in the order Y, U, Y, V."] pub const VA_FOURCC_Y212: u32 = 842084953; +#[doc = " Y216: packed 16-bit YUV 4:2:2.\n\n Eight bytes represent a pair of pixels. Each sample is a two-byte little-endian value.\n The samples are in the order Y, U, Y, V."] pub const VA_FOURCC_Y216: u32 = 909193817; +#[doc = " Y410: packed 10-bit YUVA 4:4:4.\n\n Each pixel is a four-byte little-endian value.\n A, V, Y, U are found in bits 31:30, 29:20, 19:10, 9:0 respectively."] pub const VA_FOURCC_Y410: u32 = 808531033; +#[doc = " Y412 packed 12-bit YUVA 4:4:4.\n\n Each pixel is a set of four samples, each of which is a two-byte little-endian value.\n The samples are in the order A, V, Y, U."] pub const VA_FOURCC_Y412: u32 = 842085465; +#[doc = " Y416: packed 16-bit YUVA 4:4:4.\n\n Each pixel is a set of four samples, each of which is a two-byte little-endian value.\n The samples are in the order A, V, Y, U."] pub const VA_FOURCC_Y416: u32 = 909194329; +#[doc = " YV16: three-plane 8-bit YUV 4:2:2.\n\n The three planes contain Y, V and U respectively."] pub const VA_FOURCC_YV16: u32 = 909203033; +#[doc = " P010: two-plane 10-bit YUV 4:2:0.\n\n Each sample is a two-byte little-endian value with the bottom six bits ignored.\n The first plane contains Y, the second plane contains U and V in pairs of samples."] pub const VA_FOURCC_P010: u32 = 808530000; +#[doc = " P012: two-plane 12-bit YUV 4:2:0.\n\n Each sample is a two-byte little-endian value with the bottom four bits ignored.\n The first plane contains Y, the second plane contains U and V in pairs of samples."] pub const VA_FOURCC_P012: u32 = 842084432; +#[doc = " P016: two-plane 16-bit YUV 4:2:0.\n\n Each sample is a two-byte little-endian value. The first plane contains Y, the second\n plane contains U and V in pairs of samples."] pub const VA_FOURCC_P016: u32 = 909193296; +#[doc = " I010: three-plane 10-bit YUV 4:2:0.\n\n Each sample is a two-byte little-endian value with the top six bits ignored.\n The three planes contain Y, V and U respectively."] pub const VA_FOURCC_I010: u32 = 808529993; +#[doc = " IYUV: three-plane 8-bit YUV 4:2:0.\n\n @deprecated Use I420 instead."] pub const VA_FOURCC_IYUV: u32 = 1448433993; +#[doc = " 10-bit Pixel RGB formats."] pub const VA_FOURCC_A2R10G10B10: u32 = 808669761; +#[doc = " 10-bit Pixel BGR formats."] pub const VA_FOURCC_A2B10G10R10: u32 = 808665665; +#[doc = " 10-bit Pixel RGB formats without alpha."] pub const VA_FOURCC_X2R10G10B10: u32 = 808669784; +#[doc = " 10-bit Pixel BGR formats without alpha."] pub const VA_FOURCC_X2B10G10R10: u32 = 808665688; +#[doc = " Y8: 8-bit greyscale.\n\n Only a single sample, 8 bit Y plane for monochrome images"] pub const VA_FOURCC_Y8: u32 = 538982489; +#[doc = " Y16: 16-bit greyscale.\n\n Only a single sample, 16 bit Y plane for monochrome images"] pub const VA_FOURCC_Y16: u32 = 540422489; +#[doc = " VYUV: packed 8-bit YUV 4:2:2.\n\n Four bytes per pair of pixels: V, Y, U, V."] pub const VA_FOURCC_VYUY: u32 = 1498765654; +#[doc = " YVYU: packed 8-bit YUV 4:2:2.\n\n Four bytes per pair of pixels: Y, V, Y, U."] pub const VA_FOURCC_YVYU: u32 = 1431918169; +#[doc = " AGRB64: three-plane 16-bit ARGB 16:16:16:16\n\n The four planes contain: alpha, red, green, blue respectively."] pub const VA_FOURCC_ARGB64: u32 = 877089345; +#[doc = " ABGR64: three-plane 16-bit ABGR 16:16:16:16\n\n The four planes contain: alpha, blue, green, red respectively."] pub const VA_FOURCC_ABGR64: u32 = 877085249; +#[doc = " XYUV: packed 8-bit YUVX 4:4:4.\n\n Four bytes per pixel: X, Y, U, V."] pub const VA_FOURCC_XYUV: u32 = 1448434008; +#[doc = " Q416: three-plane 16-bit YUV 4:4:4.\n\n The three planes contain Y, U and V respectively."] pub const VA_FOURCC_Q416: u32 = 909194321; pub const VA_LSB_FIRST: u32 = 1; pub const VA_MSB_FIRST: u32 = 2; +#[doc = " flags for subpictures"] pub const VA_SUBPICTURE_CHROMA_KEYING: u32 = 1; pub const VA_SUBPICTURE_GLOBAL_ALPHA: u32 = 2; pub const VA_SUBPICTURE_DESTINATION_IS_SCREEN_COORD: u32 = 4; +#[doc = " attribute value for VADisplayAttribRotation"] pub const VA_ROTATION_NONE: u32 = 0; pub const VA_ROTATION_90: u32 = 1; pub const VA_ROTATION_180: u32 = 2; pub const VA_ROTATION_270: u32 = 3; +#[doc = " @name Mirroring directions\n\n Those values could be used for VADisplayAttribMirror attribute or\n VAProcPipelineParameterBuffer::mirror_state.\n\n/\n/**@{*/\n/** \\brief No Mirroring."] pub const VA_MIRROR_NONE: u32 = 0; +#[doc = " \\brief Horizontal Mirroring."] pub const VA_MIRROR_HORIZONTAL: u32 = 1; +#[doc = " \\brief Vertical Mirroring."] pub const VA_MIRROR_VERTICAL: u32 = 2; +#[doc = " attribute value for VADisplayAttribOutOfLoopDeblock"] pub const VA_OOL_DEBLOCKING_FALSE: u32 = 0; pub const VA_OOL_DEBLOCKING_TRUE: u32 = 1; +#[doc = " Render mode"] pub const VA_RENDER_MODE_UNDEFINED: u32 = 0; pub const VA_RENDER_MODE_LOCAL_OVERLAY: u32 = 1; pub const VA_RENDER_MODE_LOCAL_GPU: u32 = 2; pub const VA_RENDER_MODE_EXTERNAL_OVERLAY: u32 = 4; pub const VA_RENDER_MODE_EXTERNAL_GPU: u32 = 8; +#[doc = " Render device"] pub const VA_RENDER_DEVICE_UNDEFINED: u32 = 0; pub const VA_RENDER_DEVICE_LOCAL: u32 = 1; pub const VA_RENDER_DEVICE_EXTERNAL: u32 = 2; @@ -459,65 +665,115 @@ pub const VA_DISPLAY_ATTRIB_NOT_SUPPORTED: u32 = 0; pub const VA_DISPLAY_ATTRIB_GETTABLE: u32 = 1; pub const VA_DISPLAY_ATTRIB_SETTABLE: u32 = 2; pub const VA_PICTURE_HEVC_INVALID: u32 = 1; +#[doc = " \\brief indication of interlace scan picture.\n should take same value for all the pictures in sequence."] pub const VA_PICTURE_HEVC_FIELD_PIC: u32 = 2; +#[doc = " \\brief polarity of the field picture.\n top field takes even lines of buffer surface.\n bottom field takes odd lines of buffer surface."] pub const VA_PICTURE_HEVC_BOTTOM_FIELD: u32 = 4; +#[doc = " \\brief Long term reference picture"] pub const VA_PICTURE_HEVC_LONG_TERM_REFERENCE: u32 = 8; +#[doc = " VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE, VA_PICTURE_HEVC_RPS_ST_CURR_AFTER\n and VA_PICTURE_HEVC_RPS_LT_CURR of any picture in ReferenceFrames[] should\n be exclusive. No more than one of them can be set for any picture.\n Sum of NumPocStCurrBefore, NumPocStCurrAfter and NumPocLtCurr\n equals NumPocTotalCurr, which should be equal to or smaller than 8.\n Application should provide valid values for both short format and long format.\n The pictures in DPB with any of these three flags turned on are referred by\n the current picture.\n/\n/** \\brief RefPicSetStCurrBefore of HEVC spec variable\n Number of ReferenceFrames[] entries with this bit set equals\n NumPocStCurrBefore."] pub const VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE: u32 = 16; +#[doc = " \\brief RefPicSetStCurrAfter of HEVC spec variable\n Number of ReferenceFrames[] entries with this bit set equals\n NumPocStCurrAfter."] pub const VA_PICTURE_HEVC_RPS_ST_CURR_AFTER: u32 = 32; +#[doc = " \\brief RefPicSetLtCurr of HEVC spec variable\n Number of ReferenceFrames[] entries with this bit set equals\n NumPocLtCurr."] pub const VA_PICTURE_HEVC_RPS_LT_CURR: u32 = 64; pub const VA_PICTURE_VVC_INVALID: u32 = 1; +#[doc = " \\brief Long term reference picture"] pub const VA_PICTURE_VVC_LONG_TERM_REFERENCE: u32 = 2; +#[doc = " \\brief Unavailable reference picture\n This flag indicates the situation that the process of\n \"generating unavailable reference pictures\" (spec section 8.3.4)\n is required."] pub const VA_PICTURE_VVC_UNAVAILABLE_REFERENCE: u32 = 4; +#[doc = " \\brief FEI specific attribute definitions\n/\n/** @name Attribute values for VAConfigAttribFEIFunctionType\n\n This is only for VAEntrypointFEI\n The desired type should be passed to driver when creating the configuration.\n If VA_FEI_FUNCTION_ENC_PAK is set, VA_FEI_FUNCTION_ENC and VA_FEI_FUNCTION_PAK\n will be ignored if set also. Combination of VA_FEI_FUNCTION_ENC and VA_FEI_FUNCTION_PAK\n is not valid. If VA_FEI_FUNCTION_ENC is set, there will be no bitstream output.\n If VA_FEI_FUNCTION_PAK is set, two extra input buffers for PAK are needed:\n VAEncFEIMVBufferType and VAEncFEIMBCodeBufferType.\n VA_FEI_FUNCTION_ENC_PAK is recommended for best performance.\n\n/\n/**@{*/\n/** \\brief ENC only is supported"] pub const VA_FEI_FUNCTION_ENC: u32 = 1; +#[doc = " \\brief PAK only is supported"] pub const VA_FEI_FUNCTION_PAK: u32 = 2; +#[doc = " \\brief ENC_PAK is supported"] pub const VA_FEI_FUNCTION_ENC_PAK: u32 = 4; pub const VA_PICTURE_STATS_INVALID: u32 = 1; pub const VA_PICTURE_STATS_PROGRESSIVE: u32 = 0; pub const VA_PICTURE_STATS_TOP_FIELD: u32 = 2; pub const VA_PICTURE_STATS_BOTTOM_FIELD: u32 = 4; +#[doc = " \\brief picutre surface content updated indicator.\n The picture surface content is updated, it means temporary buffer like downscaled pixel data in driver\n internal needs be forced freshing"] pub const VA_PICTURE_STATS_CONTENT_UPDATED: u32 = 16; +#[doc = " @name Macroblock neighbour availability bits\n\n \\anchor api_enc_h264_mb_pred_avail_bits\n Definitions for macroblock neighbour availability bits used in\n intra prediction mode (non MBAFF only).\n\n @{\n/\n/** \\brief References macroblock in the top-left corner."] pub const VA_MB_PRED_AVAIL_TOP_LEFT: u32 = 4; +#[doc = " \\brief References macroblock above the current macroblock."] pub const VA_MB_PRED_AVAIL_TOP: u32 = 16; +#[doc = " \\brief References macroblock in the top-right corner."] pub const VA_MB_PRED_AVAIL_TOP_RIGHT: u32 = 8; +#[doc = " \\brief References macroblock on the left of the current macroblock."] pub const VA_MB_PRED_AVAIL_LEFT: u32 = 64; pub const VA_AV1_MAX_SEGMENTS: u32 = 8; pub const VA_AV1_SEG_LVL_MAX: u32 = 8; +#[doc = " @name Video blending flags */\n/**@{*/\n/** \\brief Global alpha blending."] pub const VA_BLEND_GLOBAL_ALPHA: u32 = 1; +#[doc = " \\brief Premultiplied alpha blending (RGBA surfaces only)."] pub const VA_BLEND_PREMULTIPLIED_ALPHA: u32 = 2; +#[doc = " \\brief Luma color key (YUV surfaces only)."] pub const VA_BLEND_LUMA_KEY: u32 = 16; +#[doc = " @name Video pipeline flags */\n/**@{*/\n/** \\brief Specifies whether to apply subpictures when processing a surface."] pub const VA_PROC_PIPELINE_SUBPICTURES: u32 = 1; +#[doc = " \\brief Specifies whether to apply power or performance\n optimizations to a pipeline.\n\n When processing several surfaces, it may be necessary to prioritize\n more certain pipelines than others. This flag is only a hint to the\n video processor so that it can omit certain filters to save power\n for example. Typically, this flag could be used with video surfaces\n decoded from a secondary bitstream."] pub const VA_PROC_PIPELINE_FAST: u32 = 2; +#[doc = " @name Video filter flags */\n/**@{*/\n/** \\brief Specifies whether the filter shall be present in the pipeline."] pub const VA_PROC_FILTER_MANDATORY: u32 = 1; +#[doc = " @name Pipeline end flags */\n/**@{*/\n/** \\brief Specifies the pipeline is the last."] pub const VA_PIPELINE_FLAG_END: u32 = 4; +#[doc = " @name Chroma Siting flag */\n/**@{*/\n/** vertical chroma sitting take bit 0-1, horizontal chroma sitting take bit 2-3\n vertical chromma siting | horizontal chroma sitting to be chroma sitting"] pub const VA_CHROMA_SITING_UNKNOWN: u32 = 0; +#[doc = " \\brief Chroma samples are co-sited vertically on the top with the luma samples."] pub const VA_CHROMA_SITING_VERTICAL_TOP: u32 = 1; +#[doc = " \\brief Chroma samples are not co-sited vertically with the luma samples."] pub const VA_CHROMA_SITING_VERTICAL_CENTER: u32 = 2; +#[doc = " \\brief Chroma samples are co-sited vertically on the bottom with the luma samples."] pub const VA_CHROMA_SITING_VERTICAL_BOTTOM: u32 = 3; +#[doc = " \\brief Chroma samples are co-sited horizontally on the left with the luma samples."] pub const VA_CHROMA_SITING_HORIZONTAL_LEFT: u32 = 4; +#[doc = " \\brief Chroma samples are not co-sited horizontally with the luma samples."] pub const VA_CHROMA_SITING_HORIZONTAL_CENTER: u32 = 8; +#[doc = " This is to indicate that the color-space conversion uses full range or reduced range.\n VA_SOURCE_RANGE_FULL(Full range): Y/Cb/Cr is in [0, 255]. It is mainly used\n for JPEG/JFIF formats. The combination with the BT601 flag means that\n JPEG/JFIF color-space conversion matrix is used.\n VA_SOURCE_RANGE_REDUCED(Reduced range): Y is in [16, 235] and Cb/Cr is in [16, 240].\n It is mainly used for the YUV->RGB color-space conversion in SDTV/HDTV/UHDTV."] pub const VA_SOURCE_RANGE_UNKNOWN: u32 = 0; pub const VA_SOURCE_RANGE_REDUCED: u32 = 1; pub const VA_SOURCE_RANGE_FULL: u32 = 2; +#[doc = " @name Tone Mapping flags multiple HDR mode*/\n/**@{*/\n/** \\brief Tone Mapping from HDR content to HDR display."] pub const VA_TONE_MAPPING_HDR_TO_HDR: u32 = 1; +#[doc = " \\brief Tone Mapping from HDR content to SDR display."] pub const VA_TONE_MAPPING_HDR_TO_SDR: u32 = 2; +#[doc = " \\brief Tone Mapping from HDR content to EDR display."] pub const VA_TONE_MAPPING_HDR_TO_EDR: u32 = 4; +#[doc = " \\brief Tone Mapping from SDR content to HDR display."] pub const VA_TONE_MAPPING_SDR_TO_HDR: u32 = 8; +#[doc = " @name De-interlacing flags */\n/**@{*/\n/**\n \\brief Bottom field first in the input frame.\n if this is not set then assumes top field first."] pub const VA_DEINTERLACING_BOTTOM_FIELD_FIRST: u32 = 1; +#[doc = " \\brief Bottom field used in deinterlacing.\n if this is not set then assumes top field is used."] pub const VA_DEINTERLACING_BOTTOM_FIELD: u32 = 2; +#[doc = " \\brief A single field is stored in the input frame.\n if this is not set then assumes the frame contains two interleaved fields."] pub const VA_DEINTERLACING_ONE_FIELD: u32 = 4; +#[doc = " \\brief Film Mode Detection is enabled. If enabled, driver performs inverse\n of various pulldowns, such as 3:2 pulldown.\n if this is not set then assumes FMD is disabled."] pub const VA_DEINTERLACING_FMD_ENABLE: u32 = 8; pub const VA_DEINTERLACING_SCD_ENABLE: u32 = 16; +#[doc = " @name Video Processing Human Vision System (HVS) Denoise Mode.*/\n/**@{*/\n/**\n \\brief Default Mode.\n This mode is decided in driver to the appropriate mode."] pub const VA_PROC_HVS_DENOISE_DEFAULT: u32 = 0; +#[doc = " \\brief Auto BDRate Mode.\n Indicates auto BD rate improvement in pre-processing (such as before video encoding), ignore Strength."] pub const VA_PROC_HVS_DENOISE_AUTO_BDRATE: u32 = 1; +#[doc = " \\brief Auto Subjective Mode.\n Indicates auto subjective quality improvement in pre-processing (such as before video encoding), ignore Strength."] pub const VA_PROC_HVS_DENOISE_AUTO_SUBJECTIVE: u32 = 2; +#[doc = " \\brief Manual Mode.\n Indicates manual mode, allow to adjust the denoise strength manually (need to set Strength explicitly)."] pub const VA_PROC_HVS_DENOISE_MANUAL: u32 = 3; +#[doc = " @name 3DLUT Channel Layout and Mapping */\n/**@{*/\n/** \\brief 3DLUT Channel Layout is unknown."] pub const VA_3DLUT_CHANNEL_UNKNOWN: u32 = 0; +#[doc = " \\brief 3DLUT Channel Layout is R, G, B, the default layout. Map RGB to RGB."] pub const VA_3DLUT_CHANNEL_RGB_RGB: u32 = 1; +#[doc = " \\brief 3DLUT Channel Layout is Y, U, V. Map YUV to RGB."] pub const VA_3DLUT_CHANNEL_YUV_RGB: u32 = 2; +#[doc = " \\brief 3DLUT Channel Layout is V, U, Y. Map VUY to RGB."] pub const VA_3DLUT_CHANNEL_VUY_RGB: u32 = 4; +#[doc = " \\brief Kernel DRM buffer memory type."] pub const VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM: u32 = 268435456; +#[doc = " \\brief DRM PRIME memory type (old version)\n\n This supports only single objects with restricted memory layout.\n Used with VASurfaceAttribExternalBuffers."] pub const VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME: u32 = 536870912; +#[doc = " \\brief DRM PRIME memory type\n\n Used with VADRMPRIMESurfaceDescriptor."] pub const VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2: u32 = 1073741824; +#[doc = " \\brief DRM PRIME3 memory type\n\n Used with VADRMPRIME3SurfaceDescriptor."] pub const VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_3: u32 = 134217728; #[doc = "Overview\n\nThe VA API is intended to provide an interface between a video decode/encode/processing\napplication (client) and a hardware accelerator (server), to off-load\nvideo decode/encode/processing operations from the host to the hardware accelerator at various\nentry-points.\n\nThe basic operation steps are:\n\n- Negotiate a mutually acceptable configuration with the server to lock\ndown profile, entrypoints, and other attributes that will not change on\na frame-by-frame basis.\n- Create a video decode, encode or processing context which represents a\n\"virtualized\" hardware device\n- Get and fill the render buffers with the corresponding data (depending on\nprofiles and entrypoints)\n- Pass the render buffers to the server to handle the current frame\n\nInitialization & Configuration Management\n\n- Find out supported profiles\n- Find out entrypoints for a given profile\n- Find out configuration attributes for a given profile/entrypoint pair\n- Create a configuration for use by the application"] pub type VADisplay = *mut ::std::os::raw::c_void; From cfb6797ee1b00b398d3c86e1cf45bed4123bdf92 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 27 Nov 2026 08:50:20 -0800 Subject: [PATCH 3/3] fix(nix): drop x86_64-darwin, which quest's nixpkgs no longer supports Co-Authored-By: Claude Opus 5.5 --- README.md | 3 ++- flake.nix | 79 ++++++++++++++++++++++++++++++------------------------- 2 files changed, 45 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 53916ac..13877b4 100644 --- a/README.md +++ b/README.md @@ -127,7 +127,8 @@ nix develop --command just bindgen # regenerate src/bindings/libva.rs ``` The crate compiles on macOS for development, with no link-time dependency on -libva. +libva. The dev shell covers Linux and Apple silicon; on an Intel Mac, run +`cargo check` with a local Rust toolchain instead. ## Licensing diff --git a/flake.nix b/flake.nix index 296891b..2e4f7a7 100644 --- a/flake.nix +++ b/flake.nix @@ -25,43 +25,50 @@ rust-overlay, ... }: - flake-utils.lib.eachDefaultSystem ( - system: - let - pkgs = import nixpkgs { - inherit system; - overlays = [ (import rust-overlay) ]; - }; + # quest's nixpkgs no longer supports x86_64-darwin. + flake-utils.lib.eachSystem + [ + "x86_64-linux" + "aarch64-linux" + "aarch64-darwin" + ] + ( + system: + let + pkgs = import nixpkgs { + inherit system; + overlays = [ (import rust-overlay) ]; + }; - rust-toolchain = pkgs.rust-bin.stable.latest.default.override { - extensions = [ - "rust-src" - "rust-analyzer" - "rustfmt" - "clippy" - ]; - }; - in - { - devShells.default = pkgs.mkShell { - packages = - with pkgs; - [ - rust-toolchain - just - git - cargo-deny - # `just bindgen` regenerates the checked-in bindings; builds need neither it nor libclang. - rust-bindgen - ] - ++ pkgs.lib.optionals (!pkgs.stdenv.isDarwin) [ - # libva is dlopen'd at runtime (not linked at build), so this is only - # needed to actually run vaapi encode in the devShell. macOS has no VAAPI. - libva + rust-toolchain = pkgs.rust-bin.stable.latest.default.override { + extensions = [ + "rust-src" + "rust-analyzer" + "rustfmt" + "clippy" ]; - }; + }; + in + { + devShells.default = pkgs.mkShell { + packages = + with pkgs; + [ + rust-toolchain + just + git + cargo-deny + # `just bindgen` regenerates the checked-in bindings; builds need neither it nor libclang. + rust-bindgen + ] + ++ pkgs.lib.optionals (!pkgs.stdenv.isDarwin) [ + # libva is dlopen'd at runtime (not linked at build), so this is only + # needed to actually run vaapi encode in the devShell. macOS has no VAAPI. + libva + ]; + }; - formatter = pkgs.nixfmt-tree; - } - ); + formatter = pkgs.nixfmt-tree; + } + ); }