Commit graph

26638 commits

Author SHA1 Message Date
Seungha Yang
9ecdfea7da mfvideosrc: Fix invalid memory access when outputting jpeg
Don't access unknown-dangerous-nonsense address

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1662>
2020-10-08 16:28:16 +00:00
Sebastian Dröge
cc7e98816f Revert "webrtc: Save the media kind in the transceiver"
This reverts commit f54d8e9945.

It breaks the CI until the C# bindings are fixed.
2020-10-08 18:53:12 +03:00
Sebastian Dröge
a40d6f4994 Revert "rtpsender: Add API to set the priority"
This reverts commit a8b287c764.

It breaks the CI until the C# bindings are fixed.
2020-10-08 18:53:10 +03:00
Sebastian Dröge
849839ba97 Revert "rtptransceiver: Store the SSRC of the current stream"
This reverts commit d1da271f25.

It breaks the CI until the C# bindings are fixed.
2020-10-08 18:53:07 +03:00
Sebastian Dröge
e65a8cbcf1 Revert "webrtcbin: Remove unused function"
This reverts commit 39723dbe93.

It breaks the CI until the C# bindings are fixed.
2020-10-08 18:53:04 +03:00
Sebastian Dröge
b565a7ef66 Revert "webrtc: Set the DSCP markings based on the priority"
This reverts commit 8ba08598bb.

It breaks the CI until the C# bindings are fixed.
2020-10-08 18:53:00 +03:00
Sebastian Dröge
f12265d9c5 Revert "webrtc: Document more objects"
This reverts commit ad68c6b1eb.

It breaks the CI until the C# bindings are fixed.
2020-10-08 18:52:50 +03:00
Sebastian Dröge
74a42c5ba8 Revert "webrtc: Add hotdoc style since tags"
This reverts commit 63a5fa818c.

It breaks the CI until the C# bindings are fixed.
2020-10-08 18:51:37 +03:00
Olivier Crête
63a5fa818c webrtc: Add hotdoc style since tags
We're stuck having to add a separate comment for now.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1425>
2020-10-06 16:52:48 -04:00
Olivier Crête
ad68c6b1eb webrtc: Document more objects
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1425>
2020-10-06 16:49:08 -04:00
Olivier Crête
8ba08598bb webrtc: Set the DSCP markings based on the priority
This matches how the WebRTC javascript API works and the Chrome implementation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1425>
2020-10-06 16:49:08 -04:00
Olivier Crête
39723dbe93 webrtcbin: Remove unused function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1425>
2020-10-06 16:49:08 -04:00
Olivier Crête
d1da271f25 rtptransceiver: Store the SSRC of the current stream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1425>
2020-10-06 16:49:08 -04:00
Olivier Crête
a8b287c764 rtpsender: Add API to set the priority
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1425>
2020-10-06 16:49:08 -04:00
Olivier Crête
f54d8e9945 webrtc: Save the media kind in the transceiver
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1425>
2020-10-06 16:49:08 -04:00
Jan Alexander Steffens (heftig)
92dc2f4192 srt: Remove unused sa_family tracking
Now that SRT no longer needs the family when creating the socket, this
code has become useless.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1659>
2020-10-06 13:56:32 +02:00
Niklas Hambüchen
13c8bda531 srt: Move off deprecated srt_socket().
See 73ee1e1a3e/docs/API-functions.md (srt_socket)

`srt_create_socket()` was added in
4b897ba92d
and srt `v1.3.0` is the first release that has it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1659>
2020-10-06 13:56:32 +02:00
Jan Alexander Steffens (heftig)
4e26b447f6 srt: Register a log handler
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1659>
2020-10-06 12:39:04 +02:00
Jan Alexander Steffens (heftig)
936f422764 srt: Avoid removing invalid sockets from the polls
This would provoke error messages from SRT.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1659>
2020-10-06 12:39:00 +02:00
Jan Alexander Steffens (heftig)
fda4cfd15e srt: Fix use of srt_startup
`srt_startup` can also return 1 if it was successful. Avoid warning in
this case.

Avoid a race when checking whether we need to call it at all.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1659>
2020-10-06 12:38:57 +02:00
Jan Alexander Steffens (heftig)
6b8c4a5f34 srt: Fix parameter types used for socket options
The [SRT documentation][1] specifies exact types for the socket options.
Make sure we match these.

This reverts the linger workaround in commit 84f8dbd932
and extends srt_constant_params to support other types than int.

[1]: https://github.com/Haivision/srt/blob/master/docs/APISocketOptions.md

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1659>
2020-10-06 12:36:40 +02:00
Seungha Yang
0a454191c0 d3d11upload: Allow passthrough for system memory
... like how d3d11download and gl{upload,download} do.
This should've been part of the commit 9b72b04dad
but I missed.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1645>
2020-10-05 15:54:37 +00:00
Víctor Manuel Jáquez Leal
dcc4557dd6 va: allocator: refactor flush methods for both allocators
Since the logic is the same, it can be generalized in a single common
function.

