Commit Graph

89 Commits

Author SHA1 Message Date
Martin Storsjö 1851e1d05d rtpproto: Check the size before reading buf[1]
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>
2013-08-01 09:41:21 +03:00
Martin Storsjö b7e6da988b rtpproto: Move rtpproto specific function declarations to a separate header
Mixing these with the rtp depacketizer functions in rtpdec.h is
no good.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-31 21:12:34 +03:00
Martin Storsjö 892b0be1df rtpproto: Simplify the rtp_read function by looping over the fds
This avoids having duplicate code where only the fd parameter
differs.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-31 21:12:34 +03:00
Martin Storsjö 7531588fff rtpproto: Remove a misplaced comment
The fdset is a pollfd array nowadays, and it is already populated
at this point.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-31 21:12:34 +03:00
Martin Storsjö 54e03ff6af rtpproto: Support nonblocking reads
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-31 21:12:34 +03:00
Ed Torbett 7497222090 rtpproto: Support more than one SSM include address, support excludes
Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-29 22:58:55 +03:00
Martin Storsjö 4d97ca040b rtpproto: Check the source IP if one single source has been specified
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>
2013-07-19 12:02:09 +03:00
Ed Torbett 336353deaa rtpproto: Support IGMPv3 source specific multicast inclusion
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>
2013-07-19 12:00:49 +03:00
Martin Storsjö 29d2595ad7 rtpproto: Remove unused defines
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-12-12 16:01:24 +02:00
Jordi Ortiz a2dd4f7780 rtp: remove ff_rtp_get_rtcp_file_handle().
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-17 22:15:56 +03:00
Jordi Ortiz d6b9da1178 avio: add (ff)url_get_multi_file_handle() for getting more than one fd
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-08-17 22:14:30 +03:00
Mans Rullgard 6501dcfb5e Remove unnecessary inclusions of [sys/]time.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-20 11:46:46 +01:00
Mans Rullgard 4e5a514813 lavf: remove unnecessary inclusions of unistd.h
These files do not use anything provided by unistd.h.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-06-20 11:46:30 +01:00
Martin Storsjö 298a587f44 rtp: Factorize the check for distinguishing RTCP packets from RTP
The binary doesn't change after this patch.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-02-16 17:45:33 +01:00
Martin Storsjö 32b83aeec1 avio: Add an URLProtocol flag for indicating that a protocol uses network
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>
2012-01-05 23:56:52 +02:00
Martin Storsjö 7e58050590 proto: Use .priv_data_size to allocate the private context
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>
2011-12-01 13:47:26 +02:00
Anton Khirnov ddffc2fdc3 avio: add support for passing options to protocols.
Not used anywhere yet, support for passing options from avio_open() will
follow.
2011-11-13 13:14:39 +01:00
Martin Storsjö 6f1b7b3944 avio: Add an AVIOInterruptCB parameter to ffurl_open/ffurl_alloc
Change all uses of these function to pass the relevant
callback on.
2011-11-13 13:12:17 +01:00
Martin Storsjö 9957cdbfd5 avformat: Use ff_check_interrupt 2011-11-13 13:08:13 +01:00
Martin Storsjö bfc6db4477 rtpdec: Add ff_ prefix to all nonstatic symbols
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-10-12 14:48:12 +03:00
Diego Biurrun 4cc843facd rtp: remove disabled code 2011-07-21 23:03:10 +02:00
Martin Storsjö 9abbe8cc13 Use av_printf_format to check the usage of printf style functions
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>
2011-06-23 20:17:46 +03:00
Martin Storsjö f9a6cfdd04 rtpproto: Remove an unused variable
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-05-09 19:14:37 +03:00
Stefano Sabatini 59d96941f0 avio: remove AVIO_* access symbols in favor of new AVIO_FLAG_* symbols
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.
2011-04-19 19:47:58 +02:00
Anton Khirnov f35ff97f2e lavf: use designated initializers for all protocols
This is more readable and makes it easier to reorder URLProtocol
members.
2011-04-08 11:08:26 +02:00
Anton Khirnov f87b1b373a avio: AVIO_ prefixes for URL_ open flags. 2011-04-07 18:07:16 +02:00
Anton Khirnov 5958df341d avio: deprecate url_max_packet_size().
URLContext.max_packet_size should be used directly.
2011-04-04 17:45:20 +02:00
Anton Khirnov 1869ea03b7 avio: make url_get_file_handle() internal. 2011-04-04 17:45:20 +02:00
Anton Khirnov e52a9145c8 avio: make url_close() internal. 2011-04-04 17:45:20 +02:00
Anton Khirnov 925e908bc7 avio: make url_write() internal. 2011-04-04 17:45:20 +02:00
Anton Khirnov 0589da0aa5 avio: make url_open() internal. 2011-04-04 17:45:20 +02:00
Anton Khirnov 4ec153bb66 avio: make udp_set_remote_url/get_local_port internal. 2011-03-23 17:32:13 +01:00
Mans Rullgard 2912e87a6c Replace FFmpeg with Libav in licence headers
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-03-19 13:33:20 +00:00
Nicolas George c76374c6db Use AVERROR_EXIT with url_interrupt_cb.
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>
2011-03-15 08:09:19 -04:00
Martin Storsjö 28c4741a66 libavformat: Remove FF_NETERRNO()
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>
2011-02-23 07:21:31 -05:00
Anton Khirnov ab0287fcbd Move find_info_tag to lavu and add av_ prefix to it
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
2011-02-17 15:35:18 +01:00
Luca Barbato a8475bbdb6 os: replace select with poll
Select has limitations on the fd values it could accept and silently
breaks when it is reached.
2011-01-28 15:45:19 +01:00
Diego Elio Pettenò c6610a216e Prefix all _demuxer, _muxer, _protocol from libavformat and libavdevice.
This also lists the objects from those two libraries as internal (by adding
the ff_ prefix) so that they can then be hidden via linker scripts.
2011-01-26 22:10:09 +00:00
Martin Storsjö babd19ce2e rtpproto: Allow specifying the connect option, passed through to udp
By calling connect on the UDP socket, only packets from the chosen
peer address and port are received on the socket. This is one
solution to issue 1688.

