Commit graph

27117 commits

Author SHA1 Message Date
Olivier Crête
572c2b6783 webrtcbin: Take PC_LOCK when requesting new pad
This is needed to avoid having the state change under us.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 18:37:27 -04:00
Olivier Crête
4a48e291ff webrtcbin test: Add for the case where a second m-line is renegotiated
This is for the case where there answerer forces a specific media type
for a m-line, but he origin offer only has the other media type. In this
case, we will create a second transceiver on receiving the offer and add
the desired media type using renegotiation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 18:37:27 -04:00
Olivier Crête
c7107fd940 webrtcbin: Ensure that query caps method returns valid caps
This means rejecting any caps that aren't fixed. Also, use a filter
that will create unfixed caps if the other side just returns ANY.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 18:37:27 -04:00
Olivier Crête
09c65fe534 webrtcbin: Associate the stream with a new transceiver
Otherwise, this newly created transceiver has no stream and it
aborts later when it tries to connect the input pad.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 18:37:27 -04:00
Olivier Crête
83e546f935 webrtcbin: Match unassociated transceiver by kind too
When a new m-line comes in that doesn't have a transceiver, only match
existing transceivers of the same kind.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 18:37:27 -04:00
Olivier Crête
7db5848376 webrtcbin: Fix typoe in name of error GstStructure
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 18:37:27 -04:00
Olivier Crête
2bd647e999 webrtc test: Verify that forcing different kinds on peers fails
If the offer contains an audio kind and a video kind, forcing them both
at m-line zero will fail.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 18:37:27 -04:00
Olivier Crête
8df5b9f974 webrtc tests: Verify that create-offer is rejected when needed
Verify that it gets rejected if a m-line at index 1 is requested but
there is no m-line 0.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 18:37:27 -04:00
Olivier Crête
913d308e22 webrtcbin test: Add test for various cases where get_request_pad is meant to fail
This should ensure that the recently added code works.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 17:55:07 -04:00
Olivier Crête
7f29486ba4 webrtcbin: Enforce direction on request sink pad with a specific name
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 17:55:07 -04:00
Olivier Crête
5971a96109 webrtcbin: Try to match an existing transceiver on pad request
This should avoid creating extra transceivers that are duplicated.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 17:55:07 -04:00
Olivier Crête
2ca4cea538 webrtcbin: Validate locked m-lines in set*Description
Verify that the remote description match the locked m-lines, otherwise
just reject the SDP.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 17:55:07 -04:00
Olivier Crête
be84cc2c54 webrtcbin: Remove unused session_mid_map
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 17:55:07 -04:00
Olivier Crête
08dd305a20 webrtcbin: Enforce m-line restrictions when creating offer
First fail the offer creation if the mid of an existing offer doesn't
match a forced m-mline.

Then, for all newly added mlines, first look for a transceiver that
forces this m-line, then add a "floating" one, then the data channel.
And repeat this until we're out of transceivers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 17:55:07 -04:00
Olivier Crête
ed1f0f33a2 webrtcbin: Remember if a transceiver had a forced m-line
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 17:55:07 -04:00
Olivier Crête
92d356d4b0 webrtcbin: Enforce same-kind on request sink pad with a specific name
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 17:55:07 -04:00
Olivier Crête
249b2d54d7 webrtcbin: Enforce compatible caps on pad request
If a pad is requested with certain caps and there is already a
transceiver, reject the pad request if the caps don't match.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 17:55:07 -04:00
Olivier Crête
902e40cae2 webrtcbin: Reject pad request for a specific m-line if it already exists
This way, the app developer is in control.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 17:55:07 -04:00
Olivier Crête
0e2d128bec webrtcbin: Make request-pad validation an early return
This reduces the indendation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 17:55:07 -04:00
Olivier Crête
0f758a1730 webrtcbin: Add document for webrtcbin itself to generated doc
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 17:55:07 -04:00
Olivier Crête
d49e664c84 webrtcbin test: Test adding a stream to a stream+datachannel
This use-case was previously broken by the expectation of having
a 1-1 match between the pad id and the m-line index

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 17:55:07 -04:00
Olivier Crête
3be72a6c86 webrtc: Reset received_caps when releasing pad
This is to work around a race where the pad is accessed in the
webrtc main thread while being released.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 17:55:07 -04:00
Olivier Crête
b6114a7fed webrtcbin: Split pad name from mline
The simple case where this breaks is if you add a
datachannel and want to add a new pad (a new media) after). Another
case where this is broken is if the order of the media is forced to
something different by the peer.

