edith_codecs
Clone
https://git.tahinli.com/Tahinli/edith_codecs.git
0 watching0 forksRust370.3 MiBc249957Tahinli3 months ago1877 commits
| 1 | //! Hand-written FFI for the subset of libva this family uses. |
| 2 | //! |
| 3 | //! # Why hand-written |
| 4 | //! |
| 5 | //! No `bindgen`: the family rule is no build-time tooling, and a generated |
| 6 | //! 40k-line binding hides exactly the thing that has to be audited — the ABI |
| 7 | //! assumptions. Everything here is transcribed from the system headers and is |
| 8 | //! short enough to read in one sitting. |
| 9 | //! |
| 10 | //! # ABI assumptions (all four are load-bearing) |
| 11 | //! |
| 12 | //! 1. **libva 1.23.0 headers**, `/usr/include/va/{va.h,va_drm.h,va_drmcommon.h}`, |
| 13 | //! target `x86_64-unknown-linux-gnu`, System V C ABI. |
| 14 | //! 2. **C `enum` is `int` (4 bytes)** on this ABI. Every VA enum is transcribed |
| 15 | //! as a plain `i32` type alias plus constants, *never* as a `#[repr(i32)]` |
| 16 | //! Rust enum: the driver writes profile/entrypoint values into buffers we |
| 17 | //! own, and a value we have no variant for would be instant UB on a real |
| 18 | //! Rust enum. Interpretation happens in the safe layer |
| 19 | //! ([`crate::caps::Profile::from_raw`]), which has an `Unknown(i32)` arm. |
| 20 | //! This is the header-drift trap that broke cros-libva at libva >= 1.23. |
| 21 | //! 3. **Struct layouts** below are checked by the `const _: () = assert!(...)` |
| 22 | //! block at the end of this file against numbers printed by |
| 23 | //! `crates/ec-va/abi-probe.c` compiled against the *system* headers. Rerun |
| 24 | //! that probe after a libva upgrade; a mismatch means this file drifted. |
| 25 | //! 4. **`VADisplay` is an opaque pointer**; we never dereference it. |
| 26 | //! |
| 27 | //! Points 1-3 are compile-time. They cannot see a libva that changes layout |
| 28 | //! *after* this crate is built, so [`crate::Display::open`] additionally |
| 29 | //! performs a **runtime** `vaInitialize` version check and refuses anything |
| 30 | //! older than 1.23 with a typed error. |
| 31 | |
| 32 | // Every item keeps its exact C spelling so that this file can be diffed |
| 33 | // against the headers by eye — the whole audit story of a hand-written FFI. |
| 34 | |
| 35 | |
| 36 | |
| 37 | // Fields keep their C names and are documented by the header line cited on |
| 38 | // each item; restating "the fourcc field is the fourcc" 60 times would bury |
| 39 | // the ABI notes that actually matter here. |
| 40 | |
| 41 | |
| 42 | use ; |
| 43 | |
| 44 | // --------------------------------------------------------------------------- |
| 45 | // Scalar types (va.h:260-262, 1580-1647, 2042, 4727) |
| 46 | // --------------------------------------------------------------------------- |
| 47 | |
| 48 | /// Opaque display handle. Never dereferenced by this crate. |
| 49 | pub type VADisplay = *mut c_void; |
| 50 | /// Return status of every VA entry point. `va.h:262`. |
| 51 | pub type VAStatus = i32; |
| 52 | /// `va.h:1580`. |
| 53 | pub type VAGenericID = c_uint; |
| 54 | pub type VAConfigID = VAGenericID; |
| 55 | pub type VAContextID = VAGenericID; |
| 56 | pub type VASurfaceID = VAGenericID; |
| 57 | pub type VABufferID = VAGenericID; |
| 58 | pub type VAImageID = VAGenericID; |
| 59 | |
| 60 | /// C enum `VAProfile` (`va.h:502`), kept as `i32`. See ABI assumption 2. |
| 61 | pub type VAProfile = i32; |
| 62 | /// C enum `VAEntrypoint` (`va.h:552`), kept as `i32`. |
| 63 | pub type VAEntrypoint = i32; |
| 64 | /// C enum `VAConfigAttribType` (`va.h:619`), kept as `i32`. |
| 65 | pub type VAConfigAttribType = i32; |
| 66 | /// C enum `VASurfaceAttribType` (`va.h:1689`), kept as `i32`. |
| 67 | pub type VASurfaceAttribType = i32; |
| 68 | /// C enum `VAGenericValueType` (`va.h:1651`), kept as `i32`. |
| 69 | pub type VAGenericValueType = i32; |
| 70 | /// C enum `VABufferType` (`va.h:2044`), kept as `i32`. |
| 71 | pub type VABufferType = i32; |
| 72 | |
| 73 | pub const VA_INVALID_ID: VAGenericID = 0xffff_ffff; |
| 74 | pub const VA_INVALID_SURFACE: VASurfaceID = VA_INVALID_ID; |
| 75 | |
| 76 | // Status codes actually branched on; the rest are reported via `vaErrorStr`. |
| 77 | // `va.h:264-309`. |
| 78 | pub const VA_STATUS_SUCCESS: VAStatus = 0x0000_0000; |
| 79 | pub const VA_STATUS_ERROR_INVALID_CONTEXT: VAStatus = 0x0000_0005; |
| 80 | pub const VA_STATUS_ERROR_UNSUPPORTED_PROFILE: VAStatus = 0x0000_000c; |
| 81 | pub const VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT: VAStatus = 0x0000_000d; |
| 82 | pub const VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT: VAStatus = 0x0000_000e; |
| 83 | pub const VA_STATUS_ERROR_MAX_NUM_EXCEEDED: VAStatus = 0x0000_000b; |
| 84 | pub const VA_STATUS_ERROR_UNIMPLEMENTED: VAStatus = 0x0000_0014; |
| 85 | pub const VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED: VAStatus = 0x0000_0013; |
| 86 | pub const VA_STATUS_ERROR_OPERATION_FAILED: VAStatus = 0x0000_0001; |
| 87 | pub const VA_STATUS_ERROR_INVALID_PARAMETER: VAStatus = 0x0000_0012; |
| 88 | |
| 89 | // Entrypoints (`va.h:552`). |
| 90 | pub const VAEntrypointVLD: VAEntrypoint = 1; |
| 91 | pub const VAEntrypointEncSlice: VAEntrypoint = 6; |
| 92 | pub const VAEntrypointEncPicture: VAEntrypoint = 7; |
| 93 | pub const VAEntrypointEncSliceLP: VAEntrypoint = 8; |
| 94 | pub const VAEntrypointVideoProc: VAEntrypoint = 10; |
| 95 | |
| 96 | // Config attribute types (`va.h:619`). |
| 97 | pub const VAConfigAttribRTFormat: VAConfigAttribType = 0; |
| 98 | pub const VAConfigAttribRateControl: VAConfigAttribType = 5; |
| 99 | pub const VAConfigAttribDecSliceMode: VAConfigAttribType = 6; |
| 100 | pub const VAConfigAttribEncPackedHeaders: VAConfigAttribType = 10; |
| 101 | pub const VAConfigAttribEncMaxRefFrames: VAConfigAttribType = 13; |
| 102 | |
| 103 | // RT formats (`va.h:1073-1090`). |
| 104 | pub const VA_RT_FORMAT_YUV420: u32 = 0x0000_0001; |
| 105 | pub const VA_RT_FORMAT_YUV422: u32 = 0x0000_0002; |
| 106 | pub const VA_RT_FORMAT_YUV444: u32 = 0x0000_0004; |
| 107 | pub const VA_RT_FORMAT_YUV400: u32 = 0x0000_0010; |
| 108 | pub const VA_RT_FORMAT_YUV420_10: u32 = 0x0000_0100; |
| 109 | pub const VA_RT_FORMAT_YUV422_10: u32 = 0x0000_0200; |
| 110 | pub const VA_RT_FORMAT_YUV444_10: u32 = 0x0000_0400; |
| 111 | pub const VA_RT_FORMAT_YUV420_12: u32 = 0x0000_1000; |
| 112 | pub const VA_RT_FORMAT_RGB32: u32 = 0x0002_0000; |
| 113 | |
| 114 | // Surface attribute types (`va.h:1689`) and flags (`va.h:1681-1684`). |
| 115 | pub const VASurfaceAttribNone: VASurfaceAttribType = 0; |
| 116 | pub const VASurfaceAttribPixelFormat: VASurfaceAttribType = 1; |
| 117 | pub const VASurfaceAttribMinWidth: VASurfaceAttribType = 2; |
| 118 | pub const VASurfaceAttribMaxWidth: VASurfaceAttribType = 3; |
| 119 | pub const VASurfaceAttribMinHeight: VASurfaceAttribType = 4; |
| 120 | pub const VASurfaceAttribMaxHeight: VASurfaceAttribType = 5; |
| 121 | pub const VASurfaceAttribMemoryType: VASurfaceAttribType = 6; |
| 122 | pub const VASurfaceAttribUsageHint: VASurfaceAttribType = 8; |
| 123 | |
| 124 | pub const VA_SURFACE_ATTRIB_GETTABLE: u32 = 0x0000_0001; |
| 125 | pub const VA_SURFACE_ATTRIB_SETTABLE: u32 = 0x0000_0002; |
| 126 | |
| 127 | pub const VA_SURFACE_ATTRIB_USAGE_HINT_GENERIC: u32 = 0x0000_0000; |
| 128 | pub const VA_SURFACE_ATTRIB_USAGE_HINT_DECODER: u32 = 0x0000_0001; |
| 129 | pub const VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER: u32 = 0x0000_0002; |
| 130 | pub const VA_SURFACE_ATTRIB_USAGE_HINT_EXPORT: u32 = 0x0000_0020; |
| 131 | |
| 132 | // Generic value discriminants (`va.h:1651`). |
| 133 | pub const VAGenericValueTypeInteger: VAGenericValueType = 1; |
| 134 | pub const VAGenericValueTypeFloat: VAGenericValueType = 2; |
| 135 | pub const VAGenericValueTypePointer: VAGenericValueType = 3; |
| 136 | pub const VAGenericValueTypeFunc: VAGenericValueType = 4; |
| 137 | |
| 138 | // Buffer types actually used by decode/encode paths (`va.h:2044`). |
| 139 | pub const VAPictureParameterBufferType: VABufferType = 0; |
| 140 | pub const VAIQMatrixBufferType: VABufferType = 1; |
| 141 | pub const VASliceParameterBufferType: VABufferType = 4; |
| 142 | pub const VASliceDataBufferType: VABufferType = 5; |
| 143 | pub const VAImageBufferType: VABufferType = 9; |
| 144 | pub const VAProbabilityBufferType: VABufferType = 13; |
| 145 | pub const VAEncCodedBufferType: VABufferType = 21; |
| 146 | pub const VAEncSequenceParameterBufferType: VABufferType = 22; |
| 147 | pub const VAEncPictureParameterBufferType: VABufferType = 23; |
| 148 | pub const VAEncSliceParameterBufferType: VABufferType = 24; |
| 149 | pub const VAEncPackedHeaderParameterBufferType: VABufferType = 25; |
| 150 | pub const VAEncPackedHeaderDataBufferType: VABufferType = 26; |
| 151 | pub const VAEncMiscParameterBufferType: VABufferType = 27; |
| 152 | /// `va.h:2086`, the VPP pipeline parameter buffer. |
| 153 | pub const VAProcPipelineParameterBufferType: VABufferType = 41; |
| 154 | |
| 155 | // VPP filter types (`va_vpp.h:238-258`); only `None` and the HDR tone-mapping |
| 156 | // filter are used here, but the whole ordinal run is transcribed since a |
| 157 | // caller matching `vaQueryVideoProcFilters` output needs every value to tell |
| 158 | // "no filter" from "a filter this build has no constant for". |
| 159 | pub type VAProcFilterType = i32; |
| 160 | pub const VAProcFilterNone: VAProcFilterType = 0; |
| 161 | pub const VAProcFilterNoiseReduction: VAProcFilterType = 1; |
| 162 | pub const VAProcFilterDeinterlacing: VAProcFilterType = 2; |
| 163 | pub const VAProcFilterSharpening: VAProcFilterType = 3; |
| 164 | pub const VAProcFilterColorBalance: VAProcFilterType = 4; |
| 165 | pub const VAProcFilterSkinToneEnhancement: VAProcFilterType = 5; |
| 166 | pub const VAProcFilterTotalColorCorrection: VAProcFilterType = 6; |
| 167 | pub const VAProcFilterHVSNoiseReduction: VAProcFilterType = 7; |
| 168 | pub const VAProcFilterHighDynamicRangeToneMapping: VAProcFilterType = 8; |
| 169 | pub const VAProcFilter3DLUT: VAProcFilterType = 9; |
| 170 | /// Sizes a `vaQueryVideoProcFilters` output array; never returned by it. |
| 171 | pub const VAProcFilterCount: VAProcFilterType = 10; |
| 172 | |
| 173 | /// `VAProcColorStandardType`, `va_vpp.h:306`. `0` ("None") is what this crate |
| 174 | /// always passes: implicit colour handling, no explicit conversion request. |
| 175 | pub type VAProcColorStandardType = i32; |
| 176 | /// `VAProcMode`, `va_vpp.h:447`. `0` is the driver-chosen default pipeline. |
| 177 | pub type VAProcMode = i32; |
| 178 | |
| 179 | // Packed header bits an encoder may take over (`va.h:1199-1231`). |
| 180 | pub const VA_ENC_PACKED_HEADER_NONE: u32 = 0x0000_0000; |
| 181 | pub const VA_ENC_PACKED_HEADER_SEQUENCE: u32 = 0x0000_0001; |
| 182 | pub const VA_ENC_PACKED_HEADER_PICTURE: u32 = 0x0000_0002; |
| 183 | pub const VA_ENC_PACKED_HEADER_SLICE: u32 = 0x0000_0004; |
| 184 | pub const VA_ENC_PACKED_HEADER_MISC: u32 = 0x0000_0008; |
| 185 | pub const VA_ENC_PACKED_HEADER_RAW_DATA: u32 = 0x0000_0010; |
| 186 | |
| 187 | // Rate control modes (`va.h:1108-1164`). |
| 188 | pub const VA_RC_NONE: u32 = 0x0000_0001; |
| 189 | pub const VA_RC_CBR: u32 = 0x0000_0002; |
| 190 | pub const VA_RC_VBR: u32 = 0x0000_0004; |
| 191 | pub const VA_RC_CQP: u32 = 0x0000_0010; |
| 192 | |
| 193 | /// `vaCreateContext` flag: sequence contains only progressive frames (`va.h:1919`). |
| 194 | pub const VA_PROGRESSIVE: c_int = 0x1; |
| 195 | |
| 196 | // DRM PRIME memory types and export flags (`va_drmcommon.h:78-94`, `va.h:4130-4150`). |
| 197 | pub const VA_SURFACE_ATTRIB_MEM_TYPE_VA: u32 = 0x0000_0001; |
| 198 | pub const VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM: u32 = 0x1000_0000; |
| 199 | pub const VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME: u32 = 0x2000_0000; |
| 200 | pub const VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2: u32 = 0x4000_0000; |
| 201 | |
| 202 | pub const VA_EXPORT_SURFACE_READ_ONLY: u32 = 0x0001; |
| 203 | pub const VA_EXPORT_SURFACE_WRITE_ONLY: u32 = 0x0002; |
| 204 | pub const VA_EXPORT_SURFACE_READ_WRITE: u32 = 0x0003; |
| 205 | pub const VA_EXPORT_SURFACE_SEPARATE_LAYERS: u32 = 0x0004; |
| 206 | pub const VA_EXPORT_SURFACE_COMPOSED_LAYERS: u32 = 0x0008; |
| 207 | |
| 208 | // FourCCs used by the family (`va.h:4400-4700`). |
| 209 | pub const VA_FOURCC_NV12: u32 = 0x3231_564e; |
| 210 | pub const VA_FOURCC_P010: u32 = 0x3031_3050; |
| 211 | pub const VA_FOURCC_I420: u32 = 0x3032_3449; |
| 212 | pub const VA_FOURCC_YV12: u32 = 0x3231_5659; |
| 213 | |
| 214 | // --------------------------------------------------------------------------- |
| 215 | // Structs |
| 216 | // --------------------------------------------------------------------------- |
| 217 | |
| 218 | /// `VAConfigAttrib`, `va.h:1155`. |
| 219 | |
| 220 | |
| 221 | |
| 222 | |
| 223 | |
| 224 | |
| 225 | |
| 226 | /// The `value` union of `VAGenericValue`, `va.h:1663-1673`. |
| 227 | /// |
| 228 | /// Only ever read after checking the sibling `type_` discriminant. |
| 229 | |
| 230 | |
| 231 | pub union VAGenericValueUnion |
| 232 | |
| 233 | |
| 234 | |
| 235 | |
| 236 | |
| 237 | |
| 238 | /// `VAGenericValue`, `va.h:1661`. |
| 239 | |
| 240 | |
| 241 | |
| 242 | |
| 243 | |
| 244 | |
| 245 | |
| 246 | /// `VASurfaceAttrib`, `va.h:1741`. |
| 247 | |
| 248 | |
| 249 | |
| 250 | |
| 251 | |
| 252 | |
| 253 | |
| 254 | |
| 255 | /// `VAImageFormat`, `va.h:4712`. `va_reserved` is `VA_PADDING_LOW` = 4 u32s. |
| 256 | |
| 257 | |
| 258 | |
| 259 | |
| 260 | |
| 261 | |
| 262 | |
| 263 | |
| 264 | |
| 265 | |
| 266 | |
| 267 | |
| 268 | |
| 269 | |
| 270 | /// `VAImage`, `va.h:4729`. |
| 271 | |
| 272 | |
| 273 | |
| 274 | |
| 275 | |
| 276 | |
| 277 | |
| 278 | |
| 279 | |
| 280 | |
| 281 | |
| 282 | |
| 283 | |
| 284 | |
| 285 | |
| 286 | |
| 287 | |
| 288 | |
| 289 | |
| 290 | |
| 291 | |
| 292 | |
| 293 | |
| 294 | |
| 295 | |
| 296 | |
| 297 | |
| 298 | |
| 299 | /// One DRM object of a `VADRMPRIMESurfaceDescriptor`, `va_drmcommon.h:139-147`. |
| 300 | |
| 301 | |
| 302 | |
| 303 | |
| 304 | |
| 305 | |
| 306 | |
| 307 | |
| 308 | /// One layer of a `VADRMPRIMESurfaceDescriptor`, `va_drmcommon.h:151-164`. |
| 309 | |
| 310 | |
| 311 | |
| 312 | |
| 313 | |
| 314 | |
| 315 | |
| 316 | |
| 317 | |
| 318 | |
| 319 | /// `VADRMPRIMESurfaceDescriptor`, `va_drmcommon.h:130`. Used with |
| 320 | /// [`VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2`]. |
| 321 | |
| 322 | |
| 323 | |
| 324 | |
| 325 | |
| 326 | |
| 327 | |
| 328 | |
| 329 | |
| 330 | |
| 331 | |
| 332 | |
| 333 | |
| 334 | |
| 335 | |
| 336 | |
| 337 | |
| 338 | |
| 339 | |
| 340 | |
| 341 | |
| 342 | /// `VARectangle`, `va.h:406`. |
| 343 | |
| 344 | |
| 345 | |
| 346 | |
| 347 | |
| 348 | |
| 349 | |
| 350 | |
| 351 | |
| 352 | /// `VAProcColorProperties`, `va_vpp.h:683`. |
| 353 | |
| 354 | |
| 355 | |
| 356 | |
| 357 | |
| 358 | |
| 359 | |
| 360 | |
| 361 | |
| 362 | |
| 363 | |
| 364 | /// `VAProcPipelineParameterBuffer`, `va_vpp.h:886`. |
| 365 | /// |
| 366 | /// Every field this crate does not set goes to its zero/NULL default, which |
| 367 | /// libva documents as "whole surface, no filters, driver-chosen colour |
| 368 | /// handling" (va_vpp.h:899,920,956,976) — the plain conversion this crate |
| 369 | /// asks for. `va_reserved` must stay zeroed (`VA_PADDING_LARGE` - 16 = 16 |
| 370 | /// `u32`s on a 64-bit target, the layout the struct trailer promises). |
| 371 | |
| 372 | |
| 373 | |
| 374 | |
| 375 | |
| 376 | |
| 377 | |
| 378 | |
| 379 | |
| 380 | |
| 381 | |
| 382 | |
| 383 | |
| 384 | |
| 385 | |
| 386 | |
| 387 | |
| 388 | |
| 389 | |
| 390 | |
| 391 | |
| 392 | |
| 393 | |
| 394 | |
| 395 | |
| 396 | |
| 397 | |
| 398 | |
| 399 | |
| 400 | |
| 401 | |
| 402 | |
| 403 | |
| 404 | |
| 405 | |
| 406 | |
| 407 | |
| 408 | |
| 409 | |
| 410 | |
| 411 | |
| 412 | // --------------------------------------------------------------------------- |
| 413 | // Entry points |
| 414 | // --------------------------------------------------------------------------- |
| 415 | |
| 416 | |
| 417 | unsafe extern "C" |
| 418 | |
| 419 | |
| 420 | |
| 421 | |
| 422 | |
| 423 | |
| 424 | |
| 425 | |
| 426 | |
| 427 | |
| 428 | |
| 429 | |
| 430 | |
| 431 | |
| 432 | |
| 433 | |
| 434 | |
| 435 | |
| 436 | |
| 437 | |
| 438 | |
| 439 | |
| 440 | |
| 441 | |
| 442 | |
| 443 | |
| 444 | |
| 445 | |
| 446 | |
| 447 | |
| 448 | |
| 449 | |
| 450 | |
| 451 | |
| 452 | |
| 453 | |
| 454 | |
| 455 | |
| 456 | |
| 457 | |
| 458 | |
| 459 | |
| 460 | |
| 461 | |
| 462 | |
| 463 | |
| 464 | |
| 465 | |
| 466 | |
| 467 | |
| 468 | |
| 469 | |
| 470 | |
| 471 | |
| 472 | |
| 473 | |
| 474 | |
| 475 | |
| 476 | |
| 477 | |
| 478 | |
| 479 | |
| 480 | |
| 481 | |
| 482 | |
| 483 | |
| 484 | |
| 485 | |
| 486 | |
| 487 | |
| 488 | |
| 489 | |
| 490 | |
| 491 | |
| 492 | |
| 493 | |
| 494 | |
| 495 | |
| 496 | |
| 497 | |
| 498 | |
| 499 | |
| 500 | |
| 501 | |
| 502 | |
| 503 | |
| 504 | |
| 505 | |
| 506 | |
| 507 | |
| 508 | |
| 509 | |
| 510 | |
| 511 | |
| 512 | |
| 513 | |
| 514 | |
| 515 | |
| 516 | |
| 517 | |
| 518 | |
| 519 | |
| 520 | |
| 521 | |
| 522 | |
| 523 | |
| 524 | |
| 525 | |
| 526 | |
| 527 | |
| 528 | |
| 529 | |
| 530 | |
| 531 | |
| 532 | |
| 533 | |
| 534 | |
| 535 | |
| 536 | |
| 537 | |
| 538 | |
| 539 | |
| 540 | |
| 541 | |
| 542 | |
| 543 | |
| 544 | |
| 545 | |
| 546 | |
| 547 | |
| 548 | |
| 549 | |
| 550 | |
| 551 | |
| 552 | |
| 553 | |
| 554 | |
| 555 | |
| 556 | |
| 557 | |
| 558 | |
| 559 | |
| 560 | |
| 561 | |
| 562 | |
| 563 | |
| 564 | |
| 565 | |
| 566 | |
| 567 | |
| 568 | |
| 569 | |
| 570 | |
| 571 | |
| 572 | |
| 573 | |
| 574 | |
| 575 | |
| 576 | |
| 577 | |
| 578 | |
| 579 | |
| 580 | |
| 581 | |
| 582 | |
| 583 | |
| 584 | |
| 585 | |
| 586 | |
| 587 | |
| 588 | |
| 589 | |
| 590 | |
| 591 | |
| 592 | |
| 593 | |
| 594 | |
| 595 | |
| 596 | |
| 597 | |
| 598 | |
| 599 | |
| 600 | |
| 601 | |
| 602 | |
| 603 | |
| 604 | |
| 605 | |
| 606 | |
| 607 | |
| 608 | unsafe extern "C" |
| 609 | |
| 610 | |
| 611 | |
| 612 | |
| 613 | // --------------------------------------------------------------------------- |
| 614 | // ABI transcription check |
| 615 | // --------------------------------------------------------------------------- |
| 616 | // |
| 617 | // Reference output of `crates/ec-va/abi-probe.c` compiled against |
| 618 | // /usr/include/va (libva 1.23.0) with gcc on x86_64: |
| 619 | // |
| 620 | // VAConfigAttrib size=8 align=4 type=0 value=4 |
| 621 | // VAGenericValue size=16 align=8 type=0 value=8 |
| 622 | // VASurfaceAttrib size=24 align=8 type=0 flags=4 value=8 |
| 623 | // VAImageFormat size=48 align=4 fourcc=0 .. va_reserved=32 |
| 624 | // VAImage size=120 align=4 image_id=0 format=4 buf=52 |
| 625 | // width=56 height=58 data_size=60 |
| 626 | // num_planes=64 pitches=68 offsets=80 |
| 627 | // num_palette_entries=92 entry_bytes=96 |
| 628 | // component_order=100 va_reserved=104 |
| 629 | // VADRMPRIMESurfaceDescriptor size=312 align=8 fourcc=0 width=4 height=8 |
| 630 | // num_objects=12 objects=16 |
| 631 | // num_layers=80 layers=84 |
| 632 | // object elem size=16, layer elem size=56 |
| 633 | // VARectangle size=8 align=2 |
| 634 | const _: = |
| 635 | |
| 636 | |
| 637 | |
| 638 | |
| 639 | |
| 640 | |
| 641 | |
| 642 | |
| 643 | |
| 644 | |
| 645 | |
| 646 | |
| 647 | |
| 648 | |
| 649 | |
| 650 | |
| 651 | |
| 652 | |
| 653 | |
| 654 | |
| 655 | |
| 656 | |
| 657 | |
| 658 | |
| 659 | |
| 660 | |
| 661 | |
| 662 | |
| 663 | |
| 664 | |
| 665 | |
| 666 | |
| 667 | |
| 668 | |
| 669 | |
| 670 | |
| 671 | |
| 672 | |
| 673 | |
| 674 | |
| 675 | |
| 676 | |
| 677 | |
| 678 | |
| 679 | |
| 680 | |
| 681 | |
| 682 | |
| 683 | |
| 684 | |
| 685 | |
| 686 | |
| 687 | |
| 688 | |
| 689 | |
| 690 | |
| 691 | |
| 692 | |
| 693 | |
| 694 | |
| 695 | |
| 696 | |
| 697 | |
| 698 | ; |