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.
This allows set_caps to succeed if caps change in a way that
would not modify the format we're getting from the hardware.
Otherwise if not in NULL state, setting caps would fail
with EBUSY.
With this change, in some cases it's OK to go PLAYING->READY->PLAYING
rather than PLAYING->NULL->PLAYING to avoid a time-consuming close
and reopen of the device.
Fixes#621723
Fixes#621723 (partially)
set_caps can fail if the video device is running, in that case
setting its format leads to EBUSY.
If set_caps fails then we will not have set up the buffer pool
(it will be NULL) which leads to a crash when we try to pull
buffers. If we fail the negotiate on set_caps failure, then we
won't go to playing state and won't crash.
This is a small improvement. Of course, a nicer fix would
be to make set_caps work in the case where the format is
unchanged. If the format has changed, failing is
probably correct because we need to close the device
(go to NULL state) in order to set caps.
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").