It's more simple to just split both things completely. In practice, the
pads will be named in the order in which they are allocated, so it
shouldn't change the current behaviour, just enable new ones.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2104>
2021-04-12 17:55:06 -04:00
Jan Schmidt
bd9f675318 switchbin: When collecting srcpad caps, don't intersect with path caps.
The path caps describe the input caps that will select each path, don't
intersect those with the srcpad caps, which could be completely
different. Instead, when querying allowed caps for the srcpad, just
construct the union of all possible output caps from all path srcpads.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2018>
2021-04-12 14:27:00 +00:00
Jan Schmidt
1f865246c1 switchbin: Don't report sink pad caps for src pad queries.
When handling a caps query on the src pad, don't return the union
of input caps. Even when not active, a path element can be queried
for srcpad template caps, or for dropping paths the allowed downstream
caps is anything - as data will be dropped anyway.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2018>
2021-04-12 14:27:00 +00:00
Stéphane Cerveau
891be51105 gst-plugins: allow per feature registration
Split plugin into features including
dynamic types which can be indiviually
registered during a static build.

More details here:

https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2110>
2021-04-11 16:16:55 +00:00
Helmut Januschka
7f60138ef6 allow NetStream.Play.PublishNotify Message
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2154>
2021-04-10 20:34:26 +02:00
Stéphane Cerveau
da9e012e8a plugins-sys: allow per feature registration
Split plugin into features including
dynamic types which can be indiviually
registered during a static build.

More details here:

https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2116>
2021-04-09 19:23:40 +00:00
Seungha Yang
fee725f3cc codecs: vp9decoder: Update docs
* Remove "FIXME 1.20": All the bits are addressed already by using
  vp9parse element
* Fix copy & paste errors: Some comments were copied from h264decoder
  blindly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2151>
2021-04-09 12:13:24 +00:00
Seungha Yang
f7a341a1f0 codecs: vp9decoder: Make duplicate_picture() vfunc optional
The default implementation was required when superframe parsing
was handled by vp9decoder. For instance, if a superframe consists
of multiple frames with show_existing_frame header, it was vague
that which GstVp9Picture should consume GstVideoCodecFrame.

After 1.18 release, we introduced vp9parse element and
superframe should be handled by upstream vp9parse elemenet now.
So, we don't need to care about the superframe at vp9decoder class
level anymore. Simply, a frame corresponding to show_existing_frame
can be dropped if subclass doesn't implement duplicate_picture().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2151>
2021-04-09 12:13:24 +00:00
Philippe Normand
933ebba435 debugutils: Add fakeaudiosink element
This element can be useful for CI purposes on machines not running any system
audio daemon. The element implements the GstStreamVolume interface.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2125>
2021-04-09 08:13:12 +00:00
Nicolas Dufresne
f992c521c3 v4l2codecs: allocator: Keep dmabuf mapped
DMABuf allocator already implements DMABuf Sync, meaning that doing
mmap/munmap (unless the mode have changed) is not required. In fact, on
systems with IOMMU it makes the kernel redo the mmu table which is visible
in the CPU usage.

This change reduces CPU usage when decoding
bbb_sunflower_2160p_60fps_normal.mp4 on RK3399 SoC from over 30% to
around 15%.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2152>
2021-04-08 15:22:49 -04:00
Víctor Manuel Jáquez Leal
07a0b63472 va: allocator: Implement mem_copy for VA memory.
Implementation of mem_copy() virtual method for GstVaAllocator.

It's a deep copy where a new VA memory is popped out from the pool or,
if pool is empty, a new memory is allocated. The original memory is
mapped to read, and if its VAImage is not derived and size to copy is
the whole surface, the mapped VAImage of the original memory is put in
the new memory. Otherwise a slow memcpy is done between both memories.

