Vendor filtering based on device SDK

This commit is contained in:
hyugogirubato 2024-07-07 16:26:54 +02:00
parent 9400e5e7b0
commit 405c184558
2 changed files with 16 additions and 15 deletions

View File

@ -82,32 +82,31 @@ OEM_CRYPTO_API = {
# Add more as needed for different versions. # Add more as needed for different versions.
} }
# TODO: Add minimum required sdk
CDM_VENDOR_API = { CDM_VENDOR_API = {
'mediaserver': { 'mediaserver': {
Vendor(11, '1.0', 'libwvdrmengine.so') # 23 Vendor(23, 11, '1.0', 'libwvdrmengine.so')
}, },
'mediadrmserver': { 'mediadrmserver': {
Vendor(11, '1.0', 'libwvdrmengine.so') # 24 Vendor(24, 11, '1.0', 'libwvdrmengine.so')
}, },
'android.hardware.drm@1.0-service.widevine': { 'android.hardware.drm@1.0-service.widevine': {
Vendor(13, '5.1.0', 'libwvhidl.so') # 26 Vendor(26, 13, '5.1.0', 'libwvhidl.so')
}, },
'android.hardware.drm@1.1-service.widevine': { 'android.hardware.drm@1.1-service.widevine': {
Vendor(14, '14.0.0', 'libwvhidl.so') # 28 Vendor(28, 14, '14.0.0', 'libwvhidl.so')
}, },
'android.hardware.drm@1.2-service.widevine': { 'android.hardware.drm@1.2-service.widevine': {
Vendor(15, '15.0.0', 'libwvhidl.so') # 29 Vendor(29, 15, '15.0.0', 'libwvhidl.so')
}, },
'android.hardware.drm@1.3-service.widevine': { 'android.hardware.drm@1.3-service.widevine': {
Vendor(16, '16.0.0', 'libwvhidl.so') # 30 Vendor(30, 16, '16.0.0', 'libwvhidl.so')
}, },
'android.hardware.drm@1.4-service.widevine': { 'android.hardware.drm@1.4-service.widevine': {
Vendor(16, '16.1.0', 'libwvhidl.so') # 31 Vendor(31, 16, '16.1.0', 'libwvhidl.so')
}, },
'android.hardware.drm-service.widevine': { 'android.hardware.drm-service.widevine': {
Vendor(17, '17.0.0', 'libwvaidl.so'), # 33 Vendor(33, 17, '17.0.0', 'libwvaidl.so'),
Vendor(18, '18.0.0', 'android.hardware.drm-service.widevine') # 34 Vendor(34, 18, '18.0.0', 'android.hardware.drm-service.widevine')
} }
} }

View File

@ -1,17 +1,19 @@
class Vendor: class Vendor:
""" """
Represents a Vendor with OEM, version, and name attributes. Represents a Vendor with SDK, OEM, version, and name attributes.
""" """
def __init__(self, oem: int, version: str, name: str): def __init__(self, sdk: int, oem: int, version: str, name: str):
""" """
Initializes a Vendor instance. Initializes a Vendor instance.
Args: Args:
oem (int): The OEM identifier. sdk (int): Minimum SDK version required.
version (str): The version of the vendor. oem (int): OEM identifier.
name (str): The name of the vendor. version (str): Version of the vendor.
name (str): Name of the vendor.
""" """
self.sdk = sdk
self.oem = oem self.oem = oem
self.version = version self.version = version
self.name = name self.name = name