Main Page
Related Pages
Modules
Data Structures
Files
Examples
File List
Globals
libavformat
url.h
Go to the documentation of this file.
1
/*
2
*
3
* This file is part of Libav.
4
*
5
* Libav is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
9
*
10
* Libav is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
14
*
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with Libav; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
*/
19
25
#ifndef AVFORMAT_URL_H
26
#define AVFORMAT_URL_H
27
28
#include "
avio.h
"
29
#include "
libavformat/version.h
"
30
31
#include "
libavutil/dict.h
"
32
#include "
libavutil/log.h
"
33
34
#define URL_PROTOCOL_FLAG_NESTED_SCHEME 1
/*< The protocol name can be the first part of a nested protocol scheme */
35
#define URL_PROTOCOL_FLAG_NETWORK 2
/*< The protocol uses network */
36
37
extern
int (*url_interrupt_cb)(
void
);
38
39
extern
const
AVClass
ffurl_context_class
;
40
41
typedef
struct
URLContext
{
42
const
AVClass
*
av_class
;
43
struct
URLProtocol
*
prot
;
44
void
*
priv_data
;
45
char
*
filename
;
46
int
flags
;
47
int
max_packet_size
;
48
int
is_streamed
;
49
int
is_connected
;
50
AVIOInterruptCB
interrupt_callback
;
51
}
URLContext
;
52
53
typedef
struct
URLProtocol
{
54
const
char
*
name
;
55
int (*
url_open
)(
URLContext
*h,
const
char
*url,
int
flags
);
61
int (*
url_open2
)(
URLContext
*h,
const
char
*url,
int
flags
,
AVDictionary
**
options
);
62
75
int (*
url_read
)(
URLContext
*h,
unsigned
char
*buf,
int
size
);
76
int (*
url_write
)(
URLContext
*h,
const
unsigned
char
*buf,
int
size
);
77
int64_t (*
url_seek
)(
URLContext
*h, int64_t pos,
int
whence);
78
int (*
url_close
)(
URLContext
*h);
79
struct
URLProtocol
*
next
;
80
int (*
url_read_pause
)(
URLContext
*h,
int
pause);
81
int64_t (*
url_read_seek
)(
URLContext
*h,
int
stream_index,
82
int64_t timestamp,
int
flags
);
83
int (*
url_get_file_handle
)(
URLContext
*h);
84
int (*
url_get_multi_file_handle
)(
URLContext
*h,
int
**handles,
85
int
*numhandles);
86
int (*
url_shutdown
)(
URLContext
*h,
int
flags
);
87
int
priv_data_size
;
88
const
AVClass
*
priv_data_class
;
89
int
flags
;
90
int (*
url_check
)(
URLContext
*h,
int
mask
);
91
}
URLProtocol
;
92
106
int
ffurl_alloc
(
URLContext
**puc,
const
char
*filename,
int
flags
,
107
const
AVIOInterruptCB
*
int_cb
);
108
117
int
ffurl_connect
(
URLContext
*uc,
AVDictionary
**
options
);
118
135
int
ffurl_open
(
URLContext
**puc,
const
char
*filename,
int
flags
,
136
const
AVIOInterruptCB
*
int_cb
,
AVDictionary
**
options
);
137
147
int
ffurl_read
(
URLContext
*h,
unsigned
char
*buf,
int
size
);
148
156
int
ffurl_read_complete
(
URLContext
*h,
unsigned
char
*buf,
int
size
);
157
164
int
ffurl_write
(
URLContext
*h,
const
unsigned
char
*buf,
int
size
);
165
180
int64_t
ffurl_seek
(
URLContext
*h, int64_t pos,
int
whence);
181
189
int
ffurl_close
(
URLContext
*h);
190
196
int64_t
ffurl_size
(
URLContext
*h);
197
204
int
ffurl_get_file_handle
(
URLContext
*h);
205
211
int
ffurl_get_multi_file_handle
(
URLContext
*h,
int
**handles,
int
*numhandles);
212
223
int
ffurl_shutdown
(
URLContext
*h,
int
flags
);
224
230
int
ffurl_register_protocol
(
URLProtocol
*protocol,
int
size
);
231
236
int
ff_check_interrupt
(
AVIOInterruptCB
*cb);
237
243
URLProtocol
*
ffurl_protocol_next
(
URLProtocol
*prev);
244
245
/* udp.c */
246
int
ff_udp_set_remote_url
(
URLContext
*h,
const
char
*uri);
247
int
ff_udp_get_local_port
(
URLContext
*h);
248
249
#endif
/* AVFORMAT_URL_H */