Commit Graph
488 Commits
Author SHA1 Message Date
Codex 06d6d80856 record: route fractional MediaCodec audio through owned conversion
Keep producer timestamps and queue capacity in source frames, configure AAC at a native rate and initialize conversion before exposing the Surface. Preserve direct standard-rate input. Cancel partial network startup on setup failure, retaining the original error.

Full Windows C89 and GCC/Clang sanitizer suites pass, including source clocks and conversion-startup rollback. Native device acceptance remains separate.
2026-11-16 20:01:26 +01:00
Codex 908c1ea783 record: convert source PCM on the MediaCodec worker
Borrow queue spans, convert at most 256 source frames per action and retain output across partial encoder acceptance. Track source and encoded ends separately through calibration, trim and cancellation. Calculate ceil durations exactly from the binary64 source rate.

Tests cover fractional mono/stereo, packet boundaries, anti-aliasing, empty/short EOF, source gaps, cancellation and file/live calibration. An independent Python rational oracle checks 176 duration cases.
2026-11-16 20:01:26 +01:00
Codex 1a288ddfed record: admit AV1 file and RTMP recording through MediaCodec
Accept vcodec=av1, route its sized OBUs to enhanced FLV, and preserve SDR/HDR profile and source color admission. Select Android AV1 levels from Annex A main-tier display-rate, picture, dimension, header-rate and bitrate bounds; native inventory still validates the complete request.

Strict C89 Windows and Linux ASan/UBSan frontend/session/worker suites pass. File and stream tests cover SDR, PQ and scRGB; four actual-source MIME, routing and level-limit mutations are rejected. Native device encoder acceptance remains separate.
2026-11-16 20:01:26 +01:00
Codex 1059e887b8 record: activate native Android streaming through the MediaCodec frontend
Select the owned stream dispatcher for RTMP(S), validate native FLV/AAC options, propagate coded HDR source metadata, and keep stream URLs out of file history. Expose backend streaming capability and enable shared RTMP/FLV in Vulkan Android NDK builds with crypto.

Windows frontend and native menu checks pass; full arm64 Android library builds and links with native streaming entry points and passes 16 KiB ELF alignment. This is build/contract acceptance, not physical-device or independent receiver acceptance. Direct integer source audio rates and AVC/HEVC are retained; fractional-rate resampling and AV1 frontend selection remain separate work.
2026-11-16 20:01:25 +01:00
Codex 4a5bde636f record: schedule owned MediaCodec streams on the I/O dispatcher
Copy native stream configuration and URL at cold startup. Negotiate the owned shared RTMP client before publishing Surface readiness, poll producer/resolver/socket interests together, and keep detached DNS notifications independent of dispatcher lifetime. Setup and drain deadlines are I/O-owner-only; no new frame/audio waits or clocks.

Windows contract suite, focused Linux ASan/UBSan and TSan thread/wake tests, and eight actual Android NDK dispatcher compiles pass. Client and recording session boundaries remain mocked; real receiver/device acceptance and frontend activation remain pending.
2026-11-16 20:01:25 +01:00
Codex 3ddbeb2a11 record: connect MediaCodec network output to owned session lifetime
Add an RTMP/FLV-gated network session constructor and bounded network service entry point. Select live AAC priming, skip file creation and MP4 edits, report socket interests, and retire the output before stopping codecs or releasing encoders. The caller retains client ownership.

Windows strict C89 suite plus focused completion check pass. Session fixtures cover cold rollback, file regressions, network failure, delayed retirement and source/GPU closure with native/output boundaries mocked. Dispatcher activation and real receiver/device acceptance remain pending.
2026-11-16 20:01:25 +01:00
Codex d3d8d404c4 record: prime live MediaCodec AAC without publishing calibration
Gate source PCM until measured delay determines the silent input boundary. Drop complete calibration packets before output, retain silent AAC preroll and shift video/source ends to the same epoch. Preserve the existing MP4 calibration/edit path and stable descriptors across output backpressure.

Strict C89 Windows suite passes; calibrated fixtures cover six delays, empty PCM, output backpressure and early cancellation. Native MediaCodec and network session activation still require acceptance.
2026-11-16 20:01:25 +01:00
Codex a3f1ac1471 record: define calibrated AAC live-stream source epochs
Calculate packet-aligned source input and coded origins from measured encoder delay, retaining two silent AAC frames before source audio and rounding the matching video epoch upward. Keep file edit semantics separate.

