[VideoToolbox] Add strongly typed LogTransferFunction to VTCompressionProperties
- Dominant language
- C#
- Stars
- 2.9k
- Forks
- 576
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 123
Description
## Summary
`VTCompressionProperties.LogTransferFunction` is currently bound as a plain `string` property (backed by `kVTCompressionPropertyKey_LogTransferFunction`). We should add a strongly typed version using `CMFormatDescriptionLogTransferFunction` (already defined in CoreMedia), following the same pattern used elsewhere in the codebase — renaming the existing `string` property to `WeakLogTransferFunction` and adding a new strongly typed `LogTransferFunction` property.
## Background
The property was added in PR #25990 ([VideoToolbox] Update bindings up to Xcode 27 Beta 3). At the time, it was left as a plain `string` because other values beyond those in `CMFormatDescriptionLogTransferFunction` are allowed. A follow-up was requested by @rolfbjarne.
## Proposed Change
In `src/videotoolbox.cs`, on the `VTCompressionProperties` interface:
```csharp
// Current (plain string):
[TV (27, 0), MacCatalyst (27, 0), Mac (27, 0), iOS (27, 0)]
[Export ("LogTransferFunction")]
string LogTransferFunction { get; set; }
// Proposed (rename existing to Weak, add strongly typed):
[TV (27, 0), MacCatalyst (27, 0), Mac (27, 0), iOS (27, 0)]
[Export ("LogTransferFunction")]
[Internal]
string WeakLogTransferFunction { get; set; }
[TV (27, 0), MacCatalyst (27, 0), Mac (27, 0), iOS (27, 0)]
[Wrap ("WeakLogTransferFunction")]
CMFormatDescriptionLogTransferFunction LogTransferFunction { get; set; }
```
## References
- `CMFormatDescriptionLogTransferFunction` is defined in `src/coremedia.cs`
- Similar pattern: `CMFormatDescription` in CoreMedia uses the same weak/strong convention for log transfer function values
- Filed from PR #25990 review comment: https://github.com/dotnet/macios/pull/25990#discussion_r3549377389
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in src/videotoolbox.cs at the VTCompressionProperties interface, then read CMFormatDescriptionLogTransferFunction in src/coremedia.cs and compare the similar CMFormatDescription weak/strong convention. Done means the existing exported string remains available under the weak name and the typed LogTransferFunction binding follows the requested availability annotations and wrapper pattern.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100