- modules/Screen_Record: a region of one screen to H.264 in a fragmented MP4. A capture thread duplicates the screen (DuplicateOutput1, else DuplicateOutput) on a D3D11 device of its own on the screen's adapter, copies the region on the GPU, reads it back through three staging textures and draws the cursor in (colour, masked colour and monochrome shapes). An encoder thread feeds FFmpeg: h264_nvenc, else h264_amf, h264_qsv, h264_mf, libx264, each tried in turn; BGRA straight to NVENC, swscale to NV12 or YUV 4:2:0 (BT.709) for the rest. A frame is sent when the screen or cursor changed and its turn on an fps schedule is due, with a repeat each second of an unchanged screen; the encoder falling 8 frames behind drops the oldest. A lost duplication (mode change, secure desktop) is made again and recording goes on. record_start says fall_back when duplication cannot run (unsupported, too many, rotated screen). Regions under 240 x 180 are refused, then sizes are rounded down to even; a process whose view of the desktop is scaled is refused. - tools/record_probe.jai (jai first.jai - record_probe): lists the screens, records a screen or region and reports source, encoder, frames captured, sent, written and dropped, time per stage and file size; -legacy, -cuda, -exclude-test, -animate, -snapshot DIR, -check FILE. - On the RTX 5080 laptop: 60 s of 4K at 30 fps, 1802 frames, none dropped, 18 MB a minute; every change kept at 60 fps; plain DuplicateOutput works when DPI aware; a CUDA context changes nothing; WDA_EXCLUDEFROMCAPTURE is respected; QSV, Media Foundation and libx264 keep up too; a recording killed mid-way still plays. The two-GPU failure was not reproduced: the screens are on the NVIDIA GPU in this mode. The plan records the results.
52 lines
1.6 KiB
Plaintext
52 lines
1.6 KiB
Plaintext
// Type-checks src/App.jai for another OS without producing or linking a binary, to catch errors
|
|
// in code your machine does not build:
|
|
//
|
|
// jai check_targets.jai - linux (from any OS)
|
|
// jai check_targets.jai - macos (from a Mac only: the Objective_C module runs code at compile time)
|
|
//
|
|
// The constants below stand in for the ones first.jai generates; keep their names in step.
|
|
#run,stallable {
|
|
set_build_options_dc(.{do_output = false});
|
|
args := get_build_options().compile_time_command_line;
|
|
target := Operating_System_Tag.LINUX;
|
|
cpu := CPU_Tag.X64;
|
|
if array_find(args, "macos") { target = .MACOS; cpu = .ARM64; }
|
|
|
|
options := get_build_options();
|
|
options.os_target = target;
|
|
options.cpu_target = cpu;
|
|
options.output_type = .NO_OUTPUT;
|
|
options.backend = .LLVM;
|
|
options.output_executable_name = "check";
|
|
options.output_path = ".build";
|
|
|
|
w := compiler_create_workspace("check");
|
|
set_build_options(options, w);
|
|
compiler_begin_intercept(w);
|
|
add_build_file("src/App.jai", w);
|
|
add_build_string(#string S
|
|
APP_NAME :: "mcap";
|
|
APP_FOLDER_NAME :: "mcap";
|
|
GIT_BRANCH :: "check";
|
|
GIT_HASH :: "-";
|
|
VERSION :: "0.1.3";
|
|
BUILD_DATE :: "-";
|
|
DEBUG :: true;
|
|
COMPILE_TESTS :: true;
|
|
COMPILE_ARGS :: "";
|
|
NO_CRASH_DIALOG :: false;
|
|
S, w);
|
|
while true {
|
|
message := compiler_wait_for_message();
|
|
if message.kind == .COMPLETE {
|
|
m := cast(*Message_Complete) message;
|
|
log("% check: %", target, m.error_code);
|
|
break;
|
|
}
|
|
}
|
|
compiler_end_intercept(w);
|
|
}
|
|
|
|
#import "Basic";
|
|
#import "Compiler";
|