Commit graph

7607 commits

Author SHA1 Message Date
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
Jonas Larsson 94984e13a9 eglimage: Fix memory leak
Also free the GstEGLImage struct allocated by g_new0.

Fixes #661
2019-08-28 11:24:01 -07:00
Mathieu Duponchelle 4ccc7a51d1 {audio,video}aggregator: define autoptr cleanup functions 2019-08-28 14:52:22 +00:00
Hou Qi b65d1c6de9 audiodecoder: fix ctitical info assertion 'GST_IS_CAPS (dec->priv->ctx.caps)' failed
Matroskademux will send gap event when lag of video and audio is over 3 seconds.
audiodecoder needs to handle gap event and set default output caps.
Only audio info is set, while output caps is ignored. This cause the assertion failed.

Need to fill output caps in gst_audio_decoder_negotiate_default_caps() with
negotiated caps to avoid critical info printed when check it later.
2019-08-28 00:59:56 +00:00
Nirbheek Chauhan 564ab3031b gstgl: Add a new window type for WinRT
This is needed for using GstGL with ANGLE as the GLES implementation
in Universal Windows Platform apps that use the Windows Runtime
(WinRT) instead of Win32, which is deprecated and not allowed in
Windows Store apps.

This has been tested with Servo on the Microsoft HoloLens 2, and seems
to work quite well.
2019-08-28 02:25:11 +05:30
Mathieu Duponchelle 97426fd52e encoding-target: fix SECTION comment syntax
See https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/658
2019-08-27 14:25:34 +00:00
Niels De Graef 0314b482f3 Don't pass default GLib marshallers for signals
By passing NULL to `g_signal_new` instead of a marshaller, GLib will
actually internally optimize the signal (if the marshaller is available
in GLib itself) by also setting the valist marshaller. This makes the
signal emission a bit more performant than the regular marshalling,
which still needs to box into `GValue` and call libffi in case of a
generic marshaller.

Note that for custom marshallers, one would use
`g_signal_set_va_marshaller()` with the valist marshaller instead.
2019-08-27 07:31:57 +02:00
Seungha Yang 5f70adf667 gl/egl/display: Add support EGLDevice display type
Simple addition for supporting EXT_platform_device typed display.
It's a kind of special display type (part of EGL specification)
which has no window at all.
To use EGLDevice explicitly, set environment "GST_GL_WINDOW=egl-device"

See also https://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_platform_device.txt
2019-08-21 05:19:46 +00:00
Seungha Yang 7a378ba3ab glwindow: Introduce new vfunc for querying output surface availability
Only dummy window will return FALSE for now.
2019-08-21 05:19:46 +00:00
Seungha Yang 0bfb862329 video-hdr: Update documentation
* Fix typo
s/nunormalized/normalized/g

* Update GstVideoMasteringDisplayInfo description
Each values are not array.

* Add missing newline between arguments description and
detailed comment.
2019-08-20 21:16:24 +09:00
Philippe Normand 8d122f21ad gl: New pushsrc-based glbasesrc base class
The gltestsrc element was refactored to inherit from this base class which
handles the GL context. The sub-class only needs to implement the gl_start,
gl_stop and fill_gl_memory vfuncs, along with properly advertizing the GL APIs
it supports through the supported_gl_api GstGLBaseSrc class attribute.
2019-08-20 09:51:05 +01:00
Sebastian Dröge 8478aa7aed video-frame: Take TFF flag from the video info if it was set in there
The caps and thus the video info have preference. If the field order is
set in there then it applies to all frames.

This works around issues where the tff field order is only set in the
caps but not additionally in the buffer flags.
2019-08-16 09:00:28 +00:00
Mathieu Duponchelle f65145371b audioaggregator: add missing Since tag 2019-08-12 19:11:06 +02:00
Xavier Claessens 1b089ab065 glcolorconvert: Fix external-oes shader
The #extention must come before 'precision highp float;'.

Closes: #650
2019-08-12 15:52:17 +00:00
Seungha Yang 8936886192 video-hdr: Fix document typo
Fix missing document update. GstVideoContentLightMeta was changed to
GstVideoContentLightLevel during code review.
2019-08-12 22:47:33 +09:00
Tim-Philipp Müller 81dd81b739 video-color: keep UNKNOWN colorimetry define automatically up-to-date
Follow-up to !310 and helps with backport commits like !360
2019-08-11 14:16:51 +01:00
Seungha Yang fe9c38244f gl: Add support for P016 format
All implementation for P010_10LE/BE can be reused.
2019-08-08 11:46:16 +09:00
Seungha Yang c28721d89f video: Add P016 LE/BE formats
Add semi-planar 4:2:0 16 bits format.
2019-08-07 21:54:07 +00:00
Seungha Yang 90cf991337 video: Add Y444_16LE and Y444_16BE formats
Add 16 bits planar 4:4:4 YUV formats.
2019-08-07 12:10:47 +00:00
Sebastian Dröge 2bba48c9b5 video-anc: Fix ADF detection when trying to extract data from vanc
Previously we were checking offset 1 twice, but the second check
should've been for offset 2.
2019-08-07 13:01:07 +03:00
Jan Schmidt dd966c437f exiftag: Don't output rational numbers with denominator = 0 2019-07-30 04:01:55 +10:00
Lucas Stach 7b8fc744f1 gl/wayland: fix wayland event source burning CPU
Commit c71dd72b "gl/wayland: fix glib mainloop integration" was overeager
in removing the poll result test from the check function. This caused
dispatch to be called even if no new events are available on the
Wayland connection, which in turn would wake up the glib mainloop,
causing effectively a tight loop without ever blocking on the poll.

Fixes #603
2019-07-26 08:48:05 +01:00
Wonchul Lee ba9ef3c50e gldisplay: fix g-i warning 2019-07-23 09:10:17 +09:00
Guillaume Desmottes 509d4c31f0 video-format: add gst_video_format_info_component()
New API to find out which components are packed in a given plane.
Will prevent us from assuming a 1-1 mapping between planes and
components.
2019-07-19 15:47:02 +05:30
Mathieu Duponchelle c854c270be basedepayload: do not create segment in onvif mode
basedepayload generates its own segment in a pretty unconventional
manner, relying on information in the caps such as npt-start or
npt-stop, usually set by rtspsrc.

