Commit graph

7491 commits

Author SHA1 Message Date
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
Seungha Yang 2f89c3aff1 audio-info: Allow from_caps() with encoded audio format
Similar to gst_video_info_from_caps() which allows encoded video format,
don't error gst_audio_info_from_caps() with encoded audio format.
Because gst_audio_info_set_format() supports encoded format, current
behavior does not seem to be consistent.
2019-10-25 12:32:03 +09:00
Sebastian Dröge 2bc1b38825 video-converter: Use G_N_ELEMENTS instead of writing it out manually 2019-10-22 09:50:27 +03:00
Sebastian Dröge bcc1d666ec video-converter: Scaling-only fast-paths for planar formats are keeping interlacing
So we can also use them for interlaced content and speed up scaling a
bit.
2019-10-22 09:50:27 +03:00
Sebastian Dröge c9f132986c video-scaler: Correctly handle interlaced vertical scalers in gst_video_scaler_2d()
We need to provide twice as many lines as usual to the scaling function
as every second lines would be skipped.

Without this we read from random memory and produce colorful output and
crashes.
2019-10-22 09:50:27 +03:00
Sebastian Dröge 255beae3ec video-converter: Don't use fast-path halfing/doubling rescalers for interlaced planar formats
They will mix lines from the top and bottom field and by that
effectively deinterlace the video, badly.
2019-10-22 09:49:43 +03:00
Sebastian Dröge 565b797f57 video-converter: Use interlaced scalers for vertical scaling if needed
Without this, scaling e.g. interlaced UYVY causes corrupted output with
lines as follows: f1 f1 f2 f2, i.e. two lines of each field and only
then the other field.
2019-10-22 09:49:18 +03:00
Joakim Johansson f2b3e9b4a1 gstrtspconnection: messages_bytes not decreased
The watch->messages_bytes is not decreased when the write operation
from the backlog is only partly successfull.

This commit decreases the watch->messages_bytes for the successfully
sent messages.

Fixes #679
2019-10-21 09:58:27 +00:00
Haihao Xiang b3e9e3f747 glimagesink: add support for Y210 format
Y210 is a 10-bit YUY2, so we may re-use the YUY2 shaders but gl format
is set to RG16

Sample pipeline:
gst-launch-1.0 videotestsrc ! video/x-raw,format=Y210 ! glimagesink
2019-10-16 08:30:31 +08:00
David Trussel 0b362e5a4b glcolorconvert: add support for the NV16 and NV61 formats
NV16/NV61 is basically the same as NV12/NV21 with a higher chroma resolution.
Since only the size of the UV plane/texture is different, the same shaders are used as for NV12/NV21.
2019-10-15 22:53:56 +11:00
Haihao Xiang 7ef84fb757 glimagesink: add support for Y410 format
Sample pipeline:
gst-launch-1.0 videotestsrc ! video/x-raw,format=Y410 ! glimagesink
2019-10-15 04:44:02 +00:00
Haihao Xiang 56de495f0e glcolorconvert: merge shaders for AYUV and VUYA formats
The shaders can be used for AYUV and varieties.
2019-10-15 04:44:01 +00:00
Tim-Philipp Müller 289d8e53e2 Remove autotools build system 2019-10-13 14:15:43 +01:00
Tim-Philipp Müller 50aeeec15b pbutils: add description for CineForm codec 2019-10-08 19:38:14 +01:00
Tim-Philipp Müller 0704cc01a7 riff: add mapping for CineForm codec
Makes CineForm-in-AVI work.
2019-10-08 19:38:05 +01:00
Thibault Saunier 8d32de0905 glupload: Add VideoMetas and GLSyncMeta to the raw uploaded buffers
This is done by reusing `gst_gl_memory_setup_buffer` avoiding to
duplicate code.