Also the methods run the common function with a lock and signal the
buffers' conditional.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1626>
2020-10-04 18:42:51 +00:00
Víctor Manuel Jáquez Leal
37fa6df57d va: allocator: refactor GstVaDmabufAllocator
Move code down to group it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1626>
2020-10-04 18:42:51 +00:00
Víctor Manuel Jáquez Leal
9c56c1b3e8 va: allocator: refactor GstVaBuffersurface
Move code up and add namespace to methods, and renaming
_creating_buffer_surface() to the canonical
gst_va_buffer_surface_new()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1626>
2020-10-04 18:42:51 +00:00
Víctor Manuel Jáquez Leal
734e2a74c4 va: implement pooled allocators
1. Allocators don't implement memory free() methods since all the memories will
   implement dispose() returning FALSE
2. Memory/miniobject dispose() will act as memory release, enqueueing the
   release memory
3. A new allocator's method prepare_buffer() which queries the released memory
   queue and will add the requiered memories to the buffer.
4. Allocators added a GCond to synchronize dispose() and prepare_buffer()
5. A new allocator's method flush() which will free for real the memories.

While the bufferpool will

1. Remove all the memories at reset_buffer()
2. Implement acquire_buffer() calling allocator's prepare_buffer()
3. Implement flush_start() calling allocator's flush()
4. start() is disabled since it pre-allocs buffers but also calls
   our reset_buffer() which will drop the memories and later the
   buffers are ditched, something we don't want. This approach avoids
   buffer pre-allocation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1626>
2020-10-04 18:42:51 +00:00
Víctor Manuel Jáquez Leal
d6f9cfc159 va: allocator: user gst_clear_object() for _buffer_surface_unref()
Event if this function is only used by gst_va_dmabuf_memories_setup(), it might
get reused later by GstVaDmabufAllocator's functions. This change makes the
function less fragile.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1626>
2020-10-04 18:42:51 +00:00
Víctor Manuel Jáquez Leal
10b3250175 va: allocator: renamed gst_va_dmabuf_memory_release()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1626>
2020-10-04 18:42:51 +00:00
Víctor Manuel Jáquez Leal
1617dcbe9e va: allocator: renamed available_mems queue
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1626>
2020-10-04 18:42:51 +00:00
Víctor Manuel Jáquez Leal
303b1ea350 va: allocator: rename gst_va_dmabuf_allocator_setup_buffer()
Since it's related with GstVaDmabufAllocator.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1626>
2020-10-04 18:42:51 +00:00
Víctor Manuel Jáquez Leal
bb586b227f va: allocator: calculated surface frame internally
Instead of using gst_buffer_get_size() just add the memory sizes reported by
exported fd.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1626>
2020-10-04 18:42:51 +00:00
Víctor Manuel Jáquez Leal
864f0c2ede va: allocator: make GstVaMemory shareable
Renamed the first variable member of GstVaMemory from parent to mem in
order to avoid confusion with GstMemory's parent.

When freeing the structure, memory's parent is check in order to
decide if surfaces has to be destroyed or not, since only the parent
class have to destroy it.

Removed GST_MEMORY_FLAG_NO_SHARE in memory initialization, since it is
deprecated.

Implemented allocator's share virtual method which creates a new
shallow GstVaMemory structure based on the passed one which will be
it's parent.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1626>
2020-10-04 18:42:51 +00:00
Víctor Manuel Jáquez Leal
0b6d8e73ec va: allocator: remove copy method for GstVaMemory
Since the memory has to be shareable. That will be address in the next
commits.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1626>
2020-10-04 18:42:51 +00:00
Víctor Manuel Jáquez Leal
43b950b252 va: allocator: remove va allocator mem_is_span() vmethod
Since it is the default by base class.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1626>
2020-10-04 18:42:51 +00:00
Seungha Yang
a9314b4554 d3d11upload/d3d11download: Make use of staging buffer
... instead of direct cpu map for d3d11memory object. In this way,
we don't need per GstD3D11Memory staging texture.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1627>
2020-10-04 15:44:03 +00:00
Seungha Yang
f35eeaa02b d3d11: Don't hold staging texture
Staging texture is used for memory transfer between system and
gpu memory. Apart from d3d11{upload,download} elements, however,
it should happen very rarely.

Before this commit, d3d11bufferpool was allocating at least one
staging texture in order to calculate cpu accessible memory size,
and it wasn't freed for later use of the texture unconditionally.
But it will increase system memory usage. Although GstD3D11memory
object is implemented so that support CPU access, most memory
transfer will happen in d3d11{upload,download} elements.

By this commit, the initial staging texture will be freed immediately
once cpu accessible memory size is calculated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1627>
2020-10-04 15:44:03 +00:00
Seungha Yang
899f9978f5 d3d11: Move to G_DECLARE_FINAL_TYPE
... and remove unnecessary forward declaration.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1627>
2020-10-04 15:44:03 +00:00
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