edith
Clone
https://git.tahinli.com/Tahinli/edith.git
0 watching0 forksRust18.3 MiBff99ad6Tahinli6 days ago1055 commits
| 1 | //! Which decoder and which encoder a job really runs on -- the introspection a |
| 2 | //! front-end shows before an operation and while it runs. |
| 3 | //! |
| 4 | //! The point of every assertion here is *truthfulness*, not a particular seat: |
| 5 | //! this box may or may not have a working plugin, and a test that demanded |
| 6 | //! hardware would only be measuring the machine. What must hold is that the |
| 7 | //! answer given before an operation is the answer the operation then gives, and |
| 8 | //! that neither of them ever names a decoder that could not have run (software |
| 9 | //! HEVC, for one, does not exist here). |
| 10 | |
| 11 | use PathBuf; |
| 12 | use ; |
| 13 | |
| 14 | use Codec; |
| 15 | use ; |
| 16 | use ; |
| 17 | use Scratch; |
| 18 | use ; |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | /// A still has no coded stream and no decoder to pick, and it must say so |
| 31 | /// rather than borrowing the picture path's answer. |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | /// H.264 has both seats, so the probe may legitimately answer either -- but it |
| 40 | /// must answer one of them, and it must name the codec. |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | /// HEVC has a software seat here (`ec-h265`). A box with the plugin answers |
| 52 | /// hardware; a box without it answers the software seat -- and is never refused, |
| 53 | /// since the file plays either way. |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | /// The running session reports the decoder its *worker* opened, and it agrees |
| 69 | /// with what the probe said before anything played. This is the whole point of |
| 70 | /// the cell: the worker writes it where the fallback happens, so a hardware |
| 71 | /// session that dropped to software could only be seen here. |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | /// What the export card says before the button and what the progress line says |
| 93 | /// during the job are the same two answers, from the same two functions: the |
| 94 | /// picture's seat is probed by opening the very encoder the export opens, and |
| 95 | /// the sound's is decided outright. A drift between them is a front-end lying |
| 96 | /// about the machine, which is exactly what this whole surface is for. |
| 97 | /// |
| 98 | /// Every picture format, because each one is a different pair of seats: H.264 |
| 99 | /// through `ec-h264` or the plugin, and AV1 through `rav1e` in either |
| 100 | /// container -- a container is not an encoder, and the card must not say it is. |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | /// The same pin, swept over the two things that *move* the seat under a user's |
| 146 | /// hand: the picture size (the plugin refuses HEVC below the driver's 384x384 |
| 147 | /// floor and the software intra encoder takes the file) and the seat picked on |
| 148 | /// the card ([`engine::export::EncoderSeat`]). The export card reads |
| 149 | /// [`engine::export::planned_video`] for every one of these combinations, so a |
| 150 | /// size that flips the seat and a card that kept the old line is the exact lie |
| 151 | /// this sweep exists to catch. |
| 152 | /// |
| 153 | /// Not swept: the hardware AV1 seat, which is what `Hardware` means for the two |
| 154 | /// AV1 rows. Opening it hung this box's GPU into a driver reset (2026-08-10) and |
| 155 | /// a test suite is not the place to find out whether that is fixed -- `av1.rs` |
| 156 | /// keeps that one `#[ignore]`d and by name -- so `Hardware` is swept over the |
| 157 | /// formats whose seat is safe to open, and the AV1 pair only over the seats that |
| 158 | /// open no plugin at all. |
| 159 | |
| 160 | |
| 161 | |
| 162 | |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 | |
| 168 | |
| 169 | |
| 170 | |
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | |
| 176 | |
| 177 | |
| 178 | |
| 179 | |
| 180 | |
| 181 | |
| 182 | |
| 183 | |
| 184 | |
| 185 | |
| 186 | |
| 187 | |
| 188 | |
| 189 | |
| 190 | |
| 191 | |
| 192 | |
| 193 | |
| 194 | |
| 195 | |
| 196 | |
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | |
| 203 | |
| 204 | |
| 205 | |
| 206 | |
| 207 | |
| 208 | |
| 209 | |
| 210 | |
| 211 | |
| 212 | |
| 213 | |
| 214 | |
| 215 | |
| 216 | |
| 217 | |
| 218 | |
| 219 | |
| 220 | |
| 221 | |
| 222 | |
| 223 | |
| 224 | |
| 225 | |
| 226 | |
| 227 | |
| 228 | |
| 229 | |
| 230 | |
| 231 | |
| 232 | |
| 233 | |
| 234 | |
| 235 | |
| 236 | |
| 237 | |
| 238 | |
| 239 | |
| 240 | |
| 241 | |
| 242 | |
| 243 | |
| 244 | |
| 245 | |
| 246 | /// A WAV job has no picture at all and still names what writes it, so an audio |
| 247 | /// export is not a progress line with nothing to say. |
| 248 | |
| 249 | |
| 250 | |
| 251 | |
| 252 | |
| 253 | |
| 254 | |
| 255 | |
| 256 | |
| 257 | |
| 258 | |
| 259 | |
| 260 | |
| 261 | |
| 262 | |
| 263 | |
| 264 | |
| 265 | |
| 266 | |
| 267 | |
| 268 | |
| 269 | |
| 270 | |
| 271 | |
| 272 | |
| 273 | |
| 274 | |
| 275 | |
| 276 | |
| 277 | |
| 278 | |
| 279 | |
| 280 | |
| 281 | |
| 282 | |
| 283 | |
| 284 | |
| 285 | |
| 286 | |
| 287 | |
| 288 | |
| 289 | |
| 290 | |
| 291 | /// A mixed timeline cannot be copied, and the card must say so *before* the |
| 292 | /// export: a fader and a limiter both live where the lanes are summed, and a |
| 293 | /// copied AAC packet was never summed at all -- so an mp4 of such a timeline is |
| 294 | /// decoded and re-encoded, and the line names the encoder that will do it. |
| 295 | /// |
| 296 | /// The truthfulness rule of this whole file, applied to the one edit that used |
| 297 | /// to be invisible to it. |
| 298 | |
| 299 | |
| 300 | |
| 301 | |
| 302 | |
| 303 | |
| 304 | |
| 305 | |
| 306 | |
| 307 | |
| 308 | |
| 309 | |
| 310 | |
| 311 | |
| 312 | |
| 313 | |
| 314 | |
| 315 | |
| 316 | |
| 317 | |
| 318 | |
| 319 | |
| 320 | |
| 321 | |
| 322 | |
| 323 | |
| 324 | |
| 325 | |
| 326 | |
| 327 | |
| 328 | |
| 329 | |
| 330 | |
| 331 | |
| 332 | |
| 333 | |
| 334 | |
| 335 | |
| 336 | |
| 337 | |
| 338 | |
| 339 | |
| 340 | |
| 341 | |
| 342 | |
| 343 | |
| 344 | |
| 345 | |
| 346 | |
| 347 | |
| 348 | |
| 349 | |
| 350 | |
| 351 | |
| 352 | |
| 353 | |
| 354 | |
| 355 | |
| 356 | |
| 357 | |
| 358 | /// The half-line an export shows while its sound is still being mixed on the |
| 359 | /// thread beside the picture (`engine::export::publish_seats`). An mp4 job |
| 360 | /// overlaps the two passes, so this is what the *first* line out of one says |
| 361 | /// about a codec that has not run yet. |
| 362 | const MIXING: &str = "working out the sound…"; |
| 363 | |
| 364 | /// The encoders line a running job settles on: published as soon as the picture |
| 365 | /// seat is open, and completed once the sound has been measured. Waiting for the |
| 366 | /// second half is what makes this the line a card shows rather than a snapshot |
| 367 | /// of an export mid-decision -- and, because a job that ends without ever |
| 368 | /// completing it fails here, it is also the pin on that completion happening at |
| 369 | /// all, whichever of the two passes finishes first. |
| 370 | |
| 371 | |
| 372 | |
| 373 | |
| 374 | |
| 375 | |
| 376 | |
| 377 | |
| 378 | |
| 379 | |
| 380 | |
| 381 | |
| 382 | |
| 383 | |
| 384 | |
| 385 | |
| 386 | |
| 387 | |
| 388 | |
| 389 | |
| 390 | |
| 391 | /// Waits for a cancelled job to settle, so its `.part` is gone before the test |
| 392 | /// ends -- and so no worker outlives the process holding a VA-API session. |
| 393 | |
| 394 | |
| 395 | |
| 396 | |
| 397 | |
| 398 | |
| 399 | |
| 400 | |
| 401 | |
| 402 | |
| 403 |