Fixes: #1568
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2136>
2021-04-08 16:34:06 +00:00
Zhao Zhili
57d8de68d1 srtobject: fix optlen of srt_getsockflag
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2149>
2021-04-08 20:30:20 +08:00
Haihua Hu
e69d0151d2 jpeg2000parse: fix critical log when play one gray colorspace video
Need guess color space based on number of components when cannot
got it from sink caps

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1955>
2021-04-08 01:06:12 +00:00
Olivier Crête
0633bef05d ldacenc: Emit message on errors
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1875>
2021-04-08 00:38:47 +00:00
Olivier Crête
e041ff697d sbc: Return hard error on allocation or mapping error
Also post a message on the bus in these cases.wpe: Emit load-progress messages

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1875>
2021-04-08 00:38:47 +00:00
Matthieu De Beule
f449a553a7 Tell programmers that set_volume uses linear scale (fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1439)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1722>
2021-04-07 22:54:37 +00:00
Olivier Crête
98bd83484c sbc/ldac: Don't use GST_CAPS_NONE to mean NULL
The GST_CAPS_NONE macro actually returns a instance of
a empty caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1874>
2021-04-07 21:14:50 +00:00
Seungha Yang
50e116c4a7 codecs: vp9decoder: Allow decoding start with intra-only frame
As per spec "7.2 Uncompressed header semantics" and
"8.2 Frame order constraints", decoding can start with intra-only
frame. This commit is for fixing vp90-2-16-intra-only.webm
bitstream test failure.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2112>
2021-04-07 19:32:29 +00:00
Seungha Yang
6eb9856f59 codecs: vp9decoder: Pass GstVideoCodecFrame to duplicate_picture()
... and fix picture duplication logic for vavp9dec

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2112>
2021-04-07 19:32:29 +00:00
Seungha Yang
1f769839c0 codecs: vp9decoder: Port to GstVp9StatefulParser
Use newly implemented VP9 parser. Since new GstVp9FrameHeader
struct holds all the information of the stream, baseclass will not
pass parser object to new_sequence() method anymore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2112>
2021-04-07 19:32:29 +00:00
Seungha Yang
c36190cbda codecparsers: Reimplement VP9 parser
Existing VP9 parser implementation doesn't provide information
required by other stateless decoding APIs (i.e., DXVA and NVDEC),
specifically loop filter and segmentation parameters might not exist
current frame. So parser needs to fill the information by using previously
parsed information.
We can update the gstvp9parser implementation so that it can provide
all information required by stateless decoding APIs with a huge API break,
or adding more ugly struct in it.
Instead doing as such, this commit introduce a new VP9 parser implementation.

What is different from existing one?
* All variables will follow the specification as much as possible:
  VP9 Bitstream & Decoding Process Specification - v0.6 31st March 2016
* Parser will fill all the required information for decoding frame
  to GstVp9FrameHeader struct. In case of old VP9 parser,
  user needs to read additional data from parser's member variables.
* GstVp9StatefulParser object struct is completely completely opaque

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2112>
2021-04-07 19:32:29 +00:00
Seungha Yang
771326a0fb codecs: vp9decoder: Don't check codec change with show_existing_frame
Show existing frame will zero frame_type value but it doesn't mean
it's keyframe.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2112>
2021-04-07 19:32:29 +00:00
Nicolas Dufresne
24eda30bd7 v4l2codecs: Fix holding of reference picture buffer
The picture buffer (V4L2 CAPTURE buffer) was being released immediatly
when the request was done. This was problematic since even after the
request is done, the picture buffer might still be used as a reference
and should not be reused for further decoding yet.

This change effectively bind the picture buffer lifetime to the request.
So that if the picture is never showned (decode only frame) or the request
queue is full before the buffer is displayed, the picture buffer will
remain alive.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2142>
2021-04-07 19:00:21 +00:00
Doug Nazar
81d4ccdc44 rtmp2: Use correct size of write macro for param2.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2146>
2021-04-07 07:48:57 -04:00
Víctor Manuel Jáquez Leal
7395057af3 va: filter: remove unsupported formats because driver's bugs
Add a way to filter out video formats from caps because of unresolved
bugs in drivers. In this case for media-driver (iHD) where some RGB32
formats are not handled correctly.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2129>
2021-04-07 11:06:59 +00:00
Víctor Manuel Jáquez Leal
60db766a0d va: videoformats: Map more color formats.
Added Y212_LE, Y412_LE, P012_LE, Y444, RGB16, RGB and BGR10A2_LE in
the static map betwen VA and GStreamer color formats. This synchronize
the map used in gstremaer-vaapi and this plugin.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2129>
2021-04-07 11:06:59 +00:00
Víctor Manuel Jáquez Leal
d932dcf6be va: videoformats: Fix RGB32 mapping between VA and GStreamer.
Different VA drives might have different definitions for RGB32 color
formats because different bit interpretation. Sadly the specification
doesn't clarify these interpretations. So VA users have to figure out
what's the correct mapping with it's rendering color format
definition.

This patch aims to fix the static map structure after the
VAImageFormats are queried. There is another static map with the
different interpretations of the RGB32 formats, and compare them with
the given VAImageFormat, then with the GStreamer color format, update
the mapping table.

Finally, some RGB32 color formats were added.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2129>
2021-04-07 11:06:59 +00:00
Doug Nazar
dbff4c6f06 avtp: Fix log format macros
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2145>
2021-04-07 04:16:01 -04:00