Skip to content

d3d11vp9dec: Add support for internal frame resizing

d3d11vp9dec: Add support for internal frame resizing

VP9 codec allows resizing reference frame by spec. Handling this case
is a bit tricky especially when the resizing happens on non-keyframe,
because pre-allocated decoder textures (i.e., dpb) have negotiated
resolution and to change resolution meanwhile decoding on non-keyframe,
each texture might need to be re-created, copied to new dpb somehow,
and re-negotiated with downstream.

Due to the complicated requirement of negotiation driven
resizing handling, this commit adds shader into d3d11decoder object
to resize only corresponding frames. Note that if the resolution change
is detected on keyframe, decoder will re-negotiate with downstream.
d3d11decoder: Set GstVideoAlignment to downstream d3d11 buffer pool

To copy decoder output texture to another d3d11 texture, the downstream
texture needs to be aligned too.
d3d11decoder: Use aligned resolution for staging texture

Not only any textures for decoder output view, any destination texture
which would be copied from decoder output texture need to be aligned too.
Otherwise driver sometimes crashed/hung (not sure why).
d3d11colorconverter: Add support cropping

Vertex buffer will be updated if input texture resolution is different
from GstVideoInfo or when an user requests specific crop area.
d3d11bufferpool: Add padding space for semi-planar YUV formats

Resolution of NV12, P010, and P016 formats must be multiple of two.
Otherwise texture cannot be created. Instead of doing this alignment
per API consumer side, do this in buffer pool for simplicity.

Closes: #1233 (closed)

Merge request reports