In ONVIF mode, rtspsrc will generate the correct segment and this
logic in rtpbasedepayload will not be needed, this commit allows
rtspsrc to signal that through the caps.
2019-07-18 17:54:04 +02:00
Sebastian Dröge 1ec1123178 audioaggregator: Split getcaps() function into two
One for convert pads and one for normal sink pads.
2019-07-18 08:46:42 +03:00
Sebastian Dröge 5ebf6c2fac videoaggregator: We can only convert the format if a GstVideoAggregatorConvertPad is used
Otherwise assume that we can at least support any framerate.
2019-07-18 08:43:14 +03:00
Sebastian Dröge 0a21c28484 audioaggregator: Always take first configure pad's rate and downstream caps into account when calculating allow sink caps
While we can convert between all formats apart from the rate, we
actually need to make sure that we comply with a) the rate of the first
configured pad and b) also all the allowed rates from downstream.
2019-07-18 08:43:14 +03:00
Sebastian Dröge 7080d216a8 audioaggregator: If we don't have a GstAudioAggregatorConvertPad, don't assume that we can actually convert 2019-07-18 08:43:14 +03:00
Mathieu Duponchelle bced52d2e8 audioaggregator: always use downstream's rate requirements
We were previously only fixating the rate in the getcaps
implementation when downstream was requiring a discrete value,
causing negotiation to fail when upstream was capable of rate
conversion, but not made aware that it had to occur.

Instead of fixating the rate, we can simply update our sink
template caps with whatever GValue the downstream caps are holding
as their rate field.

Allows negotiation to successfully complete with pipelines such as:

audiotestsrc ! audio/x-raw, rate=48000 ! audioresample ! audiomixer name=m ! \
audio/x-raw, rate={800, 1000} ! autoaudiosink \
audiotestsrc ! audio/x-raw, rate=44100 ! audioresample ! m.
2019-07-18 08:43:14 +03:00
Seungha Yang 7227feb5cd video-color: Enhance documentation of gst_video_colorimetry_to_string()
It could return null string. So need to clarify when it will be null.
2019-07-17 02:50:51 +09:00
Seungha Yang 6a4e2f4fc9 video-color: Add util functions for conversion from/to ISO/IEC 23001-8
... and also as known as ITU-T H.273.

The conversion has been handled per plugin for now. That causes
code duplication a lot also some plugins might not be updated with newly introduced
color{matrix,transfer,primaries} enum value(s).

Instead of handling it per plugin, centralized handling can remove such
code duplication and make plugins be up-to-dated.
2019-07-15 20:52:27 +09:00
Sebastian Dröge 1381e3e2be sdp: Add support for parsing the extmap attribute from caps and storing inside caps
The extmap attribute allows mapping RTP extension header IDs to
well-known RTP extension header specifications. See RFC8285 for details.

We store the extmap attribute either as string in the caps
  extmap-X=extensionname
where X is the integer extension header ID, or as 3-tuple of strings
  extmap-X=<direction,extensionname,extensionattributes>
where direction or extensionattributes are allowed to be the empty
string.

Both formats are allowed because usually only the extension name is
given and it's much simpler to handle in caps.
2019-07-13 12:18:15 +00:00
Dylan McCall 2e686b0dad gstgldisplay: Add public foreign_display property
We use this property in gst_gl_display_egl_from_gl_display, to set
foreign_display for the new GstGLDisplayEGL instance. This fixes a
problem where gst_gl_display_egl_finalize calls EglTerminate on a
pre-existing EGL connection.
2019-07-08 20:46:58 +00:00
Sumaid Syed 18351dcd24 tag: Add tags for acoustid id & acoustid fingerprint
Mapping followed: https://picard.musicbrainz.org/docs/mappings/

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/612
2019-07-08 17:06:37 +05:30
Sumaid 8718458dc7 tag: Repair support for MusicBrainz IDs
Add missing release group ID and track ID
Mapping Followed:
https://picard.musicbrainz.org/docs/mappings/

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/612
2019-07-08 16:31:34 +05:30
Marc Leeman 92137572c3 egl: wl_egl_window is not wl_proxy
It seems that eglCreatePlatformWindowSurfaceEXT is failing (with
EGL_BAD_ALLOC) because it thinks an EGL surface has already been created
for the wl_egl_window. The reason is that the "driver_private" field of
the wl_egl_window is getting clobbered by the function
wl_proxy_set_queue().

Since a wl_egl_window is not a wl_proxy, it shouldn't be passed to
wl_proxy_set_queue(). It just wraps a wl_surface (which is a wl_proxy).
And it looks like the queue for that surface is getting set earlier on
in the function anyway.

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/621#note_184582
2019-07-03 09:07:06 +00:00
Göran Jönsson dcfa999e89 rtspconnection: data-offset increase not set 2019-06-28 07:22:17 +02:00
Göran Jönsson 35f2ea21e6 rtpsconnection: Fix number of n_vectors
Body_offset mean that so much data have been written.

Without this patch n_vectors somtimes  becomes one more than it should
and then there will be an vector that have a random size causing
writev_bytes to cause a "Bad address" error.
2019-06-27 13:18:06 +02:00
Nirbheek Chauhan 12d534bada video-color: Add compile-time assert for ColorimetryInfo enum
A comment is not sufficient because this will break when
cherry-picking or backporting commits.
2019-06-26 17:40:47 +05:30
Doug Nazar fb842a3fdb audiodecoder: Fix leak on failed audio gaps
If we fail to process the gap event we need to unref the event or
we end up with a leak.
2019-06-26 03:51:03 -04:00
Philippe Normand b233911684 glupload: Keep track of cached EGLImage texture format
This patch fixes the following critical warning:

CRITICAL **: 11:33:32.843: Unknown GL format 0x0 provided

It would happen during the setup of a second pipeline involving the DMABuf
uploader, typically with a v4l2src element. The warning was raised because the
uploader had a cached EGLImage already filled but the formats were not
synchronized accordingly.
2019-06-23 11:34:49 +01:00
Marco Felsch 197dcb9bf4 video-info: parse field-order for all interleaved formats
The "field-order" is related for all interlace_mode modes except the
"progressive" mode. So instead of or'ing each mode we can use the
already supported GST_VIDEO_INFO_IS_INTERLACED macro.
2019-06-18 09:44:44 +00:00
Haihao Xiang 6d0f796591 glimagesink: add support for P010 variants
This makes a pipeline below works:

little endian:
gst-launch-1.0 videotestsrc ! video/x-raw,format=P010_10LE ! glimagesink

big endian:
gst-launch-1.0 videotestsrc ! video/x-raw,format=P010_10BE ! glimagesink
2019-06-18 16:32:00 +08:00
Haihao Xiang 49f16489ab glcolorconvert: rename the NV12/NV12 shader to semi planar
This shader can be used for other semi planar formats, e.g. P010_10LE
2019-06-18 16:18:02 +08:00
Haihao Xiang 3f63295280 glimagesink: add support for BGR10A2_LE / RGB10A2_LE
This makes a pipeline below work:

gst-launch-1.0 videotestsrc ! video/x-raw,format={BGR10A2_LE, \
RGB10A2_LE} ! glimagesink
2019-06-18 02:58:16 +00:00
Haihao Xiang d15a516037 glformat: removde dead break after return 2019-06-18 02:58:16 +00:00
Roman Sivriver 2b25862973 video-and: Fix buffer overflow detected by asan
gst_meta_api_type_register() assumes that the last tags element is null, but it wasn't

