We haven't had a stable release since the packet_gap addition, so probably it
is worth reworking the option to something that makes more sense to the end
user. Also add burst_bits option to specify maximum length of bit bursts.
Signed-off-by: Marton Balint <cus@passwd.hu>
Since d607861, service can not be NULL, only "0".
An UDP address with neither local port nor address leaves both
service and node to their default value, and POSIX specifies
that they are not allowed to be both NULL; "0" is equivalent
to an unspecified port for all currently known protocols.
Fix CID 1341570.
This fixes partially completed send()
Avoids holding the mutex during send()
fixes race conditions in error handling
removes copied non thread specific blocking code
Fixes deadlocks on closure
Fixes data loss on closure
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit enables sending UDP packets in a background thread with specified delay.
When sending packets without a delay some devices with small RX buffer
( MAG200 STB, for example) will drop tail packets in bursts causing
decoding errors.
To use it specify "fifo_size" with "packet_gap" .
The output url will looks like udp://xxx:yyy?fifo_size=<output fifo
size>&packet_gap=<delay in usecs>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Instead of a linked list constructed at av_register_all(), store them
in a constant array of pointers.
Since no registration is necessary now, this removes some global state
from lavf. This will also allow the urlprotocol layer caller to limit
the available protocols in a simple and flexible way in the following
commits.
Glibc 2.20 onwards generates a deprecation warning for usage of _BSD_SOURCE and _SVID_SOURCE.
The solution from man feature_test_macros is to define both _DEFAULT_SOURCE and the old macros.
This solution is on the lines of the one in commit af1818276e.
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Add a missing AVClass member, check whether localaddr is null.
(Previously, localaddr was always a local stack buffer, while it
now also can be an avoption string which can be null.)
This fixes crashes when not passing any localaddr parameter, since
66028b7ba.
Signed-off-by: Martin Storsjö <martin@martin.st>
By appending `?dscp=26` to the URL, IP packets will be classified as
AF31 (assured forwarding for multimedia flows with low probability of
loss). On congested network, this allows a user to assign priorities to
flows.
Signed-off-by: Vincent Bernat <vincent@bernat.im>
Use the required socket option SO_BROADCAST to be able to stream to a broadcast
address.
Prior to the patch, trying to stream to a broadcast address was resulting to the
following error:
av_interleaved_write_frame(): Permission denied
The patch has been tested with:
ffmpeg -f v4l2 -framerate 30 -input_format yuyv422 -video_size 640x480 -i /dev/video0 \
-c:v libx264 -profile:v high -preset ultrafast -tune zerolatency -b:v 500k -pix_fmt yuv420p \
-f mpegts udp://192.168.1.255:5004?broadcast=1
I have added an option to let the user explicitly request broadcast in order to avoid
ffmpeg to broadcast unintentionally.
Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
When joining multicast groups, ffmpeg was using INADDR_ANY as interface address
which leads to enabling the multicast group on the interface with "default gateway".
Often multicast traffic is received over dedicated interface, which scenario ffmpeg was
unable to handle. With this patch, ffmpeg will enable multicast group to the interfaces
configured with address specified in &localaddr= parameter of udp:// URL. To avoid
loacal_addr resolve at udp_close(...) the UDPContext structure was extended with
struct sockaddr_storage local_addr_storage member, which is populated in udp_open(..)
and passed to udp_join_multicast_group() and udp_leave_multicast_group().
Signed-off-by: Stoian Ivanov <s.ivanov@teracomm.bg>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This allows us to explicitly fail if the caller tried to set
both inclusions and exclusions at the same time.
Signed-off-by: Martin Storsjö <martin@martin.st>
Previously this only allowed literal IP addresses. When these
are conveyed in a SDP file as in RFC4570, host names are allowed
as well.
Signed-off-by: Martin Storsjö <martin@martin.st>
This updated version does not deviate from previous behavior on default value of 'buffer_size'
I skipped porting 'sources', 'block' options for now as they're parsed seriously. So i added TODO remarks.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This patch accepts 'timeout' option for input mode only. As far as i know, UDP output cannot introduce delays.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This happens with for example mplayer.
Fixing it in ffmpeg allows new ffmpeg to be compiled with older mplayer
which would not be possible if the fix was just in mplayer.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This heaader is required for close() for sockets in network
code. For winsock, the equivalent function is defined in the
winsock2.h header.
This avoids having the HAVE_UNISTD_H in all files dealing with
raw sockets.
Signed-off-by: Martin Storsjö <martin@martin.st>