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").
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.