mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 03:31:05 +00:00
d3d12vp9dec: Disallow resolution change to larger size on non-keyframe
Intel GPU seems to be crashing if the case happens. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6709>
This commit is contained in:
parent
376aaa828d
commit
0f5f170a40
3 changed files with 38 additions and 2 deletions
|
@ -915,6 +915,34 @@ gst_d3d12_decoder_new_picture (GstD3D12Decoder * decoder,
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GstFlowReturn
|
||||||
|
gst_d3d12_decoder_new_picture_with_size (GstD3D12Decoder * decoder,
|
||||||
|
GstVideoDecoder * videodec, GstCodecPicture * picture, guint width,
|
||||||
|
guint height)
|
||||||
|
{
|
||||||
|
g_return_val_if_fail (GST_IS_D3D12_DECODER (decoder), GST_FLOW_ERROR);
|
||||||
|
g_return_val_if_fail (GST_IS_VIDEO_DECODER (videodec), GST_FLOW_ERROR);
|
||||||
|
g_return_val_if_fail (picture != nullptr, GST_FLOW_ERROR);
|
||||||
|
|
||||||
|
auto priv = decoder->priv;
|
||||||
|
if (!priv->session) {
|
||||||
|
GST_ERROR_OBJECT (decoder, "No session configured");
|
||||||
|
return GST_FLOW_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (priv->session->coded_width >= width &&
|
||||||
|
priv->session->coded_height >= height) {
|
||||||
|
return gst_d3d12_decoder_new_picture (decoder, videodec, picture);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* FIXME: D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_ALLOW_RESOLUTION_CHANGE_ON_NON_KEY_FRAME
|
||||||
|
* supported GPU can decode stream with mixed decoder heap */
|
||||||
|
GST_ERROR_OBJECT (decoder,
|
||||||
|
"Non-keyframe resolution change with larger size is not supported");
|
||||||
|
|
||||||
|
return GST_FLOW_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
static inline GstD3D12DecoderPicture *
|
static inline GstD3D12DecoderPicture *
|
||||||
get_decoder_picture (GstCodecPicture * picture)
|
get_decoder_picture (GstCodecPicture * picture)
|
||||||
{
|
{
|
||||||
|
|
|
@ -130,6 +130,12 @@ GstFlowReturn gst_d3d12_decoder_new_picture (GstD3D12Decoder * decoder,
|
||||||
GstVideoDecoder * videodec,
|
GstVideoDecoder * videodec,
|
||||||
GstCodecPicture * picture);
|
GstCodecPicture * picture);
|
||||||
|
|
||||||
|
GstFlowReturn gst_d3d12_decoder_new_picture_with_size (GstD3D12Decoder * decoder,
|
||||||
|
GstVideoDecoder * videodec,
|
||||||
|
GstCodecPicture * picture,
|
||||||
|
guint width,
|
||||||
|
guint height);
|
||||||
|
|
||||||
GstFlowReturn gst_d3d12_decoder_duplicate_picture (GstD3D12Decoder * decoder,
|
GstFlowReturn gst_d3d12_decoder_duplicate_picture (GstD3D12Decoder * decoder,
|
||||||
GstCodecPicture * src,
|
GstCodecPicture * src,
|
||||||
GstCodecPicture * dst);
|
GstCodecPicture * dst);
|
||||||
|
|
|
@ -266,9 +266,11 @@ gst_d3d12_vp9_dec_new_picture (GstDxvaVp9Decoder * decoder,
|
||||||
GstCodecPicture * picture)
|
GstCodecPicture * picture)
|
||||||
{
|
{
|
||||||
auto self = GST_D3D12_VP9_DEC (decoder);
|
auto self = GST_D3D12_VP9_DEC (decoder);
|
||||||
|
auto vp9pic = GST_VP9_PICTURE (picture);
|
||||||
|
|
||||||
return gst_d3d12_decoder_new_picture (self->decoder,
|
return gst_d3d12_decoder_new_picture_with_size (self->decoder,
|
||||||
GST_VIDEO_DECODER (decoder), picture);
|
GST_VIDEO_DECODER (decoder), picture, vp9pic->frame_hdr.width,
|
||||||
|
vp9pic->frame_hdr.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
|
|
Loading…
Reference in a new issue