00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00025 #ifndef AVFORMAT_URL_H
00026 #define AVFORMAT_URL_H
00027
00028 #include "avio.h"
00029 #include "libavformat/version.h"
00030
00031 #if !FF_API_OLD_AVIO
00032 #define URL_PROTOCOL_FLAG_NESTED_SCHEME 1
00033
00034 extern int (*url_interrupt_cb)(void);
00035
00036 typedef struct URLContext {
00037 const AVClass *av_class;
00038 struct URLProtocol *prot;
00039 void *priv_data;
00040 char *filename;
00041 int flags;
00042 int max_packet_size;
00043 int is_streamed;
00044 int is_connected;
00045 } URLContext;
00046
00047 typedef struct URLProtocol {
00048 const char *name;
00049 int (*url_open)( URLContext *h, const char *url, int flags);
00050 int (*url_read)( URLContext *h, unsigned char *buf, int size);
00051 int (*url_write)(URLContext *h, const unsigned char *buf, int size);
00052 int64_t (*url_seek)( URLContext *h, int64_t pos, int whence);
00053 int (*url_close)(URLContext *h);
00054 struct URLProtocol *next;
00055 int (*url_read_pause)(URLContext *h, int pause);
00056 int64_t (*url_read_seek)(URLContext *h, int stream_index,
00057 int64_t timestamp, int flags);
00058 int (*url_get_file_handle)(URLContext *h);
00059 int priv_data_size;
00060 const AVClass *priv_data_class;
00061 int flags;
00062 int (*url_check)(URLContext *h, int mask);
00063 } URLProtocol;
00064 #endif
00065
00077 int ffurl_alloc(URLContext **h, const char *url, int flags);
00078
00082 int ffurl_connect(URLContext *h);
00083
00095 int ffurl_open(URLContext **h, const char *url, int flags);
00096
00106 int ffurl_read(URLContext *h, unsigned char *buf, int size);
00107
00115 int ffurl_read_complete(URLContext *h, unsigned char *buf, int size);
00116
00123 int ffurl_write(URLContext *h, const unsigned char *buf, int size);
00124
00139 int64_t ffurl_seek(URLContext *h, int64_t pos, int whence);
00140
00148 int ffurl_close(URLContext *h);
00149
00155 int64_t ffurl_size(URLContext *h);
00156
00163 int ffurl_get_file_handle(URLContext *h);
00164
00170 int ffurl_register_protocol(URLProtocol *protocol, int size);
00171
00172
00173 int ff_udp_set_remote_url(URLContext *h, const char *uri);
00174 int ff_udp_get_local_port(URLContext *h);
00175
00176 #endif