==17422==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f4e2a67c998 at pc 0x7f4e2a0c92ac bp 0x7ffcc41f80b0 sp 0x7ffcc41f80a0
READ of size 8 at 0x7f4e2a67c998 thread T0
    #0 0x7f4e2a0c92ab in gst_meta_api_type_register ../subprojects/gstreamer/gst/gstmeta.c:94
    #1 0x7f4e2a5582c3 in gst_video_afd_meta_api_get_type ../subprojects/gst-plugins-base/gst-libs/gst/video/video-anc.c:1146
    #2 0x404c7c in invoke_get_type (/home/ubuntu/gst-build/build/tmp-introspect5gv1rovo/GstVideo-1.0+0x404c7c)
    #3 0x406b5c in dump_irepository (/home/ubuntu/gst-build/build/tmp-introspect5gv1rovo/GstVideo-1.0+0x406b5c)
    #4 0x407089 in main (/home/ubuntu/gst-build/build/tmp-introspect5gv1rovo/GstVideo-1.0+0x407089)
    #5 0x7f4e295b4b6a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26b6a)
    #6 0x404479 in _start (/home/ubuntu/gst-build/build/tmp-introspect5gv1rovo/GstVideo-1.0+0x404479)

0x7f4e2a67c998 is located 40 bytes to the left of global variable 'tags' defined in '../subprojects/gst-plugins-base/gst-libs/gst/video/video-anc.c:1232:25' (0x7f4e2a67c9c0) of size 24
0x7f4e2a67c998 is located 0 bytes to the right of global variable 'tags' defined in '../subprojects/gst-plugins-base/gst-libs/gst/video/video-anc.c:1141:25' (0x7f4e2a67c980) of size 24
SUMMARY: AddressSanitizer: global-buffer-overflow ../subprojects/gstreamer/gst/gstmeta.c:94 in gst_meta_api_type_register
2019-06-17 22:03:34 -04:00
Seungha Yang 3f0e1f937d codec-utils: Add parsing H265 range extensions profiles
Add support all h265 profiles defined by ITU-T H.264 (02/2018) revision
2019-06-15 17:17:36 -04:00
Wonchul Lee 7883663e26 appsrc: Fix typo in documentation 2019-06-15 14:33:32 +09:00
Wonchul Lee afcfb22f83 videodecoder: Fix typo in documentation 2019-06-15 10:44:48 +09:00
Adrian Negreanu 96363a3425 glcontext_egl: check if eglChooseConfig has a matching config
The specs recommends to also check the num_config parameter.
2019-06-14 12:59:03 +03:00
Stian Selnes eaade96409 rtpbasedepayload: Add max-reorder property
Add max-reorder property to make the old hard coded reordering limit of
100 configurable. It's particularly useful in some scenarios to set
max-reorder=0 to disable the behavior that the depayloader will drop
packets.

Note that although the default value is 100, the default limit has
increased with one because of the changed if-test. This was done to
allow the max-reorder value to be more intuitive. See tests.
2019-06-13 19:41:11 +03:00
Matthew Waters 6a399b95a8 glcontext: add a couple of preconditions of invalid usage 2019-06-13 07:08:06 +00:00
Víctor Manuel Jáquez Leal 634ff541d0 gl: detect possible GL version prefix
Instead of checking if the requested GL API is GLES2 (because ANY can
be set) the string is matched with the GLES2 prefix, and if so, then
the string is offset.
2019-06-12 20:42:34 +02:00
Havard Graff f7408f9418 rtpbasepayload: don't use GINT_TO_POINTER with GType
GType can (and will) be 64bit. GINT_TO_POINTER is not.
This will result in the api-type checked for being a different one than
it actually is...
2019-06-12 12:38:26 +00:00
Havard Graff 2e342a16ce rtpbasedepayload: don't consider existing GstRTPSourceMeta
The meta should always be generated based on what is present in the
rtp-header.
2019-06-12 12:38:26 +00:00
Marc Leeman a83859aaee gstrtppayloads: add vp8/vp9/opus encoding-name
Adding these encoding names allows easy lookup of the caps based on the
encoding-name.
2019-06-12 12:32:33 +00:00
Eike Hein 303f927d70 rtspconnection: Start CSeq at 1
RFC 7826 recommends (but does not require) starting at 0,
but at least one known server implementation fails to copy
request sequence numbers <1 into responses due to an
incorrect null check.

The server known to exhibit this behavior is the Parrot
Streaming Server, serving video from their UAV devices.
A fix has been submitted upstream as well:
https://github.com/Parrot-Developers/librtsp/pull/2

The Parrot developers are known to have tested with LibVLC.
In WireShark debugging, LibVLC appears to start with a CSeq
of 2, which is likely why this bug went unnoticed.

This reverts 487595a7d6, which set this to 0 citing the
RFC. The switch to 0 was thus a recent one; it's therefore
possible server implementors relied on the previous
GStreamer client behavior in their tests as well.

