#include <unistd.h>
#include "libavutil/avstring.h"
#include "libavutil/dict.h"
#include "libavutil/opt.h"
#include "os_support.h"
#include "avformat.h"
#include "url.h"
Go to the source code of this file.
Defines | |
#define | URL_SCHEME_CHARS |
Functions | |
URLProtocol * | ffurl_protocol_next (URLProtocol *prev) |
Iterate over all available protocols. | |
const char * | avio_enum_protocols (void **opaque, int output) |
Iterate through names of available protocols. | |
int | ffurl_register_protocol (URLProtocol *protocol, int size) |
Register the URLProtocol protocol. | |
static int | url_alloc_for_protocol (URLContext **puc, struct URLProtocol *up, const char *filename, int flags, const AVIOInterruptCB *int_cb) |
int | ffurl_connect (URLContext *uc, AVDictionary **options) |
Connect an URLContext that has been allocated by ffurl_alloc. | |
int | ffurl_alloc (URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb) |
Create a URLContext for accessing to the resource indicated by url, but do not initiate the connection yet. | |
int | ffurl_open (URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options) |
Create an URLContext for accessing to the resource indicated by url, and open it. | |
static int | retry_transfer_wrapper (URLContext *h, unsigned char *buf, int size, int size_min, int(*transfer_func)(URLContext *h, unsigned char *buf, int size)) |
int | ffurl_read (URLContext *h, unsigned char *buf, int size) |
Read up to size bytes from the resource accessed by h, and store the read bytes in buf. | |
int | ffurl_read_complete (URLContext *h, unsigned char *buf, int size) |
Read as many bytes as possible (up to size), calling the read function multiple times if necessary. | |
int | ffurl_write (URLContext *h, const unsigned char *buf, int size) |
Write size bytes from buf to the resource accessed by h. | |
int64_t | ffurl_seek (URLContext *h, int64_t pos, int whence) |
Change the position that will be used by the next read/write operation on the resource accessed by h. | |
int | ffurl_close (URLContext *h) |
Close the resource accessed by the URLContext h, and free the memory used by it. | |
int | avio_check (const char *url, int flags) |
Return AVIO_FLAG_* access flags corresponding to the access permissions of the resource in url, or a negative value corresponding to an AVERROR code in case of failure. | |
int64_t | ffurl_size (URLContext *h) |
Return the filesize of the resource accessed by h, AVERROR(ENOSYS) if the operation is not supported by h, or another negative value corresponding to an AVERROR error code in case of failure. | |
int | ffurl_get_file_handle (URLContext *h) |
Return the file descriptor associated with this URL. | |
int | ffurl_shutdown (URLContext *h, int flags) |
Signal the URLContext that we are done reading or writing the stream. | |
int | ff_check_interrupt (AVIOInterruptCB *cb) |
Check if the user has requested to interrup a blocking function associated with cb. | |
Variables | |
static URLProtocol * | first_protocol = NULL |
Logging context. | |
static const AVOption | options [] = {{NULL}} |
const AVClass | ffurl_context_class |
static const char * | urlcontext_to_name (void *ptr) |
static void * | urlcontext_child_next (void *obj, void *prev) |
static const AVClass * | urlcontext_child_class_next (const AVClass *prev) |
#define URL_SCHEME_CHARS |
Value:
"abcdefghijklmnopqrstuvwxyz" \ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ "0123456789+-."
Definition at line 196 of file avio.c.
Referenced by ffurl_alloc().
int avio_check | ( | const char * | url, | |
int | flags | |||
) |
Return AVIO_FLAG_* access flags corresponding to the access permissions of the resource in url, or a negative value corresponding to an AVERROR code in case of failure.
The returned access flags are masked by the value in flags.
Definition at line 338 of file avio.c.
Referenced by assert_file_overwrite(), build_feed_streams(), and find_image_range().
const char* avio_enum_protocols | ( | void ** | opaque, | |
int | output | |||
) |
Iterate through names of available protocols.
opaque | A private pointer representing current protocol. It must be a pointer to NULL on first iteration and will be updated by successive calls to avio_enum_protocols. | |
output | If set to 1, iterate over output protocols, otherwise over input protocols. |
Definition at line 87 of file avio.c.
Referenced by avio_enum_protocols(), and opt_protocols().
int ff_check_interrupt | ( | AVIOInterruptCB * | cb | ) |
Check if the user has requested to interrup a blocking function associated with cb.
Definition at line 386 of file avio.c.
Referenced by avformat_find_stream_info(), do_tls_poll(), hls_read(), read_data(), retry_transfer_wrapper(), rtp_read(), and tcp_open().
int ffurl_alloc | ( | URLContext ** | puc, | |
const char * | filename, | |||
int | flags, | |||
const AVIOInterruptCB * | int_cb | |||
) |
Create a URLContext for accessing to the resource indicated by url, but do not initiate the connection yet.
puc | pointer to the location where, in case of success, the function puts the pointer to the created URLContext | |
flags | flags which control how the resource indicated by url is to be opened | |
int_cb | interrupt callback to use for the URLContext, may be NULL |
Definition at line 201 of file avio.c.
Referenced by avio_check(), ffurl_open(), mmsh_open_internal(), and open_input().
int ffurl_close | ( | URLContext * | h | ) |
Close the resource accessed by the URLContext h, and free the memory used by it.
Definition at line 318 of file avio.c.
Referenced by avio_check(), avio_close(), avio_open2(), cache_close(), close_connection(), concat_close(), concat_open(), crypto_close(), ff_rtsp_undo_setup(), ffurl_open(), free_variant_list(), gopher_close(), hls_close(), hls_read(), hls_read_seek(), http_close(), http_open_cnx(), http_seek(), md5_close(), mms_close(), mmsh_close(), mmsh_open_internal(), mmsh_read_seek(), open_input(), read_data(), recheck_discard_flags(), rtmp_close(), rtp_close(), rtp_new_av_stream(), rtp_open(), sap_read_close(), sap_write_close(), tls_close(), and tls_open().
int ffurl_connect | ( | URLContext * | uc, | |
AVDictionary ** | options | |||
) |
Connect an URLContext that has been allocated by ffurl_alloc.
options | A dictionary filled with options for nested protocols, i.e. it will be passed to url_open2() for protocols implementing it. This parameter will be destroyed and replaced with a dict containing options that were not found. May be NULL. |
Definition at line 180 of file avio.c.
Referenced by avio_check(), ffurl_open(), mmsh_open_internal(), and open_input().
int ffurl_get_file_handle | ( | URLContext * | h | ) |
Return the file descriptor associated with this URL.
For RTP, this will return only the RTP file descriptor, not the RTCP file descriptor.
Definition at line 372 of file avio.c.
Referenced by http_get_file_handle(), rtp_open(), rtsp_write_packet(), sap_fetch_packet(), sap_write_header(), and tls_open().
int ffurl_open | ( | URLContext ** | puc, | |
const char * | filename, | |||
int | flags, | |||
const AVIOInterruptCB * | int_cb, | |||
AVDictionary ** | options | |||
) |
Create an URLContext for accessing to the resource indicated by url, and open it.
puc | pointer to the location where, in case of success, the function puts the pointer to the created URLContext | |
flags | flags which control how the resource indicated by url is to be opened | |
int_cb | interrupt callback to use for the URLContext, may be NULL | |
options | A dictionary filled with protocol-private options. On return this parameter will be destroyed and replaced with a dict containing options that were not found. May be NULL. |
Definition at line 235 of file avio.c.
Referenced by avio_open2(), cache_open(), concat_open(), crypto_open(), gopher_open(), hls_read(), http_open_cnx(), md5_close(), mms_open(), open_input(), rtmp_open(), rtp_new_av_stream(), rtp_open(), sap_read_header(), sap_write_header(), and tls_open().
URLProtocol* ffurl_protocol_next | ( | URLProtocol * | prev | ) |
Iterate over all available protocols.
prev | result of the previous call to this functions or NULL. |
Definition at line 36 of file avio.c.
Referenced by avio_enum_protocols(), ffurl_alloc(), and urlcontext_child_class_next().
int ffurl_read | ( | URLContext * | h, | |
unsigned char * | buf, | |||
int | size | |||
) |
Read up to size bytes from the resource accessed by h, and store the read bytes in buf.
Definition at line 283 of file avio.c.
Referenced by cache_read(), concat_read(), crypto_read(), ff_rtmp_packet_read(), ffio_fdopen(), gopher_read(), hls_read(), http_buf_read(), http_getc(), read_data(), sap_fetch_packet(), and sap_read_header().
int ffurl_read_complete | ( | URLContext * | h, | |
unsigned char * | buf, | |||
int | size | |||
) |
Read as many bytes as possible (up to size), calling the read function multiple times if necessary.
This makes special short-read handling in applications unnecessary, if the return value is < size then it is certain there was either an error or the end of file was reached.
Definition at line 290 of file avio.c.
Referenced by ff_rtmp_packet_read(), ff_rtsp_tcp_read_packet(), get_chunk_header(), get_http_header_data(), get_tcp_server_response(), open_input(), read_data_packet(), and rtmp_handshake().
int ffurl_register_protocol | ( | URLProtocol * | protocol, | |
int | size | |||
) |
int64_t ffurl_seek | ( | URLContext * | h, | |
int64_t | pos, | |||
int | whence | |||
) |
Change the position that will be used by the next read/write operation on the resource accessed by h.
pos | specifies the new position to set | |
whence | specifies how pos should be interpreted, it must be one of SEEK_SET (seek from the beginning), SEEK_CUR (seek from the current position), SEEK_END (seek from the end), or AVSEEK_SIZE (return the filesize of the requested resource, pos is ignored). |
Definition at line 308 of file avio.c.
Referenced by cache_seek(), concat_read(), concat_seek(), ffio_fdopen(), ffurl_connect(), and ffurl_size().
int ffurl_shutdown | ( | URLContext * | h, | |
int | flags | |||
) |
Signal the URLContext that we are done reading or writing the stream.
h | pointer to the resource | |
flags | flags which control how the resource indicated by url is to be shutdown |
int64_t ffurl_size | ( | URLContext * | h | ) |
Return the filesize of the resource accessed by h, AVERROR(ENOSYS) if the operation is not supported by h, or another negative value corresponding to an AVERROR error code in case of failure.
Definition at line 357 of file avio.c.
Referenced by concat_open().
int ffurl_write | ( | URLContext * | h, | |
const unsigned char * | buf, | |||
int | size | |||
) |
Write size bytes from buf to the resource accessed by h.
Definition at line 297 of file avio.c.
Referenced by ff_rtmp_packet_write(), ff_rtp_check_and_send_back_rr(), ff_rtp_send_punch_packets(), ffio_fdopen(), gopher_write(), http_connect(), http_send_data(), http_shutdown(), http_write(), md5_close(), rtmp_handshake(), rtp_write(), sap_write_close(), sap_write_packet(), send_command_packet(), and tcp_write_packet().
static int retry_transfer_wrapper | ( | URLContext * | h, | |
unsigned char * | buf, | |||
int | size, | |||
int | size_min, | |||
int(*)(URLContext *h, unsigned char *buf, int size) | transfer_func | |||
) | [inline, static] |
Definition at line 253 of file avio.c.
Referenced by ffurl_read(), ffurl_read_complete(), and ffurl_write().
static int url_alloc_for_protocol | ( | URLContext ** | puc, | |
struct URLProtocol * | up, | |||
const char * | filename, | |||
int | flags, | |||
const AVIOInterruptCB * | int_cb | |||
) | [static] |
static void* urlcontext_child_next | ( | void * | obj, | |
void * | prev | |||
) | [static] |
const AVClass ffurl_context_class |
Initial value:
{ .class_name = "URLContext", .item_name = urlcontext_to_name, .option = options, .version = LIBAVUTIL_VERSION_INT, .child_next = urlcontext_child_next, .child_class_next = urlcontext_child_class_next, }
Definition at line 76 of file avio.c.
Referenced by ffio_url_child_class_next().
URLProtocol* first_protocol = NULL [static] |