Commit graph

112 commits

Author SHA1 Message Date
Vincent Penquerc'h
c0e101e93f various: fix pad template leaks
https://bugzilla.gnome.org/show_bug.cgi?id=662664
2011-11-28 13:30:27 +00:00
Mark Nauwelaerts
77ebd33991 rtpjitterbuffer/rtpbin: relax dropping rtcp packets
... to at least having it trigger a/v synchronization, possibly without
using provided values which are still not considered sane
(as previously dropped).
2011-09-19 11:56:44 +02:00
Mark Nauwelaerts
adfe7d0467 rtpjitterbuffer: some more reset when clearing pt map
... which in particular caters for some more reset following a possible
rtsp PLAY.
2011-09-19 11:56:44 +02:00
Mark Nauwelaerts
4b7301e4d1 rtpjitterbuffer: also provide clock-base to sync signal 2011-09-19 11:52:00 +02:00
Robert Swain
5b18c652fb rtp, rtpmanager: Address unused but set variables
GCC 4.6.x spits warnings about variables that are unused but set. Such
variables have been removed where trivial but with comments left behind
for informational purposes in some cases.

gst_rtp_session_chain_recv_rtcp () was changed in commit 490113d4
to always return GST_FLOW_OK instead of the return value of
rtp_session_process_rtcp (), so we'll keep it that way.
2011-04-16 12:49:16 +01:00
Havard Graff
e71a908d96 jitterbuffer: Make src_query MT-safe
It is possible that the element might be going down while the event arrives
2011-04-08 15:23:05 +02:00
Sebastian Dröge
4c36ca30b2 jitterbuffer: Unref event if the parent element disappeared 2011-04-08 15:22:19 +02:00
Havard Graff
342686bb02 jitterbuffer: Make upstream events MT-safe 2011-04-08 15:21:46 +02:00
Sebastian Dröge
31af4fe33e rtp: Unref events if the parent element disappeared 2011-04-08 15:20:51 +02:00
Ole André Vadla Ravnås
046f170d6a rtpmanager: fix pad callbacks so they handle when parent goes away
1) We need to lock and get a strong ref to the parent, if still there.
2) If it has gone away, we need to handle that gracefully.

This is necessary in order to safely modify a running pipeline. Has been
observed when a streaming thread is doing a buffer_alloc() while an
application thread sends an event on a pad further downstream, and from
within a pad probe (holding STREAM_LOCK) carries out the pipeline plumbing
while the streaming thread has its buffer_alloc() in progress.
2011-04-08 15:16:56 +02:00
Mark Nauwelaerts
e5bcaa45e6 Revert "jitterbuffer: reset element base_time upon flush"
This reverts commit f84b8a69cb.

