Martin Storsjö
53c25ee073
aviobuf: Discard old buffered, previously read data in ffio_read_partial
...
This makes RTP custom IO work properly with pure read-only
AVIOContexts as well.
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Martin Storsjö
a0b7e28907
aviobuf: Partial support for reading in read/write contexts
...
So far, aviocontexts are used either in pure-read or pure-write
mode - full read/write mode doesn't work well (and implementing it
is a much larger, not totally trivial change).
This patch allows using avio_read and ffio_read_partial on
read/write aviocontexts, where the read operations are passed
through directly unbuffered, while writes are buffered as usual.
This is enough to support the operations needed by packet based
data transfer like in udp/rtp, where aviocontext is the only
public API for hooking up custom IO.
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Diego Biurrun
511cf612ac
miscellaneous typo fixes
12 years ago
Luca Barbato
1dd1c1c884
avio: K&R cosmetic formatting
12 years ago
Martin Storsjö
b760ffdd07
aviobuf: Remove a senseless ifdef in avio_seek
...
This seemed to assume that one never used writing avio unless
muxers or networking was enabled.
This ifdef is a remnant since 8fa641f8
.
Signed-off-by: Martin Storsjö <martin@martin.st>
12 years ago
Luca Barbato
b522000e9b
avio: introduce avio_closep
12 years ago
Stefano Sabatini
5d1203f063
avio: flush the internal buffer in avio_close()
...
This is consistent with stdio, and thus what people would naturally
expect.
12 years ago
Luca Barbato
3093939077
avio: make avio_close NULL the freed buffer
12 years ago
Luca Barbato
e1e146a2d1
avio: make avio_close(NULL) a no-op
...
Its behaviour in line with ffurl_close(NULL).
13 years ago
Anton Khirnov
2439f2ca82
lavf: remove disabled FF_API_OLD_AVIO cruft
13 years ago
Diego Biurrun
3dc99a18d4
cosmetics: drop some pointless parentheses
13 years ago
Janne Grunau
a2d1d21629
avio: exit early in fill_buffer without read_packet
...
Fixes an invalid free() with ass in avi. The sample in bug 98 passes
parts of AVPacket.data as buffer for the AVIOContext. Since the packet
is quite large fill_buffer tries to reallocate the buffer before doing
nothing. Fixes bug 98.
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
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
Diego Biurrun
124e28847b
Remove some stray unnecessary ffmpeg references.
13 years ago
Alex Converse
ab2940691b
avio: Check for invalid buffer length.
13 years ago
Anton Khirnov
c3bec4cd13
avio: don't replicate avio_alloc_context functionality.
14 years ago
Can Wu
9e2dabed4a
avio: check AVIOContext malloc failure
...
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
468644f6c1
lavf: remove FF_API_URL_RESETBUF cruft
14 years ago
Anton Khirnov
ff1ec0c3f8
avio: undeprecate av_url_read_fseek/fpause under nicer names
...
It seems their replacements won't be ready anytime soon.
14 years ago
Anton Khirnov
f87b1b373a
avio: AVIO_ prefixes for URL_ open flags.
14 years ago
Anton Khirnov
668438a31e
avio: always compile dyn_buf functions
...
Fixes build with --disable-muxers --disable-network.
Thanks to Hendrik Leppkes for noticing.
14 years ago
Anton Khirnov
5958df341d
avio: deprecate url_max_packet_size().
...
URLContext.max_packet_size should be used directly.
14 years ago
Anton Khirnov
e52a9145c8
avio: make url_close() internal.
14 years ago
Anton Khirnov
58a48c6511
avio: make url_seek() internal.
14 years ago
Anton Khirnov
925e908bc7
avio: make url_write() internal.
14 years ago
Anton Khirnov
bc371aca46
avio: make url_read() internal.
14 years ago
Anton Khirnov
0589da0aa5
avio: make url_open() internal.
14 years ago
Anton Khirnov
8bea72f7eb
avio: simplify url_open_dyn_buf_internal by using avio_alloc_context()
14 years ago
Anton Khirnov
724f6a0fa4
avio: make url_fdopen internal.
...
The unbuffered URLContext API will be made private, so there's no point
in this function being public.
14 years ago
Anton Khirnov
403ee835e7
avio: make url_open_dyn_packet_buf internal.
...
It doesn't look fit to be a part of the public API.
Adding a temporary hack to ffserver to be able to use it, should be
cleaned up when somebody is up for it.
14 years ago
Anton Khirnov
6dc7d80de7
avio: avio_ prefix for url_close_dyn_buf
14 years ago
Anton Khirnov
b92c545282
avio: avio_ prefix for url_open_dyn_buf
14 years ago
Anton Khirnov
8978fedaee
avio: introduce an AVIOContext.seekable field
...
Use it instead of url_is_streamed and AVIOContext.is_streamed.
14 years ago
Anton Khirnov
b64030f26d
avio: make get_checksum() internal.
14 years ago
Anton Khirnov
4c4427a75d
avio: make init_checksum() internal.
14 years ago
Anton Khirnov
933e90a69a
avio: make av_url_read_fseek/fpause internal.
...
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14 years ago
Anton Khirnov
8d9769a77b
avio: deprecate url_fileno
...
It's an evil hack that assumes an AVIOContext is always based on top of
an URLContext.
It's also not used anywhere.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14 years ago
Mans Rullgard
2912e87a6c
Replace FFmpeg with Libav in licence headers
...
Signed-off-by: Mans Rullgard <mans@mansr.com>
14 years ago
Anton Khirnov
b7f2fdde74
avio: rename put_flush_packet -> avio_flush
...
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14 years ago
Anton Khirnov
35f1023592
avio: deprecate url_close_buf
...
It's not used anywhere and its return value looks broken.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14 years ago
Anton Khirnov
83fddaeb81
avio: deprecate url_open_buf
...
It's only used in one place and does the same thing as
avio_alloc_context.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14 years ago
Anton Khirnov
eda4cf92d7
avio: always compile avio_printf, rather than on CONFIG_MUXERS
...
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14 years ago
Anton Khirnov
d9d86e00b2
avio: avio_ prefix for url_fprintf
...
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14 years ago
Anton Khirnov
59f65d9579
avio: make url_setbufsize internal.
...
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14 years ago
Anton Khirnov
4839c192de
lavf: move ff_get_v from avio.h to avio_internal.h
...
And rename it to ffio_read_varlen.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14 years ago
Anton Khirnov
3e68b3ba7b
avio: deprecate url_ferror
...
AVIOContext.error should be used directly instead.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14 years ago
Anton Khirnov
66e5b1df36
avio: deprecate url_feof
...
AVIOContext.eof_reached should be used directly instead.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
14 years ago