The use of gst_caps_is_always_compatible() for this optimization may lead to
false positives. It is better to stick to gst_caps_is_strictly_equal() to know
if it is required a re-negotiation.
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=750835
Delaying the pool re-negotiation untill we push all decoded (and queued)
frames downstream. Otherwise for the multi-resolution videos, the
GstVideoVideoMemory will be having wrong resolution and which leads
to nasty behaviours, especially when using software renderers.
sample media file: RAP_B_Bossen_1.bin
case explained:
The first SPS Nal will report resoultion of 448x256 and having crop rectangles to
get the final resoultion 416x240.
Starting from 25 th frame, the resolution will change to 416x240. But parser
elements won't report this since the effective croped resolution is same in
both cases. Here the core libgstvaapi will detect this through it's internal
parsing and do all context/pool destory/reset stuffs. Also it will notify this
change to plugins in advance. But if the plugin try to do re-negotiaion of pool
immediately, this will not sync with the resolution of already decoded and queued
frames and which will lead to failure in gst_video_frame_map() in downstream(if we use the
software renderer). So we have to delay the pool renegotiation in vaapidecode,
untill we push all decoded frames downstream.
https://bugzilla.gnome.org/show_bug.cgi?id=753914
Currently we are sharing the input GstVideoCodecState with
GstVaapiDecoder(gst-libs/gst/vaapi) by just doing ref and unref for
each caps change. This is troublesome in many cases, for eg: if
resoultion changes with in a singe stream. Because, when ever there
is a resolution change, GstVideoDecoder will first change the Codec_state->caps
fields with new resolution, but since we are using the same codecstate (ref)
in gstvaapidecode.c, the caps check for input caps change will always fail.
https://bugzilla.gnome.org/show_bug.cgi?id=753914
The default scan order of scaling lists are up-right-diagonal
as per hevc specification. Use the newly implemented
uprightdiagonal_to_raster conversion codecparser APIs to
get the the scaling_list values in raster order, which is
what the VA intel driver requires.
c207c6d: codecparsers: h265: Fix tile row and column parsing
47074c5: codecparsers: h265: Add APIs for up-right-diagonal/raster scan conversion
cd28b18: codecparsers: h265: Fix the range of delta_chroma_log2_weight_denom
1746bbe: videoparsers: Use gst_base_parse_merge_tags()
2f0932b: h264parse: Clear SPS info after processing
f57d6b0: videoparsers: enable accept-template flag
As the compilation of libvpx (for vp8 parser) is enabled by default,
yasm is required by default too.
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
It is no longer valid in gstreamer-vaapi.
Signed-off-by: Lim Siew Hoon <siew.hoon.lim@intel.com>
[removed unused GST_API_VERSION variable]
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=753618
Setting the sink to flushing causes gst_vaapi_window_wayland_sync() to
return FALSE which makes gst_vaapi_window_wayland_render() return
FALSE which ends up posting an ERROR message in
gst_vaapisink_show_frame_unlocked(). Solution is to just return TRUE
in the EBUSY case.
https://bugzilla.gnome.org/show_bug.cgi?id=753598
If the VPP's deinterlace-method is set, first we should check if the postproc
is already instanced to set it. Otherwise we just store it until the VPP is
added into the bin.
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=749554
There are sometimes that the VA-API display context is not shared among the
pipeline, but it is important to know it before going to READY state (when the
pipeline is already linked).
One instance of this case is this:
gst-launch-1.0 filesrc location=media ! decodebin ! vaapipostproc ! vaapisink
This patch adds a new function in gstvaapipluginutil called
gst_vaapi_create_test_display(). Its purpose is to create a disposable VA-API
display, which only will be used for verify if the VAEntrypointVideoProc is
available by the hardware. Afterwards, it should be unrefed.
If the vaapidecodebin is going to READY state, and the element still doesn't
know if VPP is available, the last resort is to create a new instance of the
VA-API display and test for it.
https://bugzilla.gnome.org/show_bug.cgi?id=749554
If USE_NATIVE_FORMATS is defined we bail out before configuring the surface
info based on the derived image configuration.
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=744042
First added the function gst_vaapi_video_format_get_best_native(), which
returns the best native format that matches a particular chroma type:
YUV 4:2:0 -> NV12, YUV 4:2:2 -> YUY2, YUV 4:0:0 -> Y800
RGB32 chroma and encoded format map to NV12 too.
That format is used to configure, initially, the surface's pool for the
allocator.
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=744042
Before, only YUV420 color space where supported. With this patch, the
encoder is queried to know the supported formats and admits YUV422
color space if its available.
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=744042
This is necessary for finding ChromaOffsetL0/ChromaOffsetL1
prediction weight table values with out using any hard coding.
Fixme: We don't have parser API for sps_range_extension, so
assumed zero value for high_precision_offsets_enabled_flag.
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Based on ITU-T rec H265(4/2015): 7-56
This was a wrong equation in rec H265 (4/2013): 7-44...
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
8e98b41: codecparsers: h265: Fix the range of delta_chroma_log2_weight_denom
839c5bc: codecparsers: h265: Fix the parsing of ref_pic_lists_modification
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
HACK: This is a work-around to identify some main profile streams having wrong profile_idc.
There are some wrongly encoded main profile streams(eg: ENTP_C_LG_3.bin) which doesn't
have any of the profile_idc values mentioned in Annex-A, instead general_profile_idc
has been set as zero and having general_profile_compatibility_flag[general_profile_idc]
is TRUE. Assuming them as MAIN profile for now.
https://bugzilla.gnome.org/show_bug.cgi?id=753226
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
gst_vaapi_video_context_prepare() received an unused parameter. This patch
removes it and the structure passed by the caller.
This a left over of "Removal of gstreamer-1.0 support" (commit 8b36e25f).
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
We are calculating the dpb size based on max_dec_pic_buffering.
But if there are more than one temporal sublayers, we are supposed
to use the max_dec_pic_buffering[max_sub_layers_minus] for dpb
size calculation (Assuming HighestTid as max_sub_layers_minus).
Sample streams: TSCL_A_VIDYO_5.bin, TSCL_B_VIDYO_4.bin
https://bugzilla.gnome.org/show_bug.cgi?id=753226
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Refactor the main vaapi caps strings into three macros:
GST_VAAPI_MAKE_SURFACE_CAPS, GST_VAAPI_MAKE_ENC_SURFACE_CAPS and
GST_VAAPI_MAKE_GLTEXUPLOAD_CAPS.
Those are in gstvaapipluginutil.h so all the elements could use them, instead
of re-declaring them every time.
No functional changes.
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Decoding process for reference picture list construction needs to be
invoked only for P and B slice and the value for slice_type of dependent slice
segment should be taken from the previous independent slice segment header
of the same pic.
https://bugzilla.gnome.org/show_bug.cgi?id=753226
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Those messagse should be attached to the object, also the lack of
caps is not an error, in particular in the case of JPEG encoding.
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=744042
When we query for the VAConfigAttribEncJPEG, we get a value which packs the
VAConfigAttribValEncJPEG structure, but we did not assign it. This patch
assigns the returned value to the attribute.
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=744042
Framerate 0/1 is valid, and it is particularly useful for picture
encoding, such as jpeg. This patch makes the encoder to admit that
framerate.
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=744042
Working on bug #744042 I realized that the gstvaapiuploader is practically not
used.
This patch removes the gstvaapiuploader and add the method
gst_vaapi_plugin_base_get_allowed_raw_caps () that returns the raw caps that
the system can handle, which is used by vaapisink and vaapipostproc.
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=752777
When seeking, the decoder is reset, but the buffer pool is not
re-negotiated, but in reset_full() the code forgets if the negotiated buffer
pool has the GLTextureUpload meta.
The decoder knows that GLTextureUpload meta was negotiated in
decide_allocation(), but this method is not called when seeking.
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=752929
gst_pad_get_allowed_caps() query the pad and the peer pad. In the case
decoders, that is OK, but in the case of the postproc might lead loops,
since the gst_base_transform_query_caps() forwards the query upstream
and forth.
Instead of gst_pad_get_allowed_caps() we only query the peer with
gst_pad_peer_query_caps() using the pad's template as filter.
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
https://bugzilla.gnome.org/show_bug.cgi?id=752558
All API/ABI changes for S3D/MVC are added in 1.5, backporting
them to older verison is not recommended.
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
ed13220: mpegvideometa: add meta transform function
18d5efd: codecparsers: jpeg: add some padding to ScanHdr struct
7a51722: codecparsers: jpeg: fix docs for table parsing functions
06b8ded: codecparsers: jpeg: fix validity checking of data parsed
387a39d: codecparsers: jpeg: fix up API
db9d6a9: codecparsers: jpeg: tweak API a little
bb6951e: codecparsers: jpeg: hide gst_jpeg_scan_for_marker_code()
f33c30c: codecparsers: jpeg: fix and optimize scan for next marker code
4658c30: codecparsers: jpeg: fix calculation of segment size
759bcb9: codecparsers: jpeg: fix default Huffman tables generation
b4811ee: codecparsers: jpeg: add JPEG bitstream parser
9422464: h264parse: fix typo in log message
9e793a0: h264parse: Move PAR calcs, and use them for stereoscopic half-aspect
77704ce: nalutils: trivial patch to check if
8bb9249: codecparsers: mpeg4: actually return full number of bits of resync marker
7862f95: Revert "codecparsers: remove ignored increment of return"
54017b1: h264parse: Add support for passing stereoscopic/multiview info
8667ee4: h264parse: Don't switch to passthrough on set_caps()
Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Improve closure of gaps in frame_num by strictly following and trying
to fill them with previous reference frames. So, they are now tracked
thus avoiding insertion of dummy ("greenish") frames.
If the new picture to be added to the DPB is not a first field, then
it shall be the second field of the previous picture that was added
before.
This removes the need for dpb_find_picture() now that we track the
immediately preceding decoded picture, in decode order.
When a dummy "other-field" is inserted, it is assumed to inherit the
reference flags from the first field, and the sliding window decoded
reference picture marking process is also executed so that corrupted
frames are moved out as early as possible.
While doing so, we also try to output frames that now contain a single
valid field picture, prior to inserting any other picture into the DPB.
Note: this may be superfluous currently based on the fact that dpb_add()
combines the two most recent pairable fields, but this process would be
further simplified later on.