Commit graph

9663 commits

Author SHA1 Message Date
Nicolas Dufresne
d397cf6d1f rtph265pay: Don't wait for next nal when input is aligned
This is the same as what was done on rtph264pay in the patch
d5d28055c1
2018-12-18 13:39:54 -05:00
Nicolas Dufresne
0524e6f8cd rtph265depay: Drain on EOS event 2018-12-18 13:39:54 -05:00
Nicolas Dufresne
65b01d5f02 rtph265depay: Factor out the code that push
This will be needed to implement draining on EOS.
2018-12-18 13:39:53 -05:00
Nicolas Dufresne
e694e2752a rtph264depay: Drain on EOS event 2018-12-18 13:39:46 -05:00
Nicolas Dufresne
d12128f527 rtph264depay: Factor out the code that push
This will be needed to implement draining on EOS.
2018-12-18 13:39:46 -05:00
Nicolas Dufresne
5e8cab71ea rtph26xpay: Remove unused IS_ACCESS_UNIT macro
This macro is not longer used. It was secretly checking if that nal was
a slice, and confusingly name to that one may think it was checking if
the nal is an AUD.
2018-12-18 13:39:46 -05:00
Nicolas Dufresne
0a6e5e439c rtph265pay: Fix reading timestamps from adapter
The code was reading the timestamp from the adapter before pushing the
new buffer into it. As a side effect, if the adapter was empty, we'd end
up using an older timestamp. In alignment=au, it means that all
timestamp was likely one frame in the past, while in alignment=nal, with
multiple slices per frame, the first slice would have the timestamp of
the previous one.
2018-12-18 13:30:05 -05:00
Nicolas Dufresne
ff2e5b94b9 rtph265pay: Forward the marker bit as buffer flag
We have a buffer flag to represent the marker bit (when present).
Forward this bit by setting the buffer flag accordingly.
2018-12-18 13:30:05 -05:00
Nicolas Dufresne
e721071dca rtph265pay: Properly set the marker bit
The marker bit is used for efficient decoding. The assumption that
it should be set on the AUD is wrong, since the AUD is conceptually
starts the frame, while the marker is to indicate the end.

So properly set the marker bit as soon as we know we are ending an
AU and also whenever upstream have set the GST_BUFFER_FLAG_MARKER
flag.
2018-12-18 13:30:05 -05:00
Nicolas Dufresne
1f72131781 rtph264pay: Fix reading timestamps from adapter
The code was reading the timestamp from the adapter before pushing the
new buffer into it. As a side effect, if the adapter was empty, we'd end
up using an older timestamp. In alignment=au, it means that all
timestamp was likely one frame in the past, while in alignment=nal, with
multiple slices per frame, the first slice would have the timestamp of
the previous one.
2018-12-18 13:30:05 -05:00
Nicolas Dufresne
4add820cce rtph264pay: Properly set the marker bit
The marker bit is used for efficient decoding. The assumption that
it should be set on the AUD is wrong, since the AUD is conceptually
starts the frame, while the marker is to indicate the end.

