Integration tests learn the sample-rate argument
Browse files at this commitc6b5eb752eaa24935437267fd1f0c21e9c633aa8Parent: 4e4ec16- fix
- integration tests learn the sample-rate argument
13 changed files +51 -26
- crates/engine/tests/audio_export.rs +16 -4
- crates/engine/tests/av1.rs +1 -1
- crates/engine/tests/eq_audio.rs +3 -2
- crates/engine/tests/export.rs +11 -11
- crates/engine/tests/export_subs.rs +5 -0
- crates/engine/tests/hevc.rs +1 -1
- crates/engine/tests/hevc_hvc1.rs +1 -1
- crates/engine/tests/import_mp4_subs.rs +1 -0
- crates/engine/tests/lanes.rs +3 -3
- crates/engine/tests/opus_export.rs +2 -0
- crates/engine/tests/silence.rs +1 -0
- crates/engine/tests/speed.rs +5 -2
- crates/engine/tests/vp9.rs +1 -1
crates/engine/tests/audio_export.rsmodified+16 -4
| @@ -227,6 +227,7 @@ fn exports_the_timeline_as_a_wav() { | |||
| 227 | format: Format::Wav, | 227 | format: Format::Wav, |
| 228 | ..Default::default() | 228 | ..Default::default() |
| 229 | }, | 229 | }, |
| 230 | + None, | ||
| 230 | ); | 231 | ); |
| 231 | wait(&handle, Duration::from_secs(60)).expect("wav export"); | 232 | wait(&handle, Duration::from_secs(60)).expect("wav export"); |
| 232 | assert_eq!(handle.progress(), 1.0, "finished at full progress"); | 233 | assert_eq!(handle.progress(), 1.0, "finished at full progress"); |
| @@ -249,6 +250,7 @@ fn exports_the_timeline_as_a_flac() { | |||
| 249 | format: Format::Flac, | 250 | format: Format::Flac, |
| 250 | ..Default::default() | 251 | ..Default::default() |
| 251 | }, | 252 | }, |
| 253 | + None, | ||
| 252 | ); | 254 | ); |
| 253 | wait(&handle, Duration::from_secs(60)).expect("flac export"); | 255 | wait(&handle, Duration::from_secs(60)).expect("flac export"); |
| 254 | assert_eq!(handle.progress(), 1.0, "finished at full progress"); | 256 | assert_eq!(handle.progress(), 1.0, "finished at full progress"); |
| @@ -287,6 +289,7 @@ fn exports_the_timeline_as_an_mp3() { | |||
| 287 | format: Format::Mp3, | 289 | format: Format::Mp3, |
| 288 | ..Default::default() | 290 | ..Default::default() |
| 289 | }, | 291 | }, |
| 292 | + None, | ||
| 290 | ); | 293 | ); |
| 291 | wait(&handle, Duration::from_secs(120)).expect("mp3 export"); | 294 | wait(&handle, Duration::from_secs(120)).expect("mp3 export"); |
| 292 | assert_eq!(handle.progress(), 1.0, "finished at full progress"); | 295 | assert_eq!(handle.progress(), 1.0, "finished at full progress"); |
| @@ -363,7 +366,7 @@ fn a_still_and_a_song_export_as_an_mp4_with_sound() { | |||
| 363 | color: Default::default(), | 366 | color: Default::default(), |
| 364 | }; | 367 | }; |
| 365 | let out = out_path("still_song", "mp4"); | 368 | let out = out_path("still_song", "mp4"); |
| 366 | - let handle = engine::export::start(project, meta, &out, &ExportSettings::default()); | 369 | + let handle = engine::export::start(project, meta, &out, &ExportSettings::default(), None); |
| 367 | wait(&handle, Duration::from_secs(300)).expect("an mp4 of a still under a song"); | 370 | wait(&handle, Duration::from_secs(300)).expect("an mp4 of a still under a song"); |
| 368 | 371 | ||
| 369 | // Picture: two seconds of it, through the demuxer an import uses. | 372 | // Picture: two seconds of it, through the demuxer an import uses. |
| @@ -431,7 +434,8 @@ fn a_fader_is_one_tracks_own_and_the_limiter_holds_the_sum() { | |||
| 431 | format: Format::Wav, | 434 | format: Format::Wav, |
| 432 | ..Default::default() | 435 | ..Default::default() |
| 433 | }, | 436 | }, |
| 434 | - ); | 437 | + None, |
| 438 | + ); | ||
| 435 | wait(&handle, Duration::from_secs(60)).unwrap_or_else(|e| panic!("{name}: {e}")); | 439 | wait(&handle, Duration::from_secs(60)).unwrap_or_else(|e| panic!("{name}: {e}")); |
| 436 | let (audio, samples) = decode(&out); | 440 | let (audio, samples) = decode(&out); |
| 437 | let peak = samples.iter().fold(0.0f32, |m, s| m.max(s.abs())); | 441 | let peak = samples.iter().fold(0.0f32, |m, s| m.max(s.abs())); |
| @@ -521,6 +525,7 @@ fn a_cancelled_audio_export_leaves_no_file() { | |||
| 521 | format: Format::Wav, | 525 | format: Format::Wav, |
| 522 | ..Default::default() | 526 | ..Default::default() |
| 523 | }, | 527 | }, |
| 528 | + None, | ||
| 524 | ); | 529 | ); |
| 525 | handle.cancel(); | 530 | handle.cancel(); |
| 526 | let outcome = wait(&handle, Duration::from_secs(120)); | 531 | let outcome = wait(&handle, Duration::from_secs(120)); |
| @@ -605,7 +610,8 @@ fn the_sound_is_written_at_the_rate_that_was_asked_for() { | |||
| 605 | audio_kbps: kbps, | 610 | audio_kbps: kbps, |
| 606 | ..Default::default() | 611 | ..Default::default() |
| 607 | }, | 612 | }, |
| 608 | - ); | 613 | + None, |
| 614 | + ); | ||
| 609 | wait(&handle, Duration::from_secs(120)).expect("mp3 export"); | 615 | wait(&handle, Duration::from_secs(120)).expect("mp3 export"); |
| 610 | let got = mp3_declared_kbps(&out); | 616 | let got = mp3_declared_kbps(&out); |
| 611 | println!("mp3 asked {kbps:?}, header says {got} kbps"); | 617 | println!("mp3 asked {kbps:?}, header says {got} kbps"); |
| @@ -681,7 +687,8 @@ fn the_sound_is_written_at_the_rate_that_was_asked_for() { | |||
| 681 | audio_kbps: Some(want), | 687 | audio_kbps: Some(want), |
| 682 | ..Default::default() | 688 | ..Default::default() |
| 683 | }, | 689 | }, |
| 684 | - ); | 690 | + None, |
| 691 | + ); | ||
| 685 | wait(&handle, Duration::from_secs(300)).expect("an mp4 of a still under a song"); | 692 | wait(&handle, Duration::from_secs(300)).expect("an mp4 of a still under a song"); |
| 686 | let got = mp4_aac_kbps(&out, f64::from(RATE)); | 693 | let got = mp4_aac_kbps(&out, f64::from(RATE)); |
| 687 | println!("mp4 asked {want} kbps, the track measures {got:.1}"); | 694 | println!("mp4 asked {want} kbps, the track measures {got:.1}"); |
| @@ -737,6 +744,7 @@ fn a_silent_clip_exports_as_silence_over_its_own_span() { | |||
| 737 | format: Format::Wav, | 744 | format: Format::Wav, |
| 738 | ..Default::default() | 745 | ..Default::default() |
| 739 | }, | 746 | }, |
| 747 | + None, | ||
| 740 | ); | 748 | ); |
| 741 | wait(&handle, Duration::from_secs(60)).expect("wav export"); | 749 | wait(&handle, Duration::from_secs(60)).expect("wav export"); |
| 742 | let (audio, samples) = decode(&out); | 750 | let (audio, samples) = decode(&out); |
| @@ -771,6 +779,7 @@ fn a_silent_timeline_refuses_an_audio_export() { | |||
| 771 | format: Format::Wav, | 779 | format: Format::Wav, |
| 772 | ..Default::default() | 780 | ..Default::default() |
| 773 | }, | 781 | }, |
| 782 | + None, | ||
| 774 | ); | 783 | ); |
| 775 | let text = wait(&handle, Duration::from_secs(60)) | 784 | let text = wait(&handle, Duration::from_secs(60)) |
| 776 | .expect_err("no audio to export") | 785 | .expect_err("no audio to export") |
| @@ -821,6 +830,7 @@ fn a_51_ac3_source_round_trips_through_a_wav() { | |||
| 821 | format: Format::Wav, | 830 | format: Format::Wav, |
| 822 | ..Default::default() | 831 | ..Default::default() |
| 823 | }, | 832 | }, |
| 833 | + None, | ||
| 824 | ); | 834 | ); |
| 825 | wait(&handle, Duration::from_secs(60)).expect("wav export of an AC-3 source"); | 835 | wait(&handle, Duration::from_secs(60)).expect("wav export of an AC-3 source"); |
| 826 | 836 | ||
| @@ -862,6 +872,7 @@ fn exports_the_timeline_as_an_ogg_vorbis() { | |||
| 862 | format: Format::Ogg, | 872 | format: Format::Ogg, |
| 863 | ..Default::default() | 873 | ..Default::default() |
| 864 | }, | 874 | }, |
| 875 | + None, | ||
| 865 | ); | 876 | ); |
| 866 | wait(&handle, Duration::from_secs(180)).expect("ogg export"); | 877 | wait(&handle, Duration::from_secs(180)).expect("ogg export"); |
| 867 | assert_eq!(handle.progress(), 1.0, "finished at full progress"); | 878 | assert_eq!(handle.progress(), 1.0, "finished at full progress"); |
| @@ -947,6 +958,7 @@ fn a_mono_timeline_exports_as_dual_mono_ogg() { | |||
| 947 | format: Format::Ogg, | 958 | format: Format::Ogg, |
| 948 | ..Default::default() | 959 | ..Default::default() |
| 949 | }, | 960 | }, |
| 961 | + None, | ||
| 950 | ); | 962 | ); |
| 951 | wait(&handle, Duration::from_secs(180)).expect("ogg export of a mono timeline"); | 963 | wait(&handle, Duration::from_secs(180)).expect("ogg export of a mono timeline"); |
| 952 | 964 | ||
crates/engine/tests/av1.rsmodified+1 -1
| @@ -333,7 +333,7 @@ fn an_mp4_export_of_a_matroska_source_carries_its_sound() { | |||
| 333 | let project = Project::single(asset("test_av1.mkv"), 15); | 333 | let project = Project::single(asset("test_av1.mkv"), 15); |
| 334 | let out = Scratch::file("ve_export_av1", "mp4"); | 334 | let out = Scratch::file("ve_export_av1", "mp4"); |
| 335 | 335 | ||
| 336 | - let handle = engine::export::start(project, meta, &out, &ExportSettings::default()); | 336 | + let handle = engine::export::start(project, meta, &out, &ExportSettings::default(), None); |
| 337 | let started = Instant::now(); | 337 | let started = Instant::now(); |
| 338 | while !handle.is_finished() { | 338 | while !handle.is_finished() { |
| 339 | assert!(started.elapsed() < Duration::from_secs(900), "export hung"); | 339 | assert!(started.elapsed() < Duration::from_secs(900), "export hung"); |
crates/engine/tests/eq_audio.rsmodified+3 -2
| @@ -300,7 +300,8 @@ fn the_audio_only_exports_carry_the_same_boost_playback_does() { | |||
| 300 | format, | 300 | format, |
| 301 | ..Default::default() | 301 | ..Default::default() |
| 302 | }, | 302 | }, |
| 303 | - ); | 303 | + None, |
| 304 | + ); | ||
| 304 | wait(&handle, Duration::from_secs(60)).expect("an audio-only export"); | 305 | wait(&handle, Duration::from_secs(60)).expect("an audio-only export"); |
| 305 | written.push(decode(&out)); | 306 | written.push(decode(&out)); |
| 306 | std::fs::remove_file(&out).unwrap(); | 307 | std::fs::remove_file(&out).unwrap(); |
| @@ -340,7 +341,7 @@ fn an_mp4_export_carries_the_boost_a_packet_copy_could_not() { | |||
| 340 | for (name, project) in [("flat", &flat), ("eqd", &eqd)] { | 341 | for (name, project) in [("flat", &flat), ("eqd", &eqd)] { |
| 341 | let out = out_path(name, "mp4"); | 342 | let out = out_path(name, "mp4"); |
| 342 | let settings = ExportSettings::default(); | 343 | let settings = ExportSettings::default(); |
| 343 | - let handle = engine::export::start(project.clone(), meta(), &out, &settings); | 344 | + let handle = engine::export::start(project.clone(), meta(), &out, &settings, None); |
| 344 | wait(&handle, Duration::from_secs(180)).expect("an equalized timeline exports as mp4"); | 345 | wait(&handle, Duration::from_secs(180)).expect("an equalized timeline exports as mp4"); |
| 345 | written.push(decode(&out)); | 346 | written.push(decode(&out)); |
| 346 | std::fs::remove_file(&out).unwrap(); | 347 | std::fs::remove_file(&out).unwrap(); |
crates/engine/tests/export.rsmodified+11 -11
| @@ -271,7 +271,7 @@ fn exports_at_the_project_resolution_with_the_watched_geometry() { | |||
| 271 | color: Default::default(), | 271 | color: Default::default(), |
| 272 | }; | 272 | }; |
| 273 | let out = out_path("mixed"); | 273 | let out = out_path("mixed"); |
| 274 | - let handle = engine::export::start(project, meta, &out, &ExportSettings::default()); | 274 | + let handle = engine::export::start(project, meta, &out, &ExportSettings::default(), None); |
| 275 | wait(&handle, Duration::from_secs(600)).expect("export"); | 275 | wait(&handle, Duration::from_secs(600)).expect("export"); |
| 276 | 276 | ||
| 277 | let (written, _) = engine::demux::Demuxer::open(&out).expect("reopen export"); | 277 | let (written, _) = engine::demux::Demuxer::open(&out).expect("reopen export"); |
| @@ -347,7 +347,7 @@ fn exports_the_audio_stream_the_timeline_plays() { | |||
| 347 | ) | 347 | ) |
| 348 | .expect("a one-source project on stream 1"); | 348 | .expect("a one-source project on stream 1"); |
| 349 | let out = out_path("stream1"); | 349 | let out = out_path("stream1"); |
| 350 | - let handle = engine::export::start(project, meta, &out, &ExportSettings::default()); | 350 | + let handle = engine::export::start(project, meta, &out, &ExportSettings::default(), None); |
| 351 | wait(&handle, Duration::from_secs(600)).expect("export"); | 351 | wait(&handle, Duration::from_secs(600)).expect("export"); |
| 352 | 352 | ||
| 353 | let (audio, _) = engine::AudioSession::open(&out) | 353 | let (audio, _) = engine::AudioSession::open(&out) |
| @@ -429,7 +429,7 @@ fn multi_source_round_trip(name: &str, limit: Duration) { | |||
| 429 | let out = out_path(name); | 429 | let out = out_path(name); |
| 430 | 430 | ||
| 431 | let started = Instant::now(); | 431 | let started = Instant::now(); |
| 432 | - let handle = engine::export::start(project.clone(), meta, &out, &ExportSettings::default()); | 432 | + let handle = engine::export::start(project.clone(), meta, &out, &ExportSettings::default(), None); |
| 433 | wait(&handle, limit).expect("export"); | 433 | wait(&handle, limit).expect("export"); |
| 434 | println!( | 434 | println!( |
| 435 | "{name}: {total} frames of two sources in {:.2} s", | 435 | "{name}: {total} frames of two sources in {:.2} s", |
| @@ -555,7 +555,7 @@ fn a_vanished_source_fails_the_export() { | |||
| 555 | 555 | ||
| 556 | std::fs::remove_file(&doomed).expect("unlink the second source"); | 556 | std::fs::remove_file(&doomed).expect("unlink the second source"); |
| 557 | let out = out_path("vanished"); | 557 | let out = out_path("vanished"); |
| 558 | - let handle = engine::export::start(project, meta, &out, &ExportSettings::default()); | 558 | + let handle = engine::export::start(project, meta, &out, &ExportSettings::default(), None); |
| 559 | let result = wait(&handle, Duration::from_secs(60)); | 559 | let result = wait(&handle, Duration::from_secs(60)); |
| 560 | let error = result.expect_err("an export of a missing file cannot succeed"); | 560 | let error = result.expect_err("an export of a missing file cannot succeed"); |
| 561 | println!("vanished source: {error}"); | 561 | println!("vanished source: {error}"); |
| @@ -1415,7 +1415,7 @@ fn a_hardware_encoder_killed_mid_export_costs_the_file_nothing() { | |||
| 1415 | injected(Some("3"), None, || { | 1415 | injected(Some("3"), None, || { |
| 1416 | // `Auto` is what an untouched export card sends: the seat that *may* | 1416 | // `Auto` is what an untouched export card sends: the seat that *may* |
| 1417 | // fall back, which is the whole question here. | 1417 | // fall back, which is the whole question here. |
| 1418 | - let handle = engine::export::start(project, meta, &out, &ExportSettings::default()); | 1418 | + let handle = engine::export::start(project, meta, &out, &ExportSettings::default(), None); |
| 1419 | wait(&handle, Duration::from_secs(180)).expect("the export survived its encoder"); | 1419 | wait(&handle, Duration::from_secs(180)).expect("the export survived its encoder"); |
| 1420 | }); | 1420 | }); |
| 1421 | 1421 | ||
| @@ -1443,7 +1443,7 @@ fn a_hardware_encoder_killed_mid_export_never_pulls_the_bar_backwards() { | |||
| 1443 | let out = out_path("hw_child_abort_progress"); | 1443 | let out = out_path("hw_child_abort_progress"); |
| 1444 | 1444 | ||
| 1445 | let seen = injected(Some("3"), None, || { | 1445 | let seen = injected(Some("3"), None, || { |
| 1446 | - let handle = engine::export::start(project, meta, &out, &ExportSettings::default()); | 1446 | + let handle = engine::export::start(project, meta, &out, &ExportSettings::default(), None); |
| 1447 | // Sampled far faster than the export writes, so the retry cannot slip | 1447 | // Sampled far faster than the export writes, so the retry cannot slip |
| 1448 | // through between two reads. | 1448 | // through between two reads. |
| 1449 | let started = Instant::now(); | 1449 | let started = Instant::now(); |
| @@ -1498,7 +1498,7 @@ fn audio_pass_threads() -> usize { | |||
| 1498 | 1498 | ||
| 1499 | /// The busiest that crowd ever gets while `export` writes this project. | 1499 | /// The busiest that crowd ever gets while `export` writes this project. |
| 1500 | fn busiest_audio_pass(project: Project, meta: engine::VideoMeta, out: &Path) -> usize { | 1500 | fn busiest_audio_pass(project: Project, meta: engine::VideoMeta, out: &Path) -> usize { |
| 1501 | - let handle = engine::export::start(project, meta, out, &ExportSettings::default()); | 1501 | + let handle = engine::export::start(project, meta, out, &ExportSettings::default(), None); |
| 1502 | let started = Instant::now(); | 1502 | let started = Instant::now(); |
| 1503 | let mut most = 0; | 1503 | let mut most = 0; |
| 1504 | while !handle.is_finished() { | 1504 | while !handle.is_finished() { |
| @@ -1600,7 +1600,7 @@ fn a_hardware_encoder_killed_at_its_open_is_simply_no_seat() { | |||
| 1600 | let out = out_path("hw_child_abort_init"); | 1600 | let out = out_path("hw_child_abort_init"); |
| 1601 | 1601 | ||
| 1602 | injected(Some("init"), None, || { | 1602 | injected(Some("init"), None, || { |
| 1603 | - let handle = engine::export::start(project, meta, &out, &ExportSettings::default()); | 1603 | + let handle = engine::export::start(project, meta, &out, &ExportSettings::default(), None); |
| 1604 | wait(&handle, Duration::from_secs(180)).expect("the export survived the open"); | 1604 | wait(&handle, Duration::from_secs(180)).expect("the export survived the open"); |
| 1605 | }); | 1605 | }); |
| 1606 | 1606 | ||
| @@ -1618,7 +1618,7 @@ fn a_hardware_encoder_killed_at_the_drain_costs_the_file_nothing() { | |||
| 1618 | let out = out_path("hw_child_abort_drain"); | 1618 | let out = out_path("hw_child_abort_drain"); |
| 1619 | 1619 | ||
| 1620 | injected(Some("drain"), None, || { | 1620 | injected(Some("drain"), None, || { |
| 1621 | - let handle = engine::export::start(project, meta, &out, &ExportSettings::default()); | 1621 | + let handle = engine::export::start(project, meta, &out, &ExportSettings::default(), None); |
| 1622 | wait(&handle, Duration::from_secs(180)).expect("the export survived the drain"); | 1622 | wait(&handle, Duration::from_secs(180)).expect("the export survived the drain"); |
| 1623 | }); | 1623 | }); |
| 1624 | 1624 | ||
| @@ -1641,7 +1641,7 @@ fn a_hardware_encoder_that_stops_answering_is_killed_and_replaced() { | |||
| 1641 | 1641 | ||
| 1642 | let started = Instant::now(); | 1642 | let started = Instant::now(); |
| 1643 | injected(None, Some("2"), || { | 1643 | injected(None, Some("2"), || { |
| 1644 | - let handle = engine::export::start(project, meta, &out, &ExportSettings::default()); | 1644 | + let handle = engine::export::start(project, meta, &out, &ExportSettings::default(), None); |
| 1645 | wait(&handle, Duration::from_secs(180)).expect("the export outlived the wedge"); | 1645 | wait(&handle, Duration::from_secs(180)).expect("the export outlived the wedge"); |
| 1646 | }); | 1646 | }); |
| 1647 | println!( | 1647 | println!( |
| @@ -1675,7 +1675,7 @@ fn an_export_that_asked_for_the_gpu_by_name_refuses_instead_of_falling_back() { | |||
| 1675 | seat: engine::export::EncoderSeat::Hardware, | 1675 | seat: engine::export::EncoderSeat::Hardware, |
| 1676 | ..Default::default() | 1676 | ..Default::default() |
| 1677 | }; | 1677 | }; |
| 1678 | - let handle = engine::export::start(project, meta, &out, &settings); | 1678 | + let handle = engine::export::start(project, meta, &out, &settings, None); |
| 1679 | wait(&handle, Duration::from_secs(180)) | 1679 | wait(&handle, Duration::from_secs(180)) |
| 1680 | .expect_err("a named hardware seat that died is not written again in software") | 1680 | .expect_err("a named hardware seat that died is not written again in software") |
| 1681 | }); | 1681 | }); |
crates/engine/tests/export_subs.rsmodified+5 -0
| @@ -157,6 +157,7 @@ fn exported_want( | |||
| 157 | subtitles: picks.to_vec(), | 157 | subtitles: picks.to_vec(), |
| 158 | ..Default::default() | 158 | ..Default::default() |
| 159 | }, | 159 | }, |
| 160 | + None, | ||
| 160 | ); | 161 | ); |
| 161 | wait(&handle, Duration::from_secs(1800)).expect("the export finishes"); | 162 | wait(&handle, Duration::from_secs(1800)).expect("the export finishes"); |
| 162 | // The bar ends where it was told it would: the picture loop's own count and | 163 | // The bar ends where it was told it would: the picture loop's own count and |
| @@ -188,6 +189,7 @@ fn exported_mp4(name: &str, project: Project, picks: &[usize]) -> Scratch { | |||
| 188 | subtitles: picks.to_vec(), | 189 | subtitles: picks.to_vec(), |
| 189 | ..Default::default() | 190 | ..Default::default() |
| 190 | }, | 191 | }, |
| 192 | + None, | ||
| 191 | ); | 193 | ); |
| 192 | wait(&handle, Duration::from_secs(1800)).expect("the export finishes"); | 194 | wait(&handle, Duration::from_secs(1800)).expect("the export finishes"); |
| 193 | out | 195 | out |
| @@ -570,6 +572,7 @@ fn an_hevc_mp4_keeps_its_rewritten_entry_and_its_text() { | |||
| 570 | subtitles: vec![1], | 572 | subtitles: vec![1], |
| 571 | ..Default::default() | 573 | ..Default::default() |
| 572 | }, | 574 | }, |
| 575 | + None, | ||
| 573 | ); | 576 | ); |
| 574 | wait(&handle, Duration::from_secs(1800)).expect("the export finishes"); | 577 | wait(&handle, Duration::from_secs(1800)).expect("the export finishes"); |
| 575 | let Some(listing) = ffmpeg_streams(&out) else { | 578 | let Some(listing) = ffmpeg_streams(&out) else { |
| @@ -662,6 +665,7 @@ fn more_tracks_than_a_block_can_number_are_refused_by_name() { | |||
| 662 | subtitles: (0..over).collect(), | 665 | subtitles: (0..over).collect(), |
| 663 | ..Default::default() | 666 | ..Default::default() |
| 664 | }, | 667 | }, |
| 668 | + None, | ||
| 665 | ); | 669 | ); |
| 666 | let said = wait(&handle, Duration::from_secs(1800)) | 670 | let said = wait(&handle, Duration::from_secs(1800)) |
| 667 | .expect_err("a file that cannot be numbered is not written") | 671 | .expect_err("a file that cannot be numbered is not written") |
| @@ -1094,6 +1098,7 @@ fn more_lanes_than_a_block_can_number_are_refused_by_name() { | |||
| 1094 | format: Format::Hevc, | 1098 | format: Format::Hevc, |
| 1095 | ..Default::default() | 1099 | ..Default::default() |
| 1096 | }, | 1100 | }, |
| 1101 | + None, | ||
| 1097 | ); | 1102 | ); |
| 1098 | let said = wait(&handle, Duration::from_secs(1800)) | 1103 | let said = wait(&handle, Duration::from_secs(1800)) |
| 1099 | .expect_err("a file that cannot be numbered is not written") | 1104 | .expect_err("a file that cannot be numbered is not written") |
crates/engine/tests/hevc.rsmodified+1 -1
| @@ -242,7 +242,7 @@ fn an_hevc_source_exports_as_h264() { | |||
| 242 | let project = Project::single(asset("test_hevc.mp4"), meta.frame_count); | 242 | let project = Project::single(asset("test_hevc.mp4"), meta.frame_count); |
| 243 | let out = Scratch::file("ve_export_hevc", "mp4"); | 243 | let out = Scratch::file("ve_export_hevc", "mp4"); |
| 244 | 244 | ||
| 245 | - let handle = engine::export::start(project, meta, &out, &ExportSettings::default()); | 245 | + let handle = engine::export::start(project, meta, &out, &ExportSettings::default(), None); |
| 246 | let started = Instant::now(); | 246 | let started = Instant::now(); |
| 247 | while !handle.is_finished() { | 247 | while !handle.is_finished() { |
| 248 | assert!(started.elapsed() < Duration::from_secs(120), "export hung"); | 248 | assert!(started.elapsed() < Duration::from_secs(120), "export hung"); |
crates/engine/tests/hevc_hvc1.rsmodified+1 -1
| @@ -127,7 +127,7 @@ fn an_hvc1_source_exports_as_h264() { | |||
| 127 | let project = Project::single(asset(HVC1), meta.frame_count); | 127 | let project = Project::single(asset(HVC1), meta.frame_count); |
| 128 | let out = Scratch::file("ve_export_hvc1", "mp4"); | 128 | let out = Scratch::file("ve_export_hvc1", "mp4"); |
| 129 | 129 | ||
| 130 | - let handle = engine::export::start(project, meta, &out, &ExportSettings::default()); | 130 | + let handle = engine::export::start(project, meta, &out, &ExportSettings::default(), None); |
| 131 | let started = Instant::now(); | 131 | let started = Instant::now(); |
| 132 | while !handle.is_finished() { | 132 | while !handle.is_finished() { |
| 133 | assert!(started.elapsed() < Duration::from_secs(120), "export hung"); | 133 | assert!(started.elapsed() < Duration::from_secs(120), "export hung"); |
crates/engine/tests/import_mp4_subs.rsmodified+1 -0
| @@ -98,6 +98,7 @@ fn exported_mp4(name: &str) -> Scratch { | |||
| 98 | subtitles: vec![0, 1], | 98 | subtitles: vec![0, 1], |
| 99 | ..Default::default() | 99 | ..Default::default() |
| 100 | }, | 100 | }, |
| 101 | + None, | ||
| 101 | ); | 102 | ); |
| 102 | wait(&handle, Duration::from_secs(300)).expect("the export finishes"); | 103 | wait(&handle, Duration::from_secs(300)).expect("the export finishes"); |
| 103 | out | 104 | out |
crates/engine/tests/lanes.rsmodified+3 -3
| @@ -266,7 +266,7 @@ fn the_mp4_copy_follows_the_lane_that_holds_the_sound() { | |||
| 266 | 266 | ||
| 267 | let out = out_path("a2_only", "mp4"); | 267 | let out = out_path("a2_only", "mp4"); |
| 268 | let (meta, _) = engine::demux::Demuxer::open(&source).unwrap(); | 268 | let (meta, _) = engine::demux::Demuxer::open(&source).unwrap(); |
| 269 | - let handle = engine::export::start(project, meta, &out, &ExportSettings::default()); | 269 | + let handle = engine::export::start(project, meta, &out, &ExportSettings::default(), None); |
| 270 | wait(&handle, Duration::from_secs(300)).expect("export the A2-only timeline"); | 270 | wait(&handle, Duration::from_secs(300)).expect("export the A2-only timeline"); |
| 271 | 271 | ||
| 272 | let written = decoded_audio(&out); | 272 | let written = decoded_audio(&out); |
| @@ -323,7 +323,7 @@ fn two_audio_lanes_are_summed() { | |||
| 323 | format: Format::Wav, | 323 | format: Format::Wav, |
| 324 | ..Default::default() | 324 | ..Default::default() |
| 325 | }; | 325 | }; |
| 326 | - let handle = engine::export::start(project, meta, &out, &settings); | 326 | + let handle = engine::export::start(project, meta, &out, &settings, None); |
| 327 | wait(&handle, Duration::from_secs(120)).expect("wav export"); | 327 | wait(&handle, Duration::from_secs(120)).expect("wav export"); |
| 328 | let mut reader = hound::WavReader::open(&out).expect("reopen the wav"); | 328 | let mut reader = hound::WavReader::open(&out).expect("reopen the wav"); |
| 329 | let spec = reader.spec(); | 329 | let spec = reader.spec(); |
| @@ -377,7 +377,7 @@ fn two_audio_lanes_are_summed() { | |||
| 377 | // this decodes both lanes and encodes the sum instead (`export::copy_audio` | 377 | // this decodes both lanes and encodes the sum instead (`export::copy_audio` |
| 378 | // routes to `encode_audio`), which is the same mix the WAV above measured. | 378 | // routes to `encode_audio`), which is the same mix the WAV above measured. |
| 379 | let out = out_path("mixed", "mp4"); | 379 | let out = out_path("mixed", "mp4"); |
| 380 | - let handle = engine::export::start(project, meta, &out, &ExportSettings::default()); | 380 | + let handle = engine::export::start(project, meta, &out, &ExportSettings::default(), None); |
| 381 | wait(&handle, Duration::from_secs(180)).expect("an mp4 of two audio lanes"); | 381 | wait(&handle, Duration::from_secs(180)).expect("an mp4 of two audio lanes"); |
| 382 | let (audio, chunks) = engine::AudioSession::open(&out) | 382 | let (audio, chunks) = engine::AudioSession::open(&out) |
| 383 | .expect("reopen the export") | 383 | .expect("reopen the export") |
crates/engine/tests/opus_export.rsmodified+2 -0
| @@ -124,6 +124,7 @@ fn export(name: &str, project: Project, video: &Path) -> Scratch { | |||
| 124 | format: Format::Hevc, | 124 | format: Format::Hevc, |
| 125 | ..Default::default() | 125 | ..Default::default() |
| 126 | }, | 126 | }, |
| 127 | + None, | ||
| 127 | ); | 128 | ); |
| 128 | wait(&handle, Duration::from_secs(600)).expect("the export finishes"); | 129 | wait(&handle, Duration::from_secs(600)).expect("the export finishes"); |
| 129 | out | 130 | out |
| @@ -455,6 +456,7 @@ fn a_copied_picture_names_the_sound_it_was_written_with() { | |||
| 455 | format: Format::Hevc, | 456 | format: Format::Hevc, |
| 456 | ..Default::default() | 457 | ..Default::default() |
| 457 | }, | 458 | }, |
| 459 | + None, | ||
| 458 | ); | 460 | ); |
| 459 | let line = { | 461 | let line = { |
| 460 | wait(&handle, Duration::from_secs(600)).expect("the export finishes"); | 462 | wait(&handle, Duration::from_secs(600)).expect("the export finishes"); |
crates/engine/tests/silence.rsmodified+1 -0
| @@ -385,6 +385,7 @@ fn scanning_a_clip_and_cutting_what_it_finds() { | |||
| 385 | true, | 385 | true, |
| 386 | engine::export::EncoderSeat::default(), | 386 | engine::export::EncoderSeat::default(), |
| 387 | p.limiter(), | 387 | p.limiter(), |
| 388 | + None, | ||
| 388 | 0, | 389 | 0, |
| 389 | ) | 390 | ) |
| 390 | .expect("save"); | 391 | .expect("save"); |
crates/engine/tests/speed.rsmodified+5 -2
| @@ -280,6 +280,7 @@ fn a_wav_export_of_a_2x_timeline_matches_the_preview() { | |||
| 280 | format: Format::Wav, | 280 | format: Format::Wav, |
| 281 | ..Default::default() | 281 | ..Default::default() |
| 282 | }, | 282 | }, |
| 283 | + None, | ||
| 283 | ); | 284 | ); |
| 284 | wait(&handle, Duration::from_secs(120)).expect("wav export"); | 285 | wait(&handle, Duration::from_secs(120)).expect("wav export"); |
| 285 | let mut reader = hound::WavReader::open(&out).expect("read the export back"); | 286 | let mut reader = hound::WavReader::open(&out).expect("read the export back"); |
| @@ -316,7 +317,7 @@ fn an_mp4_export_resamples_a_speeded_sound_clip() { | |||
| 316 | .expect("room enough"); | 317 | .expect("room enough"); |
| 317 | let heard = beep_at(&play(&project)); | 318 | let heard = beep_at(&play(&project)); |
| 318 | let out = out_path("speeded", "mp4"); | 319 | let out = out_path("speeded", "mp4"); |
| 319 | - let handle = engine::export::start(project, meta, &out, &ExportSettings::default()); | 320 | + let handle = engine::export::start(project, meta, &out, &ExportSettings::default(), None); |
| 320 | wait(&handle, Duration::from_secs(180)).expect("an mp4 of a speeded sound clip"); | 321 | wait(&handle, Duration::from_secs(180)).expect("an mp4 of a speeded sound clip"); |
| 321 | let (audio, chunks) = AudioSession::open(&out) | 322 | let (audio, chunks) = AudioSession::open(&out) |
| 322 | .expect("reopen the export") | 323 | .expect("reopen the export") |
| @@ -468,6 +469,7 @@ fn a_wav_export_of_a_2x_clip_keeps_the_beeps_pitch() { | |||
| 468 | format: Format::Wav, | 469 | format: Format::Wav, |
| 469 | ..Default::default() | 470 | ..Default::default() |
| 470 | }, | 471 | }, |
| 472 | + None, | ||
| 471 | ); | 473 | ); |
| 472 | wait(&handle, Duration::from_secs(120)).expect("wav export"); | 474 | wait(&handle, Duration::from_secs(120)).expect("wav export"); |
| 473 | let mut reader = hound::WavReader::open(&out).expect("read the export back"); | 475 | let mut reader = hound::WavReader::open(&out).expect("read the export back"); |
| @@ -528,7 +530,7 @@ fn an_mp4_export_honours_a_speeded_picture_across_a_rate_change() { | |||
| 528 | assert_eq!(total, fast + 90, "45 fast frames then 90 slow ones"); | 530 | assert_eq!(total, fast + 90, "45 fast frames then 90 slow ones"); |
| 529 | 531 | ||
| 530 | let out = out_path("honoured", "mp4"); | 532 | let out = out_path("honoured", "mp4"); |
| 531 | - let handle = engine::export::start(project, meta, &out, &ExportSettings::default()); | 533 | + let handle = engine::export::start(project, meta, &out, &ExportSettings::default(), None); |
| 532 | wait(&handle, Duration::from_secs(300)).expect("an mp4 export of a speeded picture"); | 534 | wait(&handle, Duration::from_secs(300)).expect("an mp4 export of a speeded picture"); |
| 533 | let (_, frames) = DecodeSession::open(&out).expect("reopen the export"); | 535 | let (_, frames) = DecodeSession::open(&out).expect("reopen the export"); |
| 534 | let frames: Vec<_> = frames.into_iter().collect(); | 536 | let frames: Vec<_> = frames.into_iter().collect(); |
| @@ -575,6 +577,7 @@ fn an_av1_export_honours_a_speeded_take_whole() { | |||
| 575 | format: Format::Av1, | 577 | format: Format::Av1, |
| 576 | ..Default::default() | 578 | ..Default::default() |
| 577 | }, | 579 | }, |
| 580 | + None, | ||
| 578 | ); | 581 | ); |
| 579 | wait(&handle, Duration::from_secs(600)).expect("an AV1 export of a speeded take"); | 582 | wait(&handle, Duration::from_secs(600)).expect("an AV1 export of a speeded take"); |
| 580 | assert!(out.exists(), "AV1 never refuses a rate"); | 583 | assert!(out.exists(), "AV1 never refuses a rate"); |
crates/engine/tests/vp9.rsmodified+1 -1
| @@ -195,7 +195,7 @@ fn a_vp9_source_exports_as_h264() { | |||
| 195 | let project = Project::single(asset("test_vp9.mp4"), meta.frame_count); | 195 | let project = Project::single(asset("test_vp9.mp4"), meta.frame_count); |
| 196 | let out = Scratch::file("ve_export_vp9", "mp4"); | 196 | let out = Scratch::file("ve_export_vp9", "mp4"); |
| 197 | 197 | ||
| 198 | - let handle = engine::export::start(project, meta, &out, &ExportSettings::default()); | 198 | + let handle = engine::export::start(project, meta, &out, &ExportSettings::default(), None); |
| 199 | let started = Instant::now(); | 199 | let started = Instant::now(); |
| 200 | while !handle.is_finished() { | 200 | while !handle.is_finished() { |
| 201 | assert!(started.elapsed() < Duration::from_secs(120), "export hung"); | 201 | assert!(started.elapsed() < Duration::from_secs(120), "export hung"); |