64 int ret = read(c->
fd, buf, size);
67 return (ret == -1) ?
AVERROR(errno) : ret;
73 int ret = write(c->
fd, buf, size);
74 return (ret == -1) ?
AVERROR(errno) : ret;
91 ret = stat(filename, &st);
101 #if CONFIG_FILE_PROTOCOL 112 access = O_CREAT | O_RDWR;
116 access = O_CREAT | O_WRONLY;
133 static int64_t file_seek(
URLContext *h, int64_t pos,
int whence)
141 ret = fstat(c->
fd, &st);
142 return ret < 0 ?
AVERROR(errno) : st.st_size;
145 ret = lseek(c->
fd, pos, whence);
147 return ret < 0 ?
AVERROR(errno) : ret;
158 .url_open = file_open,
161 .url_seek = file_seek,
162 .url_close = file_close,
166 .priv_data_class = &file_class,
171 #if CONFIG_PIPE_PROTOCOL 180 fd = strtol(filename, &
final, 10);
181 if((filename ==
final) || *
final ) {
189 setmode(fd, O_BINARY);
198 .url_open = pipe_open,
int is_streamed
true if streamed (no seek possible), default = false
#define AVIO_FLAG_READ
read-only
#define AVIO_FLAG_WRITE
write-only
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
miscellaneous OS support macros and functions.
int avpriv_open(const char *filename, int flags,...)
A wrapper for open() setting O_CLOEXEC.
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
static const uint16_t mask[17]
const URLProtocol ff_pipe_protocol
const URLProtocol ff_file_protocol
common internal API header
Describe the class of an AVClass context structure.
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
char * filename
specified URL
#define AVSEEK_SIZE
ORing this as the "whence" parameter to a seek function causes it to return the filesize without seek...
unbuffered private I/O API