Fixes #624.
2019-06-12 16:21:41 +09:00
Haihua Hu 2ea98270b4 viv-fb: fix build break for GST_GL_API
Need include config.h in gstglwindow_viv_fb_egl.c
2019-06-11 18:55:00 +08:00
Thibault Saunier e0ebd29a17 discoverer: Plug some leaks in the cache loading path 2019-06-07 22:44:31 -04:00
Mathieu Duponchelle d6847fe04d discoverer: unref "next" variant when parsing from variant 2019-06-05 20:51:47 +00:00
Fernando Herrrera 80547d9437 wayland: set the event queue also for the xdg_wm_base object 2019-06-05 13:27:56 +01:00
Niels De Graef 93daa1435a Use G_DEFINE_AUTOPTR_CLEANUP_FUNC unconditionally
Since we started depending on GLib 2.44, we can be sure this macro is
defined (it will be a no-op on compilers that don't support it). For
plugins we should just start using `G_DECLARE_FINAL_TYPE` which means we
no longer need the macro there, but for most types in base/gst-libs we
don't want to break ABI, which means it's better to just keep it like it
is (and use the `#ifdef` instead).
2019-06-04 20:31:09 -04:00
Daniel Klamt 394ad27507 Added GI annotation for gstvideoaffinetransformationmeta apply_matrix
The problem is that Gobject Introspections does not understand the const
gfloat matrix[16] as an matrix but as an array of gfloasts but as just
one gfloat.

To fix this i added the annotation to the parameter
descriptions.
2019-06-02 16:42:57 +00:00
Mathieu Duponchelle d98835fdef doc: remove xml from comments 2019-05-30 01:12:59 +02:00
Arun Raghavan 326940f89a video-color: Deal with NULL colorimetry while converting from string
This came up in the case where v4l2 sets caps with colorimetry=NULL, and
then tries to parse back the colorimetry, causing a crash in
gst_video_get_colorimetry() because of g_str_equal(). We fix this by
making sure the only caller of the function never calls it with a null
colorimetry string.
2019-05-24 16:37:14 +02:00
Arun Raghavan aa759d4204 video-color: Fix unknown colorimetry checking
Also drop some deadcode #defines.
2019-05-24 16:35:08 +02:00
Seungha Yang 59007d848a video-color: Add ARIB STD-B67 transfer chracteristic function
It's known also as Rec. ITU-R BT.2100-1 hybrid log-gamma (HLG) used for
both SDR and HDR rendering.
2019-05-24 09:30:40 +00:00
Seungha Yang f7af199b4c video-color: Add SMPTE ST 2084 support and BT 2100 colorimetry
SMPTE ST 2084 transfer characteristics (a.k.a ITU-R BT.2100-1 perceptual quantization, PQ)
is used for various HDR standard.
With ST 2084, we can represent BT 2100 (Rec. 2100). BT 2100 defines
various aspect of HDR such as resolution, transfer functions, matrix, primaries
and etc. It uses BT2020 color space (primaries and matrix) with PQ or HLG
transfer functions.
2019-05-24 09:30:40 +00:00
Seungha Yang 9d2f9d16a1 video-color: Define bt2020-10 transfer characteristics for clarity
bt707, bt2020-10, and bt2020-12 transfer characteristics are functionally
identical but have their own unique values by specification.
2019-05-24 09:30:40 +00:00
Matthew Waters 51f2d05ff6 gl/docs: add to new docs system 2019-05-21 01:49:48 +00:00
Mathieu Duponchelle 31ac4f4665 gstaudioaggregator: expose output-buffer-duration-fraction
The code for this is mostly lifted from audiobuffersplit, it
allows use cases such as keeping the buffers output by compositor
on one branch and audiomixer on another perfectly aligned, by
requiring the compositor to output a n/d frame rate, and setting
output-buffer-duration to d/n on the audiomixer.

The old output-buffer-duration property now simply maps to its
fractional counterpart, the last set property wins.
2019-05-16 02:55:14 +02:00
Guillaume Desmottes d90ac65af1 gloverlaycompositor: fix crash if buffer doesn't have video meta
Fix #501
2019-05-14 17:12:06 +00:00
Thibault Saunier 66c9618f0c video:doc: Remove duplicated gstvideoutils SECTION 2019-05-13 17:00:00 -04:00
Thibault Saunier 287897e465 doc: Fix some gtk-doc comments 2019-05-13 11:34:08 -04:00
Thibault Saunier 27ba8d24ec doc: Port to hotdoc 2019-05-13 11:34:08 -04:00
Thibault Saunier 685731e989 meson: Add variables for gir files
And flatten list of sources for dependencies
2019-05-13 10:19:22 -04:00
Thibault Saunier f9de1b9214 docs: Add some missing sections documentation 2019-05-13 10:19:22 -04:00
Thibault Saunier 1a2fe0e6e4 docs: Enhance GstEncodingProfile and GstEncodingTarget doc 2019-05-13 10:19:22 -04:00
Matthew Waters 15cb86435d glshader: fix default external-oes shaders
In glsl, #extension directives need to before other non-preprocesser
directives.  We were placing the precision qualifier before that.  Fix
by moving the #extension to the first line in the shader.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/601
2019-05-07 18:43:49 +10:00
Seungha Yang f4b054d349 video: Add RGB10A2_LE pixel format
Packed 10 bits per each R, G and B channel with MSB 2bits alpha channel.
This format is mapped to Windows' DXGI_FORMAT_R10G10B10A2_UNORM format which is
required for 10bits HDR rendering.

Note that this RGB10A2_LE format is R - B channel swapped version of BGR10A2_LE
2019-05-05 08:12:29 +00:00
Thibault Saunier 31f8826789 video: Generate GTypes for videotimecode enums 2019-05-03 09:58:04 -04:00
Thibault Saunier 481c4ca9cd videotimecode: Mark latest_daily_jame as allow-none in init\() 2019-05-03 09:58:04 -04:00
Aaron Boxer f6fa444f04 video-anc: add AFD/Bar support 2019-05-02 19:59:29 +00:00
Aaron Boxer 6a78d20272 video-frame: update docs
mention closed caption caps as valid caps for video buffer flags
2019-05-02 16:36:38 +00:00
Seungha Yang 4e80ea6473 videoencoder: Forward upstream HDR information to downstream
... if subclass didn't update values. Note that the mastering-display-info
and content-light-level might be updated by user defined value (e.g., encoding option).
2019-05-02 14:35:27 +09:00
Seungha Yang 3e460766e8 videodecoder: Forward upstream HDR information to downstream
The HDR related information is not part of GstVideoInfo but should be passed
to downstream.
2019-04-30 15:45:44 +00:00
Seungha Yang 74d909bc88 video: Add new APIs for HDR information representation
Introduce HDR signalling methods
* GstVideoMasteringDisplayInfo: Representing display color volume info.
  Defined by SMPTE ST 2086
* GstVideoContentLightLevel: Representing content light level specified in
  CEA-861.3, Appendix A.

Closes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/400
2019-04-30 15:45:44 +00:00
Sebastian Dröge 7095b7c47a id3tag: Correctly validate the year from v1 tags before passing to GstDateTime
By using strtoul(), invalid values will get mapped to MAXULONG and we
would have to check errno. They won't get mapped to 0.

To solve this, use the signed g_ascii_strtoll(). This will map errors to
0 or G_MAXINT64 or G_MININT64, and the valid range for GstDateTime is >
0 and <= 9999 so we can directly check for this here.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/384
2019-04-26 09:46:58 +03:00
Niels De Graef e8450397c0 gl/wayland: Don't prefix wl_shell struct field
As part of commit 808e7127, we prefixed the `GstWlWindow`'s `shell`
field with wl_, to differentiate it from the other types of shells a
Wayland compositor might support. However, this is apparently a struct
that we expose to our users, so changing it means we have an API break.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/592
2019-04-24 09:03:44 +00:00
Sebastian Dröge 5f19e83f14 eglimage: Add compatibility define for DRM_FORMAT_NV24 2019-04-23 14:12:17 +00:00
Sebastian Dröge 03a85de734 libs: Fix various Since markers 2019-04-23 12:28:26 +00:00
Sebastian Dröge e96d105e8d audioaggregator: Add Since: 1.14 markers to all public structs 2019-04-23 12:28:26 +00:00
Sebastian Dröge 53416af4f0 video-anc: Add Since: 1.16 marker 2019-04-23 12:28:26 +00:00
Sebastian Dröge fd68d5516e videoaggregator: Add Since: 1.16 markers to all public structs 2019-04-23 12:28:26 +00:00
Sebastian Dröge 1837fc46af gl: Add various missing Since: 1.16 markers
And add some missing function documentation.
2019-04-23 12:28:26 +00:00
Sebastian Dröge 31e1c8745c video-anc: Add DID16 value for SMPTE 2016-3 AFD/Bar data 2019-04-23 11:25:05 +00:00
Sebastian Dröge cbccda6f3b video-anc: Handle SD formats correctly
VANC is stored linearly in SD formats instead of separating the Y and YV
components from each other and having first all Y and then all UV
values.
2019-04-23 11:25:05 +00:00
Kristofer Bjorkstrom 1dea6d52ce rtspconnection: add Content-Length limit
Add the possible to limit the Content-Length
Define an appropriate request size limit and reject requests exceeding
the limit (413 Request Entity Too Large)
2019-04-22 09:01:32 +00:00
Michael Tretter 9c2379e00a glupload: prevent segfault when updating caps
When the glupload element renegotiates the caps, set_caps will reset the
method_impl to NULL, but the method will be kept. transform_caps tries
to use the method_impl to transform the caps, because a method is set,
but will segfault.
2019-04-12 12:05:22 +02:00
Aaron Boxer a397a36b75 video-anc: revert "add support for Bar and AFD meta-data"
This reverts commit 8759c36851.
GstMeta may not be the appropriate vehicle for this information
2019-04-10 16:09:19 -04:00
Nicolas Dufresne 4329af1e4b sdp: mikey: Add missing Since marker
Two new enums value where added without a since mark, adding it.

  @GST_MIKEY_ENC_AES_GCM_128
  @GST_MIKEY_SP_SRTP_AEAD_AUTH_TAG_LEN
2019-04-10 15:08:02 -04:00
Kristofer Bjorkstrom 487595a7d6 rtspconnection: CSeq initial value set to 0
RFC 7826: "it is RECOMMENDED to start at 0.
2019-04-10 09:09:58 +02:00
Kristofer Bjorkstrom 06b600901c rtspconnection: CSeq validation
Make rtspconnection a little more strict to RFC2326.
Make sure that CSeq is in every RTSP message and that CSeq is valid.

Also break the build_next loop if any parsing fails, By acting on
the builder->status code.
2019-04-10 09:09:58 +02:00
Ulf Olsson 7806285a10 mikey: Add support for GCM (RFC 7714)
The MIKEY details can be found in RFC 7714 section "14.3. MIKEY"
2019-04-09 19:19:47 +00:00
Thibault Saunier 4320a31bd9 encoding-target: Lower down some debugging
We do try to load target with 'random' string internally to load EncodingProfiles
2019-04-09 17:20:01 +00:00
Guillaume Desmottes e397c4cea1 video-info: explain in logs why colorimetry are rejected
It wasn't clear from the logs why some colorimetry format were rejected.
2019-04-09 13:22:12 +05:30
Mathieu Duponchelle 951b951188 gstvideometa: fix annotation 2019-04-08 21:54:00 +02:00
Tim-Philipp Müller c701d17f12 video-anc: fix g-i complaints
video-anc.h💯 Error: GstVideo: identifier not found on the first line:
 *  Active Format Description (AFD) support
   ^
video-anc.h:207: Error: GstVideo: identifier not found on the first line:
 *  Bar data support
   ^
video-anc.h:228: Warning: GstVideo: "@top_bar_flag" parameter unexpected at this location:
 * @top_bar_flag : flag indicating presence of top bar field
    ^
2019-04-07 22:08:37 +01:00
Aaron Boxer 8759c36851 video-anc: add support for Bar and AFD meta-data 2019-04-07 14:58:42 -04:00
Mathieu Duponchelle 3c4bef46b7 basepayload: Expose onvif-no-rate-control property
The ONVIF spec mandates that when Rate-Control=no, the RTP timestamps
match the original sampling times, as opposed to the intended playback
time.
2019-04-05 16:42:55 +00:00
Mathieu Duponchelle 57f5c2d4db rtspdefs: Add Onvif Rate-Control header 2019-04-05 16:42:55 +00:00
Mathieu Duponchelle e9b2cd0e53 rtspdefs: Add Onvif Frames header 2019-04-05 16:42:55 +00:00
Haihao Xiang 3b6415b421 video: add BGR10A2_LE pixel format
This pixel format is a packed 4:4:4 RGB with alpha channel (B-G-R-A),
R/G/B channel has 10 bits and alpha channel is the MSB 2 bits.
2019-04-04 01:59:18 +00:00
Mathieu Duponchelle abed7c2d3d gstvideometa: do not emit criticals when adding timecode metas
This is inconsistent with other add_meta methods such as
gst_buffer_add_video_meta , which will return NULL without
logging when gst_video_info_set_format fails.

It is up to the caller to check the return value of the
function, and log if appropriate.
2019-04-03 17:37:10 +02:00
Aaron Boxer 6ade19cc15 discoverer: async_timeout_cb: don't clean up timeout_source
discoverer_collect() already does this. So, the second
unref triggers an assert.
2019-04-01 18:35:06 +00:00
Haihao Xiang a6afa88812 video: fix unpack_Y410
It should handle data starting from x
2019-03-26 10:24:35 +08:00
Haihao Xiang 4ab04e5dea video: fix unpack_Y210
It should handle data starting from x and width may be an odd
2019-03-26 10:24:35 +08:00
Guillaume Desmottes 10ce73b6eb video-info: check if alternate caps has the feature as well
It's invalid to have a 'interlace-mode=alternate' without the Interlaced caps
feature as well.
Modify gst_video_info_from_caps() to reject such case so we can easily
spot them in bugged elements.
2019-03-25 15:36:57 +01:00
Guillaume Desmottes 6ba860021c video-info: handle 'field-order' in alternate mode
The alternate interlace mode may also use the 'field-order' field in caps.
2019-03-25 15:35:46 +01:00
Tim-Philipp Müller 2f9db671cb gl: suppress some g-i warnings
gst_gl_memory_setup_buffer() was marked as introspectable=0
anyway, so might just as well mark it as '(skip)' and suppress
the warning. Reason is the (element-type gpointer) on wrapped_data.

gstglmemory.c:1426: Warning: GstGL: gst_gl_memory_setup_buffer: argument wrapped_data: Missing (element-type) annotation
gstglmemory.c:1426: Warning: GstGL: gst_gl_memory_setup_buffer: argument wrapped_data: Missing (element-type) annotation

egl/gstegl.h:40: Warning: GstGL: symbol='EGL_EGLEXT_PROTOTYPES': Unknown namespace for symbol 'EGL_EGLEXT_PROTOTYPES'
2019-03-24 16:05:09 +00:00
Tim-Philipp Müller bb48e326ac meson: gl: don't pass generated xdg shell header and source file to g-i
They're private, g-i doesn't need to know about them.
Avoids lots of spammy g-i warnings.
2019-03-23 21:51:37 +00:00
Tim-Philipp Müller 413b7168da audiometa: fix g-i warning
gstaudiometa.c:382: Warning: GstAudio: gst_buffer_add_audio_meta: return value: Invalid non-constant return of bare structure or union; register as boxed type or (skip)
2019-03-23 20:08:56 +00:00
Sebastian Dröge 2ad6b0b432 rtspconnection: Remove unneeded bytes_written >= 0 conditions
It's unsigned and always >= 0.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/569
2019-03-22 10:28:16 +02:00
Haihao Xiang 2a45590051 video: update orc generated files for new functions 2019-03-21 23:05:09 +00:00
Haihao Xiang f0cbb78770 glimagesink: add support for VUYA format 2019-03-21 23:05:09 +00:00
Haihao Xiang 90f8cca04e video: add VUYA pixel format
AYUV in gstreamer was defined in A-Y-U-V order in memory[1], however
Microsoft defined another AYUV format in V-U-Y-A order in memory[2]. Add
VUYA format for the latter in order to distinguish the two formats

[1] https://gstreamer.freedesktop.org/documentation/design/mediatype-video-raw.html#formats
[2] https://docs.microsoft.com/en-us/windows/desktop/medfound/recommended-8-bit-yuv-formats-for-video-rendering#ayuv)
2019-03-21 23:05:09 +00:00
Josep Torra c1a5a36bba rtcpbuffer: test for len instead of type
The function rtcp_packet_min_length() returns a length for each known type
and -1 for unknown types. This change fixes the test accordingly and silences
the following warning.

gstrtcpbuffer.c:567:12: error: comparison of constant -1 with expression of type 'GstRTCPType' is always false
      [-Werror,-Wtautological-constant-out-of-range-compare]
  if (type == -1)
2019-03-21 19:27:28 +01:00
Nicolas Dufresne 3ee89d6e3c Remove some left over 0.10 references 2019-03-21 17:22:24 +00:00
Josep Torra a1cc9ea6a9 discoverer: add casts to avoid warnings in osx builds
Fix the following warnings by adding casts.

gstdiscoverer.c:1801:17: error: format specifies type 'unsigned long' but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat]
      location, file_status.st_size, file_status.st_mtime);
                ^~~~~~~~~~~~~~~~~~~
