Mans Rullgard
4521645b1a
avio: fix pointer type mismatches in avio_enum_protocols()
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
12 years ago
Michael Niedermayer
a96577df38
avio: fix sizeof argument
...
Fixes CID732284
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
d30351363f
url_alloc_for_protocol: fix use of uninitialized variable
...
Fixes CID703830
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
9a27fd12f3
avio: replace ETIMEDOUT by EIO
...
ETIMEDOUT is not available on all platforms
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Andrey Utkin
7870722592
Add 'rw_timeout' into URLContext
...
If set non-zero, limits duration of retry_transfer_wrapper() loop, thus
affects ffurl_read*(), ffurl_write()
Measured in microseconds.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
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>
13 years ago
Mans Rullgard
896bb0d742
Replace usleep() calls with av_usleep()
...
This reduces the dependency on unistd.h which is not available
on all systems.
Signed-off-by: Mans Rullgard <mans@mansr.com>
13 years ago
Michael Niedermayer
edf96d631c
url: add ffurl_closep() which also sets the context pointer to NULL
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
f89aa6751c
lavf: use av_freep() in ffurl_close()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
f7c89705e4
avio: fix "discards const qualifier from pointer target type" warning
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Samuel Pitoiset
32d545e0a4
avio: Add a function for signalling end of reading/writing
...
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Nicolas George
12eeced8b4
avio: change ffurl_alloc return code.
...
If the designated protocol is not found, return
AVERROR_PROTOCOL_NOT_FOUND instead of AVERROR(ENOENT).
13 years ago
Michael Niedermayer
6679271700
avio: Fix "warning: initialization from incompatible pointer type"
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Alex Converse
7181c4edee
cosmetics: Remove extra newlines at EOF
13 years ago
Anton Khirnov
374e469b8d
lavf: remove disabled FF_API_OLD_INTERRUPT_CB cruft
13 years ago
Anton Khirnov
2439f2ca82
lavf: remove disabled FF_API_OLD_AVIO cruft
13 years ago
Martin Storsjö
acb074301c
avio: Only do implicit network initialization for network protocols
...
The implicit network initialization is set to be removed in the
future, but is kept for compatibility. By not doing the implicit
initialization for non-network protocols, we avoid the warning
about avformat_network_init() not being called for these, where
it really doesn't make much sense.
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Michael Niedermayer
ad9e0ed170
avio: fix handling of , in urls
...
Fixes Ticket805
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
58030fc6c8
avio: Fix handling of filenames that contain :
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
6161c41817
avio: Support private options in URLProtocols
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
c12e1bd1bc
avio: allow any chars in protocols
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Martin Storsjö
45f511ece7
avio: Mark the old interrupt callback mechanism as deprecated
...
Prepare for removing it at an upcoming major bump.
13 years ago
Martin Storsjö
1dee0aca74
avio: add avio_open2, taking an interrupt callback and options
...
The interrupt callback has to be passed in during opening (setting it
after opening isn't enough), since a blocking open couldn't be
interrupted otherwise.
Options are passed down to procotols and also need to be available
during open() in most cases.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
13 years ago
Anton Khirnov
ddffc2fdc3
avio: add support for passing options to protocols.
...
Not used anywhere yet, support for passing options from avio_open() will
follow.
13 years ago
Anton Khirnov
163a31136d
avio: add and use ffurl_protocol_next().
13 years ago
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.
13 years ago
Martin Storsjö
9957cdbfd5
avformat: Use ff_check_interrupt
13 years ago
Martin Storsjö
c4a090ddb5
avio: Add an internal utility function for checking the new interrupt callback
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
13 years ago
Martin Storsjö
d10361b658
avio: Free URLContext private data allocated via AVOptions
...
Signed-off-by: Martin Storsjö <martin@martin.st>
13 years ago
Michael Niedermayer
728e6d979b
avio: print a warning from ffurl_alloc() if no protocols are allocated.
...
Fixes Ticket618
Based on code by teratorn
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Diego Biurrun
124e28847b
Remove some stray unnecessary ffmpeg references.
13 years ago
Reimar Döffinger
06a9da7365
Simplify code and avoid compiler warning about incompatible types.
14 years ago
Anton Khirnov
f0029cbcf6
lavf: use designated initializers for AVClasses.
14 years ago
Diego Biurrun
046f081b46
configure: Do not unconditionally add -D_POSIX_C_SOURCE to CPPFLAGS.
...
Adding _POSIX_C_SOURCE to CPPFLAGS globally produces all sorts of problems
since it causes certain system functions to be hidden on some (BSD) systems.
The solution is to only add the flag on systems that really require it, i.e.
glibc-based ones.
This change makes BSD systems compile out-of-the-box without the need for
adding specific flags manually. It also allows dropping a number of flags
set manually on a file-per-file basis, but were only present to work around
breakage introduced by the presence of _POSIX_C_SOURCE.
Also add _XOPEN_SOURCE to CPPFLAGS for glibc systems. We use XSI extensions
in several places already, so it is preferable to define it globally instead
of littering source files with individual #defines only needed for glibc.
14 years ago
Anton Khirnov
4a7a1b7def
lavf: use designated initializers for AVClasses.
14 years ago
Michael Niedermayer
e3323a1cbd
Fix some passing argument from incompatible pointer type warnings.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
14 years ago
Nicolas George
b9553cf4b8
avio: fix AVIO_FLAG_READ/WRITE test in ffurl_*.
...
Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
14 years ago
Martin Storsjö
26f6b8c571
avio: Fix sanity checks in ffurl_read*
...
This fixes e.g. reading data over HTTP, where the underlying
socket is set to read/write.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
14 years ago
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.
14 years ago
Anton Khirnov
7f804085f1
lavf: remove FF_API_URL_CLASS cruft.
14 years ago
Anton Khirnov
dcd4a7b62f
lavf: remove FF_API_REGISTER_PROTOCOL cruft
14 years ago
Anton Khirnov
4bde56d1af
avio: deprecate url_exist in favor of avio_check.
14 years ago
Stefano Sabatini
175389c854
avio: add avio_check()
...
The new function is more flexible than url_exist(), as it allows to
specify which access flags to check, and does not require an explicit
open of the checked resource.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
14 years ago
Anton Khirnov
cdc6a87f19
avio: deprecate av_protocol_next().
14 years ago
Anton Khirnov
f8270bbf8c
avio: add a function for iterating though protocol names.
14 years ago
Anton Khirnov
026e175775
avio: deprecate the typedef for URLInterruptCB
...
There's no particular reason to pollute the namespace with a typedef for
it.
14 years ago
Anton Khirnov
8e76a19b63
avio: make av_register_protocol2 internal.
14 years ago
Anton Khirnov
80c6e238b0
avio: avio_ prefix for url_set_interrupt_cb.
14 years ago
Anton Khirnov
f87b1b373a
avio: AVIO_ prefixes for URL_ open flags.
14 years ago
Anton Khirnov
1305d93c42
avio: deprecate av_url_read_seek
...
It's not used anywhere internally.
Salvage its documentation for ffio_read_seek.
14 years ago