Commit graph

15 commits

Author SHA1 Message Date
Johan Sternerup deddcbdc66 basesrc: protect segment_seqnum/pending with object lock
In a few places the object lock was not taken when writing to
segment_pending and segment_seqnum.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6671>
2024-04-22 18:13:46 +00:00
Johan Sternerup a3f8f036fe gstbasesrc: Do not hold LIVE_LOCK while sending events
An application that triggers a state transition from PLAYING to PAUSED
needs to acquire the LIVE_LOCK. Consequently the LIVE_LOCK must not be
taken while pushing anything on the pads because this operation might
get blocked by something that cannot be unblocked without the
application being able to proceed with the state transitions for other
elements in the pipeline. This commit extends the previous behaviour
where the live lock was released before pushing buffers (indirectly
through the unlock before subclass->create) to now also include
unlocking before pushing events.

The issue was discovered in a case for WebRTC where the application
tried to shut down a pipeline but an event originating from a video
source element (based on basesrc) was in the process of being pushed
down the pipeline when it got stuck on the STREAM_LOCK for the pad after
the rtpgccbwe element. This lock in turn was held by the rtcpgccbwe
element as it was in the process of pushing data down the pipeline but
was stuck on the blocking probes installed on dtlssrtpenc to prevent
data from flowing before dtls keys had been negotiated. What should have
happened here is that the blocking probes should be removed, but that
can only happen if the application may continue driving the state
transitions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6671>
2024-04-22 18:13:46 +00:00
Sebastian Dröge 6d3ed65179 basesrc: Clear submitted buffer lists consistently with buffers
And handle the case of a NULL buffer being returned cleanly, which is
valid as long as a buffer list is returned instead. Previously this
would cause an assertion because of calling gst_buffer_unref() with
NULL.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6460>
2024-03-27 16:16:10 +00:00
Guillaume Desmottes b6d8a55103 basesrc: add FIXME 2.0 about automatic_eos
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1334>
2024-02-08 10:51:56 +01:00
Thibault Saunier 726dd5f09f basesrc: Lower verbosity of often happening warning
decodebin(3) runs a scheduling query before pads are activated which
ultimately triggers basesrc->start which will automatically call
`gst_base_src_start_complete` for any source that is not marked as
'async'. This calls will harmlessly bail out in `not_activated_yet`
so we should not warn in that case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6011>
2024-01-30 09:09:22 +00:00
Thibault Saunier 6dc86b1f91 basesrc: Expose automatic-eos as a property
It is useful for appsrc for example and no good reason to not expose it as a property

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5725>
2023-12-05 14:04:05 +00:00
Nicolas Dufresne 7e3f8e7907 basesrc: Delay unlocking so we can hold the STREAM_LOCK
unlock_stop() is expected to be run while the streaming thread is idle. To
guaranty this is the case, we should take the streamlock, but its not
possible to take this lock during state transitions from PAUSED to
PLAYING as the wait function that we want to terminate is holding it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4961>
2023-09-06 17:34:45 +00:00
Nicolas Dufresne 47d79eedc9 basesrc: Retry create() if we are back from pause
After a create() call, which may have returned FLUSHING or a filled buffer,
if it possible that we detect that we are now in pause. As live sourced
don't produce data in pause, drop the buffer is any and later retry creating
a buffer. This will ensure that we resume from pause while avoiding displaying
ancient frame.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4961>
2023-09-06 17:34:45 +00:00
soak e506f9c23e basesrc: Restore pause/resume in derived classes
When the pipeline goes from Playing to Paused, this change will invoke
unlock in the derived class. When the pipeline goes from Paused to
Playing, this change will invoke unlock_stop in the derived class.

This feature was removed in commit 523de1a9 and is now being restored.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4961>
2023-09-06 17:34:45 +00:00
Jan Schmidt 0461103965 basesrc: Don't hold the object lock while pushing an event
Release the object lock before pushing a segment event.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4951>
2023-06-30 16:05:57 +00:00
Guillaume Desmottes 7b41db3ab6 basesrc: add gst_base_src_push_segment()
gst_base_src_new_segment() does not send the segment right away, which
may break events ordering if subclass sends other events after
calling it.
Introducing a variant pushing the segment right away to preserve
ordering in such cases.

Will be used by appsrc which has its own internal queue where we need to
preserve events order.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4297>
2023-04-05 11:11:46 +00:00
Mathieu Duponchelle f8b732563b basesrc: respect FIXED_CAPS flag in caps query implementation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3590>
2022-12-17 12:04:49 +00:00
Xavier Claessens b99ecc78ca Replace gst-i18n-*.h with gi18n-lib.h
GLib guarantees libintl is always present, using proxy-libintl as
last resort. There is no need to mock gettex API any more.

This fix static build on Windows because G_INTL_STATIC_COMPILATION must
be defined before including libintl.h, and glib does it for us as part
as including glib.h.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2028>
2022-04-19 18:01:06 +00:00
Tim-Philipp Müller 972615cf22 docs: fix unnecessary ampersand, < and > escaping in code blocks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1340>
2021-11-12 11:39:19 +00:00
Thibault Saunier 6c364d9626 Move files from gstreamer into the "subprojects/gstreamer/" subdir 2021-09-24 16:13:07 -03:00
Renamed from libs/gst/base/gstbasesrc.c (Browse further)