Commit graph

1131 commits

Author SHA1 Message Date
Tim Allen
db07fc7e85 rtp: add L8 audio support 2017-12-24 13:19:56 +01:00
Tim-Philipp Müller
c8ff205089 rtph265depay: don't insert SPS/PPS inline for hvc1 output
Only for byte-stream or hev1. For hvc1 the SPS/PPS are in the
caps as codec_data field and in this case they shouldn't be in
the stream data as well. The output caps should be updated with
the new codec_data if needed, for hvc1.
2017-11-23 09:36:15 +01:00
Tim-Philipp Müller
8da79ca824 rtph265depay: store negotiated output format as enum
We keep the boolean byte_stream around since it's nicer for
readability and most of the code just cares about byte_stream
or not. This is useful for future-proofing the code for when
we add support for hev1 output as well.
2017-11-23 09:36:15 +01:00
Tim-Philipp Müller
46861027b9 rtph265depay: add support for hvc1 as output format 2017-11-23 09:36:15 +01:00
Tim-Philipp Müller
b84201bf81 rtph265pay: don't add trailing zeros to VPS/PPS/SPS
This would happen if input is byte-stream with four-byte
sync markers instead of three-byte ones. The code that
scans for sync markers will place the start of the NALU
on the third-last byte of the NALU sync marker, which
means that any additional zeros may be counted as belonging
to the previous NALU instead of being part of the next sync
marker. Fix that so we don't send VPS/SPS/PPS with trailing
zeros in this case.

See https://bugzilla.gnome.org/show_bug.cgi?id=732758
2017-11-23 09:36:15 +01:00
Tim-Philipp Müller
311b9895ba rtph265depay: assemble AUs into downstream-allocated memory
When merging NALs into AUs, use downstream-provided allocator
to allocate memory and copy NALs directly into that memory when
assembling them.
2017-11-23 09:36:15 +01:00
Tim-Philipp Müller
2d0ea4d381 rtph265depay: try to negotiate an allocator with downstream 2017-11-23 09:36:15 +01:00
Tim-Philipp Müller
528b7e01f1 rtph265depay: simplify buffer accumulation control flow
There is no difference between pushing out a buffer directly
with gst_rtp_base_depayload_push() and returning it from the
process function. The base class will just call _depayload_push()
on the returned buffer as well.

So instead of marshalling buffers through three layers and back,
just push them from one place in handle_nal() and always return
NULL from the process vfunc. This simplifies the code a little.

Also rename _push_fragmentation_unit() to _finish_fragmentation_unit()
for clarity. Push sounds like it means being pushed out, whereas
it might just be pushed into an adapter.

This change has the side-effect that multiple NALs in a single STAP
(such as SPS/PPS) may no longer be pushed out as a single buffer if
we output NALs in byte-stream format (i.e. not aggregate AUs), but
that shouldn't really make any difference to anyone.
2017-11-23 09:36:15 +01:00
Tim-Philipp Müller
289882497a rtph265depay: fix crash with empty sprops-parameters
https://bugzilla.gnome.org/show_bug.cgi?id=780040
2017-11-23 09:36:15 +01:00
Tim-Philipp Müller
0580efc6a6 rtph265depay: minor clean-up
Declutter caps update code a bit.
2017-11-23 09:36:15 +01:00
Philip Craig
ec11b228a4 rtph264pay: don't add trailing zeros to PPS/SPS
This would happen if input is byte-stream with four-byte
sync markers instead of three-byte ones. The code that
scans for sync markers will place the start of the NALU
on the third-last byte of the NALU sync marker, which
means that any additional zeros may be counted as belonging
to the previous NALU instead of being part of the next sync
marker. Fix that so we don't send SPS/PPS with trailing
zeros in this case.

https://bugzilla.gnome.org/show_bug.cgi?id=732758
2017-11-23 09:36:15 +01:00
Tim-Philipp Müller
f3e4df72a1 rtph264depay: assemble AUs into downstream-allocated memory
When merging NALs into AUs, use downstream-provided allocator
to allocate memory and copy NALs directly into that memory when
assembling them.
2017-11-23 09:35:59 +01:00
Tim-Philipp Müller
b6f13ce4e9 rtph264depay: try to negotiate an allocator with downstream 2017-11-23 09:35:59 +01:00
Tim-Philipp Müller
44f70445b6 rtph264depay: minor clean-up
Declutter caps update code a bit.
2017-11-23 09:27:22 +01:00
Edward Hervey
50c3733a89 rtpmpvpay: Don't create empty buffer list
If there's nothing to send, just return
2017-11-10 15:51:05 +01:00
Youness Alaoui
593615de46 rtpg722pay: Add encoding-params to the src caps template
The G722 payload only accepts G722 audio with channels=1, so it must
specify the encoding-params=1 in its src caps, otherwise it causes issues
with farstream which thinks it supports 2 channels G722 and when
confronted with a remote that has G722/8000/2, it will negotiate it
and error out with a not-negotiated when the caps don't intersect
at runtime.

