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 756563 - pnmdec: causes multifilesrc to return internal data flow error (caused by a gst_pad_push() error)
pnmdec: causes multifilesrc to return internal data flow error (caused by a g...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal normal
: 1.6.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-10-14 11:20 UTC by Marianna S. Buschle
Modified: 2015-10-28 07:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
properly reset parsing state at flush (1.01 KB, patch)
2015-10-17 08:57 UTC, Reynaldo H. Verdejo Pinochet
none Details | Review
properly propagate input state (3.00 KB, patch)
2015-10-17 08:59 UTC, Reynaldo H. Verdejo Pinochet
none Details | Review
propagate input state after parsing (3.17 KB, patch)
2015-10-17 17:37 UTC, Reynaldo H. Verdejo Pinochet
committed Details | Review
completely reset parsing state at flush (1.10 KB, patch)
2015-10-17 17:39 UTC, Reynaldo H. Verdejo Pinochet
none Details | Review
completely reset parsing state at flush (1.20 KB, patch)
2015-10-17 19:33 UTC, Reynaldo H. Verdejo Pinochet
none Details | Review
complete reset parsing state at flush (944 bytes, patch)
2015-10-17 19:58 UTC, Reynaldo H. Verdejo Pinochet
committed Details | Review
drop frame in case of _handle_frame() failure (846 bytes, patch)
2015-10-17 19:59 UTC, Reynaldo H. Verdejo Pinochet
none Details | Review
drop frame in case of handle failure (838 bytes, patch)
2015-10-18 21:50 UTC, Reynaldo H. Verdejo Pinochet
committed Details | Review

Description Marianna S. Buschle 2015-10-14 11:20:16 UTC
When trying to use multifilesrc with the pnmdec I get an "Internal data flow error" after the first image

Record a stream:
gst-launch-1.0 videotestsrc num-buffers=10 ! pnmenc ! multifilesink

Play the stream:
gst-launch-1.0 multifilesrc ! pnmdec ! fakesink

ERROR: from element /GstPipeline:pipeline0/GstMultiFileSrc:multifilesrc0: Internal data flow error.
Additional debug info:
/var/lib/jenkins/jobs/qt5022-cesium/workspace/build/tmp/work/bobcat_64-poky-linux/gstreamer1.0/git-r0/git/libs/gst/base/gstbasesrc.c(2949): gst_base_src_loop (): /GstPipeline:pipeline0/GstMultiFileSrc:multifilesrc0:
gst-launch-1.0 multifilesrc ! pnmdec ! fakesink

Setting --gst-debug=*src*:5 will show that it is a gst_pad_push() error:

...
0:00:00.027635899   788       0x611400 DEBUG           multifilesrc gstmultifilesrc.c:381:gst_multi_file_src_get_filename: 0
0:00:00.027793246   788       0x611400 DEBUG           multifilesrc gstmultifilesrc.c:414:gst_multi_file_src_create:<multifilesrc0> reading from file "00000".
0:00:00.028805526   788       0x611400 DEBUG           multifilesrc gstmultifilesrc.c:456:gst_multi_file_src_create:<multifilesrc0> read file "00000".
...
0:00:00.032062416   788       0x690490 DEBUG                basesrc gstbasesrc.c:3810:gst_base_src_change_state:<multifilesrc0> PAUSED->PLAYING
0:00:00.032105420   788       0x611400 DEBUG                basesrc gstbasesrc.c:2356:gst_base_src_update_length:<multifilesrc0> reading offset 230415, length 4096, size -1, segment.stop -1, maxsize -1
0:00:00.032194276   788       0x611400 DEBUG                basesrc gstbasesrc.c:2457:gst_base_src_get_range:<multifilesrc0> calling create offset 230415 length 4096, time 0
0:00:00.032224544   788       0x611400 DEBUG           multifilesrc gstmultifilesrc.c:381:gst_multi_file_src_get_filename: 1
0:00:00.032249722   788       0x611400 DEBUG           multifilesrc gstmultifilesrc.c:414:gst_multi_file_src_create:<multifilesrc0> reading from file "00001".
New clock: GstSystemClock
0:00:00.032800276   788       0x611400 DEBUG           multifilesrc gstmultifilesrc.c:456:gst_multi_file_src_create:<multifilesrc0> read file "00001".
0:00:00.033002571   788       0x611400 DEBUG                basesrc gstbasesrc.c:2317:gst_base_src_do_sync:<multifilesrc0> no sync needed
0:00:00.033047402   788       0x611400 DEBUG                basesrc gstbasesrc.c:2521:gst_base_src_get_range:<multifilesrc0> buffer ok
0:00:00.033116960   788       0x611400 INFO                 basesrc gstbasesrc.c:2857:gst_base_src_loop:<multifilesrc0> pausing after gst_pad_push() = error
0:00:00.033163011   788       0x611400 DEBUG                basesrc gstbasesrc.c:2900:gst_base_src_loop:<multifilesrc0> pausing task, reason error
0:00:00.033301061   788       0x611400 WARN                 basesrc gstbasesrc.c:2949:gst_base_src_loop:<multifilesrc0> error: Internal data flow error.
0:00:00.033376359   788       0x611400 WARN                 basesrc gstbasesrc.c:2949:gst_base_src_loop:<multifilesrc0> error: streaming task paused, reason error (-5)
ERROR: from element /GstPipeline:pipeline0/GstMultiFileSrc:multifilesrc0: Internal data flow error.

Note that if jpeg/png (even raw) formats are used it works, therefore I assume the problem must be in the pnmdec...

gst-launch-1.0 videotestsrc num-buffers=10 ! jpegenc ! multifilesink
gst-launch-1.0 multifilesrc ! jpegdec ! fakesink
or
gst-launch-1.0 videotestsrc num-buffers=10 ! pngenc ! multifilesink
gst-launch-1.0 multifilesrc ! pngdec ! fakesink
Comment 1 Reynaldo H. Verdejo Pinochet 2015-10-17 08:57:37 UTC
Created attachment 313520 [details] [review]
properly reset parsing state at flush

This sorts out the incomplete parser status reset at flush, solves the problem but uncovers others, namely, the element not forwarding the input state properly, see second patch in this series.
Comment 2 Reynaldo H. Verdejo Pinochet 2015-10-17 08:59:15 UTC
Created attachment 313521 [details] [review]
properly propagate input state

propagates input state so caps="...framerate=" works with ie ! videorate
Comment 3 Reynaldo H. Verdejo Pinochet 2015-10-17 09:03:00 UTC
Review of attachment 313520 [details] [review]:

::: gst/pnm/gstpnmdec.c
@@ +204,3 @@
   r = gst_video_decoder_allocate_output_frame (decoder, frame);
   if (r != GST_FLOW_OK) {
+    r = gst_video_decoder_drop_frame (GST_VIDEO_DECODER (s), frame);

^ This small change from my debugging slip through the cracks but according to the docs on the baseclass should be correct?
Comment 4 Tim-Philipp Müller 2015-10-17 13:06:28 UTC
None of the commit messages actually mention what these patches fix, just that they're doing something "properly" now :)
Comment 5 Reynaldo H. Verdejo Pinochet 2015-10-17 17:37:27 UTC
Created attachment 313547 [details] [review]
propagate input state after parsing
Comment 6 Reynaldo H. Verdejo Pinochet 2015-10-17 17:39:11 UTC
Created attachment 313548 [details] [review]
completely reset parsing state at flush

The new commit msgs should be more descriptive. Thanks for taking a look.
Comment 7 Sebastian Dröge (slomo) 2015-10-17 17:46:03 UTC
Review of attachment 313548 [details] [review]:

::: gst/pnm/gstpnmdec.c
@@ +99,2 @@
   s->size = 0;
   s->current_size = 0;

Or just memset() it all to 0 just to be sure and future-proof? Or add a reset() function that resets all these and is also called by start() :)
Comment 8 Reynaldo H. Verdejo Pinochet 2015-10-17 19:33:53 UTC
Created attachment 313562 [details] [review]
completely reset parsing state at flush

(In reply to Sebastian Dröge (slomo) from comment #7)
> Review of attachment 313548 [details] [review] [review]:
> [...]
> Or just memset() it all to 0 just to be sure and future-proof? Or add a
> reset() function that resets all these and is also called by start() :)

Hey Sebastian. Thanks for taking a look.

Are you referring to the s->mngr parser values? I'm not sure
resetting the entire codec state in 's' is correct here & it's
not needed to resolve this issue. New patch attached.

I have a couple of other minor changes for pnmdec after working
on it for a bit. I will include your reset() idea with them.
Comment 9 Reynaldo H. Verdejo Pinochet 2015-10-17 19:58:13 UTC
Created attachment 313571 [details] [review]
complete reset parsing state at flush

Separated the unrelated frame drop change at handle() failure
Comment 10 Reynaldo H. Verdejo Pinochet 2015-10-17 19:59:31 UTC
Created attachment 313572 [details] [review]
drop frame in case of _handle_frame() failure
Comment 11 Sebastian Dröge (slomo) 2015-10-18 08:19:49 UTC
Comment on attachment 313572 [details] [review]
drop frame in case of _handle_frame() failure

Here you would override the non-OK return value with potentially OK or something else.
Comment 12 Reynaldo H. Verdejo Pinochet 2015-10-18 21:50:51 UTC
Created attachment 313632 [details] [review]
drop frame in case of handle failure

You are right, actually did it on purpose but now I understood it
didn't make sense. keeping original return value now. Thanks again
for taking a look.
Comment 13 Reynaldo H. Verdejo Pinochet 2015-10-18 21:55:42 UTC
Review of attachment 313547 [details] [review]:

commit ec5648763dd00b09ae2522372d453417ae8403f0
Author: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Date:   Sat Oct 17 01:51:24 2015 -0700

    pnmdec: propagate input state after parsing
    
    Store and copy input state fields when setting the
    output state of the decoder. Avoids problems like
    the framerate set by an upstream element being ignored
    
    Related to:
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756563
Comment 14 Reynaldo H. Verdejo Pinochet 2015-10-18 21:56:55 UTC
Review of attachment 313571 [details] [review]:

commit 4b5e2f68a3767ddd66681c7a20c05bb2829c3234
Author: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Date:   Fri Oct 16 20:45:42 2015 -0700

    pnmdec: completely reset parsing state at flush
    
    Makes sure the mngr struct reflects a clean state
    for the next frame, avoiding failures like:
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756563
Comment 15 Reynaldo H. Verdejo Pinochet 2015-10-18 21:58:07 UTC
Review of attachment 313632 [details] [review]:

commit 801c27689e76822bc558a513f7ffae87af001406
Author: Reynaldo H. Verdejo Pinochet <reynaldo@osg.samsung.com>
Date:   Sat Oct 17 12:48:11 2015 -0700

    pnmdec: drop frame in case of _handle() failure
    
    Allows baseclass to handle it from there
    
    Related to:
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756563
Comment 16 Sebastian Dröge (slomo) 2015-10-19 08:12:46 UTC
Should this go into 1.6.1?
Comment 17 Reynaldo H. Verdejo Pinochet 2015-10-28 05:57:11 UTC
(In reply to Sebastian Dröge (slomo) from comment #16)
> Should this go into 1.6.1?

Hey, sorry for the late reply. Yes, it should be safe. I saw
you merged 78c22c3cbd492ab already but the other two are the
ones actually fixing the problem.
Comment 18 Sebastian Dröge (slomo) 2015-10-28 07:12:31 UTC
Can you merge them?
Comment 19 Reynaldo H. Verdejo Pinochet 2015-10-28 07:45:33 UTC
(In reply to Sebastian Dröge (slomo) from comment #18)
> Can you merge them?

Double checked, they were all merged by you last Tuesday ;)