Since all URLContexts have the same AVOptions, such AVOptions
will be applied on the outermost context only and removed from the
dict, while they probably make sense on all contexts.
This makes sure that rw_timeout gets propagated to the innermost
URLContext (to make sure it gets passed to the tcp protocol, when
opening a http connection for instance).
Alternatively, such matching options would be kept in the dict
and only removed after the ffurl_connect call.
Signed-off-by: Martin Storsjö <martin@martin.st>
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.
Only the upper 2 bits of the first byte are known to be
a fixed value.
The lower bits in the first byte of a RTP packet could be set
if the input is from another RTP packetizers than libavformat's,
but for RTCP packets, they would also be set when sending RTCP RR
packets, triggering false warnings about incorrect input format
to the protocol.
Signed-off-by: Martin Storsjö <martin@martin.st>
Tell the user that the RTP muxer needs to be used to packetize
the data - using the RTP protocol on its own isn't enough.
Signed-off-by: Martin Storsjö <martin@martin.st>
IPPROTO_IPV6 is unrelated here (it's only used in udp.c for
multicast sockopts), check for support for the sockaddr_in6
struct itself.
Signed-off-by: Martin Storsjö <martin@martin.st>
If we've received packets on the same socket before, the return
packets are sent to that address. If we've only received packets
on the other socket, try to guess the source port for the other
one assuming the basic +1/-1 logic.
Signed-off-by: Martin Storsjö <martin@martin.st>
Move the sources documentation up below the marker for deprecated
otpions. Also mention the new block parameter, that was added
in 749722209.
Signed-off-by: Martin Storsjö <martin@martin.st>
A separate rtcp port can already be set when opening the rtp
protocol normally, but when doing port setup as in RTSP (where
we first need to open the local ports and pass them to the peer,
and only then receive the remote peer port numbers), we didn't
check the same url parameter as in the normal open routine.
Signed-off-by: Martin Storsjö <martin@martin.st>
I doubt that anyone ever would try to send a 1 byte packet
via the RTP protocol, but check just in case - it shouldn't
crash at least.
Signed-off-by: Martin Storsjö <martin@martin.st>
If another peer is sending unicast packets to the same port that
we are listening on, those packets can end up being received despite
using source specific multicast. For those cases, manually check the
source address of received packets against the intended source address.
This only handles the case when the source list is one single IP
address for now, which probably is the most common case.
Based on a patch by Ed Torbett.
Signed-off-by: Martin Storsjö <martin@martin.st>
Blocking/exclusion is not supported yet.
The rtp protocol parameter takes the same form as the existing
sources parameter for the udp protocol.
Signed-off-by: Martin Storsjö <martin@martin.st>
This definition is in two files, since the definitions will move
to the private header at the next bump.
Signed-off-by: Martin Storsjö <martin@martin.st>
This simplifies the open functions by avoiding one function
call that needs error checking, reducing the amount of
extra bulk code.
Signed-off-by: Martin Storsjö <martin@martin.st>
This helps catching cases where the format string doesn't
match what is passed in, or injection bugs where user data
is passed in as format string.
Signed-off-by: Martin Storsjö <martin@martin.st>
Make AVIO_FLAG_ access constants work as flags, and in particular fix
the behavior of functions (such as avio_check()) which expect them to
be flags rather than modes.
This breaks API.
Functions interrupted by url_interrupt_cb should not be restarted.
Therefore using AVERROR(EINTR) was wrong, as it did not allow to distinguish
when the underlying system call was interrupted and actually needed to be
restarted.
This fixes roundup issues 2657 and 2659 (ffplay not exiting for streamed
content).
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Map EAGAIN and EINTR from ff_neterrno to the normal AVERROR()
error codes. Provide fallback definitions of other errno.h network
errors, mapping them to the corresponding winsock errors.
This eases catching these error codes in common code, without having
to distinguish between FF_NETERRNO(EAGAIN) and AVERROR(EAGAIN).
This fixes roundup issue 2614, unbreaking blocking network IO on
windows.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>