https://bugzilla.gnome.org/show_bug.cgi?id=789878
2017-11-03 17:20:31 -04:00
Sebastian Dröge
263494f9c7 rtpsbcdepay: Fix potential NULL pointer dereference
CID 1418864
2017-10-07 14:06:38 +03:00
Sebastian Dröge
58f0eabd61 sbcdepay: Add property to ignore input timestamps
This then just counts samples and calculates the output timestamps based
on that and the very first observed timestamp. The timestamps on the
buffers are continued to be used to detect discontinuities that are too
big and reset the counter at that point.

When receiving data via Bluetooth, many devices put completely wrong
values into the RTP timestamp field. For example iOS seems to put a
timestamp in milliseconds in there, instead of something based on the
current sample offset (RTP clock-rate == sample rate).

https://bugzilla.gnome.org/show_bug.cgi?id=787297
2017-09-28 14:15:12 +03:00
Ponnam Srinivas
c0622addf6 rtph265depay: Fix Memory leak in error case
https://bugzilla.gnome.org/show_bug.cgi?id=787937
2017-09-26 11:09:53 +03:00
Tim-Philipp Müller
6f9cb1716a rtph265depay: fix keyunit detection
https://bugzilla.gnome.org/show_bug.cgi?id=787254
2017-09-05 13:56:18 +01:00
Arun Raghavan
301e8d558e rtpsbcpay: Fix some tabs that crept in somehow 2017-08-29 22:12:35 +05:30
Arun Raghavan
e6b6583a5e rtpsbcpay: Fix compile error 2017-08-14 17:39:15 +05:30
Jochen Henneberg
f641ac60e3 rtpsbcpay: fix if buffer size exceeds MTU
The plugin queued buffer data if not all buffer data fit
into a single RTP packet. Now RTP packets are pushed as long
as enough data is available.
2017-08-14 16:56:17 +05:30
Yasushi SHOJI
c7f42cc3bc rtpgsmpay: fix accidental garbage data before actual payload
Do not allocate payload size outbuf if appending payload buffer.

The commit 137672ff18 attached payload
to the output buffer but forgot to remove payload allocation.  That
effectively doubled payload size and add zero'ed or random bytes.

Makes the following pipeline work again:

gst-launch-1.0 -v audiotestsrc wave=2 ! gsmenc ! rtpgsmpay ! rtpgsmdepay ! gsmdec ! autoaudiosink

https://bugzilla.gnome.org/show_bug.cgi?id=784616
2017-07-09 13:21:23 +01:00
Tim-Philipp Müller
18b53c2236 rtph265depay: fix caps leak 2017-06-02 11:30:15 +01:00
Tim-Philipp Müller
a68a7fb65d rtph264depay: simplify buffer accumulation control flow
There is no difference between pushing out a buffer directly
with gst_rtp_base_depayload_push() and returning it from the
process function. The base class will just call _depayload_push()
on the returned buffer as well.

So instead of marshalling buffers through three layers and back,
just push them from one place in handle_nal() and always return
NULL from the process vfunc. This simplifies the code a little.

Also rename _push_fragmentation_unit() to _finish_fragmentation_unit()
for clarity. Push sounds like it means being pushed out, whereas
it might just be pushed into an adapter.

This change has the side-effect that multiple NALs in a single STAP
(such as SPS/PPS) may no longer be pushed out as a single buffer if
we output NALs in byte-stream format (i.e. not aggregate AUs), but
that shouldn't really make any difference to anyone.
2017-06-01 17:32:17 +01:00
Tim-Philipp Müller
a9f9166004 rtpopusdepay: minor perf improvements
Use the ::process_rtp_packet() vfunc to avoid mapping the
RTP buffer twice.

