Libav 0.7.1
|
00001 /* 00002 * 00003 * This file is part of Libav. 00004 * 00005 * Libav is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Lesser General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2.1 of the License, or (at your option) any later version. 00009 * 00010 * Libav is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Lesser General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Lesser General Public 00016 * License along with Libav; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 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 /*< The protocol name can be the first part of a nested protocol scheme */ 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 /* udp.c */ 00173 int ff_udp_set_remote_url(URLContext *h, const char *uri); 00174 int ff_udp_get_local_port(URLContext *h); 00175 00176 #endif /* AVFORMAT_URL_H */