Commit Graph

406 Commits

Author SHA1 Message Date
Alex Converse 7181c4edee cosmetics: Remove extra newlines at EOF 2012-01-27 17:19:09 -08:00
Anton Khirnov adad5b88f8 lavf: remove disabled FF_API_RTSP_URL_OPTIONS cruft 2012-01-27 10:52:43 +01:00
Anton Khirnov 6e9651d106 lavf: remove AVFormatParameters from AVFormatContext.read_header signature 2012-01-27 10:51:57 +01:00
Dmitry Volyntsev 58f0978581 rtsp: Use a random offset for trying to open UDP ports for RTP
This avoids (for all practical cases) the issue of reusing
the same UDP port as for an earlier connection. If the remote
doesn't know the previous session was closed, he might keep
on sending packets to that port. If we always start off trying
to open the same UDP port, we might get those packets intermixed
with the new ones.

This is occasionally an issue when testing RTSP stuff with
DSS, perhaps also with other servers.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-22 01:10:03 +02:00
Martin Storsjö dbb06b8c0d rtsp: Allow specifying the UDP port range via AVOptions
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-22 01:10:02 +02:00
Dmitry Volyntsev bc495bad3d rtsp: Remove a leftover, currently pointless check
This check isn't relevant in the way the code currently works.

Also change a case of if (x == 0) into if (!x).

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-22 01:10:00 +02:00
Jean First 4be386b318 rtsp: Fix compiler warning for uninitialized variable
This one won't ever be used uninitialized in practice, but
the compiler doesn't realize it.

Signed-off-by: Martin Storsjö <martin@martin.st>
2012-01-04 22:15:42 +02:00
Anton Khirnov cd3716b9aa Replace all uses of av_close_input_file() with avformat_close_input(). 2011-12-12 20:34:38 +01:00
Anton Khirnov 3a7f7678eb lavf: deprecate av_close_input_stream().
And remove all its uses.
2011-12-12 20:21:47 +01:00
Martin Storsjö 30266038bd rtsp: Initialize the media_type_mask in the rtp guessing demuxer
The media_type_mask is initialized via AVOptions for the
rtsp and sdp demuxers, but it isn't available as an option
for the rtp guessing demuxer (since it doesn't really make
sense there). Therefore, it must be manually initialized
instead, since a zero value means no media types at all
are accepted.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-12-02 11:52:47 +02:00
Anton Khirnov c3f9ebf743 lavf: make av_set_pts_info private.
It's supposed to be called only from (de)muxers.
2011-11-30 20:34:45 +01:00
Martin Storsjö 2583660664 rtpdec: Add an init function that can do custom codec context initialization
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-30 17:32:18 +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ö 6149485f6c http: Change the chunksize AVOption into chunked_post
The chunksize internal variable has two different uses - for
reading, it's the amount of data left of the current chunk
(or -1 if the server doesn't send data in chunked mode), where
it's only an internal state variable. For writing, it's used
to decide whether to enable chunked encoding (by default), by
using the value 0, or disable chunked encoding (value -1).

This, while consistent, doesn't make much sense to expose
as an AVOption. This splits the usage of the internal variable
into two variables, chunksize which is used for reading (as
before), and chunked_post which is the user-settable option,
with the values 0 and 1, where 1 is default.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-10 13:21:26 +02:00
Martin Storsjö 196bf28c5d rtsp: Set http custom headers via the AVOption
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-10 10:51:35 +02:00
Martin Storsjö 4b3dc857e4 rtsp: Discard the dynamic handler, if it has an alloc function which failed
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-07 11:23:56 +02:00
Reimar Döffinger bb3244dee2 Replace all usage of strcasecmp/strncasecmp
All current usages of it are incompatible with localization.
For example strcasecmp("i", "I") != 0 is possible, but would
break many of the places where it is used.

Instead use our own implementations that always treat the data
as ASCII.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-06 11:52:57 +02:00
Martin Storsjö d450cc4f4a rtsp: Disable chunked http post through AVOptions
This avoids having to use a private function.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-05 16:53:58 +02:00
John Brooks f011fcd67e rtsp: add allowed_media_types option
Streams from RTSP or SDP that do not match an allowed type will
be skipped entirely, which allows video-only or audio-only
streaming from servers that provide both.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-02 21:37:46 +02:00
Anton Khirnov 84ad31ff18 lavf: replace av_new_stream->avformat_new_stream part II.
Manual replacements are done in this commit.

In many cases, the id is some constant made up number (e.g. 0 for video
and 1 for audio), which is then not used in the demuxer for anything.
Those ids are removed.
2011-10-19 17:02:11 +02:00
Martin Storsjö 51369f2891 rtsp: Expose the flag options via private AVOptions for sdp and rtp, too
This allows setting the filter_src option for these demuxers, too,
which wasn't possible at all before (where the option only was set
via URL parameters for RTSP).

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-10-17 22:02:31 +03:00
Martin Storsjö 3a6765fb5d rtsp: Make the rtsp flags avoptions set via a define
This helps sharing these options with the sdp and rtp demuxers.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-10-17 22:02:30 +03:00
Martin Storsjö 9867aea524 rtsp: Remove the separate filter_source variable
Read it as a flag from the flags field instead.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-10-17 19:57:49 +03:00
Martin Storsjö eca4850c6d rtsp: Accept options via private avoptions instead of URL options
Eventually, the old way of passing options by adding
stuff to the URL can be dropped.

