Scenario is using wayland with this pipeline: videotestsrc ! glupload ! qml6glsink.
First pipeline and qml construction works just fine. However if all GStreamer
and QML scenegraph resources are removed, GStreamer will call eglTerminate() and
sever the connection to the display server for Qt. When Qt attempts to do any
further GL operations like construct a new QML scene, it can crash in any number
of places as libEGL will start returning NULL or other unexpected values.
What we really need is to ensure that if an external API (e.g. Qt) will
eventually call eglTerminate(), there is no need for GStreamer to call
eglTerminate(). This is what the foreign display flags allows setting.
There is also another possible scenario where one may like to make GStreamer
assume ownership of an EGLDisplay and thus eventually call `eglTerminate()`. As
such, it is now also possible to mark an GstGLDisplayEGL as non-foreign.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8504>
Add new property to support application allocated GstCudaMemory.
CUDA memory alloc/free is a global device synchronization point
as if launching CUDA kernel on default CUDA stream. To avoid the global
synchronization, we added stream-ordered allocation support
which allocates CUDA memory asynchronously.
However, NVENC does not allow registering the stream-ordered
allocated memory. Thus encoder was allocating normal CUDA
memory in case that input CUDA memory is stream-ordered type.
In this commit, newly introduced property will allow application
to provide encoder with GstCudaBufferPool. Application can
preallocate sufficient amount of CUDA memory in advance
to avoid global device synchronization while pipeline is running.
For now, this pool is used only if input CUDA memory is allocated
via stream-ordered-allocation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8516>
Cropping parameters were being miscalculated - getting
the output width/height wrong when an x/y crop offset
was given.
Cropping was also incorrectly being applied twice (because at
some point after the convertframe code was written,
`videocrop` also started paying attention to the
GstVideoCropMeta, but not in useful ways for this purpose). Add
a buffer probe to strip the crop meta from the input buffer
so videocrop can do its job correctly.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8526>
transform_caps() from the upload methods can return NULL in some cases, so fall
back to empty caps in that case.
This can happen if "Raw Data" is the currently selected method and new caps with
memory:DMABuf caps feature are negotiated.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8514>
The property is defined as:
> The difference between incoming timestamp and next timestamp must exceed
> the given value for audiorate to add or drop samples.
so if the gap duration < tolerance, we should not act.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8498>
AV1 specification [1] define 2 AV1 raw bitstreams storage
formats without containers:
- OBU in chapiter 5.2
- Annexb in chapiter 11.
Implement a detection function for the both cases mostly
by testing OBU forbidden, type, has_size_field and reserved bits.
For annexb case testing if temporal unit size, frame unit size and
obu length are valid. If they are check that the first OBU is
a temporal delimiter.
[1] https://aomediacodec.github.io/av1-spec/av1-spec.pdf
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8502>
The parent class will allow the handle to be reused at the end of the function.
If we are still modifying the released fence, then another thread can acquire
the fence while we are still clearing some of its data and produce a data race
or a leaked fence depending on which thread wins.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8491>
This fix handles the case where the order of components in the cmpd box
does not correspond to the order used for a specific track. That
is the case where the uncC component_index values are something
other than 0, 1, 2, 3.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8483>
Add a button in the web interface to trigger pipeline dumps via websocket,
replacing the need to manually send SIGUSR1 to the process. Also set up
the pipeline-snapshot tracer with the proper websocket URL by default.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7999>
Suppose you invoke gst-launch with this invalid pipeline:
```
$ gst-launch-1.0 videotestsrc num-buffers=10 ! x264enc name=enc ! mux.sink_0 \
mpegtsmux name=mux ! fakesink
0:00:00.018631594 351169 0xb523090 ERROR GST_PIPELINE
subprojects/gstreamer/gst/parse/grammar.y:1151:gst_parse_perform_link:
could not link enc to mux
WARNING: erroneous pipeline: could not link enc to mux
```
The error message you get is not very helpful. This is a pity, because
this is where the error comes from:
```c
static GstPad *
gst_base_ts_mux_request_new_pad (GstElement * element, GstPadTemplate * templ,
const gchar * name, const GstCaps * caps)
{ // [...]
GST_ELEMENT_ERROR (element, STREAM, MUX,
("Invalid Elementary stream PID (0x%02u < 0x40)", pid), (NULL));
return NULL;
```
mpegtsmux posted an error with an explanation of why the linking failed.
However, since the error ocurred within gst_parse_launchv(), gst-launch
could not have set a bus handler, and the error message got discarded.
This patch attempts to make gst-launch more user-friendly by setting a
temporary bus handler during early bin construction to catch error
messages like this.
The errors are logged as ERROR level in the GST_PIPELINE category.
However, this is not enough, as GST_LEVEL_DEFAULT defaults to
GST_LEVEL_NONE in releases. In other words, outside of the dev
environment, GStreamer won't print ERROR logs by default.
To make sure the errors can reach users of packaged versions of
GStreamer, a new AtomicRcBox-based struct is added: reason_receiver_t.
graph_t owns a reference to reason_receiver_t and so does the temporary
bus handler.
When the temporary bus handler receives an error message, the `reason`
field of `reason_receiver_t` is filled with the error message.
Later, when SET_ERROR() is called as a consequence of the operation that
posted the error having returned failure, the reason message is
extracted and added to the GError message.
This is how the resulting error would look in the example from above:
WARNING: erroneous pipeline: could not link enc to mux --
GstMpegTsMux <mux> posted an error message: Invalid Elementary
stream PID (0x00 < 0x40)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8417>
This leads to spurious negotiation failures because the configured method can
change over time and caps queries (and thus transform_caps) are happening
independently from configuring caps. Instead prefer the transformed caps of the
current method, but always also return the transformed caps for all other
methods. Previously all other methods would've only been used if the current
method returned empty caps. If a different method is needed later when
configuring the caps, it will be and was selected regardless.
Later during caps fixation, prefer the caps of the current method too for the
fixated caps if possible in any way.
This should preserve the desired behaviour of preferring the current method if
possible but to change to a different method if nothing else is possible, while
also returning consistent (and not too narrow) caps every time.
The way how the current method was checked was also racy as the current method
might change at any moment during caps query handling, and apart from
inconsistent results also a NULL pointer dereference was possible here. Use the
GST_OBJECT_LOCK to protect access to the current method like in other places.
This part of the code was introduced in f349cdccf5
and tried to be fixed multiple times over the years without addressing the root
cause of caps queries and caps configuration happening independently from each
other, e.g. in !2687 and !2699.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8431>
We can only reliably use the adaptation field discontinuity flag if our input is
properly timestamped on a regular basis (ex: UDP, DVB, RTP, etc...).
For HLS and other systems which don't provide that information, we should not
reset the base observations. Otherwise we would potentially end up picking a
reference time from a long time ago.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8480>
Adding new h264ccextractor element. This element will extract
closed caption meta from H.264 stream, and output in display order.
For the frame reordering, this element is implemented as a subclass
of h264decoder but without actual frame decoding.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6580>
Checking whether rtpjitterbuffer actually timestamps the buffers according to
the RFC7273 clock definition and rtpjitterbuffer configuration required looking
at the DEBUG logs.
This commit adds an entry in the rtpjitterbuffer stats to indicate if
conditions are met for RFC7273 to be active.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7829>
As per the C++ standard, any usage of a std::set::iterator after it has
been erased from the collection results in undefined behaviour. This has
resulted in application crashes due to CUDA illegal address errors.
This commit fixes the issue by copying and incrementing the iterator
within any for-loops that also invoke std::set::erase.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8472>