Fixes bug #646397.
2011-04-04 11:49:00 +02:00
Mark Nauwelaerts
6bc1aa0e59 jitterbuffer: handle position query 2011-03-09 17:18:08 +01:00
Mark Nauwelaerts
1f7f434df6 jitterbuffer: also estimate eos if very near eos 2011-03-07 16:56:43 +01:00
Mark Nauwelaerts
3c9a4239bf jitterbuffer: avoid trying to buffer more than is available.
That is, in case of short (or near eos of) stream, deadlock (until timeout)
would occur trying to buffer more than is yet forthcoming.
2011-03-07 16:56:18 +01:00
Mark Nauwelaerts
f84b8a69cb jitterbuffer: reset element base_time upon flush
... to arrange for properly scheduled timeout (following seek).
2011-03-07 11:07:12 +01:00
Wim Taymans
6cb0efede4 jitterbuffer: provide a clock.
since we are using the clock for sync, we need to also provide a clock for good
measure. The reason is that even if downstream elements provide a clock, we
don't want to have that clock selected because it might not be running yet.
2010-12-20 11:13:09 +01:00
Wim Taymans
ffc7cd9803 jitterbuffer: avoid leaking sink events
Avoid leaking the newsegment event when it has the wrong format.
2010-12-13 12:57:58 +01:00
Stefan Kost
d8167e3071 various (gst): add a missing G_PARAM_STATIC_STRINGS flags 2010-10-13 18:00:28 +03:00
Pascal Buhler
7a8c2a4b8a rtpmanager: packet lost should not be a warning. It happens all the time... 2010-09-24 16:00:03 +02:00
Wim Taymans
f03fd91400 jitterbuffer: rename a variable to avoid confusion 2010-09-06 11:01:57 +02:00
Sebastian Dröge
f16ed4a91c gst: Don't use GST_DEBUG_FUNCPTR for GObject vfuncs 2010-06-06 17:52:40 +02:00
Thijs Vermeir
0bb2be3a7e rtpjitterbuffer: fix compiler warning
unused variable ‘estimated’
2010-06-02 15:32:36 +02:00
Alessandro Decina
4b6cb93025 rtpjitterbuffer: stop buffering and emit EOS at the end of a stream
When using RTP_JITTER_BUFFER_MODE_BUFFER, make sure that the ringbuffer doesn't
get stuck buffering forever when there isn't enough data left to fill the
buffer.
2010-06-02 14:21:16 +02:00
Alessandro Decina
40899379c0 rtpjitterbuffer: move some initialization code from change_state to _init.
Set ->active to TRUE in _init so it can be set to FALSE after creating the
jitterbuffer and it won't be mistakenly reset to TRUE in the change_state
function.
This is needed to start the jitterbuffer as inactive when rtpbin is buffering.
2010-05-03 13:34:59 +02:00
Benjamin Otte
cccfeaa59c gst_element_class_set_details => gst_element_class_set_details_simple 2010-03-18 14:32:00 +01:00
Sebastian Dröge
bcd06ea527 rtpjitterbuffer: Reset skew detection after instantiating the jitterbuffer
...not only when going to READY. This sets high_level and friends to
a more useful value.
2010-02-23 17:24:03 +01:00
Tim-Philipp Müller
07fa73f199 docs: add Since: markers for new jitterbuffer properties 2010-02-19 12:13:07 +00:00
Wim Taymans
772eca5aff jitterbuffer: start out active and not buffering
There is no need to set the latency in the jittebuffer in _init, we will set
that later when going to PAUSED.
Set the jitterbuffer active and not buffering when starting.
2010-02-12 17:22:56 +01:00
Wim Taymans
8bbfd94c25 rtpbin: more buffering work
When deactivating jitterbuffers when the buffering starts, keep the current
percent of the jitterbuffer and also set the jitterbuffer in the buffering state
so that we know when it's filled again.
Add property to get the buffering percentage of the jitterbuffer.
2010-02-12 17:22:56 +01:00
Wim Taymans
e6e287cdcc rtpjitterbuffer: adjust latency in buffer mode
When we are in buffer mode, adjust the buffering low/high thresholds based on
the total configured latency. If we don't and there is a huge queue or element
with a big latency downstream we might drain the complete queue immediately and
start buffering again.
2010-02-12 17:22:55 +01:00
Wim Taymans
ab73603031 jitterbuffer: add ts-offset to timestamp
Add the ts-offset to the buffer timestamp to get the final output timestamp of
the buffer.
2010-02-12 17:22:55 +01:00
Wim Taymans
74a3be350d rtpbin: do more accurate buffer offsets
Return the next timestamp in the jitterbuffer.
Use the min-timestamp of the jitterbuffers to calculate an offset so that the
next timestamp is pushed with a timestamp equal to running_time.
Start producing timestamps from 0 in the buffering case too.
2010-02-12 17:22:55 +01:00
Wim Taymans
ecf6ed8fc1 jitterbuffer: keep track of offset
Keep track of an outgoing offset that we add to each outgoing buffer to
compensate for PAUSE when buffering.
Adjust the offset when activating.
2010-02-12 17:22:54 +01:00
Wim Taymans
20a27a545a rtpbin: more buffering updates
Add signal to pause the jitterbuffer. This will be emitted from gstrtpbin when
one of the jitterbuffers is buffering.
Make rtpbin collect the buffering messages and post a new buffering message with
the min value.
Remove the stats callback from jitterbuffer but pass a percent integer to
functions that affect the buffering state of the jitterbuffer. This allows us
then to post buffering messages from outside of the jitterbuffer lock.
2010-02-12 17:22:53 +01:00
Wim Taymans
a5b9d3f917 rtpbin: propagate buffer-mode property
Propagate buffer-mode property to the jitterbuffers.
Intercept BUFFERING messages in rtpbin
2010-02-12 17:22:53 +01:00
Wim Taymans
d3db9574a9 jitterbuffer: do more buffering implementation
Add callback for buffering stats.
Configure the latency in the jitterbuffer instead of passing it with _insert.
Calculate buffering levels when pushing and popping
Post buffering messages.
2010-02-12 17:22:52 +01:00
Wim Taymans
aeacbfed3e jitterbuffer: flesh out buffering mode some more
Add a buffering state to the jitterbuffer and wait until buffering ends before
pushing out packets.
2010-02-12 17:22:52 +01:00
Wim Taymans
56b29c9a6b jitterbuffer: hook up the mode property
Expose a mode property on the jitterbuffer.
Fix the case where timestamps are -1 in the check for outgoing timestamps.
2010-02-12 17:22:52 +01:00
Wim Taymans
99a581215f jitterbuffer: add some more debug info 2010-02-12 13:53:57 +01:00
Wim Taymans
8070ae967b jitterbuffer: avoid using wrong clock-rate
Check for a valid clock-rate before attempting to estimate the npt
stop time.
2009-11-25 10:38:23 -06:00
Wim Taymans
f52859432f jitterbuffer: release lock before emiting signals
Release the jbuf lock before emiting the request-pt-map signal to avoid
deadlocks. We also need to catch the shutdown case when locking again.