This avoids having to tamper with the user-specified URL to
pass options on the transport mode. This also works better
with redirects, since the options don't need to be parsed out
from the URL.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-10-17 19:57:48 +03:00
Martin Storsjö 2c9aa0247d rtsp: Simplify AVOption definitions
Use defines for shortening common parts, omit the .dbl named
initializer (since it's the first element in the union).

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-10-17 19:57:47 +03:00
Martin Storsjö 17fff881e7 rtsp: Merge the AVOption lists
This eases adding options that are common for both. The
AV_OPT_FLAG_EN/DECODING_PARAM still indicates whether they belong
to the muxer or demuxer.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-10-17 19:57:45 +03:00
Martin Storsjö 76b0d03d82 rtsp: Request that dynamic rate is disabled
DSS enables this automatically if streaming VOD over TCP. If
enabled, the server feeds packets faster than realtime, screwing
up RTCP NTP based timestamps.

Also, DSS doesn't indicate that this was indicated, if it was
enabled automatically (although if it was requested to be enabled,
a header saying that it was enabled is added, but this isn't
added if it is enabled automatically), making it even harder
to detect and work around properly without explicitly asking
for it to be disabled(/enabled, if we were able to support it).

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-10-12 14:48:47 +03:00
Martin Storsjö 30eae32530 rtsp: Parse the x-Accept-Dynamic-Rate header
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-10-12 14:48:45 +03: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 76e25dbca6 rtsp: remove disabled code 2011-07-18 18:22:02 +02:00
Anton Khirnov dfc2c4d900 lavf: use designated initialisers for all (de)muxers.
It's more readable and less prone to breakage.
2011-07-17 06:58:37 +02:00
Mans Rullgard 0ebcdf5cda Do not include mathematics.h in avutil.h
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-07-03 21:42:06 +01:00
Diego Biurrun f75e3da535 RTSP: Doxygen comment cleanup
Do not use Doxygen for comments that apply to specific implementation
details; merge some duplicated Doxygen comment blocks.
2011-07-03 22:33:22 +02:00
Martin Storsjö d840733937 rtsp: Don't pass string pointer as format string to ff_url_join
In this case, the string that was passed couldn't contain
user-defined data and thus there was no risk for injection
bugs, but it's safer this way, if we later change the
content of the options string.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-06-16 17:40:28 +03:00
Anton Khirnov d2d67e424f Remove all uses of now deprecated metadata functions. 2011-06-08 07:43:45 +02:00
Diego Biurrun f190f676bc Replace custom DEBUG preprocessor trickery by the standard one. 2011-06-03 00:44:06 +02:00
Ilya 4515f9b58a rtsp: use strtoul to parse rtptime and seq values.
strtol could return negative values, leading to various error messages,
mainly "non-monotonically increasing dts".

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-05-24 19:11:28 +02:00
Martin Storsjö 0b4949b518 rtsp: Only do keepalive using GET_PARAMETER if the server supports it
This is more like what VLC does. If the server doesn't mention
supporting GET_PARAMETER in response to an OPTIONS request,
VLC doesn't send any keepalive requests at all. After this patch,
libavformat will still send OPTIONS keepalives if GET_PARAMETER
isn't explicitly said to be supported.

Some RTSP cameras don't support GET_PARAMETER, and will
close the connection if this is sent as keepalive request
(but support OPTIONS just fine, but probably don't need any
keepalive at all). Some other cameras don't support using
OPTIONS as keepalive, but require GET_PARAMETER instead.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-05-11 10:42:34 +03:00
Martin Storsjö 9261e6cf3f rtp: Rename the open/close functions to alloc/free
This avoids clashes if we internally want to override the global
open function.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-24 00:05: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 f87b1b373a avio: AVIO_ prefixes for URL_ open flags. 2011-04-07 18:07:16 +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 dce3756459 avio: make url_read_complete() internal. 2011-04-04 17:45:20 +02:00
Anton Khirnov bc371aca46 avio: make url_read() 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 62eaaeacb5 avio: make url_connect internal. 2011-04-04 17:45:20 +02:00