Check all delays 0-4096 at six rates. Independently encode/decode synthetic AAC-LC at 44.1/48 kHz mono/stereo, recover delay from the chirp, omit calibration packets and compare source PCM against continuous decoding. This is not MediaCodec device acceptance or dispatcher activation.
2026-11-16 20:01:25 +01:00
Codex dfaf13cfbd record: bridge MediaCodec packet borrows to shared RTMP output
Add a bounded I/O-worker output adapter with cold mux setup, serialized packet admission, transport backpressure, normal drain and cancellation retirement. Keep the MediaCodec descriptor live until both shared mux and RTMP transport borrows retire.

The controller must establish live AAC priming and source epochs separately; this adapter does not enable Android streaming or reuse MP4 calibration edits. Strict C89 Windows contract suite passes with the actual shared FLV mux and mocked transport.
2026-11-16 20:01:25 +01:00
Codex e41c91b7fc record: build shared FLV configuration from MediaCodec setup data
Create worker-side AVC/HEVC/AV1 mux configuration from bounded native CSD and optional AAC setup. Join separate AVC parameter sets only during cold setup, retain neither native format nor encoder metadata, and preserve microsecond packet clocks without rebasing. Reuse shared Annex B and AV1 mux validation, including codec-specific packet budgets and depth/color admission.

Add actual shared-mux fixtures for configuration copying, separate/combined AVC setup, AAC payload borrowing, microsecond timestamps, codec depth mismatch and early packet-budget refusal. This does not enable the unfinished Android network publisher.
2026-11-16 20:01:25 +01:00
Codex ea2af53aa4 record: retain MediaCodec output across consumer backpressure
Add a copied worker-owned output callback table, with the existing file mux as the default adapter. Retain one immutable native packet descriptor per encoder while output is BUSY; calibrate AAC only once for that packet and release the codec borrow only after output acceptance. Worker free waits for bounded output retirement before encoder destruction is allowed.

Exercise no-repump/no-early-release behavior, callback-table ownership, delayed cancellation retirement and calibrated coded/source clocks under BUSY. The strict-C89 native MinGW MediaCodec suite passes. Android network publisher integration remains unfinished.
2026-11-16 20:01:25 +01:00
Codex b2e921be5a record: expose bounded borrowed MediaCodec video configuration
Allow the owning worker to inspect native csd-0/csd-1 buffers before constructing shared stream output. Bound each buffer to 65535 bytes, clear outputs on refusal and preserve encoder state for optional/malformed metadata. No dequeue, release, allocation or encoded-payload copy occurs. Audio and stopped encoders cannot expose video configuration.

Cover separate CSD borrows, missing/malformed/oversized metadata, invalid arguments, audio refusal and stopped-state invalidation. Streaming remains disabled pending output/publisher and lifecycle integration.
2026-11-16 20:01:25 +01:00
Codex 8d0b716fca record: integrate native Vulkan frontend capture and A/V drain
Connect the admitted desktop Vulkan encode queue to viewport recording through
an asynchronous worker. Capture GPU pixels in the renderer submission, publish
only successful submissions, and retain source/device resources through stop,
resize and deferred video reinitialization. Refuse unsupported devices, HDR,
formats and audio layouts before creating output. Start after the first core
frame so admission uses its actual audio layout.

Hold PCM on the existing worker queue until encoded video establishes its
clock limit. Trim trailing queued PCM at video EOS before AC-3 padding and
publish the actual consumed count after worker retirement. This prevents a
threaded resize from leaving audio beyond the last captured picture. Add no
producer locks, waits, pixel readbacks or pacing logs.

Configure selects the driver on desktop Vulkan builds with its dependencies;
existing default driver priority is retained. Add frontend admission/lifetime,
delayed-video PCM, terminal-result publication and native isolated-window
resize/reinit/stop regression coverage.

