Commit graph

455 commits

Author SHA1 Message Date
Sebastian Dröge
bfc13c8e51 rtp: Add GstRTPProfile enum 2015-05-20 15:41:06 +03:00
Sebastian Dröge
faafaaec56 rtpbasepayload: Try harder to reuse previously configured caps values and give more preference to anything set as properties
This affects the pt, ssrc, seqnum-offset and timestamp-offset properties. If
they were set from a property, or we configured caps before, we try to use
that value for them. Even if the first structure of the downstream caps
specifies a different value, we check if the value is supported by other
structures.
Only if all this fails, we use the values given by downstream in the first
structure, i.e. if no properties were set and these are the first caps we
negotiate or downstream does not support our values.

By doing this we ensure that we don't spuriously change ssrcs or other fields
in the middle of the stream (and also consider property values more). Ssrc
changes would currently happen after sending an RTX packet (thus creating a
new internal source inside the rtpsession), and then renegotiating the
payloader (which then gets the RTX ssrc from rtpsession).

https://bugzilla.gnome.org/show_bug.cgi?id=749581
2015-05-19 16:59:45 +03:00
Sebastian Dröge
1a2c590cd2 rtpbasedepayload: Add some debug output 2015-05-05 13:16:05 +02:00
Tim-Philipp Müller
c680e324bc Remove obsolete Android build cruft
This is not needed any longer.
2015-04-26 18:42:34 +01:00
Tim-Philipp Müller
dfc34c5841 rtp: rtcpbuffer: fix typo in enum
and in docs. Spotted by Rob Swain.
2015-04-07 16:44:20 +01:00
Edward Hervey
3eb35c77cc introspection: Don't use g-ir-scanner cache at compile time
It pollutes user directories and we don't need to cache it

https://bugzilla.gnome.org/show_bug.cgi?id=747095
2015-03-31 11:21:43 +02:00
Nicolas Dufresne
b7facbaf22 basedepay: Handle initial gaps and no clock-base
When generating segment, we can't assume the first buffer is actually
the first expected one. If it's not, we need to adjust the segment to
start a bit before.

Additionally, we if don't know when the stream is suppose to have
started (no clock-base in caps), it means we need to keep everything in
running time and only rely on jitterbuffer to synchronize.

https://bugzilla.gnome.org/show_bug.cgi?id=635701
2015-03-27 19:03:41 -04:00
Nicolas Dufresne
802ad73103 basedepayload: Fix generated segment
This fixes playback position in RTSP.

https://bugzilla.gnome.org/show_bug.cgi?id=635701
2015-03-26 17:43:47 -04:00
Sebastian Dröge
8f13a31bae rtpbuffer: Link to an explanation why the seqnum comparison function does the right thing even for wraparounds 2015-03-09 11:12:46 +01:00
Zaheer Abbas Merali
3ef295d9d6 rtcpbuffer: fix spelling of word in comment 2014-12-12 08:32:15 -08:00
Luis de Bethencourt
7ca8e6e71d rtp: Do not use deprecated gtk-doc 'Rename to' tag
GObject introspection GTK-Doc tag "Rename to" has been deprecated, changing to
rename-to annotation.

https://bugzilla.gnome.org/show_bug.cgi?id=739514
2014-11-02 15:14:13 +00:00
Vincent Penquerc'h
20344f6dc9 rtpbuffer: add a const where appropriate 2014-10-30 11:42:02 +00:00
Olivier Crête
bdf8ce286d rtpbasepayload: Implement reconfigure event & renegotiation without subclass
Implement the reconfigure event, also do correct downstream caps negotiation
if the subclass doesn't implementy set_caps.

https://bugzilla.gnome.org/show_bug.cgi?id=725361
2014-05-03 10:21:04 +02:00
Olivier Crête
deb27bddf6 rtpbasepayload: Save the PT after fixating 2014-05-02 18:30:23 -04:00
Vincent Penquerc'h
db8460cbd8 rtpbuffer: avoid underflow in size calculation 2014-05-02 15:10:07 +01:00
John Bassett
0fd60ac858 rtpbasepayload: restrict initial random sequence number to be <= 32767
In order to prevent SRTP roll over counter issues the initial sequence
number is restricted to <= 32767. This is recommended by RFC 4568 section 6.4.
2014-05-01 17:00:47 -04:00
Vincent Penquerc'h
ffdf87b121 rtcpbuffer: check claimed data size against available size
Coverity 1208773
2014-04-30 18:13:15 +01:00
Stian Selnes
0011d8cbb5 rtpbuffer: fix memory leak when gst_rtp_buffer_map fails
Make sure rtp->data[3] is set before jumping to error path.

