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 760513 - baseparse: Need push remaining data in adapter when switching to pass through mode
baseparse: Need push remaining data in adapter when switching to pass through...
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
1.6.0
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-01-12 10:29 UTC by Lyon
Modified: 2018-11-03 12:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
the patch for gstbase to fix missing buffer when switch to pass through mode (1.78 KB, patch)
2016-01-15 09:52 UTC, Lyon
none Details | Review
gdppay of our demux output (3.01 MB, application/octet-stream)
2016-11-14 07:17 UTC, Lyon
  Details

Description Lyon 2016-01-12 10:29:52 UTC
When we are trying to play some h264/avi streams, with our own parser plugin  linked with h264parse and then avdec_h264,  there will be some corrupt video be observed. while using avidemux link with h264parse, it plays well.


After doing some investigation.
- avdec_h264 only support alignment au format.
- and avidemux output caps not specify the alignment as "au"
 So h264parse will do the parse to convert alignment to "au"

- however, when using our own parser plugin, the output plugins already set the video as alignment "au",  so that h264parse work in pass through mode.
   But it seems the h264parse's output lost the sps/pps data in the begging, which cause the video decoding error for some frames.

So it maybe bugs in h264parse pass through mode, suppose in pass through mode, the output should be the same as when h246parse not linked in the pipeline.

I'm not sure if this issue has been raised before, so I recorded the issue here

Thanks a lot ~
Comment 1 Lyon 2016-01-15 09:52:06 UTC
Created attachment 319081 [details] [review]
the patch for gstbase to fix missing buffer when switch to pass through mode
Comment 2 Lyon 2016-01-15 09:57:16 UTC
further checking the pass through mode in h264parse.
It seems the root cause of above issue is that:
previously h264parse set passthrough flag at the negotiate in the set_caps (if input format and alignment match negotiated output). but there is a commit e8908f5aeef952566f6bccde743c7735d3f8c6ef , to set passthrough until at least one keyframe has been parsed (in case the stream contains SEI messages that supplement the output caps - for example by providing stereoscopic information).

That means the passthrough flag will be set not in the first buffer, and if the passthough flag is not set, the chain in buffer in gstbaseparse will be pushed into adapter, however, when it switches to passthrough mode, there are still data in the adapter which are not pushed to downstream. And there will be no chance to push the remaining data in adapter in pass through mode ever after.

Resolution:
In pass through mode , should check the adapter and if there still remaining data, need push them to downstream.
Please see attache patch for the fix.

Thanks
Lyon
Comment 3 Tim-Philipp Müller 2016-11-11 20:41:18 UTC
This seems plausible. I'd love to have a test case for this, e.g. some input data from your other element in form of gdppay ! filesink.

I wonder if we should do this at the moment we're deciding to switch to passthrough mode instead of doing it in the chain function.

You can use gst_adapter_take_buffer() by the way, then _clear() is not needed.
Comment 4 Lyon 2016-11-14 07:17:10 UTC
Created attachment 339780 [details]
gdppay of our demux output

Hi, Tim
Please see attached file for the test case
Using the command line below to get the output:

gst-launch-1.0 filesrc location=H264_BP40_640x480_25_1657_NoAudio.avi ! 'video/x-msvideo' ! aiurdemux ! 'video/x-h264, parsed=(boolean)true, alignment=(string)au, stream-format=(string)byte-stream, width=(int)640, height=(int)480, framerate=(fraction)25/1' ! gdppay !  filesink location=./gdppay_aiur_out.dat
Comment 5 Lyon 2016-11-14 08:32:39 UTC
(In reply to Tim-Philipp Müller from comment #3)
> This seems plausible. I'd love to have a test case for this, e.g. some input
> data from your other element in form of gdppay ! filesink.
> 
> I wonder if we should do this at the moment we're deciding to switch to
> passthrough mode instead of doing it in the chain function.

do you mean do this in the videoparser when set_passthrough(), then will it be easier for handle it in baseparse than in the videoparse subclass (coz there maybe several parsers need to be modifier?)

> You can use gst_adapter_take_buffer() by the way, then _clear() is not
> needed.
Comment 6 GStreamer system administrator 2018-11-03 12:31:59 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/149.