Validation: GCC/Clang ASan+UBSan frontend contracts, Vulkan encode contracts,
recording output/session/dispatch contracts and independent MP4 A/V checks.
Windows native recording passes threaded/direct multichannel float PCM at
32/44.1/48 kHz, plus resize, reinit and stop with Khronos sync validation.
Desktop Linux and Windows frontends build with automatic feature selection.
Native Linux GPU acceptance remains open. The unrelated extended RSLC unsized
uniform-buffer fixture is rejected by the installed standalone SPIR-V validator;
that check is retained as a failure, not reported as an extended-suite pass.
2026-11-16 19:50:40 +01:00
Codex 64336dc2f7 record: bridge Vulkan capture and renderer submissions
Merge capture timeline dependencies without modifying caller batches, then publish slots only after native submission succeeds. Retain producer ownership through uncertain results, command discard and timeline retirement; preserve the pool borrow if admission disappears during a frame.

Strict C89 and Windows/GCC/Clang sanitizer fixtures cover semaphore chains, bounded admission and failure recovery. Native direct-image and buffer A/V checks exercise binary semaphores, an existing timeline and a reset/discard value gap with zero synchronization-validation errors. Frontend driver binding remains separate.
2026-11-16 18:56:35 +01:00
Codex b578db3004 record: own Vulkan capture resources on the recording worker
Compile and publish optional capture resources with dispatcher readiness, then retire them on the worker after the video producer proves its GPU commands complete. Keep the encoder pool alive through capture destruction and skip unused capture startup after early cancellation.

Lifecycle regressions cover startup refusal, cancellation and independent video/audio closure; an injected premature destruction fails. Native direct-image and buffer A/V runs pass with zero synchronization-validation errors, alongside Windows, GCC/Clang sanitizers, TSan and a linked threadless frontend. Renderer binding remains separate.
2026-11-16 18:41:14 +01:00
Codex 266a1841ef record: dispatch Vulkan recording work away from producers
Own session startup, file output and retirement on a dedicated worker. Publish immutable pool borrows after startup, wake through the existing lock-free eventcount backend and wait for each producer to close itself before teardown. Add concurrent startup/cancel/error contracts and native GPU A/V acceptance for both capture paths. Threadless and locking-fallback configurations refuse admission.
2026-11-16 18:04:45 +01:00
Codex fa19896686 record: convert fractional core PCM for Metal file recording
Keep the producer clock and queue budget in source frames. Convert on the recording worker through AudioToolbox, retain converted packets across mux backpressure and retire native input borrows before queue teardown. Preserve the direct path for integral rates and extend conversion contracts through eight channels.
2026-11-16 17:47:49 +01:00
Codex 09778a7a2a record: own Vulkan encoder and file output through retirement
Add a worker-owned Vulkan recording session with rational video clocks and encoder-derived mux metadata. Producer closure gates output, GPU and queue retirement; cancellation preserves borrowed packets and startup errors. Exercise actual queue/worker/mux/audio contracts with delayed GPU/file completion, independent producers, threadless builds and emitted MP4 metadata checks.
2026-11-16 17:38:32 +01:00
libretroadmin 64b2dfc719 Cleanups; reduce memsets 2026-11-15 22:44:40 +01:00
Codex 2d2a58b0a3 record: wire eligible Apple SDKs to native recording and shared RTMP
Derive the native Metal backend from a shared SDK floor rather than a desktop-only target check. Add shared RTMP/FLV flags to the existing Apple network configuration and let griffin include the existing native implementation units. Extend the real SDK audit to compile the actual C frontend using automatic backend admission, with ARC kept out of C compilation.

This is an unlanded integration candidate. SDK compilation, full Apple application linking and physical-device recording/streaming acceptance are pending.
2026-11-14 11:45:22 +01:00
Codex 1bdcf6f545 record: connect native Metal session and dispatcher on mobile Apple SDKs
Compile the real session and dedicated worker on eligible iOS/tvOS SDKs and reject older runtimes before startup. Mobile uses verified hardware admission without assuming a desktop GPU registry ID. Preserve desktop enumeration and affinity selection. Expand the opt-in SDK audit to compile capture, session, dispatcher and muxer units, with explicit non-stub and native-slot assertions.