So properly set the marker bit as soon as we know we are ending an
AU and also whenever upstream have set the GST_BUFFER_FLAG_MARKER
flag.
2018-12-18 13:30:05 -05:00
Nicolas Dufresne
e4f38c986e rtph264depay: Forward the marker bit as buffer flag
We have a buffer flag to represent the marker bit (when present).
Forward this bit by setting the buffer flag accordingly.
2018-12-18 13:30:05 -05:00
Nicolas Dufresne
13278fbcf5 rtph264pay: Protect against use of reserved NAL types
Don't allow external encoder to use one of the reserved NAL type
implicated in NAL aggreation. These out-of-spec NAL types, if passed
from the outside world will lead to an invalid RTP payload being
created.
2018-12-18 13:30:05 -05:00
Sebastian Dröge
4f7ef56c53 isomp4: Replace GST_VIDEO_CAPTION_TYPE_CEA608_IN_CEA708_RAW with CEA608_S334_1A
For the demuxer we have to select line offset 0 for the time being as
this information is not passed over MOV.
2018-12-15 21:31:20 +00:00
Olivier Crête
d857522237 rtpjitterbuffer: Run all timers immediately on EOS
When the EOS event is received, run all timers immediately and avoid
pushing the EOS downstream before this has been run. This ensures that
the lost packet statistics are accurate.
2018-12-14 12:10:16 +00:00
Nicolas Dufresne
3de2c28fc1 rtpjitterbuffer: Stop waiting after EOS
After EOS is received, it is pointless to wait for further events,
specially waiting on timers. This patches fixes two cases where we could
wait instead of returning GST_FLOW_EOS and trigger a spin of the loop
function when EOS is queued, regardless if this EOS is the queue head or
not.
2018-12-14 12:10:16 +00:00
Jochen Henneberg
7824e87c5b flacparse: On sink caps change restart parser
Draining the parser is not enough here, on caps change we need to
reset it so it is ready to accept new caps.
2018-12-14 09:22:33 +00:00
Jochen Henneberg
9b6dcc7f1b rtpgstdepay: Update pad caps if inline caps change
If the inlined caps change while using the same CV we need to update the
source pad caps.
2018-12-14 09:22:33 +00:00
Sebastian Dröge
c50be8f146 qtdemux: Put framerate into the closedcaption caps if it can be calculated from the stream
Using the same calculation used for video streams.
2018-12-06 16:05:50 +00:00
Sebastian Dröge
830e7dc14b qtmux: Set timescale of closedcaption tracks to the one of the main video track 2018-12-06 16:05:50 +00:00
Maciej Wolny
ec655de288 Remove duplicate declarations
This causes 'redefinition of typedef ...' errors on GCC 4.5.3
2018-12-04 11:13:02 +00:00
Alicia Boya García
38b553dda7 qtdemux: set need_segment after a second moov
stream.segment should be updated with the values of the current edit
list, also when a new `moov` is received. Unfortunately this was not
being the case because of an early return.

As a consequence of this bugs, no end of movie clipping was being
performed on the new moov and no segment event was being emitted.

When performing stream switching (e.g. in MSE) the new moov may have a
different edit list. This is often the case when switching between
baseline H.264 (which lacks B-frames) and more demanding profiles. For
this reason it's important to emit a new segment in order to be able
to get matching stream times.
2018-11-30 20:44:57 +00:00
Alicia Boya García
26cc201c8a qtdemux: Initialize QtDemuxStream.segment in its constructor
This patch moves the initialization of QtDemuxStream.segment from
gst_qtdemux_add_stream() to _create_stream(). This ensures the segment
is always initialized when the stream is created.

Otherwise the segment format is left as GST_FORMAT_UNDEFINED in the case
were a track is reparsed and qtdemux_reuse_and_configure_stream() is
called instead of gst_qtdemux_add_stream(). (See
qtdemux_expose_streams() in the non streams-aware case.)
2018-11-30 20:44:57 +00:00
Miguel Paris
48a4fd4e50 rtpsession: properly handle rtcp_feedback_retention_window
- Consider GST_CLOCK_TIME_NONE as not to be used.
- Complete "rtcp-feedback-retention-window" property getter/setter
  implementation.