https://bugzilla.gnome.org/show_bug.cgi?id=729117
2014-04-29 08:46:29 +02:00
Tim-Philipp Müller
bcb8068e27 docs: remove outdated and pointless 'Last reviewed' lines from docs
They are very confusing for people, and more often than not
also just not very accurate. Seeing 'last reviewed: 2005' in
your docs is not very confidence-inspiring. Let's just remove
those comments.
2014-04-26 23:28:57 +01:00
Wim Taymans
f2ee068729 rtpbasedepay: add stats property
Add a stats property that holds a structure with all the current
values of the depayloader.

See https://bugzilla.gnome.org/show_bug.cgi?id=646577
2014-04-12 07:10:36 +02:00
Wim Taymans
314eee6dd1 rtpbasepayload: update docs 2014-04-12 06:43:24 +02:00
Wim Taymans
f0348d7005 rtpbasepayload: add current timestamp and seqnum offset to stats
Expose the current timestamp and seqnum offset in the stats

See https://bugzilla.gnome.org/show_bug.cgi?id=646577
2014-04-12 06:27:36 +02:00
Wim Taymans
bf4079277d rtpbasepayload: add pt and ssrc to stats 2014-03-20 09:19:46 +01:00
Sebastian Rasmussen
d6dc1b6c46 rtpbasepayload: Let caps event also configure seqnum-offset
Previously the sequence number kept track of by GstRTPBasePayload would
only be set when going from READY to PAUSED state. This meant that a
downstream element that attempted to configure a basepayloader by
setting seqnum-offset e.g. in its sinkpad's caps template would have
trouble configuring the basepayloader. The reason was that the caps
event which arrives with the desired value for seqnum-offset did not
arrive at the basepayloader until caps negotiation took place,
significantly later than the transition from READY to PAUSED.

The result after this patch is that the default value for the
seqnum-offset property, or later set values for this property, will take
effect when going from READY to PAUSED like before. In addition the an
arriving caps event will also affect the basepayloaders configured
sequence number as the event arrives.
2014-02-24 12:10:26 +01:00
Sebastian Rasmussen
638d069c91 rtpbasepayload: Fix payload type property boundary value
The payload type field in an RTP packet header is 7 bits wide, hence the
boundary values ought to be 0x00 and 0x7f, not the previously stated
values 0x00 and 0x80.
2014-02-24 12:10:26 +01:00
Sebastian Rasmussen
3cc67ff494 rtpbasedepayload: Fix typos in comments 2014-02-24 12:10:26 +01:00
Sebastian Rasmussen
125b9c19c0 rtpbasepayload: Do cosmetic changes to rtptime calculations
* Change running time type to guint64
 * Use GST_CLOCK_TIME_NONE() to check for invalid timestamps
 * Name variables so ns-based and hz-based timestamps are evident

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=719383
2014-01-28 14:41:41 +01:00
Sebastian Rasmussen
0142cd5e35 rtpbasepayload: Expose running-time of payloaded stream
https://bugzilla.gnome.org/show_bug.cgi?id=719415
2014-01-28 14:41:41 +01:00
Sebastian Rasmussen
865a5d1c8f rtpbasepayload: Improve documentation for perfect-rtptime
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=719383
2014-01-28 14:41:41 +01:00
Sebastian Rasmussen
713dfe0d70 rtpbasepayload: Fix typos in documentation for properties
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=719383
2014-01-28 14:41:41 +01:00
Sebastian Rasmussen
fa393e5d60 rtpbasepayload: Add statistics property
This property allows for an atomically retrieved set of properties that
can e.g. be used to generate RTP-Info headers.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=719415
2014-01-27 15:11:09 +01:00
George Kiagiadakis
6108407db1 gstrtpbasepayload: use the session's suggested ssrc after a collision, if the session provides one
Conflicts:
	gst-libs/gst/rtp/gstrtpbasepayload.c
2013-12-30 13:13:35 +01:00
Julien Isorce
71788c1432 rtpbasepayload: change SSRC on GstRTPCollision event
Change our SSRC and update the caps when we receive a GstRTPCollision
event from downstream.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=711560
2013-12-12 13:44:15 +01:00
Julien Isorce
6f614e1225 rtpbasepayload: implement src_event function
Add a srcpad event handler and call the src_event vmethod.
2013-12-12 13:16:01 +01:00
Sebastian Rasmussen
c734f9fba8 rtpbuffer: Allow subbuffering of empty buffers
See https://bugzilla.gnome.org/show_bug.cgi?id=720162
2013-12-10 12:38:56 +01:00
Sebastian Dröge
76985c5e81 rtpbuffer: Fix gst_rtp_buffer_ext_timestamp() with clang 5 on iOS/ARM
The bitwise NOT operator is not defined on signed integers.
Thanks to Wim Taymans for finding the cause.

