Rémi Bernon (@rbernon) commented about dlls/winegstreamer/h264_decoder.c:
+ { + IMFMediaBuffer_Unlock(decoder->temp_buffer); + goto done; + } + row_count = current_length / decoder->wg_format.u.video.width; + if (dst_length / dst_pitch != row_count) + { + ERR("Row count mismatch %ld vs %ld.\n", row_count, dst_length / dst_pitch); + IMFMediaBuffer_Unlock(decoder->temp_buffer); + IMF2DBuffer2_Unlock2D(dst_buffer); + goto done; + } + hr = MFCopyImage(dst_data, dst_pitch, src_data, decoder->wg_format.u.video.width, + decoder->wg_format.u.video.width, row_count); + + IMFMediaBuffer_Unlock(decoder->temp_buffer); I don't think this last commit should be done here. I understand that currently the wg_sample will force the D3D buffer to be copied to CPU first when locking, but the fix should probably to map the wg_sample memory with Lock2DSize like this here, and support writing directly into it from gstreamer side.
Probably that would be a separate MR if it's not a trivial change. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/2587#note_29042