When chain method was called after gst_uri_downloader_stop and before state has been changed to NULL, execution was blocking on g_mutex_lock.
Conflicts:
gst-libs/gst/uridownloader/gsturidownloader.c
When downloading and cancelling quickly the uridownloader object and the
element using it could miss the cancelled window and the uridownloader
would fetch the wrong URI and block on subsequent fetches.
This was also problematic when stopping elements, while one task would
call the cancel, another element thread could issue a new fetch_uri. As
the cancel state isn't 'permanent' this fetch_uri would block and
prevent the whole element from stopping and going to NULL.
This patch makes the 'cancelled' state permanent until a
gst_uri_downloader_reset is called. This way the element knows the
window where the uridownloader isn't active and only reactivate it when
ready.
This can be used by parsers to provide pre-parsed information to
downstream elements that would require it (so they can avoid having
to parse the bitstream again).
The content of the EGLImages can be at least in GStreamer orientation,
meaning top line first in memory, or OpenGL orientation, meaning
bottom line first in memory.
Add utility functions to convert quantization matrices from zigzag scan
order (as encoded in the bitstream) into raster scan order. Also provide
another function to reverse the operation.
https://bugzilla.gnome.org/show_bug.cgi?id=693000
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Quantizer matrices are encoded in zigzag scan order in the bitstream,
but they are stored in raster scan order when they are parsed. However,
default matrices were also prepared in zigzag scan order, hence the
mismatch. i.e. the matrices were presented either in raster scan order
if they are explicitly present in the bitstream, or they were presented
in zigzag scan order if the default definitions were to be used instead.
One way to solve this problem is to always expose the quantization
matrices in zigzag scan order, since this is the role of the parser to
not build up stories from the source bitstream and just present what
is in there.
Utility functions will be provided to convert quantization matrices in
either scan order.
https://bugzilla.gnome.org/show_bug.cgi?id=693000
Signed-off-by: Cong Zhong <congx.zhong@intel.com>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Fix parsing of residual bytes. This is a two-step process. First,
remaining colums of full vertical resolution (<height>) need to be
processed. Next, remaining bytes in the first row can be processed,
while taking into account the fact that we may have filled in the
first columns already. So, this is not full horizontal resolution.
The following figure helps in understanding the expected order of
operations, for a 8x5 MBs bitplane.
5 5 6 6 6 6 6 6
5 5 1 1 1 2 2 2
5 5 1 1 1 2 2 2
5 5 3 3 3 4 4 4
5 5 3 3 3 4 4 4
So, after tiles 1 to 4 are decoded, vertical tile 5 needs to be
processed (2x5 MBs) and then the horizontal tile 6 (6x1 MBs).
https://bugzilla.gnome.org/show_bug.cgi?id=692461
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Fix decoding of DIFF6 or NORM6 bitplanes with an odd number of lines
(3x2 "horizontal" tiles). In this case, we have to skip the first line
of macroblocks but <width> number of bytes was used to do so, instead
of the actual <stride> size.
This fixes decoding for the video sample attached to:
https://bugzilla.gnome.org/show_bug.cgi?id=668565https://bugzilla.gnome.org/show_bug.cgi?id=692461
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Add gst_vc1_parse_slice_header() function to parse slice headers as
described in 7.1.2. Slice layers are optional and allowed in advanced
profile mode only. Picture header, if available (PIC_HEADER_FLAG),
is parsed but not recorded because it shall be the same as that was
previously parsed with gst_vc1_parse_frame_header().
This fixes SA00049.vc1 conformance test.
https://bugzilla.gnome.org/show_bug.cgi?id=692388
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Fix decoding of DIFF2 or NORM2 bitplanes with an odd number of macroblocks.
In particular, account for the first bit that was already parsed so that to
avoid a buffer overflow after all pairs are parsed.
This fixes SA00040.vc1 conformance test.
https://bugzilla.gnome.org/show_bug.cgi?id=692312
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Rename dqsbedge to dqbedge. The intent is that we can only have a single
boundary edge selector, depending on the value of dqprofile. So, dqbedge
represents DQSBEDGE if dqprofile == GST_VC1_DQPROFILE_SINGLE_EDGE, or
DQDBEDGE if dqprofile == GST_VC1_DQPROFILE_DOUBLE_EDGE.
The former dqbedge field is marked as unused and can be removed on the
next gst-plugins-bad version that allows ABI changes.
https://bugzilla.gnome.org/show_bug.cgi?id=692272
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Fix parsing of VOPDQUANT when DQUANT == 2. In particular, DQUANTFRM is
not present in the bitstream in this case and it shall be derived to
the default value of zero (7.1.1.31.1).
https://bugzilla.gnome.org/show_bug.cgi?id=692271
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Fix calculation of ALTPQUANT when DQUANT == 1. PQDIFF alters ALTPQUANT
in any case. See 7.1.1.31.6.
https://bugzilla.gnome.org/show_bug.cgi?id=692270
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Fix parse_vopdquant() to correctly parse DQPROFILE, which is 2 bits
instead of a single bit.
https://bugzilla.gnome.org/show_bug.cgi?id=692267
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
The standard specifies that when slice_beta_offset_div2 is not present
in the slice header, then the value of slice_beta_offset_div2 shall be
inferred to be equal to 0.
https://bugzilla.gnome.org/show_bug.cgi?id=692265
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Coverity found missing break in parse_frame_header_advanced() when
determining PTYPE from FPTYPE for interlaced streams.
https://bugzilla.gnome.org/show_bug.cgi?id=688626
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
gst_h264_parse_sps() returned FALSE if it parsed invalid (negative)
size components. Now make it gracefully return GST_H264_PARSER_ERROR
instead of GST_H264_PARSER_OK (FALSE).
https://bugzilla.gnome.org/show_bug.cgi?id=684568