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
#if !FF_API_OLD_AVIO
35
#define URL_PROTOCOL_FLAG_NESTED_SCHEME 1
/*< The protocol name can be the first part of a nested protocol scheme */
36
#define URL_PROTOCOL_FLAG_NETWORK 2
/*< The protocol uses network */
37
38
extern
int (*url_interrupt_cb)(
void
);
39
40
extern
const
AVClass
ffurl_context_class
;
41
42
typedef
struct
URLContext
{
43
const
AVClass
*
av_class
;
44
struct
URLProtocol
*
prot
;
45
void
*
priv_data
;
46
char
*
filename
;
47
int
flags
;
48
int
max_packet_size
;
49
int
is_streamed
;
50
int
is_connected
;
51
AVIOInterruptCB
interrupt_callback
;
52
}
URLContext
;
53
54
typedef
struct
URLProtocol
{
55
const
char
*
name
;
56
int (*
url_open
)(
URLContext
*h,
const
char
*url,
int
flags
);
62
int (*
url_open2
)(
URLContext
*h,
const
char
*url,
int
flags
,
AVDictionary
**
options
);
63
int (*
url_read
)(
URLContext
*h,
unsigned
char
*buf,
int
size
);
64
int (*
url_write
)(
URLContext
*h,
const
unsigned
char
*buf,
int
size
);
65
int64_t (*
url_seek
)(
URLContext
*h, int64_t pos,
int
whence);
66
int (*
url_close
)(
URLContext
*h);
67
struct
URLProtocol
*
next
;
68
int (*
url_read_pause
)(
URLContext
*h,
int
pause);
69
int64_t (*
url_read_seek
)(
URLContext
*h,
int
stream_index,
70
int64_t timestamp,
int
flags
);
71
int (*
url_get_file_handle
)(
URLContext
*h);
72
int
priv_data_size
;
73
const
AVClass
*
priv_data_class
;
74
int
flags
;
75
int (*
url_check
)(
URLContext
*h,
int
mask
);
76
}
URLProtocol
;
77
#endif
78
92
int
ffurl_alloc
(
URLContext
**puc,
const
char
*filename,
int
flags
,
93
const
AVIOInterruptCB
*
int_cb
);
94
103
int
ffurl_connect
(
URLContext
*uc,
AVDictionary
**
options
);
104
121
int
ffurl_open
(
URLContext
**puc,
const
char
*filename,
int
flags
,
122
const
AVIOInterruptCB
*
int_cb
,
AVDictionary
**
options
);
123
133
int
ffurl_read
(
URLContext
*h,
unsigned
char
*buf,
int
size
);
134
142
int
ffurl_read_complete
(
URLContext
*h,
unsigned
char
*buf,
int
size
);
143
150
int
ffurl_write
(
URLContext
*h,
const
unsigned
char
*buf,
int
size
);
151
166
int64_t
ffurl_seek
(
URLContext
*h, int64_t pos,
int
whence);
167
175
int
ffurl_close
(
URLContext
*h);
176
182
int64_t
ffurl_size
(
URLContext
*h);
183
190
int
ffurl_get_file_handle
(
URLContext
*h);
191
197
int
ffurl_register_protocol
(
URLProtocol
*protocol,
int
size
);
198
203
int
ff_check_interrupt
(
AVIOInterruptCB
*cb);
204
210
URLProtocol
*
ffurl_protocol_next
(
URLProtocol
*prev);
211
212
/* udp.c */
213
int
ff_udp_set_remote_url
(
URLContext
*h,
const
char
*uri);
214
int
ff_udp_get_local_port
(
URLContext
*h);
215
216
#endif
/* AVFORMAT_URL_H */