Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion .github/workflows/windows-recording-encoder.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
name: Windows recording encoder

# The segmented recording encoder's tests on Windows, the only platform where
# a hardware encoder that fails mid-recording is replaced with libx264.
# a hardware encoder that fails mid-recording is replaced with libx264, and the
# Media Foundation self-test that runs in a child process because Intel's
# transform faults on odd frame sizes.
on:
pull_request:
paths:
- "crates/enc-ffmpeg/**"
- "crates/enc-mediafoundation/**"
- "crates/media-info/**"
- "crates/export/tests/windows_odd_size_export.rs"
- "crates/recording/src/output_pipeline/win_fragmented_m4s.rs"
- "Cargo.lock"
- ".github/workflows/windows-recording-encoder.yml"
push:
branches: [main]
paths:
- "crates/enc-ffmpeg/**"
- "crates/enc-mediafoundation/**"
- "crates/media-info/**"
- "crates/export/tests/windows_odd_size_export.rs"
- "crates/recording/src/output_pipeline/win_fragmented_m4s.rs"
- "Cargo.lock"
- ".github/workflows/windows-recording-encoder.yml"
Expand Down Expand Up @@ -55,3 +63,24 @@ jobs:

- name: Segmented encoder tests
run: cargo test --locked -p cap-enc-ffmpeg --lib mux::segmented_stream -- --nocapture

- name: Encoder selection and isolated self-test tests
run: cargo test --locked -p cap-media-info --lib intel_h264_mft && cargo test --locked -p cap-enc-ffmpeg --lib self_test -- --nocapture

# The fault runs wherever the self-test runs: in a child it fails only
# the child, in this process it would end the test with 0xc0000005.
- name: Media Foundation self-test fault falls back (access violation)
env:
CAP_H264_SELF_TEST_FAULT: access_violation
run: cargo test --locked -p cap-enc-ffmpeg --lib video::h264::self_test_tests::media_foundation_self_test_fault_falls_back_to_libx264_at_odd_sizes -- --exact --nocapture

- name: Media Foundation self-test fault falls back (fast fail 0xc0000409)
env:
CAP_H264_SELF_TEST_FAULT: abort
run: cargo test --locked -p cap-enc-ffmpeg --lib video::h264::self_test_tests::media_foundation_self_test_fault_falls_back_to_libx264_at_odd_sizes -- --exact --nocapture

- name: Odd size export with a faulting Media Foundation self-test
env:
CAP_DEBUG_H264_ENCODER_ORDER: h264_mf,libx264
CAP_H264_SELF_TEST_FAULT: access_violation
run: cargo test --locked -p cap-export --test windows_odd_size_export -- --nocapture --test-threads=1
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apps/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cap-recording = { path = "../../crates/recording" }
cap-rendering = { path = "../../crates/rendering" }
cap-editor = { path = "../../crates/editor" }
cap-export = { path = "../../crates/export" }
cap-enc-ffmpeg = { path = "../../crates/enc-ffmpeg" }
cap-media-info = { path = "../../crates/media-info" }
cap-timestamp = { path = "../../crates/timestamp" }
cap-utils = { path = "../../crates/utils" }
Expand Down
2 changes: 2 additions & 0 deletions apps/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@ struct CompletionsArgs {
}

fn main() {
cap_enc_ffmpeg::isolated_self_test::run_child_or_register_host();

#[cfg(target_os = "linux")]
if let Some(threads) = cap_utils::linux_runtime::llvmpipe_thread_count() {
// Mesa counts host CPUs inside containers; configure it before creating the CLI runtime.
Expand Down
1 change: 1 addition & 0 deletions apps/desktop-gpui/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions apps/desktop-gpui/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ fn app_runtime() -> tokio::runtime::Runtime {
}

fn main() {
// A copy of Cap started to self-test a hardware H264 encoder runs only
// that test and exits, before logging, crash capture or single-instance.
cap_enc_ffmpeg::isolated_self_test::run_child_or_register_host();

#[cfg(target_os = "linux")]
if let Some(threads) = cap_utils::linux_runtime::llvmpipe_thread_count() {
// Mesa counts host CPUs inside containers; apply the process limit before logging starts threads.
Expand Down
6 changes: 5 additions & 1 deletion crates/enc-ffmpeg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ tracing.workspace = true
workspace-hack = { version = "0.1", path = "../workspace-hack" }

[target.'cfg(target_os = "windows")'.dependencies]
cap-enc-mediafoundation = { path = "../enc-mediafoundation" }
cap-frame-converter = { path = "../frame-converter" }
windows = { workspace = true, features = ["Win32_Storage_FileSystem"] }
windows = { workspace = true, features = [
"Win32_Storage_FileSystem",
"Win32_System_Diagnostics_Debug",
] }

[dev-dependencies]
tempfile = "3.20.0"
Expand Down
Loading
Loading