Commit graph

7517 commits

Author SHA1 Message Date
Matthew Waters af1986352b glviewconvert: fix a use-after-free with allocation params
_free(params) followed by a params->align is a bad idea :)
2020-02-05 15:32:14 +11:00
Matthew Waters cbffe13d60 glviewconvert: also remove GL buffers on a reset
Fixes a possible memory leak on renegotiation
2020-02-05 15:32:14 +11:00
Matthew Waters 9461d178ea gl/basesrc: call gl_stop when shutting down
Fixes multiple leaks
2020-02-05 15:31:38 +11:00
Havard Graff 19e4d1a93c rtpbuffer: add gst_rtp_buffer_get_extension_onebyte_header_from_bytes
So that one can parse the GBytes returned by gst_rtp_buffer_get_extension_bytes
2020-02-04 08:44:43 +00:00
Mathieu Duponchelle 54cc985810 videoaggregator: handle gap buffers properly
This simply implies not trying to "prepare" those buffers,
as mapping an empty buffer to a video frame does not make
much sense.

This also adds a simple test in compositor that performs
some trivial checking of the handling of gap events, the test
was not failing before, but an error was logged, this is
no longer the case.

Fixes #717
2020-01-30 19:02:44 +01:00
Sebastian Dröge 72cb0c0641 videoaggregator: Don't configure NULL chroma-site/colorimetry
If there's no known value in the best caps then the functions to convert
them to strings will return NULL. Having the fields not in the caps is
not a problem, having them with a NULL value however will cause
negotiation failures.
2020-01-28 22:07:44 +02:00
Thibault Saunier ae2b4f8899 encodebin: Add missing 'Since' marker 2020-01-13 18:33:29 -03:00
Nicolas Dufresne 8b2afcf56a rtpbasepayload: Save and forward the push flow return
Save push/push_list helper flow return and in case of failure, return it
in the process function. This allow forwarding downstream flow return
even if the subclass is using the push/push_list helper.
2020-01-11 19:39:55 -05:00
Ryan Huang c7a9a966b0 Fix link to raw video format design document 2020-01-02 23:37:21 +00:00
Aaron Boxer 807418894b rtspurl: add API method to create request uri combined with control url
code logic very similar to gst_rtsp_url_get_request_uri ()
2019-12-27 16:57:08 +00:00
Mathieu Duponchelle 64d2e6b70d gstvideoaggregator: always update converter when needed
In prepare_frame, it is not enough for the target info
(conversion_info) to not have changed to decide not to update
the converter, as the vpad info may have changed as well.

Fixes #714
2019-12-27 11:57:22 +00:00
Sebastian Dröge ad68f71d9a fft: Update our kiss fft version
This fixes thread-safety issues and various other minor issues. Our
previous version was about 13 years old.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/715
2019-12-27 11:53:14 +02:00
Seungha Yang 940c9998e5 glwindow/win32: Don't post any WinProc message to parent window
Posting any message to parent seems to be pointless. That might break
parent window.
Regardless of the posting, parent window can catch mouse event
and also any keyboard events will be handled by parent window by default.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/634
2019-12-22 09:16:35 +00:00
Stéphane Cerveau 6cfdeb7423 videoencoder: send new headers in finish_frame
If headers have been set by subclass, this headers should be sent
for a first time or on demand with a key-unit
2019-12-21 02:59:14 +00:00
Stéphane Cerveau 7013a58874 videoencoder: Use video marker flag to signal end of frame
This marker is optional, its name refer to RTP marker bit. This mark can
be use to reduce latency in various use cases. With the split between
finish_frame() and finish_subframe() we will now be able to identitfy
the last subframe with no latency.

