• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

libavformat/url.h

Go to the documentation of this file.
00001 /*
00002  *
00003  * This file is part of FFmpeg.
00004  *
00005  * FFmpeg 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  * FFmpeg 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 FFmpeg; 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 #include "libavutil/dict.h"
00032 #include "libavutil/log.h"
00033 
00034 #if !FF_API_OLD_AVIO
00035 #define URL_PROTOCOL_FLAG_NESTED_SCHEME 1 /*< The protocol name can be the first part of a nested protocol scheme */
00036 #define URL_PROTOCOL_FLAG_NETWORK       2 /*< The protocol uses network */
00037 
00038 extern int (*url_interrupt_cb)(void);
00039 
00040 extern const AVClass ffurl_context_class;
00041 
00042 typedef struct URLContext {
00043     const AVClass *av_class;    
00044     struct URLProtocol *prot;
00045     void *priv_data;
00046     char *filename;             
00047     int flags;
00048     int max_packet_size;        
00049     int is_streamed;            
00050     int is_connected;
00051     AVIOInterruptCB interrupt_callback;
00052 } URLContext;
00053 
00054 typedef struct URLProtocol {
00055     const char *name;
00056     int     (*url_open)( URLContext *h, const char *url, int flags);
00062     int     (*url_open2)(URLContext *h, const char *url, int flags, AVDictionary **options);
00063     int     (*url_read)( URLContext *h, unsigned char *buf, int size);
00064     int     (*url_write)(URLContext *h, const unsigned char *buf, int size);
00065     int64_t (*url_seek)( URLContext *h, int64_t pos, int whence);
00066     int     (*url_close)(URLContext *h);
00067     struct URLProtocol *next;
00068     int (*url_read_pause)(URLContext *h, int pause);
00069     int64_t (*url_read_seek)(URLContext *h, int stream_index,
00070                              int64_t timestamp, int flags);
00071     int (*url_get_file_handle)(URLContext *h);
00072     int priv_data_size;
00073     const AVClass *priv_data_class;
00074     int flags;
00075     int (*url_check)(URLContext *h, int mask);
00076 } URLProtocol;
00077 #endif
00078 
00092 int ffurl_alloc(URLContext **puc, const char *filename, int flags,
00093                 const AVIOInterruptCB *int_cb);
00094 
00103 int ffurl_connect(URLContext *uc, AVDictionary **options);
00104 
00121 int ffurl_open(URLContext **puc, const char *filename, int flags,
00122                const AVIOInterruptCB *int_cb, AVDictionary **options);
00123 
00133 int ffurl_read(URLContext *h, unsigned char *buf, int size);
00134 
00142 int ffurl_read_complete(URLContext *h, unsigned char *buf, int size);
00143 
00150 int ffurl_write(URLContext *h, const unsigned char *buf, int size);
00151 
00166 int64_t ffurl_seek(URLContext *h, int64_t pos, int whence);
00167 
00175 int ffurl_close(URLContext *h);
00176 
00182 int64_t ffurl_size(URLContext *h);
00183 
00190 int ffurl_get_file_handle(URLContext *h);
00191 
00197 int ffurl_register_protocol(URLProtocol *protocol, int size);
00198 
00203 int ff_check_interrupt(AVIOInterruptCB *cb);
00204 
00210 URLProtocol *ffurl_protocol_next(URLProtocol *prev);
00211 
00212 /* udp.c */
00213 int ff_udp_set_remote_url(URLContext *h, const char *uri);
00214 int ff_udp_get_local_port(URLContext *h);
00215 
00216 #endif /* AVFORMAT_URL_H */
Generated on Fri Feb 1 2013 14:34:55 for FFmpeg by doxygen 1.7.1