gst_rtp_buffer_get_payload_buffer() returns a new sub-buffer
which will always be writable, so no need to make it writable.
2017-05-24 16:41:45 +01:00
Tim-Philipp Müller
f9a740b319 rtp: opus: use existing utility funcs for copying/dropping metas
We had our own copies of those while the code was in -bad, but now
we can use the existing utility functions instead of re-implementing
them.
2017-05-24 16:18:01 +01:00
Tim-Philipp Müller
4a28e649c3 rtp: cache meta tag quarks and add more utility functions for metas
Every g_quark_from_static_string() is a hash table lookup serialised
on the global quark lock in GLib. Let's just look up the two quarks
we need once and cache them locally for future use. While we're at it,
add new utility functions for the two most commonly used tags
(audio + video). Make first argument a gpointer so we don't have to
cast and make the code ugly. These are used for logging purposes
only anyway.
2017-05-24 13:32:10 +01:00
Nicolas Dufresne
b68d936ae0 Remove plugin specific static build option
Static and dynamic plugins now have the same interface. The standard
--enable-static/--enable-shared toggle are sufficient.
2017-05-16 14:41:19 -04:00
Tim-Philipp Müller
e7e7f26200 rtph264depay: don't insert SPS/PPS inline for AVC output
SPS/PPS are in the caps in this case and shouldn't be in
the stream data.
2017-04-24 17:29:37 +01:00
Tim-Philipp Müller
c8f094cf7d rtph264depay: fix crash with empty sprops-parameters
https://bugzilla.gnome.org/show_bug.cgi?id=780040
2017-03-16 00:41:44 +00:00
Michael Dutka
cef5411193 rtph264depay, rtph265depay: remove stray g_debug()
https://bugzilla.gnome.org/show_bug.cgi?id=779858
2017-03-10 18:14:52 +00:00
Sebastian Dröge
f2e17f5791 rtph263pay: Free mac on errors
CID 1212149
2017-02-28 12:57:02 +02:00
Sebastian Dröge
bc14107742 rtpvorbispay: Add missing break to for loop 2017-02-28 12:45:24 +02:00
Sebastian Dröge
e693d29728 rtpvorbispay: When getting new headers, replace the old version of them
This prevents storing an infinite amount of e.g. comment headers if they
come without a new initialization header in front of them. There can
only be one header of each type.
2017-02-27 19:32:40 +02:00
Sebastian Dröge
f44314c029 vorbispay: Only replace headers when receiving a new config header
If we also replace all headers when receiving any possibly following
comments header, we would throw away the config header before being able
to make use of it.
2017-02-27 19:24:07 +02:00
Edgard Lima
8635258046 Update Edgard Lima's email
https://bugzilla.gnome.org/show_bug.cgi?id=779230
2017-02-27 00:34:19 +00:00
Jochen Henneberg
29f9062016 rtpvorbispay: Update and send out headers when new headers are received
The payloader needs to reset and update the vorbis config data which is
pushed on the network if it receives new headers, or at least, it may
have to do so.

Without this, the stream configuration could change without the
payloader sending the new configuration to the other side.
2017-02-20 14:21:13 +02:00
Jonas Holmberg
494246f75c rtph265pay: Fix handling of config-interval
Insert VPS/SPS/PPS before the first NAL unit containing an I-frame in an
access unit only. If an access unit consists of several such NAL units
(tiles) VPS/SPS/PPS should only be inserted before the first of them so
that parameters are only updated between frames.

Do not insert VPS/SPS/PPS before P-frames when config-interval is -1.

https://bugzilla.gnome.org/show_bug.cgi?id=775817
2017-01-23 12:59:15 +02:00
Tim-Philipp Müller
d7b2820b73 Fix indentation 2017-01-09 19:05:10 +00:00
Tim-Philipp Müller
8ad0baccc2 rtpklvdepay: add the SPARSE flag to the outgoing stream-start event 2016-12-18 12:00:38 +00:00
Sebastian Dröge
63938ef730 gst: Don't declare variables inside the for loop header
This is a C99 feature.
2016-12-13 22:32:46 +02:00
Garima Gaur
50e7096a86 rtp: Fix some memory leaks in usage of gst_pad_get_current_caps()
https://bugzilla.gnome.org/show_bug.cgi?id=775071
2016-12-01 13:04:03 +02:00
Sebastian Dröge
d0f608f60b vrawpay: Error out cleanly if mapping the video frame fails
Instead of later dereferencing NULL and crashing.
2016-11-28 09:30:25 +02:00
Stian Selnes
cbd13883a8 rtph263depay: Don't drop mode b packets with picture start code
Some buggy payloaders, e.g. rtph263pay, may use mode B for packets
that starts with a picture (or GOB) start code although it's not
allowed. Let's be nice and not drop these packets/frames.

https://bugzilla.gnome.org/show_bug.cgi?id=773516
2016-11-01 20:21:40 +02:00
Havard Graff
78ab8cbdcd rtph263ppay: Fix caps leak
Fix leaking caps when downstream has not-fixed caps.

https://bugzilla.gnome.org/show_bug.cgi?id=773515
2016-11-01 20:20:47 +02:00
Stian Selnes
fca2d2f9f0 rtph263pay: Fix indentation
https://bugzilla.gnome.org/show_bug.cgi?id=773514
2016-11-01 20:19:43 +02:00
Stian Selnes
087ae64123 rtph263pay: Use GST_TRACE_OBJECT for logging bitstream parsing
Bump the bitstream parsing to TRACE log level so it doesn't flood the
output when trying to read the more useful DEBUG and LOG messages.

Also use GST_DEBUG_OBJECT instead of GST_DEBUG in various places

https://bugzilla.gnome.org/show_bug.cgi?id=773514
2016-11-01 20:19:15 +02:00
Stian Selnes
bcff182fd9 rtph263pay: Fix leak for B-fragments
Altough commits 6a16be7, 64f9d08 and 0c7e3a8 fixed some issues they
introduced others. This patch fixes the leak of one macroblock for every
B fragment.

Macroblock structures must not be freed immediately after finding the
boundaries as they are stored and used later. However the inital dummy
structure (used for finding the first boundary) must be freed.

CID #1212156

https://bugzilla.gnome.org/show_bug.cgi?id=773512
2016-11-01 20:18:14 +02:00