Libav
|
#include "libavutil/avstring.h"
#include "libavutil/dict.h"
#include "libavutil/opt.h"
#include "libavutil/time.h"
#include "os_support.h"
#include "avformat.h"
#include "url.h"
Go to the source code of this file.
Macros | |
#define | URL_SCHEME_CHARS |
Functions | |
static int | url_alloc_for_protocol (URLContext **puc, const URLProtocol *up, const char *filename, int flags, const AVIOInterruptCB *int_cb, const URLProtocol **protocols) |
int | ffurl_connect (URLContext *uc, AVDictionary **options) |
Connect an URLContext that has been allocated by ffurl_alloc. More... | |
int | ffurl_alloc (URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb, const URLProtocol **protocols) |
Create a URLContext for accessing to the resource indicated by url, but do not initiate the connection yet. More... | |
int | ffurl_open (URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options, const URLProtocol **protocols, URLContext *parent) |
Create an URLContext for accessing to the resource indicated by url, and open it. More... | |
static int | retry_transfer_wrapper (URLContext *h, uint8_t *buf, int size, int size_min, int(*transfer_func)(URLContext *h, uint8_t *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. More... | |
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. More... | |
int | ffurl_write (URLContext *h, const unsigned char *buf, int size) |
Write size bytes from buf to the resource accessed by h. More... | |
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. More... | |
int | ffurl_close (URLContext *h) |
Close the resource accessed by the URLContext h, and free the memory used by it. More... | |
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. More... | |
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. More... | |
int | ffurl_get_file_handle (URLContext *h) |
Return the file descriptor associated with this URL. More... | |
int | ffurl_get_multi_file_handle (URLContext *h, int **handles, int *numhandles) |
Return the file descriptors associated with this URL. More... | |
int | ffurl_shutdown (URLContext *h, int flags) |
Signal the URLContext that we are done reading or writing the stream. More... | |
int | ff_check_interrupt (AVIOInterruptCB *cb) |
Check if the user has requested to interrupt a blocking function associated with cb. More... | |
Logging context. | |
static const AVOption | options [] |
const AVClass | ffurl_context_class |
static const char * | urlcontext_to_name (void *ptr) |
static void * | urlcontext_child_next (void *obj, void *prev) |
#define URL_SCHEME_CHARS |
Definition at line 138 of file avio.c.
Referenced by ffurl_alloc().
|
static |
Definition at line 66 of file avio.c.
Referenced by ffurl_alloc().
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 119 of file avio.c.
Referenced by avio_check(), ff_rtsp_open_transport_ctx(), ffurl_open(), mmsh_open(), and rtmp_http_open().
int ffurl_alloc | ( | URLContext ** | puc, |
const char * | filename, | ||
int | flags, | ||
const AVIOInterruptCB * | int_cb, | ||
const URLProtocol ** | protocols | ||
) |
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 |
protocols | a NULL-terminate list of protocols available for use by this context and its children. The caller must ensure this list remains valid until the context is closed. |
Definition at line 143 of file avio.c.
Referenced by avio_check(), ff_rtsp_open_transport_ctx(), ffurl_open(), mmsh_open(), and rtmp_http_open().
int ffurl_open | ( | URLContext ** | puc, |
const char * | filename, | ||
int | flags, | ||
const AVIOInterruptCB * | int_cb, | ||
AVDictionary ** | options, | ||
const URLProtocol ** | protocols, | ||
URLContext * | parent | ||
) |
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. |
protocols | a NULL-terminate list of protocols available for use by this context and its children. The caller must ensure this list remains valid until the context is closed. |
parent | An enclosing URLContext, whose generic options should be applied to this URLContext as well. |
Definition at line 175 of file avio.c.
Referenced by avio_open2(), concat_open(), crypto_open(), ff_rtsp_open_transport_ctx(), ff_tls_open_underlying(), gopher_open(), hls_read(), http_open_cnx_internal(), icecast_open(), ism_flush(), ism_seek(), md5_close(), mms_open(), rtmp_calc_swfhash(), rtmp_open(), rtmpe_open(), rtp_open(), rtsp_listen(), rtsp_read_setup(), sap_read_header(), sap_write_header(), and srtp_open().
|
inlinestatic |
Definition at line 200 of file avio.c.
Referenced by ffurl_read(), ffurl_read_complete(), and ffurl_write().
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 243 of file avio.c.
Referenced by concat_read(), crypto_read(), ff_rtmp_packet_read(), ff_rtmp_packet_read_internal(), ff_rtsp_open_transport_ctx(), gnutls_url_pull(), gopher_read(), hls_read(), http_buf_read(), http_getc(), io_read_packet(), rtmp_http_open(), rtmp_http_read(), rtmp_http_send_cmd(), rtmp_write(), rtmpe_read(), sap_fetch_packet(), sap_read_header(), srtp_read(), and url_bio_bread().
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 250 of file avio.c.
Referenced by ff_rtsp_open_transport_ctx(), ff_rtsp_tcp_read_packet(), get_chunk_header(), get_http_header_data(), get_tcp_server_response(), read_data_packet(), read_line(), rtmp_calc_swfhash(), rtmp_handshake(), rtmp_packet_read_one_chunk(), rtmp_receive_hs_packet(), rtmp_server_handshake(), and rtsp_read_announce().
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 257 of file avio.c.
Referenced by ff_rtmp_packet_write(), ff_rtp_check_and_send_back_rr(), ff_rtp_send_punch_packets(), ff_rtp_send_rtcp_feedback(), ff_rtsp_open_transport_ctx(), ff_rtsp_tcp_write_packet(), gnutls_url_push(), gopher_write(), http_connect(), http_shutdown(), http_write(), icecast_write(), io_write_packet(), ism_write(), md5_close(), rtmp_handshake(), rtmp_send_hs_packet(), rtmp_server_handshake(), rtmpe_write(), rtp_write(), rtsp_send_reply(), sap_write_close(), sap_write_packet(), send_command_packet(), srtp_write(), and url_bio_bwrite().
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 270 of file avio.c.
Referenced by concat_read(), concat_seek(), ffurl_connect(), ffurl_size(), io_seek(), ism_seek(), and rtmp_calc_swfhash().
int ffurl_close | ( | URLContext * | h | ) |
Close the resource accessed by the URLContext h, and free the memory used by it.
Definition at line 280 of file avio.c.
Referenced by avio_check(), avio_close(), avio_open2(), concat_close(), concat_open(), crypto_close(), ff_rtp_chain_mux_open(), ff_rtsp_open_transport_ctx(), ff_rtsp_undo_setup(), ffurl_open(), gopher_close(), hls_close(), hls_read(), http_close(), http_open_cnx(), http_seek(), icecast_close(), ism_flush(), ism_free(), ism_seek(), md5_close(), mms_close(), mmsh_close(), mmsh_open(), rtmp_calc_swfhash(), rtmp_close(), rtmp_http_close(), rtmp_open(), rtmpe_close(), rtp_close(), rtp_open(), rtsp_listen(), sap_read_close(), sap_write_close(), srtp_close(), and tls_close().
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 301 of file avio.c.
Referenced by assert_file_overwrite(), and find_image_range().
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 330 of file avio.c.
Referenced by concat_open().
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 345 of file avio.c.
Referenced by ff_rtsp_open_transport_ctx(), http_get_file_handle(), rtp_open(), rtsp_write_packet(), sap_fetch_packet(), sap_write_header(), and srtp_get_file_handle().
int ffurl_get_multi_file_handle | ( | URLContext * | h, |
int ** | handles, | ||
int * | numhandles | ||
) |
Return the file descriptors associated with this URL.
Definition at line 352 of file avio.c.
Referenced by ff_rtsp_open_transport_ctx(), and srtp_get_multi_file_handle().
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 |
int ff_check_interrupt | ( | AVIOInterruptCB * | cb | ) |
Check if the user has requested to interrupt a blocking function associated with cb.
Definition at line 374 of file avio.c.
Referenced by avformat_find_stream_info(), ff_listen_connect(), ff_poll_interrupt(), ff_rtsp_open_transport_ctx(), hls_read(), read_data(), retry_transfer_wrapper(), and rtp_read().
|
static |
const AVClass ffurl_context_class |
Definition at line 56 of file avio.c.
Referenced by io_priv_child_class_next(), and url_alloc_for_protocol().