|
FFmpeg
|
unbuffered private I/O API More...
#include "avio.h"#include "libavformat/version.h"#include "libavutil/dict.h"#include "libavutil/log.h"Go to the source code of this file.
Classes | |
| struct | URLContext |
| struct | URLProtocol |
Macros | |
| #define | URL_PROTOCOL_FLAG_NESTED_SCHEME 1 /*< The protocol name can be the first part of a nested protocol scheme */ |
| #define | URL_PROTOCOL_FLAG_NETWORK 2 /*< The protocol uses network */ |
Typedefs | |
| typedef struct URLContext | URLContext |
| typedef struct URLProtocol | URLProtocol |
Functions | |
| 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. More... | |
| int | ffurl_connect (URLContext *uc, AVDictionary **options) |
| Connect an URLContext that has been allocated by ffurl_alloc. More... | |
| int | ffurl_open_whitelist (URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options, const char *whitelist, const char *blacklist, URLContext *parent) |
| Create an URLContext for accessing to the resource indicated by url, and open it. More... | |
| int | ffurl_open (URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options) |
| int | ffurl_accept (URLContext *s, URLContext **c) |
| Accept an URLContext c on an URLContext s. More... | |
| int | ffurl_handshake (URLContext *c) |
| Perform one step of the protocol handshake to accept a new client. More... | |
| 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_closep (URLContext **h) |
| Close the resource accessed by the URLContext h, and free the memory used by it. More... | |
| int | ffurl_close (URLContext *h) |
| 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. More... | |
| int | ffurl_get_multi_file_handle (URLContext *h, int **handles, int *numhandles) |
| Return the file descriptors associated with this URL. More... | |
| int | ffurl_get_short_seek (URLContext *h) |
| Return the current short seek threshold value for 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. | |
| int | ff_udp_set_remote_url (URLContext *h, const char *uri) |
| If no filename is given to av_open_input_file because you want to get the local port first, then you must call this function to set the remote server address. More... | |
| int | ff_udp_get_local_port (URLContext *h) |
| Return the local port used by the UDP connection. More... | |
| int | ff_url_join (char *str, int size, const char *proto, const char *authorization, const char *hostname, int port, const char *fmt,...) av_printf_format(7 |
| Assemble a URL string from components. More... | |
| int void | ff_make_absolute_url (char *buf, int size, const char *base, const char *rel) |
| Convert a relative url into an absolute url, given a base url. More... | |
| AVIODirEntry * | ff_alloc_dir_entry (void) |
| Allocate directory entry with default values. More... | |
| const AVClass * | ff_urlcontext_child_class_next (const AVClass *prev) |
| const URLProtocol ** | ffurl_get_protocols (const char *whitelist, const char *blacklist) |
| Construct a list of protocols matching a given whitelist and/or blacklist. More... | |
Variables | |
| const AVClass | ffurl_context_class |
unbuffered private I/O API
| AVIODirEntry* ff_alloc_dir_entry | ( | void | ) |
Allocate directory entry with default values.
| int void ff_make_absolute_url | ( | char * | buf, |
| int | size, | ||
| const char * | base, | ||
| const char * | rel | ||
| ) |
Convert a relative url into an absolute url, given a base url.
| buf | the buffer where output absolute url is written |
| size | the size of buf |
| base | the base url, may be equal to buf. |
| rel | the new url, which is interpreted relative to base |
| int ff_udp_get_local_port | ( | URLContext * | h | ) |
Return the local port used by the UDP connection.
| h | media file context |
| int ff_udp_set_remote_url | ( | URLContext * | h, |
| const char * | uri | ||
| ) |
If no filename is given to av_open_input_file because you want to get the local port first, then you must call this function to set the remote server address.
url syntax: udp://host:port[?option=val...] option: 'ttl=n' : set the ttl value (for multicast only) 'localport=n' : set the local port 'pkt_size=n' : set max packet size 'reuse=1' : enable reusing the socket 'overrun_nonfatal=1': survive in case of circular buffer overrun
| h | media file context |
| uri | of the remote server |
| int ff_url_join | ( | char * | str, |
| int | size, | ||
| const char * | proto, | ||
| const char * | authorization, | ||
| const char * | hostname, | ||
| int | port, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
Assemble a URL string from components.
This is the reverse operation of av_url_split.
Note, this requires networking to be initialized, so the caller must ensure ff_network_init has been called.
| str | the buffer to fill with the url |
| size | the size of the str buffer |
| proto | the protocol identifier, if null, the separator after the identifier is left out, too |
| authorization | an optional authorization string, may be null. An empty string is treated the same as a null string. |
| hostname | the host name string |
| port | the port number, left out from the string if negative |
| fmt | a generic format string for everything to add after the host/port, may be null |
| int ffurl_accept | ( | URLContext * | s, |
| URLContext ** | c | ||
| ) |
Accept an URLContext c on an URLContext s.
| s | server context |
| c | client context, must be unallocated. |
| 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 |
| int ffurl_closep | ( | URLContext ** | h | ) |
Close the resource accessed by the URLContext h, and free the memory used by it.
Also set the URLContext pointer to NULL.
| 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. |
| 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.
| int ffurl_get_multi_file_handle | ( | URLContext * | h, |
| int ** | handles, | ||
| int * | numhandles | ||
| ) |
Return the file descriptors associated with this URL.
| const URLProtocol** ffurl_get_protocols | ( | const char * | whitelist, |
| const char * | blacklist | ||
| ) |
Construct a list of protocols matching a given whitelist and/or blacklist.
| whitelist | a comma-separated list of allowed protocol names or NULL. If this is a non-empty string, only protocols in this list will be included. |
| blacklist | a comma-separated list of forbidden protocol names or NULL. If this is a non-empty string, all protocols in this list will be excluded. |
| int ffurl_get_short_seek | ( | URLContext * | h | ) |
Return the current short seek threshold value for this URL.
| int ffurl_handshake | ( | URLContext * | c | ) |
Perform one step of the protocol handshake to accept a new client.
See avio_handshake() for details. Implementations should try to return decreasing values. If the protocol uses an underlying protocol, the underlying handshake is usually the first step, and the return value can be: (largest value for this protocol) + (return value from other protocol)
| c | the client context |
| int ffurl_open_whitelist | ( | URLContext ** | puc, |
| const char * | filename, | ||
| int | flags, | ||
| const AVIOInterruptCB * | int_cb, | ||
| AVDictionary ** | options, | ||
| const char * | whitelist, | ||
| const char * | blacklist, | ||
| 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. |
| parent | An enclosing URLContext, whose generic options should be applied to this URLContext as well. |
| 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.
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.
| 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). |
| 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 ffurl_write | ( | URLContext * | h, |
| const unsigned char * | buf, | ||
| int | size | ||
| ) |
Write size bytes from buf to the resource accessed by h.
1.8.12