Commit graph

487 commits

Author SHA1 Message Date
Seungha Yang
c389dbf332 rtcpbuffer: Remove invalid sanity check
Checking the address distance between given begin/end sequence
doesn't make sense. They are output params.

This is to fix weird failure of libs_rtp on Windows
2018-12-30 23:25:14 +00:00
Tim-Philipp Müller
83806dc4e1 rtcpbuffer: fix typo 2018-12-30 18:06:58 +00:00
Tim-Philipp Müller
44b18ea2b6 rtcpbuffer: fix function guards with side effects
Code in g_return_*() must not have side effects, as it
might be compiled out if -DG_DISABLE_CHECKS is used, in
which case we would read garbage off the stack.
2018-12-30 17:28:38 +00:00
Tim-Philipp Müller
aa910c3cb7 rtp: fix g-i warnings
Use same variable name in function declaration as in function
definition and gtk-doc/g-i blurb.
2018-12-16 23:15:57 +00:00
Olivier Crête
01a25d81c1 rtcpbuffer: Validate the length of RTCP packets 2018-12-13 14:01:06 -05:00
Justin Kim
5303e2c32b rtcpbuffer: add support XR packet parsing
According to RFC3611, the extended report blocks in XR packet can
have variable length. To visit each block, the iterator should look
into block header. Once XR type is extracted, users can parse the
detailed information by given functions.

Loss/Duplicate RLE
The Loss RLE and the Duplicate RLE have same format so
they can share parsers. For unit test, randomly generated
pseudo packet is used.

Packet Receipt Times
The packet receipt times report block has a list of receipt
times which are in [begin_seq, end_seq).

Receiver Reference Time paser for XR packet
The receiver reference time has ntptime which is 64 bit type.

DLRR
The DLRR report block consists of sub-blocks which has ssrc, last RR,
and delay since last RR. The number of sub-blocks should be calculated
from block length.

Statistics Summary
The Statistics Summary report block provides fixed length
information.

VoIP Metrics
VoIP Metrics consists of several metrics even though they are in
a report block. Data retrieving functions are added per metrics.

https://bugzilla.gnome.org/show_bug.cgi?id=789822
2018-12-13 14:01:06 -05:00
Linus Svensson
72ecbe2aef rtpbasepayload: Update current seqnum for buffer lists
The current sequence number will be the one from the first RTP buffer
when a buffer list is pushed, but should be the last one.

Fixes #495
2018-11-14 12:30:06 +00:00
Stian Selnes
f766b85b96 rtpbasepayload: rtpbasedepayload: Add source-info property
Add a source-info property that will read/write meta to the buffers
about RTP source information. The GstRTPSourceMeta can be used to
transport information about the origin of a buffer, e.g. the sources
that is included in a mixed audio buffer.

A new function gst_rtp_base_payload_allocate_output_buffer() is added
for payloaders to use to allocate the output RTP buffer with the correct
number of CSRCs according to the meta and fill it.

RTPSourceMeta does not make sense on RTP buffers since the information
is in the RTP header. So the payloader will strip the meta from the
output buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=761947
2018-10-10 14:38:01 -04:00
Tim-Philipp Müller
dc29bc4e13 libs: fix API export/import and 'inconsistent linkage' on MSVC
For each lib we build export its own API in headers when we're
building it, otherwise import the API from the headers.

This fixes linker warnings on Windows when building with MSVC.

The problem was that we had defined all GST_*_API decorators
unconditionally to GST_EXPORT. This was intentional and only
supposed to be temporary, but caused linker warnings because
we tell the linker that we want to export all symbols even
those from externall DLLs, and when the linker notices that
they were in external DLLS and not present locally it warns.

What we need to do when building each library is: export
the library's own symbols and import all other symbols. To
this end we define e.g. BUILDING_GST_FOO and then we define
the GST_FOO_API decorator either to export or to import
symbols depending on whether BUILDING_GST_FOO is set or not.
That way external users of each library API automatically
get the import.

While we're at it, add new GST_API_EXPORT in config.h and use
that for GST_*_API decorators instead of GST_EXPORT.