The SDK audit remains a pending gate. This candidate does not enable mobile application feature defines or claim native-device recording acceptance.
2026-11-14 11:45:22 +01:00
Codex 54a6926a3f record: align native buffer settings with bounded capture rings
Use the same native queue limits in menu ranges and backend initialization. Honor the selected NVENC ring size instead of fixing it at four. Keep invalid legacy values on the existing four-slot fallback and restore legacy ranges when switching away from native recording.

Validate native ranges and fallback values, driver changes and actual Metal initializer slot configurations in the portable frontend tests.
2026-11-12 18:53:15 +01:00
Codex 094d4192aa menu: filter native streaming services by TLS availability
Keep the built-in RTMPS-only Facebook and Kick choices out of native plaintext-only builds while preserving FFmpeg protocol choices. Navigate the finite set of supported modes in both directions without timers or backend work. Exercise the actual dropdown filter and actions in plain and TLS variants; the previous capability predicate fails the no-TLS fixture.
2026-11-12 18:53:15 +01:00
Codex df859b6ca0 menu: expose supported native recording and streaming controls
Query registered recording backends instead of restricting the shared Recording page and Quick Menu start action to FFmpeg. Native GPU recorders expose their custom profiles, GPU capture, frame-drop and queue controls; compiled Metal/NVENC RTMP providers also expose service, profile and URL settings. Keep unsupported quality/software controls hidden and omit the UDP Local mode for RTMP-only backends in dropdowns and left/right navigation. Capability queries do no device, codec or network work.

The production settings-list, Quick Menu predicate and setting actions pass a shared native capability fixture on Windows and Linux sanitizers. The actual old settings-list body and old start predicate each fail it. Full application/native build checks remain required before publication.
2026-11-12 18:53:15 +01:00
Codex 3685e90f99 record: reject impossible packet bounds before Metal stream startup 2026-11-12 16:48:00 +01:00
Codex f10151d1c8 record: share the native packet capacity limit with Metal streaming 2026-11-12 16:46:17 +01:00
Codex fc99649544 record: preserve native streaming startup failure stage 2026-11-12 16:41:42 +01:00
Codex 04c6866bcb record: connect native Metal streaming to the frontend
Admit RTMP/RTMPS URLs and strict FLV/AAC profiles, preserve fractional source audio clocks and choose supported AAC output rates. Enable the built-in transport by default for eligible networked Metal/AVFoundation builds while respecting explicit feature disables.

Keep stream URLs out of recording history and avoid retaining a redundant frontend URL copy. Release the worker startup URL after the client adopts it and keep unsupported SDK builds on the existing fallback.

Add portable profile/source-clock checks and native application start/stop acceptance for direct/threaded AVC, fractional HEVC, mono and video-only output. Native acceptance remains required before landing.
2026-11-12 16:25:20 +01:00
Codex c9260506ee record: drive Metal streaming on the owned I/O worker
Own RTMP setup and socket/producer readiness on the existing dispatcher. Retain independent DNS completion notifications through cancellation, keep native audio conversion on the worker and service the connection before first-picture format binding. Preserve file-mode Mach scheduling and producer retirement barriers.

