Commit Graph

118 Commits

Author SHA1 Message Date
Diego Biurrun ec4f04da1a avformat: Mark argument in av_{i|o}format_next/ffurl_protocol_next as const 2014-07-26 14:51:16 -07:00
Martin Storsjö 0c5f839693 lavf: Remove a now useless parameter to ffurl_register_protocol
This was added in 9b07a2dc02 as an ABI hack to allow older
code built with lavf 52 to register protocols even if the size
of the URLProtocol struct was increased. Later, registering
protocols from outside of lavf was removed and this workaround
isn't needed any longer since lavf 53.

This removes an unchecked malloc and a memory leak for the cases
when this workaround actually was used - which it hasn't since
lavf 53.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-10-30 09:53:48 +02:00
Derek Buitenhuis 25c7db7cc9 avio: Check for memory allocation failure of private data
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2013-10-29 11:40:15 +00:00
Luca Barbato 53151723e3 avio: K&R formatting cosmetics 2013-10-28 00:04:50 +01:00
Luca Barbato ea71aafd68 avio: Use AVERROR_PROTOCOL_NOT_FOUND
When the protocol is missing ffurl_alloc() should return
AVERROR_PROTOCOL_NOT_FOUND instead of AVERROR(ENOENT).

Bug-Id: 577
CC: libav-stable@libav.org
2013-10-21 15:55:20 +02:00
Michael Niedermayer 5d876be87a avio: Handle AVERROR_EOF in the same way as the return value 0
This makes sure the ffurl_read_complete function actually
returns the number of bytes read, as the documentation of the
function says, even if the underlying protocol uses AVERROR_EOF
instead of 0.

Signed-off-by: Martin Storsjö <martin@martin.st>
2013-07-07 13:30:01 +03:00
Mans Rullgard 4521645b1a avio: fix pointer type mismatches in avio_enum_protocols()
Signed-off-by: Mans Rullgard <mans@mansr.com>
2012-10-27 13:43:44 +01: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 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>
2012-06-22 17:15:36 +01:00
Samuel Pitoiset 32d545e0a4 avio: Add a function for signalling end of reading/writing
Signed-off-by: Martin Storsjö <martin@martin.st>
2012-05-22 23:16:41 +03:00
Alex Converse 7181c4edee cosmetics: Remove extra newlines at EOF 2012-01-27 17:19:09 -08:00
Anton Khirnov 374e469b8d lavf: remove disabled FF_API_OLD_INTERRUPT_CB cruft 2012-01-27 10:52:43 +01:00
Anton Khirnov 2439f2ca82 lavf: remove disabled FF_API_OLD_AVIO cruft 2012-01-27 10:52:42 +01:00
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>
2012-01-05 23:56:56 +02:00
Martin Storsjö 45f511ece7 avio: Mark the old interrupt callback mechanism as deprecated
Prepare for removing it at an upcoming major bump.
2011-11-18 11:01:16 +01:00
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>
2011-11-13 13:17:04 +01: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
Anton Khirnov 163a31136d avio: add and use ffurl_protocol_next(). 2011-11-13 13:14:14 +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ö c4a090ddb5 avio: Add an internal utility function for checking the new interrupt callback
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-11-13 13:07:48 +01:00
Martin Storsjö d10361b658 avio: Free URLContext private data allocated via AVOptions
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-11-10 10:51:06 +02:00
Diego Biurrun 124e28847b Remove some stray unnecessary ffmpeg references. 2011-11-02 10:42:54 +01:00
Anton Khirnov f0029cbcf6 lavf: use designated initializers for AVClasses. 2011-05-17 23:01:42 +02:00
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.
2011-05-12 11:41:59 +02:00
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>
2011-04-20 17:00:11 +02: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 7f804085f1 lavf: remove FF_API_URL_CLASS cruft. 2011-04-19 18:31:12 +02:00
Anton Khirnov dcd4a7b62f lavf: remove FF_API_REGISTER_PROTOCOL cruft 2011-04-19 18:28:38 +02:00
Anton Khirnov 4bde56d1af avio: deprecate url_exist in favor of avio_check. 2011-04-13 07:38:18 +02:00
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>
2011-04-13 07:38:15 +02:00
Anton Khirnov cdc6a87f19 avio: deprecate av_protocol_next(). 2011-04-08 17:48:53 +02:00
Anton Khirnov f8270bbf8c avio: add a function for iterating though protocol names. 2011-04-08 17:48:44 +02:00
Anton Khirnov 026e175775 avio: deprecate the typedef for URLInterruptCB
There's no particular reason to pollute the namespace with a typedef for
it.
2011-04-08 07:07:58 +02:00
Anton Khirnov 8e76a19b63 avio: make av_register_protocol2 internal. 2011-04-07 18:11:24 +02:00
Anton Khirnov 80c6e238b0 avio: avio_ prefix for url_set_interrupt_cb. 2011-04-07 18:11:24 +02:00
Anton Khirnov f87b1b373a avio: AVIO_ prefixes for URL_ open flags. 2011-04-07 18:07:16 +02:00
Anton Khirnov 1305d93c42 avio: deprecate av_url_read_seek
It's not used anywhere internally.

Salvage its documentation for ffio_read_seek.
2011-04-05 08:40:27 +02:00
Anton Khirnov fa104e14ab avio: deprecate av_url_read_pause
It's not used anywhere internally.

Salvage its documentation for ffio_read_pause.
2011-04-05 08:39:40 +02:00
Anton Khirnov 727c7aa026 avio: deprecate url_get_filename().
URLContext.filename should be used directly.
2011-04-04 17:45:20 +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 32a97d4630 avio: make url_filesize() 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 58a48c6511 avio: make url_seek() 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