2018-11-30 10:55:26 +00:00
Miguel Paris
458741e4b2 rtpsource: properly prune RTCP packets out of feedback_retention_window
Closes #522
2018-11-30 10:55:26 +00:00
Miguel Paris
53f03d4cc1 rtpsource: properly compare buffer PTSs 2018-11-30 10:55:26 +00:00
Miguel Paris
57829c3352 rtpsource: retain_rtcp_packet: warning if invalid running_time 2018-11-30 10:55:26 +00:00
Miguel Paris
36f55b03e8 rtpsession: properly set the running_time for rtcp packet info 2018-11-30 10:55:26 +00:00
Nicolas Dufresne
d637567ab3 rtpssrcdemux: Rename confusingly name lock macros
This is an extra internal recurisve lock use to avoid having to take
both sink pad streams lock all the time. This patch renamed it
INTERLNAL_STREAM_LOCK/UNLOCK() to avoid confusion with possible upstream
GST_PAD API.
2018-11-29 15:34:47 -05:00
Nicolas Dufresne
40daf6322d rtpssrcdemux: Hold on internal stream lock while pushing sticky
This reverts "6f3734c305 rtpssrcdemux: Only forward stick events while
holding the sinkpad stream lock" and actually hold on the internal
stream lock. This prevents in some needed case having a second
streaming thread poping in and messing up event ordering.
2018-11-29 15:33:57 -05:00
Matej Knopp
e9495c55f4 matroskademux: fix handling of MS ACM audio
Pass riff codec-data as strf, not strd, which is where
gst_riff_create_audio_caps() expects the WAVEFORMATEXTENSIBLE
data.

https://bugzilla.gnome.org/show_bug.cgi?id=757583
Fixes #234
2018-11-28 11:55:14 +00:00
Jordan Petridis
515ada7e22
Run gst-indent through the files
This is required before we enabled an indent test in the CI.

https://gitlab.freedesktop.org/gstreamer/gstreamer-project/issues/33
2018-11-28 05:52:16 +02:00
Thibault Saunier
2e0a45d7df aspectcropration: Fix potential unref of NULL pointer 2018-11-26 08:11:57 -03:00
Thibault Saunier
eb2b58cc0b aspectcropratio: Set caps from the streaming thread on property changes
Otherwise it might lead to deadlocks

See https://gitlab.gnome.org/GNOME/pitivi/issues/2259

Closes #518
2018-11-26 07:14:09 -03:00
Nicolas Dufresne
21378d83c2 rtpssrcdemux: Forward serialized events to all pads
While forwarding serialized event, we use gst_pad_forward() function.
In the forward callback (GstPadForwardFunction) we always return
TRUE. Returning true there will stop the dispatching procedure. As a
side effect, only one events is receiving the events. This breaks
when sending EOS from the applicaiton, it also breaks the latency
tracer.
2018-11-24 13:01:25 +00:00
Alicia Boya García
753b7c17f3 matroskademux: Defer seeks received before GST_MATROSKA_READ_STATE_DATA
This patch enables matroskademux to receive seeks before it reaches
GST_MATROSKA_READ_STATE_DATA.

Closes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/514

This also enables receiving seeks in the element READY state.

When such a seek is received, it is stored to be later handled when
GST_MATROSKA_READ_STATE_DATA is reached.
2018-11-15 08:01:29 +00:00
Linus Svensson
8fc8b7ee33 rtpsession: Implement reset
Reset RTPSession when rtpsession changes state from PAUSED to READY.
Without this change, a stored last_rtptime in RTPSource could interfere
with RTP timestamp generation in RTCP Sender Report.

Fixes #510
2018-11-13 12:30:35 +00:00
Mathieu Duponchelle
fd560bcb27 rtpfunnel: Stop using G_DECLARE_FINAL_TYPE
Fixes #516
2018-11-13 00:37:11 +01:00
Matthew Waters
40fc8aea8f matroska: implement preliminary support for the bitrate query
Return the size / total duration as a ballpark estimate.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/60
2018-11-07 15:07:18 +00:00
Matthew Waters
8a7074f748 isomp4: add preliminary support for the bitrate query
Return the upstream size over the duration as a first estimate.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/60
2018-11-07 15:07:18 +00:00
Sebastian Dröge
87202cc03d rtpbin: Sink jitterbuffer/storage before passing as parameters to signals
Otherwise signal handlers from bindings will take ownership of them as
they are still floating, and we won't own a reference inside rtpbin
anymore.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/issues/515
2018-11-07 09:11:16 +00:00
Olivier Crête
fea0d0b1a4 flvmux: Force timestamps to always be increasing
https://bugzilla.gnome.org/show_bug.cgi?id=796382
2018-11-05 18:17:01 -05:00
Seungha Yang
5d542030db qtdemux: Ignore corrupted CTTS box
If ctts (CompositionOffsetBox) has larger sample_offset
(offset between PTS and DTS) than (2 * duration) of the stream,
assume the ctts box to be corrupted and ignore the box.

