After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 796771 - videodecoder: Don't always drain on gaps/discont
videodecoder: Don't always drain on gaps/discont
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
unspecified
Other All
: Normal normal
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-07-09 18:16 UTC by Nicolas Dufresne (ndufresne)
Modified: 2018-07-12 19:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
videodecoder: Don't always drain on gaps/discont (1.90 KB, patch)
2018-07-09 18:16 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review

Description Nicolas Dufresne (ndufresne) 2018-07-09 18:16:00 UTC
This drain was introduced by resolution of the following bug fix:

  https://bugzilla.gnome.org/show_bug.cgi?id=767232

The problem being that OMX and V4L2 only support draining in a way the
reference frames are lost. There is also concerns about FFMPEG and VAAPI
as it means reference frames, which are pushed as read/write, are being
pushed. So in direct rendering, modication of these frames will cause
decoding issues.

In this bug report, it was also stated that this was needed for
TRICKMODE_KEY_UNITS. In this mode, gaps and discont are very unlikely, though
if they appears, skipping to the next immediatly is what one would expect.
Comment 1 Nicolas Dufresne (ndufresne) 2018-07-09 18:16:05 UTC
Created attachment 372984 [details] [review]
videodecoder: Don't always drain on gaps/discont

V4L2 and OMX decoder don't support draining and keeping reference
frames. As a side effect, these decoder just stops working on
gaps/discont. When this drain was introduced, the commit stated that
this was for TRICKMODE_KEY_UNITS, so only drain if running in this mode.
Comment 2 Jan Schmidt 2018-07-09 23:54:43 UTC
People have gone back and forth on this question a bit in the past. The problem with a discont is that you can't really guarantee anything about the following bytes - you don't know how large the discont was.

It's *usually* a single packet, or some minor corruption, but in the worst case it can mean something much worse - for a H.264 bytestream for example, you can't guarantee that you didn't miss a new SPS/PPS and are supposed to be decoding a stream of a completely new resolution now.

In the long term, I think we need to distinguish the 2 cases somehow - "best effort, safe to continue decoding after discont" and "all bets are off, better wait for the next IDR".

For now, this seems fine.
Comment 3 Nicolas Dufresne (ndufresne) 2018-07-12 19:26:51 UTC
Attachment 372984 [details] pushed as 62cb084 - videodecoder: Don't always drain on gaps/discont