gstdiscoverer.c:1801:38: error: format specifies type 'long long' but the argument has type '__darwin_time_t' (aka 'long') [-Werror,-Wformat]
      location, file_status.st_size, file_status.st_mtime);

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/570
2019-03-21 17:21:30 +01:00
Stian Selnes eadeec791a rtpbasedepayload: Drop gap events before first buffer
Before a gap event is pushed downstream a segment event must be pushed
since the gap event can cause packet concealment downstream and hence
data flow. Since concealment before receiving any data packets usually
doesn't make any sense, the gap event is not sent downstream.

Alternatively one could generate a default caps and segment event, but
no need to complicate things until it's proven necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=773104
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/301
2019-03-20 15:30:50 +00:00
Roman Shpuntov 31cb8500ee macOS gst-plugins-base/gl/cocoa: UI API called on a background thread: -[NSView removeFromSuperview]
The problem inside gstglwindow_cocoa.m, all UI operations must be called from main UI thread.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/568
Fixes #568
2019-03-20 18:44:12 +07:00
Wonchul Lee a75e47e815 appsrc: Fix docs typo
Fix typo empty-percent to min-percent
2019-03-16 14:57:56 +00:00
Antonio Ospite 1eb9c5b309 rtpbasepayload: print list size in log output instead of -1
It is weird to see "Preparing to push packet with size 4294967295" in
the logs, so print the list length in case of a buffer list.
2019-03-15 17:38:58 +01:00
Tobias Ronge f672277509 gstrtspconnection: Security loophole making heap overflow
The former code allowed an attacker to create a heap overflow by
sending a longer than allowed session id in a response and including a
semicolon to change the maximum length. With this change, the parser
will never go beyond 512 bytes.
2019-03-14 10:24:30 +01:00
Guillaume Desmottes 2e939afd73 video-color: add more color primaries formats
They correspond to index 10, 11, 12 and 22 from ITU-T H.273,
Table 2 – Interpretation of colour primaries (ColourPrimaries) value
2019-03-12 16:53:54 +01:00
Nirbheek Chauhan 045137d340 glwindow/win32: Don't use condition variables for message synchronization
Using a single condition variable for synchronization across all GL
messages is very slow on Windows and uses up to 20% CPU usage in some
workloads due to lock contention and false broadcasts.