Add independent native receiver coverage of the URL-owning worker and full network-enabled frontend links with and without threads. Native acceptance remains a gate before frontend streaming selection.
2026-11-12 15:44:20 +01:00
Codex d391508ed1 record: bind native VT streaming to Metal session startup
Adopt fresh AAC/SRC and a ready RTMP client with the renderer-selected video resources. Retain the first encoded format through output retirement, keep producer closure independent, and clean up both adopted and unbound resources. Cover drain, borrowed SRC cancellation, missing format and cancellation before binding with SDK stand-ins; reject early format release.
2026-11-12 14:43:07 +01:00
Codex 1ab9e85b97 record: share Metal cold startup with owned outputs
Let an output binder adopt the existing renderer-selected encoder, aligned pool and capture. Keep file recording on that bootstrap and verify null/refused binders retire their cold resources before the next successful startup.
2026-11-12 14:43:07 +01:00
Codex 33e757d6be record: bind VT streaming resources to the owned output lifecycle
Adopt the READY client and fresh AAC/SRC encoders only after successful stream construction. Retire network-held packet loans before source-converter reset, AAC disposal and connection destruction. Reuse the session owner for producer closure and native encoder/GPU teardown. Cover normal drain, cancellation, reset/dispose retry and exactly-once ownership through the real controller and stream pump.
2026-11-12 14:43:07 +01:00
Codex adf99cb980 record: reuse owned Metal session retirement for streaming outputs
Allow an output-owned producer pump to bind the first encoded sample and expose network readiness without adding network dependencies to the file session. Preserve producer closure barriers, output borrow retirement, encoder teardown and GPU/queue cleanup. Keep the existing file-output path and test both lifecycles.
2026-11-12 13:31:59 +01:00
Codex 46053b4a54 record: feed resampled PCM directly to VT streaming AAC loans
Borrow a fresh source-rate adapter without another PCM ring. Preserve output-rate AAC timestamps and return unused writable loans on BUSY or EOF. Leave source-converter retirement with its caller after stream cancellation. Exercise separate source/output clocks, ownership and concurrent production, and add real fractional/up/downsampled RTMP receiver cases.
2026-11-12 13:20:04 +01:00
Codex cbc415f2ba record: lend queued PCM to native sample-rate conversion
Convert core sample rates to the AAC clock on the recording worker. Borrow queue input until the next native callback and write directly into caller-owned AAC input loans. Keep AAC priming in the output-rate domain. Cover retirement, cancellation, EOF and format contracts, with native independent PCM/AAC timing checks.
2026-11-12 13:10:15 +01:00
Codex 78f4141ad7 record: consume prebuffered PCM directly in VT streaming
Borrow a caller-owned PCM queue so audio can precede the first native video format without a second ring. Copy queued spans directly into the native AAC input loan, preserve source timestamps and retire partial queue loans on cancellation. Exercise admission, prebuffering, chunk boundaries, cancellation and concurrent producers; extend the native receiver fixture with pre-format PCM.
2026-11-12 12:33:29 +01:00
Codex 323d3a2367 record: lend contiguous queued PCM to the native mux
Keep contiguous PCM in the SPSC ring until acknowledgement and retain bounded staging for wrapped packets. The AVFoundation worker and cancellation drain use this offer; existing copy-based callers retain their queue-capacity behavior. Exercise loan identity, producer pressure, wrapped headers/payloads, EOF and concurrent packet retirement.
2026-11-12 12:18:45 +01:00
Codex d8bd21a89e record: use canonical AudioToolbox AAC-LC format flags
The AAC-LC format ID uses no flags; the MPEG-4 object type belongs in ASC, not the stream-description flags. Native macOS returns zero and was rejected by the old admission check. Model that canonical result independently and keep rejecting wrong flags, codec, rate, channels, frame count and property size.
2026-11-12 11:03:48 +01:00
Codex be70b9eaea record: connect native Apple packets to FLV and RTMP
Service borrowed VideoToolbox and AudioToolbox producers through the shared FLV mux and READY RTMP client. Require explicit compatible output epochs for native AAC priming and retain payload loans until network retirement. Keep native encoder ownership with the caller during failure cleanup. Add independent wire-clock, backpressure, cancellation and concurrent PCM-producer contracts. Frontend selection remains gated on native Apple acceptance.
2026-11-12 10:45:16 +01:00
Codex ec1fc806d5 record: expose borrowed native AVC and HEVC configuration
Read bounded avcC/hvcC records from the retained-by-caller format and keep header bytes borrowed during cold mux setup. Reject absent or malformed atom values before accessing CFData. Gate native exported headers through the shared FLV mux alongside packet loan checks.
2026-11-12 10:32:50 +01:00
Codex 12ff7f9842 record: borrow VideoToolbox encoded packet views
Keep contiguous CoreMedia payloads borrowed until the streaming consumer returns them. Reserve bounded setup storage for fragmented blocks and reject changed formats, inexact clocks and premature reuse. Exercise the view in portable ownership contracts and the native Metal encode pipeline; frontend streaming selection remains unchanged.
2026-11-12 10:25:03 +01:00
Codex d7f44832a6 record: add worker-owned AudioToolbox AAC packet encoding
Lend two fixed PCM buffers so native callback retention cannot race reuse. Borrow raw AAC output until release, preserve source-frame timestamps, expose priming and final input counts, and keep cancellation ownership explicit.