The right export define depends on the toolchain and whether
we're using -fvisibility=hidden or not, so it's better to set it
to the right thing directly than hard-coding a compiler whitelist
in the public header.

We put the export define into config.h instead of passing it via the
command line to the compiler because it might contain spaces and brackets
and in the autotools scenario we'd have to pass that through multiple
layers of plumbing and Makefile/shell escaping and we're just not going
to be *that* lucky.

The export define is only used if we're compiling our lib, not by external
users of the lib headers, so it's not a problem to put it into config.h

Also, this means all .c files of libs need to include config.h
to get the export marker defined, so fix up a few that didn't
include config.h.

This commit depends on a common submodule commit that makes gst-glib-gen.mak
add an #include "config.h" to generated enum/marshal .c files for the
autotools build.

https://bugzilla.gnome.org/show_bug.cgi?id=797185
2018-09-24 08:45:34 +01:00
Nirbheek Chauhan
a9cab426d0 meson: Maintain macOS ABI through dylib versioning
Requires Meson 0.48, but the feature will be ignored on older versions
so it's safe to add it without bumping the requirement.

Documentation:
https://github.com/mesonbuild/meson/blob/master/docs/markdown/Reference-manual.md#shared_library
2018-08-31 14:40:43 +05:30
Tim-Philipp Müller
ca15315565 gst-libs: include config.h in all source files
This will be needed later when we get our export define from config.h
2018-08-13 09:23:34 +01:00
Bastian Köcher
efa9bdccf9 meson: fix install dir for generated header files
Nixos installs into a non-standard includedir, so need
to take account of the 'includedir' option instead of
just hard-coding 'include' here.

https://bugzilla.gnome.org/show_bug.cgi?id=794856
2018-08-10 12:43:38 +01:00
Tim-Philipp Müller
7f9730ecf4 rtp: Update for g_type_class_add_private() deprecation in recent GLib
https://gitlab.gnome.org/GNOME/glib/merge_requests/7
2018-06-23 22:22:22 +02:00
Edward Hervey
924eb8d8a7 rtpbasedepayload: Properly propagate segment seqnum
This wasn't done previously and the outgoing SEGMENT events had
seqnums which weren't consistent with the upstream ones
2018-06-05 17:24:55 +02:00
Antoine Jacoutot
c765649505 libs: g-ir-scanner: do not hardcode libtool path
https://bugzilla.gnome.org/show_bug.cgi?id=726571
2018-05-18 13:41:25 +02:00
Mark Nauwelaerts
fe6f65b1c2 rtp: fix some GIR annotations
Mostly related to out and array parameters.
2018-04-23 19:33:12 +02:00
Mathieu Duponchelle
8467939538 rtpbasedepayload: condition the sending of gap events
The default implementation for packet loss handling previously
always sent a gap event.

While this is correct as long as we know the packet that was
lost was actually a media packet, with ULPFEC this becomes
a bit more complicated, as we do not know whether the packet
that was lost was a FEC packet, in which case it is better
to not actually send any gap events in the default implementation.

Some payloaders can be more clever about, for example VP8 can
use the picture-id, and the M and S bits to determine whether
the missing packet was inside an encoded frame or outside,
and thus whether if it was a media packet or a FEC packet,
which is why ulpfecdec still lets these lost events go through,
though stripping them of their seqnum, and appending a new
"might-have-been-fec" field to them.

This is all a bit terrible, but necessary to have ULPFEC
integrate properly with the rest of our RTP stack.

https://bugzilla.gnome.org/show_bug.cgi?id=794909
2018-04-19 16:39:06 +02:00
Edward Hervey
22c9e5f7c1 libs: Documentation cleanup
* Fix wrong naming, wrong types and typos
* Add missing sections
* Add missing documentation for entries
* Explicitely mark private structure entries
* Remove items that never existed
2018-04-02 08:53:28 +02:00
Alessandro Decina
345aa2cd9e meson: libs: use gnome.mkenums_simple() to generate enumtypes files
This way we no longer need custom wrapper scripts or template files.
2018-03-22 13:15:35 +00:00
Tim-Philipp Müller
363b790d38 rtp: GST_EXPORT -> GST_RTP_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 12:16:42 +00:00
Mikhail Fludkov
d7397f0235 rtpbuffer.h: Add new RTPBuffer flags
These flags will be used for Forward Error Correction purposes

