The format is only checked for 10-bit capable formats, which in this
case applies to HEVC only. When HEVC is disabled, then `format` is
not checked and becomes an unused variable otherwise.
Existing code made use of macros which broke parsing in Xcode and
complicated debugging as crucial code was executed within macros and
not actual source code.
Use of mutable CoreFramework data structures (which were never mutated)
is replaced by use of faster non-mutable variants.
When an allocator needs to be used, `kCFAllocatorDefault` is specified
explicitly.
VideoToolbox session properties are also set in bulk instead of
multiple consecutive calls.
Also simplifies detection of Apple Silicon hosts to make code more
readable.
Copying the encoder list takes a while which blocks the main thread.
Doing the copying asynchronously removes instead of blocking the main
thread improves startup performance by about 60ms.
Both rate control methods only work on hardware encoders and will error
out when selected for software encoders, so we shouldn't show them there
Co-Authored-By: Sebastian Beckmann <beckmann.sebastian@outlook.de>
The session_set_bitrate method already returns an OSStatus to confirm
that everything has been successful. As such, a second check to make
sure that the bitrate has indeed changed is redundant and only adds
unnecessary code.