Commit graph

26301 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal
666eedc215 va: caps: centralize caps feature discovering
These function were repeated in the different implemented
elements. This patch centralize them.

The side effect is dmabuf memory type is no longer checked with the
current VAContext, but assuming that dmabuf is a consequence of caps
negotiation from dynamic generated caps templates, where the context's
memory types are validated, there's no need to validate them twice.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1644>
2020-10-04 15:22:04 +00:00
Víctor Manuel Jáquez Leal
3653c19de3 va: filter: fix counter variable reuse
There was a bug reusing the counter variable i in nested loops. Also
the patch makes the code cleaner.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1643>
2020-10-04 16:05:03 +02:00
Lars Lundqvist
9ded00bcf0 curlbasesink: Add curl seek callback
Adding functionality to handle SEEK_SET enables rewinding of sent data.
In the HTTP case, this happens after an HTTP 401 has been received from
the other end. This will result in the sent data being resent.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1616>
2020-10-01 10:40:14 +00:00
Sebastian Dröge
97e648a738 decklink: Correctly order the different dependent mode tables
One was forgotten in 309f6187fe.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1617>
2020-10-01 06:29:19 +00:00
Seungha Yang
a668de747f wasapisrc: Make sure that wasapisrc produces data in loopback mode
An oddness of wasapi loopback feature is that capture client will not
produce any data if there's no outputting sound to corresponding
render client. In other words, if there's no sound to render,
capture task will stall. As an option to solve such issue, we can
add timeout to wake up from capture thread if there's no incoming data
within given time interval. But it seems to be glitch prone.
Another approach is that we can keep pushing silence data into
render client so that capture client can keep capturing data
(even if it's just silence).

This patch will choose the latter one because it's more straightforward
way and it's likely produce glitchless sound than former approach.

A bonus point of this approach is that loopback capture on Windows7/8
will work with this patch. Note that there's an OS bug prior to Windows10
when loopback capture client is running with event-driven mode.
To work around the bug, event signalling should be handled manually
for read thread to wake up.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1588>
2020-09-30 12:57:34 +00:00
Matthew Waters
b003387526 wpesrc: fix some caps leaks using the non-GL output
Always chain up to the parent _stop() implementation as it unrefs some
caps (among other things).

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1409
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1618>
2020-09-30 12:10:44 +00:00
Hosang Lee
f7a8ece5ef smoothstreaming: clear live adapter on seek
In live streaming, buffers sent by souphttpsrc are pushed to the live
adapter. The buffers in the adapter are sent out of mssdemux when it
is greater than 4096 bytes.

Occasionally, when seeking in live streams, if seek occurs just
after the last data chunk was received, and if this data chunk is
smaller than 4096 bytes, it will be kept in the live adapter.
This remaining data in the live adapter will be erroneously prepended
to the new data that is downloaded after seek and pushed out.
When qtdemux receives this data, since it does not start with
a moof box, it is impossible to demux the fragment, and bogus
size error will occur.

Clear out the live adapter on seek so that no unnecessary remaining
data is pushed out together with the new fragment after seeking.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1345>
2020-09-30 11:48:02 +00:00
Víctor Manuel Jáquez Leal
cd618f19b9 va: simplify VPP detection
Also the previous code failed if VPP was not present blacklisting the
plugin.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1619>
2020-09-30 10:49:39 +02:00
Haihao Xiang
df49114275 msdk: call vaExportSurfaceHandle() to get DMABuf FD
Compared to vaAcquireBufferHandle(), vaExportSurfaceHandle() may
provide the handle details, so we needn't call vaDeriveImage().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1353>
2020-09-29 02:06:02 +00:00
Ederson de Souza
8335039ecd tests/avtp: Fix coverity issues
Fixes sign extension issues, unchecked return values and some constant
expression results.

CID: 1465073, 1465074, 1465075, 1465076, 1465077
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1398>
2020-09-28 18:40:43 +00:00
Ederson de Souza
38d3360edb avtp: Change "%lu" for G_GUINT64_FORMAT
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1398>
2020-09-28 18:40:43 +00:00
raghavendra
84f8dbd932 srtobject: typecast SRTO_LINGER to linger
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1615>
2020-09-25 22:00:26 +05:30
He Junyan
d90e353daa codecparsers: vp8parser: clear the frame_hdr before parsing.
Uninited frame_hdr may have garbage and may contain some wrong
results after the parsing process.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1587>
2020-09-25 17:07:43 +08:00
He Junyan
709bec8f07 va: Implement the VA vp8 decoder.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1587>
2020-09-25 17:07:30 +08:00
He Junyan
ae8f97ae34 va: codestyle: Clear all tabs in header files
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1587>
2020-09-25 17:07:10 +08:00
He Junyan
410938a069 va: util: make the _format_changed a common decoder function.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1587>
2020-09-25 17:07:05 +08:00
Víctor Manuel Jáquez Leal
00b73cfddd va: h264dec: allocate output buffers according DPB size
Instead of allocating the maximal number of references for output
buffers, this patch reduces the memory foot print in many cases by
just allocating the output buffers required for the DPB.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1595>
2020-09-24 20:35:49 +02:00
Víctor Manuel Jáquez Leal
755d769045 va: decoder: store output buffer rather than surface
GstVaDecodePicture stored the processed VASurfaceID, under the
assumption that the bufferpool with keep the referenced buffers, but
this approach is fragil.

This patch changes GstVaDecodePicture to store the output buffer,
which already contains its VASurfaceID, and provides a new method to
retrieve the VASurfaceID directly from picture.

Based on He Junyan <junyan.he@intel.com> patches for
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1587

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1594>
2020-09-24 15:36:06 +02:00
Matthew Waters
6c26d0e1a0 vtdec/vulkan: use Shared storage mode for IOSurface textures
Fixes a debug assertion with i(Pad)OS 14:

'IOSurface textures must use MTLStorageModeShared'

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1592>
2020-09-23 23:21:50 +00:00
Jan Alexander Steffens (heftig)
5a1b56a0e0 mpegtsmux: Restore intervals when creating TsMux
Otherwise the settings from the properties would be overwritten with
the defaults.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1593>
2020-09-23 16:50:34 +00:00
Víctor Manuel Jáquez Leal
990d1bfbce va: vpp: global lock to handle shared buffers
Add a global mutex to exclusive access to shared stream buffers, such
as DMABufs or VASurfaces after a tee:

LIBVA_DRIVER_NAME=iHD \
gst-launch-1.0 v4l2src ! tee name=t t. ! queue ! \
  vapostproc skin-tone=9 ! xvimagesink \
  t. ! queue ! vapostproc ! xvimagesink

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
9845ec68dc va: add vapostproc element
Video postprocessor for VA-API

Funcionalities: resize frames, change format, import buffers, apply
filters (such as denoise, sharpen, orientation, if driver offers them).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
117453b947 va: allocator: export composed layer for YUY2 and UYVY
This is a result of an error reported by i965 driver which only can
export composed layer for these formats. This seems to work too with
iHD. These formats are not exposed as native surfaces in Gallium.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
a4e535d5c1 va: allocator: add gst_va_dmabuf_buffer_setup()
This function will take an array of DMABuf GstMemory and an array of
fd, and create a VASurfaceID with those fds. Later that VASurfaceID is
attached to each DMABuf through GstVaBufferSurface.

In order to free the surface GstVaBufferSurface now have GstVaDisplay
member, and _buffer_surface_unref() were added.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
6ac4e79b21 va: allocator: try to get VASurfaceID from every DMABuf allocator
Relax the check of the allocator type, because now the qdata can be
attached for other DMABuf allocators.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
20e493981b va: allocator: try to create surface without fourcc but chroma only
There are, in VPP, surfaces that doesn't support 4:2:2 fourccs but it
supports the chroma. So this patch gives that opportunity to the
driver.

This patch also simplifiies
gst_va_video_surface_format_from_image_format() to just an iterator
for surfaces available formats.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
482a7d7d7e va: allocator: create surfaces with VASurfaceAttribExternalBuffers
Add a new parameter to _create_surfaces(): a pointer to
VASurfaceAttribExternalBuffers.

If it's defined the memory type is changed to DRM_PRIME, also a new item is
added to the VASurfaceAttrib array with
VASurfaceAttribExternalBufferDescriptor.

Also, the VASurfaceAttrib for pixel format is not mandatory anymore. If fourcc
parameter is 0, is not added in the array, relying on the chroma. This is
useful when creating surfaces for uploading or downloading images.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
f306b1e0fe va: pool: use gst_object_replace() for allocator
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
f6a623d565 va: device: use gst_clear_object()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
6af7ec3c0f va: caps: expose gst_caps_set_format_array()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1529>
2020-09-23 18:19:22 +02:00
Víctor Manuel Jáquez Leal
b1a1e2d841 va: vah264dec: fix documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1591>
2020-09-23 15:14:21 +00:00
Víctor Manuel Jáquez Leal
3dd8276551 codecs: h264: unref leaked caps
Unref a leaked caps at set_latency().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1590>
2020-09-23 11:52:47 +02:00
Haihao Xiang
912fa7ce99 msdk: add support for AV1 decoding
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1448>
2020-09-22 06:54:27 +00:00
Víctor Manuel Jáquez Leal
9ed141734e va: utils: use GstObject for GstVaDisplay in context
Thus application could fetch the GstVaDisplay through the sync bus
without knowning the specific implementation, and sharing it or
extract properties.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1586>
2020-09-21 17:07:51 +00:00
Víctor Manuel Jáquez Leal
ed80aa5d6b va: utils: fix code style and wrong log message
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1586>
2020-09-21 17:07:51 +00:00
Philippe Normand
2e8927ce93 wpe: Plug event leak
Handled events don't go through the default pad event handler, so they need to
be unreffed in this case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1568>
2020-09-21 16:39:57 +00:00
Jan Schmidt
6fc7455881 wpesrc: Don't crash if WPE doesn't generate a buffer.
On creating a 2nd wpesrc in a new pipeline in an app that already
has a runnig wpesrc, WPE sometimes doesn't return a buffer on request,
leading to a crash. This commit fixes the crash, but not the underlying
failure - a 2nd wpesrc can still error out instead.

Partially fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1386

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1568>
2020-09-21 16:39:57 +00:00
Philippe Normand
c3659cd611 wpe: Plug SHM buffer leaks
Fixes #1409

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1568>
2020-09-21 16:39:57 +00:00
Philippe Normand
8ef30a9ce5 wpe: Move webview load waiting to WPEView
As waiting for the load to be finished is specific to the WebView, it should be
done from our WPEView, not from the WPEContextThread. This fixes issues where
multiple wpesrc elements are created in sequence. Without this patch the first
view might receive erroneous buffer notifications.

Fixes #1386

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1568>
2020-09-21 16:39:57 +00:00
Sanchayan Maity
248d2bb795 audiobuffersplit: Add support for specifying output buffer size
Currently for buffer splitting only output duration can be specified.
Allow specifying a buffer size in bytes for splitting.

Consider a use case of the below pipeline
appsrc ! rptL16pay ! capsfilter ! rtpbin ! udpsink

Maintaining MTU for RTP transfer is desirable but in a scenario
where the buffers being pushed to appsrc do not adhere to this,
an audiobuffersplit element placed between appsrc and rtpL16pay
with output buffer size specified considering the MTU can help
mitigate this.

While rtpL16pay already has a MTU setting, in case of where an
incoming buffer has a size close to MTU, for eg. with a MTU of
1280, a buffer of size 1276 bytes would be split into two buffers,
one of 1268 and other of 8 bytes considering RTP header size of
12 bytes. Putting audiobuffersplit between appsrc and rtpL16pay
can take care of this.

While buffer duration could still be used being able to specify
the size in bytes is helpful here.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1578>
2020-09-21 15:17:18 +00:00
Philippe Normand
b707454a5a wpe: Use proper callback for TLS errors signal handling
The load-failed and load-failed-with-tls-errors signals expect distinct callback
signatures.

Fixes #1388

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1566>
2020-09-21 14:11:15 +00:00
Víctor Manuel Jáquez Leal
9e9e5c72d5 va: h264dec: add documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1585>
2020-09-20 09:21:08 +02:00
Haihao Xiang
9443bf7a22 msdk: enable GPUCopy
Note it works for system memory only

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/910>
2020-09-20 01:40:08 +00:00
Haihao Xiang
1d082baf18 msdk: call MFXInitEx instead of MFXInit
MFXInitEx has more control than MFXInit. The current setting in this
commit is identical to MFXInit

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/910>
2020-09-20 01:40:08 +00:00
Víctor Manuel Jáquez Leal
467618f8ac va: decoder: render picture only if data
Call vaRenderPicture() only if buffer or slice data is available.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1584>
2020-09-19 14:32:13 +02:00
Víctor Manuel Jáquez Leal
ad019a1d01 va: decoder: warn if decode fails on a surface
Instead of logging error if a step fails, it logs a warning message
reducing the noise and obeying the rule for errors since the program
doesn't end

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1584>
2020-09-19 14:32:13 +02:00
Víctor Manuel Jáquez Leal
ad839ada5b va: h264dec: check is pad has fixed caps at caps query
Otherwise it will always reply with the possible driver caps, which
generates problems with Web MSE players.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1583>
2020-09-19 13:00:49 +02:00
Seungha Yang
2fe1afeafa va: h264dec: Don't need to set pts/dts/duration on outputting frame
It will be handled by videodecoder baseclass

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1582>
2020-09-18 23:50:54 +00:00
Olivier Crête
825a79f01f webrtcbin: Accept end-of-candidate pass it to libnice
libnice now supports the concept of end-of-candidate, so use the API
for it. This also means that if you don't do that, the webrtcbin will
never declared the connection as failed.

This requires bumping the dependency to libnice 0.1.16

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1139>
2020-09-18 18:40:58 -04:00
Nicolas Dufresne
671d9fed3a kmssink: Do not source using padded width/height
The width/height from the video meta can be padded width, height. But when
sourcing from padded buffer, we only want to use the valid pixels. This
rectangle is from the crop meta, orther it is deduces from the caps. The width
and height from the caps is save in the parent class, use these instead of the
GstVideoInfo when settting the src rectangle.

This fixes an issue with 1080p video displaying repeated or green at the
padded bottom 8 lines (seen with v4l2codecs).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1580>
2020-09-18 16:26:23 +00:00