https://bugzilla.gnome.org/show_bug.cgi?id=711819
2013-11-13 20:15:02 +01:00
Wim Taymans
240c7234f6 rtpbuffer: check for valid payload type
The payload type can't be between 72 and 76 because with the marker bit set,
this could be mistaken for an RTCP packet then. We do a relaxed check and
only refuse 72-76 when the marker bit is set. The effect is that when
we try to map an RTCP packet as an RTP packet, we will certainly fail.
2013-09-13 16:05:58 +02:00
Wim Taymans
ca1dac6982 rtcpbuffer: do additional packet checks
Check the packet size and avoid crashing on malformed packets.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=655727
2013-08-26 11:47:40 +02:00
Wim Taymans
b848f38215 rtcpbuffer: improve bye parsing
It is an error to ask for a non-existing BYE SSRC, the caller should
check the SSRC count first.
2013-08-26 11:46:11 +02:00
Wim Taymans
121235511a rtpbasedepayload: mark DISCONT on buffer in all cases
Always mark discont on the input buffer when we detect a seqnum
discont and not only when we previously marked ourselves DISCONT.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=706422
2013-08-21 12:38:10 +02:00
Olivier Crête
c6fd304eb6 rtpbaseaudiopayload: Avoid copying the data 2013-08-18 22:24:08 -04:00
Wim Taymans
c1da65da5e rtcpbuffer: calculate FB packet length correctly 2013-08-06 15:44:03 +02:00
Ognyan Tonchev
25fdde908a rtpbasepayload: Do not leak the event when segment is delayed
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=703119
2013-06-26 15:45:30 +02:00
Branko Subasic
4dd5c5b808 rtpbuffer: add gst_rtp_buffer_get_payload_bytes
The function gst_rtp_buffer_get_payload can not be used in Python
because it lacks necessary length parameter. This patch adds a new
function, gst_rtp_buffer_get_payload_bytes, to use from Python
bindings. The new function has the advisory "Rename to:" annotation
so it can replace the gst_rtp_buffer_get_payload whan creating
bindings.

The function gst_rtp_buffer_get_extension_bytes is also added. It wraps
gst_rtp_buffer_get_extension_data which doesn't work in Python due to
incomplete annotation and because it returns the length as number of
32-bit words.

https://bugzilla.gnome.org/show_bug.cgi?id=698562
2013-06-18 11:23:40 +02:00
Nicolas Dufresne
94b7ae7767 rtpbasepayload: Delay segment event after caps
https://bugzilla.gnome.org/show_bug.cgi?id=700222
2013-05-14 09:50:22 +02:00
Tom Greenwood
789ddf42a9 rtpbasedepayload: Ignore caps events if the caps did not change
https://bugzilla.gnome.org/show_bug.cgi?id=697672
2013-04-15 10:00:05 +02:00
Tim-Philipp Müller
664adc6e19 gst-libs: use GST_*_1_0 environment variables everywhere
The _1_0 suffixed environment variables override the
non-suffixed ones, so if we're in an environment that
sets the _1_0 suffixed ones, such as jhbuild, we need
to set those to make sure ours actually always get
used.
2013-01-16 10:16:27 +00:00
Thijs Vermeir
2887485358 rtp: fix compiler warning
comparison is always true due to limited range of data type
2012-12-18 15:27:48 +01:00
Sebastian Dröge
3f82e919dd libs: Use foo/foo.h as single-include header consistently everywhere
https://bugzilla.gnome.org/show_bug.cgi?id=688785
2012-12-12 17:13:10 +00:00
Evan Nemerson
4d77fba46c libs: Add missing single include headers and use them in GIRs 2012-11-21 11:01:24 +01:00
Tim-Philipp Müller
71e46b2478 gst_adapter_prev_timestamp -> gst_adapter_prev_pts
https://bugzilla.gnome.org/show_bug.cgi?id=675598
2012-11-14 00:03:15 +00:00
Wim Taymans
af3f75f3a9 rtpbuffer: protect against empty buffers 2012-11-12 11:18:16 +01:00
Wim Taymans
4463df5b0d rtp: fix ntp56 parsing 2012-11-06 09:18:54 +01:00
Wim Taymans
82d327fb91 rtp: add helpers for header extensions
Add helpers and defines for the NTP-64 and NTP-56 header extensions.
2012-11-06 09:18:54 +01:00
Tim-Philipp Müller
5f59b4f7ee Fix FSF address
https://bugzilla.gnome.org/show_bug.cgi?id=687520
2012-11-03 23:05:09 +00:00
Miguel Angel Cabrera Moya
b1318c86e8 rtpbasedepay: remove unused variable
https://bugzilla.gnome.org/show_bug.cgi?id=687146
2012-10-29 21:20:35 +00:00
Tim-Philipp Müller
a4f2df6341 Revert "g-i: change g-ir-scanner arg --library=libgstfoo-X.la to --library=gstfoo-X"
This reverts commit e39fbe6b7e.