Without a VideoMeta, mapping those buffers lead to GstBuffer mapping the
buffer in system memory even when specifying the GL flags (through the
buffer merging mechanism) making the result totally broken.
2019-10-02 19:27:39 +00:00
Haihao Xiang 606ab04cd6 video-format: correct the pixel stride for Y410
The stride for Y410 is 4 bytes, not 0 byte
2019-09-30 14:26:14 +00:00
Axel Mårtensson feb1e24347 audiosink: fix resuming after pause
For resuming after paused, gst_audio_sink_ring_buffer_start() needs to
be called to notify the ringbuffer to continue to play.
2019-09-27 05:34:57 +00:00
Philippe Renon 0dc1b6049e audiosink: expose more audioringbuffer vmethods to child sinks
The newly exposed vmethods are pause, resume, stop and clear_all.
The existing reset vmethod is deprecated.

The audio sink will fallback to calling reset if pause or stop
are not provided and will fallback to calling start if
resume is not provided. There is no default clear_all
implementation.
Existing audio sinks continue to work as before.

This change is useful for sinks that need to distinguish
between a pause and a stop (currently both are handled
by a reset) and is needed for https://bugzilla.gnome.org/show_bug.cgi?id=788362

https://bugzilla.gnome.org/show_bug.cgi?id=788361
2019-09-27 05:34:57 +00:00
Nirbheek Chauhan 6f7c9e43bc audio: Use LoadPackagedLibrary when building for UWP
Universal Windows Platform apps are not allowed to use LoadLibrary to
load arbitrary DLLs from the filesystem. They can only use
LoadPackagedLibrary to load DLLs that have been packaged with the app
as assets.

See also: https://gitlab.freedesktop.org/gstreamer/gstreamer/merge_requests/190
2019-09-24 15:17:39 +00:00
Matthew Waters 8ce2460ad5 build: fix debug output werror build with newer gcc
In file included from ../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gst.h:55,
                 from ../gst-libs/gst/tag/tag.h:25,
                 from ../gst-libs/gst/tag/gsttageditingprivate.h:24,
                 from ../gst-libs/gst/tag/gsttageditingprivate.c:23:
../gst-libs/gst/tag/gsttageditingprivate.c: In function ‘__exif_tag_capturing_white_balance_to_exif_value’:
../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gstinfo.h:645:5: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  645 |     gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  646 |         (GObject *) (object), __VA_ARGS__);    \
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gstinfo.h:1068:27: note: in expansion of macro ‘GST_CAT_LEVEL_LOG’
 1068 | #define GST_WARNING(...)  GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
      |                           ^~~~~~~~~~~~~~~~~
../gst-libs/gst/tag/gsttageditingprivate.c:265:3: note: in expansion of macro ‘GST_WARNING’
  265 |   GST_WARNING ("Invalid white balance: %s", str);
      |   ^~~~~~~~~~~
../gst-libs/gst/tag/gsttageditingprivate.c:265:40: note: format string is defined here
  265 |   GST_WARNING ("Invalid white balance: %s", str);
      |                                        ^~

In file included from ../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gst.h:55,
                 from ../gst-libs/gst/tag/tag.h:25,
                 from ../gst-libs/gst/tag/gstxmptag.c:39:
../gst-libs/gst/tag/gstxmptag.c: In function ‘deserialize_exif_gps_direction’:
../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gstinfo.h:645:5: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  645 |     gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  646 |         (GObject *) (object), __VA_ARGS__);    \
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gstinfo.h:1068:27: note: in expansion of macro ‘GST_CAT_LEVEL_LOG’
 1068 | #define GST_WARNING(...)  GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
      |                           ^~~~~~~~~~~~~~~~~
../gst-libs/gst/tag/gstxmptag.c:818:5: note: in expansion of macro ‘GST_WARNING’
  818 |     GST_WARNING ("Missing %s tag", dirref_str);
      |     ^~~~~~~~~~~
../gst-libs/gst/tag/gstxmptag.c:818:27: note: format string is defined here
  818 |     GST_WARNING ("Missing %s tag", dirref_str);
      |                           ^~
In file included from ../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gst.h:55,
                 from ../gst-libs/gst/tag/tag.h:25,
                 from ../gst-libs/gst/tag/gstxmptag.c:39:
../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gstinfo.h:645:5: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  645 |     gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  646 |         (GObject *) (object), __VA_ARGS__);    \
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gstinfo.h:1068:27: note: in expansion of macro ‘GST_CAT_LEVEL_LOG’
 1068 | #define GST_WARNING(...)  GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
      |                           ^~~~~~~~~~~~~~~~~
../gst-libs/gst/tag/gstxmptag.c:814:5: note: in expansion of macro ‘GST_WARNING’
  814 |     GST_WARNING ("Missing %s tag", dir_str);
      |     ^~~~~~~~~~~
../gst-libs/gst/tag/gstxmptag.c:814:27: note: format string is defined here
  814 |     GST_WARNING ("Missing %s tag", dir_str);
      |                           ^~

In file included from ../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gst.h:55,
                 from ../gst-libs/gst/gl/gstgl_fwd.h:24,
                 from ../gst-libs/gst/gl/gl.h:24,
                 from ../gst-libs/gst/gl/gstglsl.c:25:
../gst-libs/gst/gl/gstglsl.c: In function ‘gst_glsl_version_profile_from_string’:
../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gstinfo.h:645:5: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  645 |     gst_debug_log ((cat), (level), __FILE__, GST_FUNCTION, __LINE__, \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  646 |         (GObject *) (object), __VA_ARGS__);    \
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../dist/linux_x86_64/include/gstreamer-1.0/gst/gstinfo.h:1068:27: note: in expansion of macro ‘GST_CAT_LEVEL_LOG’
 1068 | #define GST_WARNING(...)  GST_CAT_LEVEL_LOG (GST_CAT_DEFAULT, GST_LEVEL_WARNING, NULL, __VA_ARGS__)
      |                           ^~~~~~~~~~~~~~~~~
../gst-libs/gst/gl/gstglsl.c:333:7: note: in expansion of macro ‘GST_WARNING’
  333 |       GST_WARNING ("Invalid preprocesser directive detected: %s", version_s);
      |       ^~~~~~~~~~~
../gst-libs/gst/gl/gstglsl.c:333:62: note: format string is defined here
  333 |       GST_WARNING ("Invalid preprocesser directive detected: %s", version_s);
      |                                                              ^~

In function ‘print_stream_info’,
    inlined from ‘print_topology’ at ../tools/gst-discoverer.c:352:3:
../tools/gst-discoverer.c:316:3: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
  316 |   g_print ("%*s%s: %s\n", 2 * GPOINTER_TO_INT (depth), " ",
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  317 |       gst_discoverer_stream_info_get_stream_type_nick (info), desc);
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-09-23 17:59:12 +10:00
Haihao Xiang 14ce1ccdd2 glimagesink: Fix VUYA in memory:DMABuf
Sample pipeline:
gst-launch-1.0 videotestsrc ! msdkvpp ! \
video/x-raw\(memory:DMABuf\),format=VUYA ! glimagesink
2019-09-16 15:46:47 +08:00
Seungha Yang e5d06b24b7 egldevice: Fix undeclared type build error
Not all eglext.h defines EGLDeviceEXT type. That's implementation and
egl extension version dependent.
2019-09-12 13:32:07 +00:00
Doug Nazar 0c955c16ce audio-resampler: Update NEON to handle remainders not multiples of 4
If the remainder is not evenly divisable by 4, we'd miss the check
for zero and continue the loop until crashing. Change the branch
to take into account negatives as well.

This more closely matches the SSE loop.
2019-09-02 23:25:39 -04:00
Thibault Saunier 909baa2360 Pass the code through codespell 2019-08-30 13:05:36 +00:00
Matthew Waters fc539f6162 glwindow/cocoa: silence unused-variable warning
We are using ARC to cleanup after ourselves.

../gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m:159:20: error: unused variable 'queue' [-Werror,-Wunused-variable]
  dispatch_queue_t queue = (__bridge_transfer dispatch_queue_t) window->priv->gl_queue;
                   ^
2019-08-30 13:00:14 +10:00
Matthew Waters bff6e9a749 glcontext/egl: fallback to WINDOW_BIT if PBUFFER_BIT fails
There are some drivers that do not advertise any PBUFFER EGLConfig's.
2019-08-29 00:31:26 +00:00