https://bugzilla.gnome.org/show_bug.cgi?id=792695
2018-02-21 12:45:41 +01:00
Miguel Paris
bae3636197 rtp: fix gst_rtp_buffer_ext_timestamp taking into account backwards
If timestamp goes forwards more than allowed, we consider that the
timestamp belongs to the previous counting, so the extended timestamp
is unwrapped.

https://bugzilla.gnome.org/show_bug.cgi?id=783443
2017-12-21 17:27:42 -05:00
Sebastian Dröge
d33c407f6b rtp: Require gconstpointer instead of gpointer for gst_rt[c]p_buffer_new_copy_data() 2017-11-17 14:14:55 +02:00
Edward Hervey
ae865ec1d1 rtcpbuffer: fix left shift override
Needs to be cast to the target type
2017-11-04 16:56:10 +01:00
Justin Kim
33709106e9 rtcpbuffer: Add XR type
RTCP XR provides supplements information of the report blocks
from SR and RR. This patch is for downgrading warnings when
XR is detected before implementing entire block types of RFC3611.

https://bugzilla.gnome.org/show_bug.cgi?id=789743
2017-11-01 10:54:10 +02:00
Havard Graff
43985b363d meson: remove vs_module_defs
GST_EXPORT should handle it.
2017-10-05 13:53:14 +01:00
Tim-Philipp Müller
33ae84fd1c rtp: mark symbols explicitly for export with GST_EXPORT 2017-05-16 15:22:42 +01:00
Tim-Philipp Müller
f4494dab87 rtpbasedepayload: fix class description in docs 2017-05-15 16:20:01 +01:00
Tim-Philipp Müller
60e9629860 g-i: no need to load registry in g-i scanner 2017-05-04 23:55:20 +01:00
Sebastian Dröge
a3656ba29b libs: Check if meta transform_func is NULL before using it
https://bugzilla.gnome.org/show_bug.cgi?id=782050
2017-05-02 14:31:14 +03:00
Rico Tzschichholz
07a427b403 meson: Pass --c-include accordingly to GIR builds 2017-04-13 12:23:32 +01:00
Thibault Saunier
099ac9faf2 docs: Convert gtkdoc comments to markdown
Modernizing the documentation, making it simpler to read an
modify and allowing us to possibly switch to hotdoc in the
future.
2017-03-10 18:19:17 -03:00
Miguel Paris
036bdf5d2d rtpbuffer: Fix ensure_buffers() if whole packet is in one GstMemory
When gst_rtp_buffer_add_extension_onebyte_header() is used over a
GstRtpBuffer that only contains a memory for the whole packet,
ensure_buffers function crashes at the next point:

mem = gst_memory_copy (rtp->map[i].memory, offset, rtp->size[i]);

when i==2 because the payload is not mapped.

In addition the offset is calculated subtracting in the wrong direction.

https://bugzilla.gnome.org/show_bug.cgi?id=774959
2016-11-25 13:15:24 +02:00
Sebastian Dröge
b9f59fd999 rtpbasepayload: Ensure to set the RECONFIGURE flag again if reconfiguration failed
https://bugzilla.gnome.org/show_bug.cgi?id=774623
2016-11-18 12:04:27 +02:00
Thibault Saunier
6917cb629e meson: Generate girs
https://bugzilla.gnome.org/show_bug.cgi?id=773944
2016-11-09 18:06:19 -03:00
Sebastian Dröge
d84879db28 rtpbasedepayload: Reject non-TIME segments
https://bugzilla.gnome.org/show_bug.cgi?id=765796
2016-11-01 21:09:13 +02:00
Sebastian Dröge
568ec0fc7b Revert "basertpdepayload: create valid segment when given non-time segment"
This reverts commit 0f609bc6c6.
2016-11-01 21:09:04 +02:00
Havard Graff
c726e0ab6d rtpbuffer: Add buffer flag RETRANSMISSION
Useful for elements to know if a buffer is a retransmitted RTP packet.