Looks like we need to pass the full .la file after all in a setup
with libtool, or it might not find the library, e.g. like

  ERROR: can't resolve libraries to shared libraries: gstfft-1.0

Conflicts:
	gst-libs/gst/audio/Makefile.am
	gst-libs/gst/pbutils/Makefile.am

Also see https://bugzilla.gnome.org/show_bug.cgi?id=603710
2012-10-29 12:47:05 +00:00
Tim-Philipp Müller
e39fbe6b7e g-i: change g-ir-scanner arg --library=libgstfoo-X.la to --library=gstfoo-X
As it should be according to the man page.

https://bugzilla.gnome.org/show_bug.cgi?id=679315
2012-10-28 17:35:57 +00:00
Tim-Philipp Müller
5e0dfec62c Remove -DGST_USE_UNSTABLE_API 2012-09-17 16:05:37 +01:00
Tim-Philipp Müller
21c61586ad rtpbasepayload: error out if no CAPS event was received before buffers
Most payloaders set/send their own output format from the setcaps
function, so if we don't get input caps, things probably wont' work
right, even if the input format is fixed (as in the case of the mpeg-ts
payloader for example).

https://bugzilla.gnome.org/show_bug.cgi?id=683428
2012-09-06 18:23:22 +01:00
Tim-Philipp Müller
3d006f6d2a rtpbasepayload: assume input caps are accepted if subclass has no set_caps vfunc
Not that anyone should ascribe too much meaning to these return
values in the age of sticky caps.
2012-09-06 17:47:01 +01:00
Mark Nauwelaerts
bd67736851 rtpbasedepay: indicate packet loss using GAP event 2012-09-05 12:02:32 +02:00
Tim-Philipp Müller
392d3225ce rtp: fix buffer leak when gst_rtp_buffer_map() fails because of broken data
Makes libs/rtp unit test valgrind clean.
2012-08-22 09:20:55 +01:00
Wim Taymans
1968127650 rtp: Fix extension data support
Allocate header, payload and padding in separate memory blocks in
gst_rtp_buffer_allocate().
don't use part of the payload data as storage for the extension data but store
it in a separate memory block that can be enlarged when needed.
Rework the one and two-byte header extension to make it reserve space for the
extra extension first.
Fix RTP unit test. Don't map the complete buffer or make assumptions on the
memory layout of the underlaying implementation. We can now always add extension
data because we have a separate memory block for it.
2012-08-22 09:56:39 +02:00
Wim Taymans
2d6fd0f72d rtp: fix extension length calculation 2012-08-22 09:56:39 +02:00
Wim Taymans
f548e58385 rtp: remove unused field 2012-08-22 09:56:39 +02:00
Andoni Morales Alastruey
d2aebc7f94 rtpbuffer: use proper format for gsize 2012-08-08 17:41:19 +02:00
Wim Taymans
11a494d5c9 rtp: Add support for multiple memory blocks in RTP
Add support RTP buffers with multiple memory blocks. We allow one block for the
header, one for the extension data, N for data and one memory block for the
padding.
Remove the validate function, we validate now when we map because we need to
parse things in order to map multiple memory blocks.
2012-07-17 16:41:36 +02:00
Evan Nemerson
f21c4667b9 rtp: add many missing annotations on RTP/RTCP buffer functions 2012-07-17 11:10:37 +02:00
Evan Nemerson
63579633f5 rtpbaseaudiopayload: add transfer annotation to get_adapter return 2012-07-17 11:10:04 +02:00
Edward Hervey
2817bdadc9 libs: Remove "Since" markers and minor doc fixups 2012-07-13 12:11:06 +02:00
Wim Taymans
baa2fac2f8 audiopayload: disable broken bufferlist handling
The bufferlist handling is broken so make sure it is never enabled.
2012-06-06 16:40:24 +02:00
Sebastian Rasmussen
b7b123964b gst-libs: make pkg-config get path to pkg-config dirs from configure
When --with-pkg-config-path is supplied to configure this path is now
explicitly propagated to pkg-config.