Using per-message event handles reduces the CPU usage to negligible
amounts despite having to allocate a new event handle for each
message.
2019-03-12 03:21:57 +00:00
Nirbheek Chauhan 36ec18c230 glmemory: Disable GL timing queries when debugging
This can be very expensive in some workloads, taking up to 11% of the
total execution time.
2019-03-12 03:21:57 +00:00
Nirbheek Chauhan 21bc1040d4 glframebuffer: Don't do expensive checks with low gst debug levels
Framebuffer checks can be very expensive, taking up to 3-5% of the
total CPU consumed by the application.
2019-03-12 03:21:57 +00:00
Lucas Stach c71dd72b21 gl/wayland: fix glib mainloop integration
Implement the prepare and check functions according to the
documentation by returning TRUE when events should be dispatched
via the dispatch function.

As wl_display_read_events never blocks we can call it unconditionally
without looking at the poll status.

This simplifies the implementation and gets rid of a race where the
mainloop could get blocked due to nobody actually reading the events
from the wayland connection.
2019-03-11 13:54:16 +01:00
Mathieu Duponchelle a35d500eae videoaggregator: fix buffer skipping with pad offsets
The ->skip_buffer implementation in videoaggregator replicates
the behaviour of the aggregate method to determine whether a
buffer can be skipped
(https://bugzilla.gnome.org/show_bug.cgi?id=781928).

This fixes a typo that made it so the start time of the buffer
was calculated against the output segment, not the segment of
the relevant sinkpad, which caused buffers to be skipped when
for example a sinkpad had received a segment which base had
been modified by a pad offset somewhere along the way.

This simply makes the calculation of the buffer start time
identical to the calculation in aggregate()
2019-03-08 07:40:25 +00:00
Matthew Waters 6a37bf9bb9 gl: Don't restore the viewport on function exit
Doing so involves retrieving the current viewport from OpenGL which as
with any glGet operation, is expensive.

This means that the various sinks need to reset the viewport on draw.

In the process, fix resizing on cocoa.
2019-03-08 17:49:05 +11:00
Thibault Saunier 7bcd72f5b6 Revert "Revert "discoverer: Serialize/load "next" StreamInfo in GVariants""
This reverts commit 747f5a75c3.

This was never meant to be reverted in the first place but sliped in
during developement
2019-03-07 19:52:44 -03:00
Thibault Saunier 747f5a75c3 Revert "discoverer: Serialize/load "next" StreamInfo in GVariants"
This reverts commit 6ca357f5b67590c694a95013f5eb5fdd04cf46a9.
2019-03-07 20:59:29 +00:00
Thibault Saunier 19c86b4494 discoverer: Remove padding from private headers 2019-03-07 20:59:29 +00:00
Thibault Saunier c8eee6f0c6 dicoverer: Do not add container infos to the stream list
They are not added on actual discovery

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/398
2019-03-07 20:59:29 +00:00
Thibault Saunier 4014995d0c discoverer: Serialize/load "next" StreamInfo in GVariants
See https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/398
2019-03-07 20:59:29 +00:00
Thibault Saunier 54920276b0 discoverer: Implement GstDiscovererInfo caching
This uses the gst_discoverer_info_from/to_variant API and saves
the variants on disc (in the user data cache dir) allowing much
faster retrieval of the information after the cache has been built.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/398
2019-03-07 20:59:29 +00:00
Olivier Crête 6a8c15f3bd video-aggregator: Sync property values to output timestamp
The properties need to be change at every output frame based on the output
time because they may change even though the input frame is not changing.
2019-03-07 14:43:06 -05:00
Matthew Waters 4e13980e10 gl: fix a few other leaks when not getting to PAUSED 2019-03-07 02:01:09 +11:00
Matthew Waters 86aa568383 glcolorconvert: Ensure we free the internal convert object
If we only ever make it to READY, transform_caps can create an
internal convert object that will never be freed by basetransform's
stop vmethod (PAUSED->READY).
2019-03-06 23:32:18 +11:00
Tim-Philipp Müller d58b7cf75c gl: .gitignore generated wayland xdg shell files 2019-03-06 10:49:48 +00:00
Tim-Philipp Müller 81ccfdd6fd video: fix pipeline leak in gst_video_convert_sample_async() 2019-03-06 10:04:48 +00:00
Matthew Waters 13fc711eca gloverlaycompositor: Also free the texcoord GL buffer
Fix a typo that was attempting to free the position GL buffer twice
(without any consequences as there was a if (buffer) check)

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/561
2019-03-06 01:08:04 +00:00
Tim-Philipp Müller 8d1122013b audiodecoder: add _finish_subframe() method
This allows us to output audio samples without discarding
any input frames, which is useful for some formats/codecs
(e.g. the MonkeysAudio decoder implementation in ffmpeg
which will might return e.g. 16 output buffers for an
input buffer for certain files).

In the past decoder implementations just concatenated
the returned audio buffers until a full frame had been
decoded, but that's no longer possible to do efficiently
when the decoder returns audio samples in non-interleaved
layout.

Allowing subframes to be output before the entire input
frame is decoded can also be useful to decrease startup
latency/delay.

https://gitlab.freedesktop.org/gstreamer/gst-libav/issues/49
2019-03-05 19:49:13 +00:00
Marc Leeman 2e5f5e67ce rtp: add H265 to lookup for media info 2019-03-05 14:33:17 +01:00
Nicolas Dufresne 3f3719da41 videooverlay: Fix render-rectangle range
The range was set to -1 to MAXINT, but the x,y value can be negative.
Relax the restriction so that we can now have negative coordinates.
2019-03-04 17:05:04 -05:00
Matthew Waters 55bcdcf01a gl: actually use the highp specifier
675415bf2e contained a typo that incorrectly
used the mediump specifier instead of highp.
2019-02-28 23:39:21 +11:00
Matthew Waters 675415bf2e gl: try to use highp precision where supported
The use of mediump as a specifier in GLSL shaders will have limited
resolution and when used as texture coordinates may become inaccurate
over texture sizes of 1024.
2019-02-28 17:26:32 +11:00
James Cowgill 8f51fba8b5 video-format: Fix GBRA_10/12 alpha channel pixel strides
These formats have 4 components, so they should also have 4 components
of pixel stride.
2019-02-20 09:40:24 +00:00
Kristofer Bjorkstrom 4bc906e87e rtspconnection: Fix GError set over the top of a previous GError
The function fill_bytes could sometimes return a value greater than zero
and in the same time set the GError.

Function read_bytes calls fill_bytes in a while loop. In the special
case above it would call fill_bytes with error already set.
Thus resulting in "GError set over the top of a previous GError".

Solved this by clearing GError when return value is greater than zero.
Actions are taken depending on error type by caller of read_bytes. Eg.
with EWOULDBLOCK gst_rtsp_source_dispatch_read will try to read the
missing bytes again (GST_RTSP_EINTR )

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/445
2019-02-18 16:12:58 +00:00
Tim-Philipp Müller 0cdb3aa9b3 gl: eglimage: fix build on RPi by adding more fallback defines for EGL_*_EXT 2019-02-18 13:52:43 +00:00
Tim-Philipp Müller 79365f9b41 pbutils: add description for AV1 codec
Fixes #558
2019-02-16 15:29:57 +00:00
Edward Hervey dc2bc38b1e wayland: Also dist the private header 2019-02-13 11:59:10 +01:00
Nicolas Dufresne 77d7cfea10 eglimage: Add some more defines
This allow building on advertised version of libdrm drm_fourcc.h files.

Fixes #549
2019-02-11 10:01:55 -05:00
Nicolas Dufresne 837173c0f0 Revert "fix issue"
This reverts commit 5e0c458e0e.
2019-02-11 10:01:50 -05:00
yanle.zhang 5e0c458e0e fix issue
549."https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/549".
2019-02-11 16:13:15 +08:00
Seungha Yang 3152cbb46e glupload: Don't leak caps features
Create caps features when it is required.
2019-02-08 21:43:43 +09:00
Niels De Graef 17899dc9b6 gl/wayland: add support for XDG-shell
[wl_shell] is officially [deprecated], so provide support for the
XDG-shell protocol should be provided by all desktop-like compositors.
(In case they don't, we can of course fall back to wl_shell).

Note that the [XML spec] is provided by the `wayland-protocols`
git repository, which is provided by the Wayland project.

[wl_shell]: https://people.freedesktop.org/~whot/wayland-doxygen/wayland/Client/group__iface__wl__shell.html
[deprecated]: 698dde1958
[XML spec]: https://github.com/wayland-project/wayland-protocols/blob/master/stable/xdg-shell/xdg-shell.xml
2019-02-06 22:45:28 +00:00
Niels De Graef b52cf2f7d1 gl/wayland: extract code to create wl_shell_surface
This is just a cosmetic change that will make it easier to differentiate
between wl_shell and xdg_wm_base later.
2019-02-06 22:45:28 +00:00
Niels De Graef 808e712767 gl/wayland: prefix shell(_surface) with wl_
This will help us make the distinction later with xdg-shell and other
possible protocols that need to be supported.
2019-02-06 22:45:28 +00:00
Guillaume Desmottes f5a1164590 videodecoder: remove useless code in negotiate_default_caps()
gst_video_decoder_negotiate_default_caps() is meant to pick a default output
format when we need one earlier because of an incoming GAP.
It tries to use the input caps as a base if available and fallback to a default
format (I420 1280x720@30) for the missing fields.

But the framerate and pixel-aspect were not explicitly passed to
gst_video_decoder_set_output_state() which is solely relying on the input format
as reference to get the framerate anx pixel-aspect-ratio.
So there is no need to manually handling those two fields as
gst_video_decoder_set_output_state() will already use the ones from
upstream if available, and they will be ignored anyway if there are not.

This also prevent confusing debugging output where we claim to use a
specific framerate while actually none was set.
2019-02-04 11:53:03 +01:00
Sebastian Dröge 05f0fe79a2 rtspconnection: Fix uninitialized variable warning when compiling with pre-2.59.1 GLib
gstrtspconnection.c: In function ‘writev_bytes’:
gstrtspconnection.c:1348:10: error: ‘res’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   return res;
          ^
2019-01-30 13:04:12 +00:00
Seungha Yang a86fc3da46 rtspconnection: Fix broken build on GLib 2.59.0
GPollableReturn enum was introduced after GLib 2.59.0 release.
2019-01-30 12:29:01 +00:00
mrk501 361835979e audioringbuffer: Fix wrong memcpy address when reordering channels
When using multichannel audio data and being needed to reorder channels,
audio data is not copied correctly because destination address of
memcpy is wrong.

For example, the following command
$ gst-launch-1.0 pulsesrc ! audio/x-raw,channels=6,format=S16LE ! filesink location=test.raw
will reproduce this issue if there is 6-ch audio input device.

This commit fixes that.

The detailed process of this issue is as follows:
1. gst-launch-1.0 calls gst_pulsesrc_prepare (gst-plugins-good/ext/pulse/pulsesrc.c)

   1466 gst_pulsesrc_prepare (GstAudioSrc * asrc, GstAudioRingBufferSpec * spec)
   1467 {
   (skip...)
   1480   {
   1481     GstAudioRingBufferSpec s = *spec;
   1482     const pa_channel_map *m;
   1483
   1484     m = pa_stream_get_channel_map (pulsesrc->stream);
   1485     gst_pulse_channel_map_to_gst (m, &s);
   1486     gst_audio_ring_buffer_set_channel_positions (GST_AUDIO_BASE_SRC
   1487         (pulsesrc)->ringbuffer, s.info.position);
   1488   }

   In my environment, after line 1485 is processed, position of spec and s are
     spec->info.position[0] = 0
     spec->info.position[1] = 1
     spec->info.position[2] = 2
     spec->info.position[3] = 6
     spec->info.position[4] = 7
     spec->info.position[5] = 8

     s.info.position[0] = 0
     s.info.position[1] = 6
     s.info.position[2] = 2
     s.info.position[3] = 1
     s.info.position[4] = 7
     s.info.position[5] = 8

   The values of spec->info.positions equal
   GST_AUDIO_BASE_SRC(pulsesrc)->ringbuffer->spec->info.positions.

2. gst_audio_ring_buffer_set_channel_positions calls
   gst_audio_get_channel_reorder_map.

3. Arguments of gst_audio_get_channel_reorder_map are
    from = s.info.position
    to = GST_AUDIO_BASE_SRC(pulsesrc)->ringbuffer->spec->info.positions

   At the end of this function, reorder_map is set to
     reorder_map[0] = 0
     reorder_map[1] = 3
     reorder_map[2] = 2
     reorder_map[3] = 1
     reorder_map[4] = 4
     reorder_map[5] = 5

4. Go back to gst_audio_ring_buffer_set_channel_positions and
   2065       buf->need_reorder = TRUE;
   is processed.

5. Finally, in gst_audio_ring_buffer_read,

   1821     if (need_reorder) {
   (skip...)
   1829           memcpy (data + i * bpf + reorder_map[j] * bps, ptr + j * bps, bps);

   is processed and makes this issue.
2019-01-29 14:49:19 +00:00
Sebastian Dröge 3a0e7fb8f4 rtspconnection: Update to merged GOutputStream::writev() API 2019-01-29 14:17:29 +02:00
Sebastian Dröge 8a54cc3b16 rtspconnection: Handle EOF on writev() after checking for all other error conditions
Otherwise we would return EOF if nothing was written in any case, even
if this was actually a case of TIMEOUT or EWOULDBLOCK for example.

Thanks to Edward Hervey for debugging and finding this issue.
2019-01-29 14:17:23 +02:00
Ognyan Tonchev 87a9f2b92c rtspconnection: Fixes for corrupt RTP packets in dispatch_write()
Fixes 2 problems:

1) Number of unmapped memories does not always match number of mmaped ones in
dispatch_write().
2) When dispatch_write() is dispatched second time after an incomplete write,
already set offsets will not be taken into account, thus corrupt RTP data will
be sent.
2019-01-29 14:17:23 +02:00
Sebastian Dröge f90dac8d48 rtsp-connection: Make use of new GstRTSPMessage API for directly storing a body buffer and add API for writing multiple messages
By doing so we can send a whole GstBufferList and each memory in the
contained buffers without copying into a single memory area and with a
single writev() call. This improves performance considerably for
high-packet-rate streams.

This depends on https://gitlab.gnome.org/GNOME/glib/merge_requests/333
to be efficient, otherwise each chunk of memory is a separate write()
call.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/370
2019-01-29 14:17:23 +02:00
Sebastian Dröge b3c0d8b89b rtsp-message: Add support for storing GstBuffers directly as body payload of messages
This makes it unnecessary for callers to first merge together all
memories, and it allows API like GstRTSPConnection to write them out
without first copying all memories together or using writev()-style API
to write multiple memories out in one go.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/370
2019-01-29 14:17:23 +02:00
Andrew Gall 3a9148b334 video-anc: Fix glib version check for G_GNUC_CHECK_VERSION macro
Fixes #544
2019-01-29 13:58:43 +02:00
Seungha Yang b32b59ce76 discoverer: Hold GSource object instead of source id
g_source_remove() works only for a GSource which was attached
to default GMainContext, but the GSource might be attached to
custom context depending on how gst_discoverer_start() was called.

Whatever the attached context was, g_source_destroy() can clean it up.
2019-01-28 18:53:39 +09:00
Tim-Philipp Müller 6330eb0cb3 meson: opengl: fix enabled_gl_apis in pkg-config file
Make consistent with what autotools puts into enabled_gl_apis
variable. Autotools puts 'gl' in there instead of 'opengl'.

This would cause problems when building -bad glmixers plugin
in meson against a -base that was built with autotools.

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/871
2019-01-22 13:35:38 +00:00
Haihao Xiang 7874c74cfb gstglwindow_x11: require a resize event at once after XResizeWindow
Otherwise surface_width/surface_height stored in GstGLWindowPrivate
isn't changed, sometimes an unnecessary reconfigure event is sent on
sinkpad, then result in upstream reconfiguring.

Example pipeline:

gst-launch-1.0 videotestsrc ! msdkvpp ! glimagesink
2019-01-21 01:27:15 +00:00