Add portable callback/loan fault contracts and a native AAC decode oracle with retained failure artifacts. This foundation does not enable Apple streaming; native format, priming and PCM acceptance must pass before landing.
2026-11-12 10:13:38 +01:00
Codex a232f38143 record: accept borrowed AV1 OBUs in the stream adapter
Use the AV1 native-header mux and submit sized temporal units without Annex B conversion. Keep source color and depth validation and retain worker packets until network release.

Cover rejected configuration, backpressure and video-only drain. Frontend AV1 streaming remains disabled until native encoder acceptance passes.
2026-11-12 09:41:00 +01:00
Codex 654744fbce record: stream native HEVC and HDR over Enhanced RTMP
Select HEVC Annex B framing and advertise the actual encoder and optional AAC track during worker setup. Derive colorInfo from coded encoder metadata, preserving absent mastering/light values and the existing core HDR ABI. Keep packet/audio leases and bounded worker scheduling unchanged.

Allow native HEVC streaming in the frontend and use its smaller FLV packet limit. Cover admission/teardown contracts, real SDR/PQ/HLG GPU streams, wire color metadata and threaded/direct frontend streaming. Correct the native fixture to use the codec-specific packet bound.
2026-11-11 01:02:40 +01:00
Codex 2f6cdda706 record: stream native NVENC video and AAC over RTMP
Connect the I/O-owned publisher to borrowed encoder packets and direct native AAC input. Keep producer input pending until publish setup completes, schedule network readiness alongside GPU completion, and bound setup and final drain.

Cover packet lifetime and cancellation contracts, native socket wakes, and independent GPU/AAC receiver decoding. Preserve file recording and reject unsupported streaming formats explicitly.
2026-11-10 23:46:07 +01:00
Codex 122da7195a record: add borrowed native Windows AAC encoding
Lend native PCM input and retain raw AAC output until its consumer returns the packet. Keep native calls on one recording I/O owner, bound input admission, preserve source timestamps and load optional Media Foundation entry points at runtime.

Use private interface IDs to avoid bulk SDK GUID collisions. Verify real Windows encoding against an independent decoder, including mono/stereo, supported rates and bitrates, partial blocks, large clocks, cancellation and owner checks.
2026-11-10 22:23:07 +01:00
LibretroAdmin 0a0c008538 Mux Vulkan recordings with native PCM and file output
Connect bounded encoder packet borrows and AC-3 audio to MP4 output on an I/O worker. Convert borrowed PCM ring spans directly into encoder input and reuse exclusive file creation while preserving short-write and finalization errors.
2026-11-09 06:59:27 +01:00
LibretroAdmin eda83a779b Feed Vulkan recording through the GPU frame queue
Retain queued input across encoder backpressure and return slots only after compressed packet acknowledgement. Stop admission on encoder failure and preserve leases until producer GPU retirement and encoder teardown.
2026-11-09 06:19:07 +01:00
LibretroAdmin a4cde9db7d Fix clang warnings from the macOS build
rslc_front: the parser's error returns go through rslc_p_fail()'s
false directly instead of a comma expression. encoding_deflate: the
past-end refill counts its overrun in a branch. gl2: drop an unused
local. record_ffmpeg: ok starts false and the lowered-thread flag lives
only under FFMPEG_HAVE_THREAD_NICE. rgui: subtitle glyph counts are
narrowed after clamping to the column count. r7z: pend_method takes
the resumable coder's method ID explicitly as 32 bits.
2026-11-08 19:52:02 +01:00
LibretroAdmin b6743ae168 ffmpeg: recorder log lines and core subtitles without locks
The recorder's av_log callback builds each line in a slot of the
calling thread's own, claimed with a compare-and-swap and released once
the line is out, so lines from the encoder threads never splice and no
call waits on another.

The ffmpeg core hands each subtitle track's newest change to the thread
that renders through a one-slot mailbox swapped with a single exchange;
only that thread calls into libass, seeks included. A change supersedes
the one before it, so the held memory stays bounded when nothing
renders. Targets without pointer atomics keep a lock around the swap.

samples/cores/ffmpeg_ass_events checks the hand-off against a libass
stand-in, and samples/record/ffmpeg_pipeline gains a lane for whole log
lines from several threads.
2026-10-31 10:18:03 +01:00