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
5 changes: 5 additions & 0 deletions rs/moq-nvenc/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- `Session::register_generic_resource` and `Session::register_cuda_resource` only register the allocation; call `RegisteredResource::map` for each encode and pass the returned `MappedResource` to `Session::encode_picture`. Registration is the expensive call, so a reused input registers once.
- `RegisteredResource::map` refuses with `ErrorKind::InvalidCall` once an earlier mapping never unmapped (it failed to unmap, or its submission was abandoned or forgotten), and such a registration never releases its allocation.

## [0.1.2](https://github.com/moq-dev/moq/compare/moq-nvenc-v0.1.1...moq-nvenc-v0.1.2) - 2026-09-26

### Fixed
Expand Down
12 changes: 7 additions & 5 deletions rs/moq-nvenc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ driver handles, and returns a submission that keeps input and output resources
alive until synchronous completion. Raw SDK structs remain available under
`sys`; APIs that accept their pointers are explicitly unsafe.

External input registration is transactional. If NVENC registers an allocation
but cannot map it, the safe wrapper unregisters it before releasing its owner.
When rollback also fails, the mapping error remains primary, the unregister
error is available through `EncodeError::cleanup`, and the allocation stays
owned because the driver may still refer to it.
An external input is registered once and mapped for each encode, as NVENC
expects: registration is the expensive call, and the allocation may be written
only while unmapped. A registration marks itself mapped before handing out a
mapping and clears the mark only once that mapping unmaps, so when an unmap or
unregister fails, or a submission is abandoned or forgotten, the allocation
stays owned because the driver may still refer to it, and no later mapping is
allowed.

The `sys` bindings are generated with bindgen from the vendored headers
(`src/sys/headers/`); see the [upstream repo](https://github.com/ViliamVadocz/nvidia-video-codec-sdk)
Expand Down
Loading