Fixes #593354
2009-11-18 10:50:44 +01:00
Stefan Kost
e43eb89449 tests: add a jitterbuffer test
Tests pushing a few buffers in various order and asserting the order sent by the
jitterbuffer. Contains two disabled tests that need more work.
2009-10-22 13:35:57 +03:00
Wim Taymans
8fb77403c5 jitterbuffer: cache latency in nanoseconds
Cache the latency in nanoseconds units to avoid having to convert the
milliseconds value to nanoseconds all the time.
2009-10-01 12:52:40 +02:00
Stefan Kost
0a7ef67ad0 docs: fix gtk-doc warnings 2009-09-10 10:28:48 +03:00
Håvard Graff
40549278c3 jitterbuffer: avoid throwing reordered buffers with same timestamps
When we receive a reordered packet with the same timestamp as the previous one
(which can happen for fragmented packets) don't consider the packet as lost but
instead wait for the reordered packet to arrive.

Switch the warning-level, so that a reordering does not get a warning, only
an actual produced lost-packet.

Fixes #594251
2009-09-08 13:39:31 +02:00
Olivier Crête
f542f710cf rtpjitterbuffer: Lock clock_rate variable
The priv->clock_rate variable could become -1 between when its checked to not
be -1 and when its used, causing an assertion. Fixed by taking the mutex
earlier in the chain() function.

Fixes #593955
2009-09-03 19:17:00 +02:00
Wim Taymans
8d924611e7 jitterbuffer: make sure time does not go backwards
When we construct a timestamp that would result in a timestamp that is earlier
than when the packet was received, reset the skew calculation as this is
probably a sign that the sender restarted or paused.

Fixes #593354
2009-09-01 12:48:28 +02:00
Sebastian Dröge
000a483d31 rtp: Use new gst_iterator_new_single() for the internal linked pads iteration 2009-08-31 08:09:09 +02:00
Sebastian Dröge
c8c02d2c7a jitterbuffer: Use iterate internal links instead of deprecated get internal links 2009-08-31 08:09:08 +02:00
Tim-Philipp Müller
c5793a6a45 Make build without warnings with debugging disabled 2009-08-11 02:30:45 +01:00