d3d11decoder: Refactor for more unified decoding flow
authorSeungha Yang <seungha@centricular.com>
Wed, 15 Sep 2021 15:59:37 +0000 (00:59 +0900)
committerSeungha Yang <seungha@centricular.com>
Fri, 17 Sep 2021 11:03:28 +0000 (20:03 +0900)
commit7d1f6459a09f23d6f0735956f0cd14fdefdaf16d
treea98292de34f7ddb52b0c267aca6dae50df2fd0a2
parenta77f793c8bc4559367604e3203a07c5841d64c06
d3d11decoder: Refactor for more unified decoding flow

... and various code cleanup.

* Move spreaded decoding API calls into one method
Previously, decoding flow of most codecs are
- Call DecoderBeginFrame() on start_picture()
- Call {Get,Release}DecoderBuffer() on decode_slice()
- Call SubmitDecoderBuffers() and DecoderEndFrame() on end_picture()
Such spreaded API calls make it hard to keep track of status
of decoding. Now it will be done at once in a new method.

* Drop a code for non-zero wBadSliceChopping
When bitstream buffer provided by driver is not sufficient
to write compressed bitstream data, host decoder needs to make use
of wBadSliceChopping so that driver can understand there are
multiple bitstream buffer. But it's a bit unrealistic and
not tested. Since FFMpeg's DXVA implemetaion doesn't support it,
we might be able to ignore the case for now.

* Make code more portable
Consider common logic of GstCodecs -> DXVA translation for all D3D APIs
(i,e., D3D9, D3D11, and D3D12).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2525>
15 files changed:
sys/d3d11/gstd3d11av1dec.cpp
sys/d3d11/gstd3d11av1dec.h
sys/d3d11/gstd3d11decoder.cpp
sys/d3d11/gstd3d11decoder.h
sys/d3d11/gstd3d11h264dec.cpp
sys/d3d11/gstd3d11h264dec.h
sys/d3d11/gstd3d11h265dec.cpp
sys/d3d11/gstd3d11h265dec.h
sys/d3d11/gstd3d11mpeg2dec.cpp
sys/d3d11/gstd3d11mpeg2dec.h
sys/d3d11/gstd3d11vp8dec.cpp
sys/d3d11/gstd3d11vp8dec.h
sys/d3d11/gstd3d11vp9dec.cpp
sys/d3d11/gstd3d11vp9dec.h
sys/d3d11/plugin.cpp