Although the spec says that the clock-rate should always be 90000, some rtsp
servers send different clock-rates so we must accept then in order to handle
those streams too.
When we can't find any channel or encoding-params on the caps for dynamic
payload types, set the default number of channels to 1, as the spec says we
should.
See #623209
Don't reuse sockets but make the udpsrc element fail the state change when the
socket is already in use. If we don't prevent reuse, we might end up using the same
port for different streams in some cases.
Fixes#622017
When parsing the number of channels, use the encoding-params property from the
RTP caps because that is where we can find the channels according to the spec.
Fall back to the channels property in the caps when needed.
Fixes#623209
G729 packets may only occur intermittently (e.g. cn packets), and as such
do not allow for perfect-rtptime calculating rtp times based on frame or byte
count. In particular, do not use rtp audio base payloader as base class, but
rather base payloader directly.
To support setups with firewall/ipsec, it is useful for an rtsp client to be
able to set the range of ports that can be used for rtp/rtcp reception.
Allows this by adding a "port-range" property to the rtspsrc element.
Fixes#625153
The RTSP server rtspsrc is communicating with, sends a GET_PARAMETER request
periodically as a ping. The code in gst_rtspsrc_handle_request forms an OK
response and sends, but doesn't call gst_rtsp_message_unset to free the memory
after sending the response. This results in a constant slow memory leak.
Fixes#624770
That is, in files that have no index (Cue), perform seek by scanning for
nearest cluster with timecode before requested position. Scanning is done
as a combination of interpolation and sequential scan.
Fixes#617368.
Timestamp rounding issues could lead to going backwards 2 keyframe periods
(rather than only 1). While this is not necessarily a problem, it might
potentially place additional (buffering) load on downstream and could be
avoided (because We Can).
Fixes#623629.
There seems to be a bug in libmp4v2 that generates a MPEG4BitRateBox as
(bufferSizeDB, avgBitrate, maxBitrate) instead of (bufferSizeDB,
maxBitrate, avgBitrate), according to the spec. I used the mp4file
output while writing this code, so the order is wrong. This patches
fixes that.
https://bugzilla.gnome.org/show_bug.cgi?id=623654
PluginInfo is quite a sizeable struct, let's not allocate it on the
stack, especially not if we're copying it over into another dynamically
allocated copy anyway.
Fixes#570761.
If we restart the Stream in the case of doing a transition from
PAUSED_TO_READY and back with READY_TO_PAUSED aso. the duration of the video
will get calculated even if we have a avi header with that information.
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
On windows builds, sets source address for bind to INADDR_ANY, while
maintaining the original multicast group address for subsequent join.
Fixes#595978
Skip everything before the @ sign in the url location. VLC uses that as the
remote address to connect to (but we ignore it for now). This makes our udp urls
compatible with the ones used by VLC.
Fixes#597695
Keep a global connection for aggregate control but also keep stream connections
for non-aggregate control.
Add some helper methods to connect/close/flush the connections.
Subsequent entry time calculations use blockalign value to determine
number of frames per chunk, and blockalign == 1 is then most unlikely to result
in reasonable values (which also aligns with "spec").
So matroska's Block structure has no keyframe flag, only the SimpleBlock has it.
To detect keyframes in Blocks, it is just the BlockGroup container that needs
to have a ReferenceBlock attached if it is a delta frame in video.
Use new dts audio typefinder from -base to check if the PCM data
contains a dts stream. This way we recognise more varieties more
reliably and also detect the dts stream if there isn't a frame
sync right at the start of the data.
Fixes#413942.
Start cluster at every keyframe or when we would overflow the previous
cluster's relative timestamp field. This would avoid as much as possible
starting clusters at non-keyframes.
Don't send them upstream because for upstream a BYTES seek
might make sense but is completely wrong because upstream
can't seek to a byte position of the audio or video stream.
Also don't build the index in push mode for non-TIME seeks,
things will go wrong here otherwise.
This allows us to skip delta units earlier and is a bit clearer in my
opinion. It also makes only video buffers ever be delta units, not
just for SimpleBlock as before.
When the keyframe bit of SimpleBlock Flags wasn't set, the buffer was being
marked with GST_BUFFER_FLAG_DELTA_UNIT, causing all buffers to be skipped
after a seek. This may be a problem with the Sorenson Squish encoder, but
arguably the keyframe bit should only be applied to video.
Fixes bug #620358.
Even though we don't use delivery-method in our payloader, older versions of
the theora payloader in gstreamer required it. As such we need to keep this
around in the caps for backwards-compatibility.
This reverts part of 49463a37cbFixes#618940
When we calculate the frame duration, we need to use the amount of
frames in the _previous_ packet, not the current packet. The frame duration is
needed to correctly de-interleave interleaved streams. This fixes the case where
there are a variable number of frames in a packet.
Fixes#620494
This commit basically puts _get_caps() in sync with accept_caps().
If we don't have a master pad OR the master pad caps aren't negotiated
then we just return the downstream allowed caps.
If we have a master pad with negotiated caps, we return those caps
with a free range of width/height/framerate
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.
In demuxer and muxer use the gst_util_uint64 scaling functions rather than
standard integer division. Add warnings (to be changed to debug) for debugging
the timestamp and duration.
Specifically, this reduces pushing several small buffers for each
data buffer and also avoids a seek for each buffer altogether
(though a seek is still needed for each cluster).
Fixes#619273.
Before, vp8dec had no option but to decode all frames even if some/all
of them would be late. With this change, performance when keyframes are
frequent is helped a great deal. On my Thinkpad X60s, decoding a 20 s
1080p sunflower encode with keyframes every 10 frames went from taking
42 s with 5 frames shown to 21 s with 15 frames shown (still slow
enough to count by hand). When keyframes are more sparse, you will
still be able to catch up eventually, but the results won't be as
noticable.
Fix timestamp rounding to allow the correct index to be located.
The issue was that scaling from GStreamer time format to mov time format was
rounding down causing the timestamp of the newsegment event received after a
flushing keyframe seek to find the sample index before the one it should
causing further backward seeking to the keyframe prior until no rounding error
occurred.
Rounding up when scaling to mov format has the desired effect, and it is
not clear whether just the _round () variant would be sufficient.
Fixes bug #619105
Add webm typefinder just for the release, so webm works for
people whose distros don't patch gst-plugins-base as well.
We'll remove this again after the release.
In this day and age this should be safe. There's otherwise a risk people
will be creating unneccessarily big WebM files as they can't use
SimpleBlock in v1.
The original plan was to let WebM v1 be the same as Matroska v2 (with
extra constraints), but for simplicity it was decided to handle the
versions equally, such that e.g. SimpleBlock is only allowed in WebM v2.
Failure to do this for corrupt input can cause a subbuffer bigger
than the actual buffer to be created, quickly leading to segfault.
Test case:
bug_s222005751_r0.001____memcpy.webm
The comment says this cannot happen, but it did and I don't know
why. This is not the correct fix, needs investigation. Test case:
bug_s555010094_r0.0005:0.008____IA__g_assertion_message_expr.webm
This was triggering an UTF-8 assertion in gst_caps_set_simple for
corrupt files with garbage as codec id. Test case:
gstreamer_error_trying_to_set_invalid_utf8_as_codec_id.webm
Old gst_ebml_read_ascii renamed to gst_ebml_read_string, also used by
gst_ebml_read_utf8. Unlike for UTF-8, failure to validate is an error,
as gst_ebml_read_ascii is used for reading doctype and codec id and we
might just as well give up early in those cases.
Because GstMatroskaTrackContext *stream is set up in the first
SimpleBlock or Block, a rogue CodecState otherwise causes a segfault on
derefencing the NULL pointer. Test case:
bug_s5506167_r0.001____gst_matroska_demux_parse_blockgroup_or_simpleblock.webm
It probably will not be in the final RFC as it is not in RFC 5215 for Vorbis.
If there is a configuration specified, assume it is in-line and if nothing is
specified, assume it is in-band.
https://bugzilla.gnome.org/show_bug.cgi?id=618386
Don't blindly add the durations of incomming buffers to the total queued
duration because it might be invalid. Mark the total queued duration invalid
when we receive an invalid incomming timestamp because that's when we lose track
of the total queued duration.
Fixes#618324
Add a new config-interval property to instruct the payloader to insert
configuration headers at periodic intervals in the stream
(when a keyframe is countered).