GNOME Bugzilla – Bug 722697
pad: Setting pad offsets breaks the running time in QoS and other events
Last modified: 2014-04-10 06:27:13 UTC
Created attachment 266874 [details] example's app showing the bug If we have a pipe like this: videotestsrc ! video/x-raw, width=<w>, height=<h> ! videomixer ! xvimagesink Then on PLAYING_STATE: 1. Wait for a arbitrary period of time. 2. Set the pipe on PAUSED_STATE. 3. Request a new pad on the mixer. 4. Call gst_pad_set_offset(<current_running_time) on the new mixer's pad. 5. Create a bin (filesrc ! matroskademux ! theoradec). 6. Link the bin and the new mixer's sink pad. 7. Call gst_element_sync_state_with_parent on the bin 8. Set the pipeline on PLAYING_STATE. The result is that the new video is showed during a short time. The decoder shows "dropping frame because of QoS". The video referenced in the example's code was generated with: gst-launch-1.0 -e videotestsrc ! timeoverlay font-desc=60 ! video/x-raw, width=250,height=250 ! theoraenc ! matroskamux ! filesink location=video.mkv Notes: * If we use videotestsrc instead of filesrc on step 5, the pipe works OK. * Using fakesink or filesink instead of xvimagesink works OK. * If we drop the QOS on the decoder's src pad the video is showed correctly.
On http://www.filedropper.com/logtar I've uploaded a tar.bz with the output log of running with GST_DEBUG=6. The first WARN message of the theoradec is: 0:00:05.294375461 28228 0x1228e30 WARN theoradec gsttheoradec.c:741:theora_handle_data_packet:<theoradec0> dropping frame because of QoS.
Ah yes, the QoS events need to be adapted for the pad offsets :)
Wim suggested to add an offset field to GstEvent, and consumers of events can do something with that then. Not ideal yet.
This should fix it, but it's untested so far: http://cgit.freedesktop.org/~slomo/gstreamer/log/?h=event-offsets
Fixes your sample application btw
it looks good to me.
commit 1492465b89961622947c2c41a454c5e7f61b6b61 Author: Sebastian Dröge <sebastian@centricular.com> Date: Fri Apr 4 17:28:23 2014 +0200 event: Update running time in QoS based on the pad offsets https://bugzilla.gnome.org/show_bug.cgi?id=722697 commit 42cbb7c7c70126b781cf730977fa85986d5a95ed Author: Sebastian Dröge <sebastian@centricular.com> Date: Fri Apr 4 17:15:25 2014 +0200 pad: Apply pad offsets on all events, not just segment events commit d445027ec17954820c60379b5aadd16274ad683f Author: Sebastian Dröge <sebastian@centricular.com> Date: Fri Apr 4 17:06:18 2014 +0200 event: Add running-time-offset field to all events Events passing through #GstPads that have a running time offset set via gst_pad_set_offset() will get their offset adjusted according to the pad's offset. If the event contains any information that related to the running time, this information will need to be updated before usage with this offset.