Originally committed as revision 26244 to svn://svn.ffmpeg.org/ffmpeg/trunk
2011-01-06 15:16:09 +00:00
Aurelien Jacobs a178edf298 drop rtp_get_file_handles() which is not part of public API and not used anymore
Originally committed as revision 25556 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-23 16:21:49 +00:00
Aurelien Jacobs fb660f4015 drop rtp_get_local_port() which is not part of public API and not used anymore
Originally committed as revision 25555 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-10-23 16:20:56 +00:00
Martin Storsjö 4a94cfea02 rtpproto: Use a sockaddr_storage instead of a sockaddr_in with recvfrom
Originally committed as revision 25224 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-09-27 16:10:23 +00:00
Josh Allmann 186f1ec5f4 Add rtp_get_rtcp_file_handle function
Patch by Josh Allmann, joshua dot allmann at gmail

Originally committed as revision 24929 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-08-25 17:32:59 +00:00
Josh Allmann 7f3468d392 rtp: Replace hardcoded RTCP packet types with defines
Patch by Josh Allmann, joshua dot allmann at gmail

Originally committed as revision 24912 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-08-25 09:15:31 +00:00
Diego Biurrun 9a58234fea Fix misspelled parameter names in Doxygen documentation.
This fixes one Doxygen warning each.

Originally committed as revision 23970 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-07-02 10:49:29 +00:00
Måns Rullgård f3bfe388b5 Make ff_url_split() public
ff_url_split() is retained as an alias, as it was used by ffserver,
to avoid breaking ABI compatibility with it.

Originally committed as revision 23822 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-06-27 14:16:46 +00:00
Martin Storsjö 27241cbffe Declare the url_write buffer parameter as const
Originally committed as revision 23401 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-06-01 07:46:23 +00:00
Diego Biurrun ba87f0801d Remove explicit filename from Doxygen @file commands.
Passing an explicit filename to this command is only necessary if the
documentation in the @file block refers to a file different from the
one the block resides in.

Originally committed as revision 22921 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-20 14:45:34 +00:00
Luca Barbato 9094d867aa Make rtp protocol obey rfc3550
Originally committed as revision 22906 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-04-19 11:40:45 +00:00
Martin Storsjö cae9a15c98 Don't report EINTR from select as an error, retry select instead
Originally committed as revision 22694 to svn://svn.ffmpeg.org/ffmpeg/trunk
2010-03-26 16:04:38 +00:00