In order to detail the use of GST_BUFFER_FLAG_MARKER in a video
use case, the flag GST_VIDEO_BUFFER_FLAG_MARKER has been introduced
with a proper documentation clarifying marker's role.
2019-12-21 02:59:14 +00:00
Guillaume Desmottes 3e32896912 videoencoder: add API to push subframes
Introduce a new API so encoders can split the encoding in subframes.
This can be useful to reduce the overall latency as we no longer need to
wait for the full frame to be encoded to start decoding or sending it.
2019-12-21 02:59:14 +00:00
Guillaume Desmottes 789803fd6d videoencoder: factor out logic from gst_video_encoder_finish_frame()
No semantic change, I'm going to reuse all those functions in a new
finish_slice() methods.
2019-12-21 02:59:14 +00:00
Jonas Holmberg af909c6d82 audioencoder: fix segment event leak
Segment event was leaked if format != _TIME.
2019-12-20 12:43:35 +00:00
Olivier Crête 6b283d9e78 Revert "videoencoder: factor out logic from gst_video_encoder_finish_frame()"
This reverts commit b1ec312b8e.
2019-12-19 17:52:12 -05:00
Stéphane Cerveau b1ec312b8e videoencoder: factor out logic from gst_video_encoder_finish_frame()
No semantic change, I'm going to reuse all those functions in a new
finish_slice() methods.
2019-12-19 21:59:10 +00:00
Olivier Crête 61aeb4bbc3 rtspconnection: Add functions without GTimeVal deprecate existing
GTimeVal is now deprecated in GLib, so let's deprecate it here too
2019-12-18 18:20:25 +00:00
Stéphane Cerveau f8dc428a2a remove various useless linefeed in logs 2019-12-11 10:07:12 +01:00
Stéphane Cerveau 3b8769e673 codec-utils: add h264 constrained and progressive profiles
Those profiles have been added in the version 2012-01
and 2011-06 of the AVC spec.

Aligned code with https://bugzilla.gnome.org/show_bug.cgi?id=794127
2019-12-03 23:35:23 +00:00
Matthew Waters eb0107986a gl/macos+ios: privatise _invoke_on_main()
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1132
2019-12-03 14:15:58 +11:00
Mart Raudsepp 65f2bb8fa2 videoaggregator: don't let a repeat-after-eos pad prevent EOS
.. if there are pads present that are not repeating after EOS.

Fixes #664
2019-11-27 22:21:14 +02:00
Edward Hervey df35256dad video-converter: Fix RGB-XYZ-RGB conversion
The matrices were in the wrong order.
Instead of the conversion matrix being
  _ XYZ_TO_RGB_output * RGB_TO_XYZ_input * input_RGB
It was
  _ RGB_TO_XYZ_input * XYZ_TO_RGB_output * input_RGB
2019-11-21 13:46:38 +00:00
Jochen Henneberg 33ae846607 audioringbuffer: Reset reorder flag before check
This function might be revisited with different channel position mapping
while audio source goes into play so the reorder flag needs to be reset
before the checks happen.
2019-11-17 14:10:31 +00:00
Wonchul Lee 32ae3e336d glupload: Fix allocator leak
It fixes allocator leak in failure case
2019-11-15 10:26:48 +00:00
Guillaume Desmottes 8a3d901d8f video-info: improve GST_CAPS_FEATURE_FORMAT_INTERLACED documentation
Copied the description from gst-doc written by Tim.

Fix #606
2019-11-15 04:19:20 +00:00
Matthew Waters a41bad561a gl/window: marshall quit to the window thread
Fixes a possible deadlock where we're waiting for the window thread to
quit but it never does.
2019-11-15 01:04:45 +00:00
Sebastian Dröge 89f613abf5 audio-buffer: Don't fail to map buffers with zero samples
Instead initialize the map infos, etc to NULL like gst_buffer_map()
would be doing on a zero-sized buffer.

This fixes a crash in audioresample if the first output buffer would
contain zero samples.
2019-11-14 14:47:44 +01:00
Wonchul Lee 7d8e7cd3eb glcontext/egl: Fix window leak
Fixed to do unref after use of window get by gst_gl_context_get_window()
2019-11-13 17:35:40 +09:00
Nicolas Dufresne 9870783f01 eglimage: Fix extension names in dmabuf import check
There was a typo in the extension name which resulted in the modifiers
to never be set when doing DMABuf import. That triggered the modifiers
lookup in Intel driver, which was in fact hiding bugs in the gldownload
to glupload path when doing DMABuf.

Note, this changes breaks pipeline the following pipeline on Intel and
some other drivers:

  gltestsrc ! gldownload ! video/x-raw\(memory:DMABuf\) ! glimagsink

A fix for this was added to Mesa recently:

Related to https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1338
Fixes 5d0e191710
2019-11-11 17:01:23 -05:00
Nicolas Dufresne ac0d19b72f eglimage: Fix exported DMABuf size
All we know is the height and the stride, so make sure not to expose
the DMABuf larger then the size we know about.
2019-11-11 17:01:23 -05:00
Nicolas Dufresne 976e7e4e3d eglimage: Fail exportation if a modififer is used
We don't support modififers and that would result in bad image being
displayed. Note that this was fixes recently in Mesa MR 1138, prior to
that, the reported modifier is always 0, which makes this change a
no-op.

Fixes #441
Related to https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1338
2019-11-11 17:01:23 -05:00
Matthew Waters 3b552cc05a display: add a specific lock for the list of windows
It's either this or replacing all the object lock usage in gldisplay
with a recursive mutex which is not backwards compatible

