GNOME Bugzilla – Bug 748054
avfvideosrc: starting capture session too early, sending buffers with PTS=NONE
Last modified: 2015-05-11 11:20:39 UTC
avfvideosrc starts the capture session earlier than PLAYING, and sample buffers that arrive before element has clock are stamped with pts=GST_CLOCK_TIME_NONE. Whether or not we're interested in starting session early (for whatever reason...), we should not send out those buffers. After http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/? id=5bc17dac295da9ec33c05b42ddac41b61bfaaaba, we now don't try to use clock anymore, but we still end up sending buffers with pts=GST_CLOCK_TIME_NONE which seems bogus.
Especially the first buffer timestamps should never be NONE. That's confusing sinks.
Created attachment 301839 [details] [review] avfvideosrc: drop frames we get before we have a clock
Review of attachment 301839 [details] [review]: ::: sys/applemedia/avfvideosrc.m @@ +852,3 @@ + if (timestamp == GST_CLOCK_TIME_NONE) { + [bufQueueLock unlock]; + return; Don't we have to release sampleBuffer here?
(In reply to Sebastian Dröge (slomo) from comment #3) > Don't we have to release sampleBuffer here? No, we're in the delegate and we haven't retained it. https://developer.apple.com/library/ios/documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html "A corollary of the basic rules is that when you pass an object to another object (as a function parameter), you should expect that the receiver will take ownership of the passed object if it needs to maintain it."
commit 528871f571b83b399ecc352a4e8358ad605aeb8b Author: Ilya Konstantinov <ilya.konstantinov@gmail.com> Date: Wed Apr 15 01:24:45 2015 +0300 avfvideosrc: drop frames we get before we have a clock https://bugzilla.gnome.org/show_bug.cgi?id=748054
Created attachment 303048 [details] [review] avfvideosrc: fix unconditional buffer queue unlock My previous patch introduced a bug -- we should never unlock unconditionally unless stopRequest is set. Additionally, the same bug was present in the unlockStop method.
(This was discovered by setting the element into PAUSED then PLAYED.)
commit c948484c7fe764467ee749aa04d02617d8fee591 Author: Ilya Konstantinov <ilya.konstantinov@gmail.com> Date: Thu May 7 21:18:27 2015 +0200 avfvideosrc: fix unconditional buffer queue unlock Unless stopRequest is set, we should unlock conditionally -- otherwise, the 'create:' method can wake up to an empty buffer queue and pull a nil buffer. https://bugzilla.gnome.org/show_bug.cgi?id=748054