https://bugzilla.gnome.org/show_bug.cgi?id=797262
2018-11-01 16:03:12 +02:00
Sebastian Dröge
a03d29420b scaletempo: Implement SEGMENT query
https://bugzilla.gnome.org/show_bug.cgi?id=797313
2018-10-28 17:52:18 +00:00
Sebastian Dröge
2415d517f1 wavparse: Implement SEGMENT query
https://bugzilla.gnome.org/show_bug.cgi?id=797313
2018-10-28 17:52:18 +00:00
Olivier Crête
486044063a dtmfsrc: Declare output as interleaved
This element doesn't support planar audio yet.
2018-10-28 17:12:59 +00:00
Olivier Crête
cc69c876fe rtpsession: Allow changing the SDES at runtime
Make it possible to modify the SDES in a packet at runtime.

https://bugzilla.gnome.org/show_bug.cgi?id=763502
2018-10-28 12:10:36 +00:00
Alicia Boya García
5fcb7f715a qtmux: round to nearest when computing mehd and tkhd duration
This fixes a bug where in some files mehd.fragment_duration is one unit
less than the actual duration of the fragmented movie, as explained below:

mehd.fragment_duration is computed by scaling the end timestamp of
the last frame of the movie in (in nanoseconds) by the movie timescale.

In some situations, the end timestamp is innacurate due to lossy conversion to
fixed point required by GstBuffer upstream.

Take for instance a movie with 3 frames at exactly 3 fps.

$ gst-launch-1.0 -v videotestsrc num-buffers=3 \
  ! video/x-raw, framerate="(fraction)3/1" \
  ! x264enc \
  ! fakesink silent=false

dts: 999:59:59.333333334,  pts: 1000:00:00.000000000, duration: 0:00:00.333333333
dts: 999:59:59.666666667,  pts: 1000:00:00.666666666, duration: 0:00:00.333333334
dts: 1000:00:00.000000000, pts: 1000:00:00.333333333, duration: 0:00:00.333333333

The end timestamp is calculated by qtmux in this way:

end timestamp = last frame DTS + last frame DUR - first frame DTS =
  = 1000:00:00.000000000 + 0:00:00.333333333 - 999:59:59.333333334 =
  = 0:00:00.999999999

qtmux needs to round this timestamp to the declared movie timescale, which can
ameliorate this distortion, but it's important that round-neareast is used;
otherwise it would backfire badly.

Take for example a movie with a timescale of 30 units/s.

0.999999999 s * 30 units/s = 29.999999970 units

A round-floor (as it was done before this patch) would set fragment_duration to
29 units, amplifying the original distorsion from 1 nanosecond up to 33
milliseconds less than the correct value. The greatest distortion would occur
in the case where timescale = framerate, where an entire frame duration would
be subtracted.

Also, rounding is added to tkhd duration computation too, which
potentially has the same problem.

https://bugzilla.gnome.org/show_bug.cgi?id=793959
2018-10-27 13:12:56 +01:00
Marc Leeman
827d70daee udpsrc: print information about bind_error socket error
In some cases, a bind error occurs during operation. Printing
the information about the problem is critical for finding the
conflict

https://bugzilla.gnome.org/show_bug.cgi?id=797340
2018-10-27 13:12:53 +01:00
Johan Bjäreholt
e736f29376 matroska-demux: Fix caps memleak
https://bugzilla.gnome.org/show_bug.cgi?id=797326
2018-10-27 10:48:38 +01:00