Loading media/codec2/sfplugin/Android.bp +4 −0 Original line number Original line Diff line number Diff line Loading @@ -37,6 +37,10 @@ cc_library_shared { "media_ndk_headers", "media_ndk_headers", ], ], static_libs: [ "SurfaceFlingerProperties", ], shared_libs: [ shared_libs: [ "android.hardware.cas.native@1.0", "android.hardware.cas.native@1.0", "android.hardware.drm@1.0", "android.hardware.drm@1.0", Loading media/codec2/sfplugin/Codec2InfoBuilder.cpp +9 −2 Original line number Original line Diff line number Diff line Loading @@ -33,6 +33,7 @@ #include <OMX_Video.h> #include <OMX_Video.h> #include <OMX_VideoExt.h> #include <OMX_VideoExt.h> #include <OMX_AsString.h> #include <OMX_AsString.h> #include <SurfaceFlingerProperties.sysprop.h> #include <android/hardware/media/omx/1.0/IOmx.h> #include <android/hardware/media/omx/1.0/IOmx.h> #include <android/hardware/media/omx/1.0/IOmxObserver.h> #include <android/hardware/media/omx/1.0/IOmxObserver.h> Loading Loading @@ -158,6 +159,12 @@ bool addSupportedProfileLevels( // TODO: directly check this from the component interface // TODO: directly check this from the component interface supports10Bit = (supportsHdr || supportsHdr10Plus); supports10Bit = (supportsHdr || supportsHdr10Plus); // If the device doesn't support HDR display, then no codec on the device // can advertise support for HDR profiles. // Default to true to maintain backward compatibility auto ret = sysprop::SurfaceFlingerProperties::has_HDR_display(); bool hasHDRDisplay = ret.has_value() ? *ret : true; bool added = false; bool added = false; for (C2Value::Primitive profile : profileQuery[0].values.values) { for (C2Value::Primitive profile : profileQuery[0].values.values) { Loading @@ -183,8 +190,8 @@ bool addSupportedProfileLevels( if (mapper && mapper->mapProfile(pl.profile, &sdkProfile) if (mapper && mapper->mapProfile(pl.profile, &sdkProfile) && mapper->mapLevel(pl.level, &sdkLevel)) { && mapper->mapLevel(pl.level, &sdkLevel)) { caps->addProfileLevel((uint32_t)sdkProfile, (uint32_t)sdkLevel); caps->addProfileLevel((uint32_t)sdkProfile, (uint32_t)sdkLevel); // also list HDR profiles if component supports HDR // also list HDR profiles if component supports HDR and device has HDR display if (supportsHdr) { if (supportsHdr && hasHDRDisplay) { auto hdrMapper = C2Mapper::GetHdrProfileLevelMapper(trait.mediaType); auto hdrMapper = C2Mapper::GetHdrProfileLevelMapper(trait.mediaType); if (hdrMapper && hdrMapper->mapProfile(pl.profile, &sdkProfile)) { if (hdrMapper && hdrMapper->mapProfile(pl.profile, &sdkProfile)) { caps->addProfileLevel((uint32_t)sdkProfile, (uint32_t)sdkLevel); caps->addProfileLevel((uint32_t)sdkProfile, (uint32_t)sdkLevel); Loading Loading
media/codec2/sfplugin/Android.bp +4 −0 Original line number Original line Diff line number Diff line Loading @@ -37,6 +37,10 @@ cc_library_shared { "media_ndk_headers", "media_ndk_headers", ], ], static_libs: [ "SurfaceFlingerProperties", ], shared_libs: [ shared_libs: [ "android.hardware.cas.native@1.0", "android.hardware.cas.native@1.0", "android.hardware.drm@1.0", "android.hardware.drm@1.0", Loading
media/codec2/sfplugin/Codec2InfoBuilder.cpp +9 −2 Original line number Original line Diff line number Diff line Loading @@ -33,6 +33,7 @@ #include <OMX_Video.h> #include <OMX_Video.h> #include <OMX_VideoExt.h> #include <OMX_VideoExt.h> #include <OMX_AsString.h> #include <OMX_AsString.h> #include <SurfaceFlingerProperties.sysprop.h> #include <android/hardware/media/omx/1.0/IOmx.h> #include <android/hardware/media/omx/1.0/IOmx.h> #include <android/hardware/media/omx/1.0/IOmxObserver.h> #include <android/hardware/media/omx/1.0/IOmxObserver.h> Loading Loading @@ -158,6 +159,12 @@ bool addSupportedProfileLevels( // TODO: directly check this from the component interface // TODO: directly check this from the component interface supports10Bit = (supportsHdr || supportsHdr10Plus); supports10Bit = (supportsHdr || supportsHdr10Plus); // If the device doesn't support HDR display, then no codec on the device // can advertise support for HDR profiles. // Default to true to maintain backward compatibility auto ret = sysprop::SurfaceFlingerProperties::has_HDR_display(); bool hasHDRDisplay = ret.has_value() ? *ret : true; bool added = false; bool added = false; for (C2Value::Primitive profile : profileQuery[0].values.values) { for (C2Value::Primitive profile : profileQuery[0].values.values) { Loading @@ -183,8 +190,8 @@ bool addSupportedProfileLevels( if (mapper && mapper->mapProfile(pl.profile, &sdkProfile) if (mapper && mapper->mapProfile(pl.profile, &sdkProfile) && mapper->mapLevel(pl.level, &sdkLevel)) { && mapper->mapLevel(pl.level, &sdkLevel)) { caps->addProfileLevel((uint32_t)sdkProfile, (uint32_t)sdkLevel); caps->addProfileLevel((uint32_t)sdkProfile, (uint32_t)sdkLevel); // also list HDR profiles if component supports HDR // also list HDR profiles if component supports HDR and device has HDR display if (supportsHdr) { if (supportsHdr && hasHDRDisplay) { auto hdrMapper = C2Mapper::GetHdrProfileLevelMapper(trait.mediaType); auto hdrMapper = C2Mapper::GetHdrProfileLevelMapper(trait.mediaType); if (hdrMapper && hdrMapper->mapProfile(pl.profile, &sdkProfile)) { if (hdrMapper && hdrMapper->mapProfile(pl.profile, &sdkProfile)) { caps->addProfileLevel((uint32_t)sdkProfile, (uint32_t)sdkLevel); caps->addProfileLevel((uint32_t)sdkProfile, (uint32_t)sdkLevel); Loading