boolean return value is not sufficient for representing the reason
of error in most cases. For instance, any errors around new_sequence()
would mean negotiation error, not just *ERROR*.
And some subclasses will allocate buffer/memory/surface on new_picture()
but it could be failed because of expected error, likely flushing
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2528>
Initially we tried to use the internal color conversion used in i965
and Gallium drivers when decoding. But this approach has showed
limitations and problems.
This patch removes completely the possible color conversion at
decoding, since it show problems with deinterlacing, for example:
gst-launch-1.0 filesrc location=interlaced.mpg2 ! parsebin ! vampeg2dec ! vadeinterlace ! xvimagesink
Allowing only the surface formats when decoding is more stable.
For color conversion is better to do it explicitly with vapostproc.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2531>
... 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>
In the h264, the Baseline profile is widely misused. A lot of streams declare
that they are the Baseline, but in fact they just conform to ConstrainedBaseline.
The features such as FMO and ASO are not used at all.
If the decoder does not strictly conforms to the SPEC, we can just use Baseline
or Main profile to decode it to avoid lots of streams failure.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2428>
In order to install the color balance interface, a GstVaFilter is
instantiated and queried to know if it supports color balance
filter. It was done just after the GObject was registered. Now, it's
done before.
The reason of this change is that deinterlace element has to be
registered only if deinterlace filter is available, using only one
instantiate of GstVaFilter.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2495>
User can get the required buffer size by using buffer pool config.
Since d3d11 implementation is a candidate for public library in the future,
we need to hide everything from header as much as possible.
Note that the total size of allocated d3d11 texture memory by GPU is not
controllable factor. It depends on hardware specific alignment/padding
requirement. So, GstD3D11 implementation updates actual buffer size
by allocating D3D11 texture, since there's no way to get CPU accessible
memory size without allocating real D3D11 texture.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2482>
Split fields ends up on multiple picture and requires accessing the
other_field to complete the information (POC).
This also cleanup the DPB from non-reference (was not useful) and skips
properly merge field instead of keeping them duplicated. This fixes most
of interlace decoding seen in fluster.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2474>
When a frame is composed of two fields, the base class now split the
picture in two. In order to support this, we need to ensure that picture
buffer is held in VB2 queue so that the second field get decoded into
it. This also implements the new_field_picture() virtual and sets the
previous request on the new picture.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2474>
Originally, if a buffer arrives with crop meta but downstream doesn't
handle crop allocation meta, vapostproc tried to reconfigure itself to
non pass-through mode automatically. Sadly, this behavior was based on
the wrong assumption that propose_allocation() vmethod would bring
downstream allocation query, but it is not.
Now, if vapostproc is in pass-through mode, the cropping is passed to
downstream. Pass-through mode can be disabled via a parameter.
Finally, if pass-through mode isn't enabled, it's assumed the buffer
is going to be processed and, if cropping, downstream already
negotiated the cropped frame size, thus it's required to do the
cropping inside vapostproc to avoid artifacts because of the size of
downstream allocated buffers.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2443>
There are three framerate conversion algorithms described in
<https://github.com/Intel-Media-SDK/MediaSDK/blob/master/doc/mediasdk-man.md>,
interpolation is not implemented so far and thus distributed timestamp algorihtm
is considered to be more practical which evenly distributes output timestamps
according to output framerate. In this case, newly generated frames are inserted
between current frame and previous one, timestamp is calculated by msdk API.
This implementation first pushes newly generated buffers(outbuf_new) forward and
the current buffer(outbuf) is handled at last round by base transform automatically.
A flag "create_new_surface" is used to indicate if new surfaces have been generated
and then push new outbuf forward accordingly.
Considering the upstream element may not be the msdk element, it is necessary to
always set the input surface timestamp as same as input buffer's timestamp and
convert it to msdk timestamp.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2418>