https://bugzilla.gnome.org/show_bug.cgi?id=673377
2012-05-05 23:26:20 +01:00
Sebastian Dröge
65307dd132 gst: Update versioning 2012-04-04 14:55:15 +02:00
Wim Taymans
296e1bf3dd rtpbuffer: removed old memory
Ensure writability of rtp buffer and remove old memory first
Fix some docs
2012-04-04 09:34:00 +02:00
Wim Taymans
6e9d28eef6 rtp: fix initializer 2012-04-02 11:05:38 +02:00
Wim Taymans
92f46c07fe rtpbuffer: keep more state
Prepare for the future, make it possible to map multiple buffer regions, like
the header and the payload.
2012-04-02 10:31:18 +02:00
Wim Taymans
9ef519d99a Improve buffer allocation of wrapped memory 2012-04-01 18:11:23 +02:00
Wim Taymans
345dc31f20 update for buffer api change 2012-03-30 18:15:30 +02:00
Mark Nauwelaerts
6039266c43 rtpbasepayload: plug caps leak 2012-03-29 17:15:43 +02:00
Wim Taymans
df5253b22c update for memory api changes 2012-03-15 13:32:08 +01:00
Wim Taymans
28034226c6 update for memory api changes 2012-03-14 21:35:45 +01:00
Wim Taymans
37e940df83 rtpbasepay: add support for DTS and PTS 2012-03-13 18:15:04 +01:00
Wim Taymans
25137962ad fix for caps API changes 2012-03-11 19:04:41 +01:00
Wim Taymans
63f3f27164 update for new memory api 2012-02-22 02:05:24 +01:00
Olivier Crête
cb044668d3 rtcpbuffer: Set the map.size to the current size of the RTCP packet
maxsize is the maximum size
2012-01-27 19:01:55 +01:00
Olivier Crête
b993b8457d rtpcbuffer: To write inside a RTCP buffer, you must be able to read
So always require read
2012-01-27 19:01:55 +01:00
Olivier Crête
6b559a50fb rtcpbuffer: Return errors if the map mode doesn't match the actions 2012-01-27 19:01:55 +01:00
Olivier Crête
ab359d36d5 rtcpbuffer: Don't try to modify read-only buffers 2012-01-27 19:01:55 +01:00
Wim Taymans
e7575bc525 rtp: improve structures
Remove flags that is in the mapinfo now
2012-01-25 12:30:53 +01:00
Wim Taymans
fcdc385aa1 port to new map API 2012-01-25 12:30:53 +01:00
Olivier Crête
1a592199e9 rtpbasepayload: Port to group-less GstBufferList 2012-01-25 11:55:02 +01:00
Wim Taymans
d9ef75b799 rtcp: handle size update correctly
Do explicit resize to set the size of a buffer instead of setting a value in
unmap.
2012-01-19 15:20:01 +01:00
Wim Taymans
5872bcc33a Update for memory API changes 2012-01-19 12:15:18 +01:00
Sebastian Dröge
dc8984d76c Merge branch 'master' into 0.11
Conflicts:
	gst-libs/gst/app/gstappsrc.c
	gst-libs/gst/audio/multichannel.h
	gst-libs/gst/video/videooverlay.c
	gst/playback/gstplaysink.c
	gst/playback/gststreamsynchronizer.c
	tests/check/Makefile.am
	win32/common/libgstvideo.def
2012-01-10 13:15:12 +01:00
Pascal Buhler
0febae7443 rtcpbuffer: prevent overflow of 16bit header length.
RTCP header can be  (2^16 + 1) * 4 bytes long, so when validating a bogus
packet it was possible to get a 16bit overflow resulting in a length of 0.
This would put the gst_rtcp_buffer_validate_data function in a endless loop.

https://bugzilla.gnome.org/show_bug.cgi?id=667313
2012-01-05 11:12:25 +00:00
Wim Taymans
6be9a67148 rtp: add INIT macros 2011-12-09 19:22:21 +01:00
Tim-Philipp Müller
54c5cd8c3f rtpbuffer: add GST_RTP_BUFFER_INIT to initialize RTP buffers on the stack
Fixes build of -good.
2011-12-09 15:03:41 +00:00
Edward Hervey
ea0ed511f8 rtp: Initialize GstRTPBuffer before usage 2011-12-05 18:42:24 +01:00
Edward Hervey
94230af7a3 rtp: Don't forget to initialize GstRTPBuffer 2011-12-05 18:30:37 +01:00