Skip to content

Commit 8aec35a

Browse files
committed
Allow primary planes to be overlays for video underlays
1 parent a3237b7 commit 8aec35a

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

  • app/streaming/video/ffmpeg-renderers

app/streaming/video/ffmpeg-renderers/drm.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -806,10 +806,16 @@ bool DrmRenderer::initialize(PDECODER_PARAMETERS params)
806806
}
807807

808808
DrmPropertyMap props { m_DrmFd, planeRes->planes[i], DRM_MODE_OBJECT_PLANE };
809-
// Only consider overlay planes as valid targets
810-
if (auto type = props.property("type"); type->initialValue() != DRM_PLANE_TYPE_OVERLAY) {
811-
drmModeFreePlane(plane);
812-
continue;
809+
// Only consider overlay or primary planes as valid targets
810+
// The latter might seem strange, but some DRM devices use
811+
// underlays where the YUV-compatible overlay plane resides
812+
// underneath the primary plane. In this case, we will use
813+
// the primary plane as an overlay plane on top of the video.
814+
if (auto type = props.property("type"))
815+
if (type->initialValue() != DRM_PLANE_TYPE_OVERLAY && type->initialValue() != DRM_PLANE_TYPE_PRIMARY) {
816+
drmModeFreePlane(plane);
817+
continue;
818+
}
813819
}
814820

815821
// The overlay plane must support ARGB8888

0 commit comments

Comments
 (0)