The failure case is effectively:
1. The user has locked the display object lock
2. a glcontext loses it's last ref and attempts to quit the window
3. gst_gl_window_quit() attempts to remove the window from the display
4. gst_gl_display_remove_window attempts to take the display object lock

The only concern with changing the locking for the window list in the
display is that gst_gl_display_create_window() has documentation requiring
the object lock to be held which must continue to work correctly.
2019-11-06 01:07:27 +00:00
Matthew Waters b887db1efe glwindow: fix racy resize updates
Take locks around resize handling and marshall all resizes to the
windowing thread by default.
2019-11-06 01:07:27 +00:00
Matthew Waters b29d61b88e glwindow: remove window from display list on quit/finalize
Fixes a possible use-after-free in the X11 backend.
2019-11-06 01:07:26 +00:00
Matthew Waters d79d742492 gl/display: Add thread-safe retrieve_window
Returning a transfer none value for a value checked by a lock is not
thread safe as the reference could disappear before the caller can take
its reference.
2019-11-06 01:07:26 +00:00
Thibault Saunier a724f9ddfb encodebin: Ensure that a single segment is pushed into encoders
Following the [design document] encodebin needs to handle sources that
output multiple streams, for that purpose and to make it simpler,
we ensure that a single segment is outputted to the encoders by using
an `identity single-segment=true` at the beginning of streams chains.

Added API to enable or disable the use of that new feature.
Added support for the encoding profile parser for that new property,
keeping backward compatibility

[design document]: https://gstreamer.freedesktop.org/documentation/additional/design/encoding.html?gi-language=c#rendering-timelines
2019-11-05 18:03:09 +00:00
Havard Graff daea137c9d rtcpbuffer: add RTPFB_TYPE_TWCC for Transport-Wide Congestion Control 2019-11-05 12:42:52 +00:00
Guillaume Desmottes e5c9a921ad videometa: document how the meta can be used to negotiate buffers layout
I'm going to use this new API in gst-omx so an encoder can request
v4l2src to produce buffers matching the encoder stride and slice heights
preventing copies of incoming buffers.
2019-11-04 12:59:31 +00:00
Matthew Waters a32cd0e55e gl/gbm: ensure we call the resize callback before attempting to draw
Without this, sinks will not be notified about size changes or even the
initial size and would render at 0x0.
2019-11-05 07:27:29 +11:00
Sebastian Dröge 166f979761 video-scaler: Ensure we're always using the correct lines for scaling in gst_video_scaler_2d()
Especially for interlaced input make sure to
  a) never mix both fields
  b) never read lines after the end of the input frame
  c) allocate enough space in the temporary lines to not write outside
     the allocated memory area

This fixes various memory corruptions and rescaling artefacts.
2019-11-03 10:46:43 +01:00
Nicolas Dufresne 1174e37b80 videodecoder: Add a property to disable dropping on QoS 2019-11-02 14:36:01 +00:00
Nicolas Dufresne 1570314609 videodecoder: Post QoS when we drop because of QoS
At the moment, we only posted QoS messages when frame_drop() was
called, but not in finish_frame() when QoS triggered a late push.
This should fix applications that tries to account the dropped
frames. We also emit a warning on drops so it's more clear what is
happening.
2019-11-02 14:36:01 +00:00
Guillaume Desmottes b418b4b6ec gl: use gst_video_meta_set_alignment() 2019-11-02 13:05:43 +01:00
Guillaume Desmottes 75680e5d34 videometa: add alignment field
By adding this field, buffer producers can now explicitly set the exact
geometry of planes, allowing users to easily know the padded size and
height of each plane.

GstVideoMeta is always heap allocated by GStreamer itself so we can
safely extend it.
2019-11-02 13:05:43 +01:00
Guillaume Desmottes 36ce08826e video-info: add gst_video_info_align_full()
When using gst_video_info_align() user had no easy way to retrieve the
padded size and height of each plane.
This can easily be implemented in fill_planes() as it's already called
in align() with the padded height.

Ideally we'd add a plane_size field to GstVideoInfo but the remaining
padding is too small so that would be an ABI break.

Fix #618
2019-11-02 13:05:43 +01:00
Guillaume Desmottes 73a628923e video-info: fix GST_VIDEO_INFO_FIELD_HEIGHT() with frame odd height
We want to round up when halfing height.

I do have a test for this but it relies on my new video-align tests so
it's part of the next commit. Recording the fix separately if we want to
backport this fix to the stable branch.
2019-11-02 13:05:43 +01:00