https://bugzilla.gnome.org/show_bug.cgi?id=769771
2016-09-01 13:05:47 +03:00
Nirbheek Chauhan
5c4f4ac1bd Add support for Meson as alternative/parallel build system
https://github.com/mesonbuild/meson

With contributions from:

Tim-Philipp Müller <tim@centricular.com>
Jussi Pakkanen <jpakkane@gmail.com> (original port)

Highlights of the features provided are:
* Faster builds on Linux (~40-50% faster)
* The ability to build with MSVC on Windows
* Generate Visual Studio project files
* Generate XCode project files
* Much faster builds on Windows (on-par with Linux)
* Seriously fast configure and building on embedded

... and many more. For more details see:

http://blog.nirbheek.in/2016/05/gstreamer-and-meson-new-hope.html
http://blog.nirbheek.in/2016/07/building-and-developing-gstreamer-using.html

Building with Meson should work on both Linux and Windows, but may
need a few more tweaks on other operating systems.
2016-08-20 11:09:51 +01:00
Sebastian Dröge
69f90adbaf rtpbuffer: Add some const qualifiers
gst_rtp_buffer_add_extension_onebyte_header() and
gst_rtp_buffer_add_extension_twobytes_header() can have a const argument for
the actual extension data.
2016-07-26 17:46:38 +03:00
Tim-Philipp Müller
a80c546628 rtp: rtpbasedepayload: simplify code
Remove unnecessary helper struct for callbacks. The bclass
member of the helper struct was not used, so we can just
remove it and the GET_CLASS() call and simplify the whole
affair by passing the depayloader directly to the callback.
2016-07-15 19:51:20 +01:00
Zaheer Abbas Merali
0f609bc6c6 basertpdepayload: create valid segment when given non-time segment
This will become an error in 1.10.

https://bugzilla.gnome.org/show_bug.cgi?id=765796
2016-07-01 14:16:46 +02:00
Tim-Philipp Müller
d52a74f32e g-i: pass compiler env to g-ir-scanner
It's what introspection.mak does as well. Should
fix spurious build failures on gnome-continuous.
2016-05-24 00:44:21 +01:00
Vivia Nikolaidou
a0cf3b4262 fdmemory, rtpbasedepayload: Ran gst-indent
https://bugzilla.gnome.org/show_bug.cgi?id=764948
2016-04-12 17:34:18 +03:00
Mikhail Fludkov
7a206336dd rtpbasedepayload: look at ssrc before sequence numbers
Doing so prevents us dropping buffers in the rare, but possible, situations,
when the stream changes SSRC and new sequence numbers does not differ
much from the last sequence number from previous SSRC. For example:
ssrc - 0xaaaa 101,102,103,104 ssrc - 0xbbbb 102, 103, 104, 105...
In the scenario above we don't want to drop the first 3 packets of
0xbbbb stream.

https://bugzilla.gnome.org/show_bug.cgi?id=764459
2016-04-03 11:49:16 +03:00
Tim-Philipp Müller
3ab183c758 rtp: rtcpbuffer: fix indentation
https://bugzilla.gnome.org/show_bug.cgi?id=761944
2016-03-30 22:41:54 +01:00
Tim-Philipp Müller
5377088f1e rtp: rtpcbuffer: fix Since markers
https://bugzilla.gnome.org/show_bug.cgi?id=761944
2016-03-30 22:41:54 +01:00
Stian Selnes
93196092d1 rtcpbuffer: Add API for APP packets
https://bugzilla.gnome.org/show_bug.cgi?id=761944
2016-03-24 14:24:11 +02:00
Haakon Sporsheim
d8e9a711a0 rtcpbuffer: Add profile-specific extension API.
https://bugzilla.gnome.org/show_bug.cgi?id=761950
2016-03-24 14:22:54 +02:00
Sebastian Dröge
2c29f09da8 rtpbasepayload: Handle gst_pad_get_current_caps() returning NULL gracefully 2016-02-23 18:23:45 +02:00