libavformat/url.h File Reference

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.

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.
int ffurl_connect (URLContext *uc, AVDictionary **options)
 Connect an URLContext that has been allocated by ffurl_alloc.
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.
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.
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_register_protocol (URLProtocol *protocol, int size)
 Register the URLProtocol protocol.
int ff_check_interrupt (AVIOInterruptCB *cb)
 Check if the user has requested to interrup a blocking function associated with cb.
URLProtocolffurl_protocol_next (URLProtocol *prev)
 Iterate over all available protocols.
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.
int ff_udp_get_local_port (URLContext *h)
 Return the local port used by the UDP connection.


Detailed Description

unbuffered private I/O API

Definition in file url.h.


Function Documentation

int ff_check_interrupt ( AVIOInterruptCB cb  ) 

Check if the user has requested to interrup a blocking function associated with cb.

Definition at line 489 of file avio.c.

Referenced by applehttp_read(), avformat_find_stream_info(), do_tls_poll(), read_data(), retry_transfer_wrapper(), rtp_read(), and tcp_open().

int ff_udp_get_local_port ( URLContext h  ) 

Return the local port used by the UDP connection.

Parameters:
h media file context
Returns:
the local port number

Definition at line 305 of file udp.c.

Referenced by ff_rtp_get_local_rtcp_port(), ff_rtp_get_local_rtp_port(), and rtp_open().

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

Parameters:
h media file context
uri of the remote server
Returns:
zero if no error.

Definition at line 266 of file udp.c.

Referenced by ff_rtp_set_remote_url(), and udp_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.

Parameters:
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
Returns:
0 in case of success, a negative value corresponding to an AVERROR code in case of failure

Definition at line 287 of file avio.c.

Referenced by avio_check(), ffurl_open(), mmsh_open_internal(), open_input(), and url_alloc().

int ffurl_close ( URLContext h  ) 

int ffurl_connect ( URLContext uc,
AVDictionary **  options 
)

Connect an URLContext that has been allocated by ffurl_alloc.

Parameters:
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 189 of file avio.c.

Referenced by avio_check(), ffurl_open(), mmsh_open_internal(), open_input(), url_connect(), and url_open_protocol().

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.

Returns:
the file descriptor associated with this URL, or <0 on error.

Definition at line 468 of file avio.c.

Referenced by http_get_file_handle(), rtp_open(), rtsp_write_packet(), sap_fetch_packet(), sap_write_header(), tls_open(), and url_get_file_handle().

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.

Parameters:
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.
Returns:
0 in case of success, a negative value corresponding to an AVERROR code in case of failure

Definition at line 321 of file avio.c.

Referenced by applehttp_read(), avio_open2(), cache_open(), concat_open(), crypto_open(), gopher_open(), http_open_cnx(), md5_close(), mms_open(), open_input(), rtmp_open(), rtp_open(), sap_read_header(), sap_write_header(), tls_open(), url_exist(), and url_open().

URLProtocol* ffurl_protocol_next ( URLProtocol prev  ) 

Iterate over all available protocols.

Parameters:
prev result of the previous call to this functions or NULL.

Definition at line 36 of file avio.c.

Referenced by av_protocol_next(), 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.

Returns:
The number of bytes actually read, or a negative value corresponding to an AVERROR code in case of error. A value of zero indicates that it is not possible to read more from the accessed resource (except if the value of the size argument is also zero).

Definition at line 369 of file avio.c.

Referenced by applehttp_read(), cache_read(), concat_read(), crypto_read(), ff_rtmp_packet_read(), ffio_fdopen(), gopher_read(), http_buf_read(), http_getc(), read_data(), sap_fetch_packet(), sap_read_header(), and url_read().

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 376 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(), rtmp_handshake(), and url_read_complete().

int ffurl_register_protocol ( URLProtocol protocol,
int  size 
)

Register the URLProtocol protocol.

Parameters:
size the size of the URLProtocol struct referenced

Definition at line 107 of file avio.c.

Referenced by av_register_protocol2().

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.

Parameters:
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).
Returns:
a negative value corresponding to an AVERROR code in case of failure, or the resulting file position, measured in bytes from the beginning of the file. You can use this feature together with SEEK_CUR to read the current file position.

Definition at line 394 of file avio.c.

Referenced by cache_seek(), concat_read(), concat_seek(), ffio_fdopen(), ffurl_connect(), ffurl_size(), and url_seek().

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 453 of file avio.c.

Referenced by concat_open(), and url_filesize().

int ffurl_write ( URLContext h,
const unsigned char *  buf,
int  size 
)

Write size bytes from buf to the resource accessed by h.

Returns:
the number of bytes actually written, or a negative value corresponding to an AVERROR code in case of failure

Definition at line 383 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_close(), http_connect(), http_write(), md5_close(), rtmp_handshake(), rtp_write(), sap_write_close(), sap_write_packet(), send_command_packet(), tcp_write_packet(), and url_write().


Generated on Fri Oct 26 02:43:53 2012 for FFmpeg by  doxygen 1.5.8