vtenc: Fix checking for certain CPU variants when running in VMs
authorPiotr Brzeziński <piotr@centricular.com>
Tue, 28 Feb 2023 14:26:45 +0000 (15:26 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 28 Feb 2023 17:31:54 +0000 (17:31 +0000)
commit9a2462391b46aa388f5d4e0102ef4ee74df2f8f1
tree3205b44f1d7fc0b1d71fcc02453dda709b981b00
parentf1bc3e6d88a3ebc1769f9c888fa4c1b1f39601dc
vtenc: Fix checking for certain CPU variants when running in VMs

These checks were introduced to prevent exposing ARGB64/RGBA64 in the caps
when running on M1 Pro/Max with macOS <13 because of a bug in VideoToolbox.
Unfortunately, the initial buffer size of 15 is too short when running
in a VM - the CPU brand string there looks like "Apple M1 Pro (Virtual)",
which due to its length causes sysctlbyname to return -1, resulting in
broken formats still showing up in the caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4082>
subprojects/gst-plugins-bad/sys/applemedia/vtenc.c