Go to the documentation of this file.
22 #include "config_components.h"
47 # define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
49 # define S_ISFIFO(m) 0
56 # define S_ISLNK(m) (((m) & S_IFLNK) == S_IFLNK)
65 # define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
67 # define S_ISSOCK(m) 0
74 # define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
83 # define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
144 if (
ret == 0 &&
c->follow)
169 const char *filename =
h->filename;
173 #if HAVE_ACCESS && defined(R_OK)
174 if (access(filename, F_OK) < 0)
177 if (access(filename, R_OK) >= 0)
180 if (access(filename, W_OK) >= 0)
184 ret = stat(filename, &st);
199 #ifdef F_DUPFD_CLOEXEC
200 newfd = fcntl(oldfd, F_DUPFD_CLOEXEC, 0);
208 if (fcntl(newfd, F_SETFD, FD_CLOEXEC) == -1)
221 int ret = close(
c->fd);
233 ret = fstat(
c->fd, &st);
237 ret = lseek(
c->fd,
pos, whence);
242 #if CONFIG_FILE_PROTOCOL
248 const char *filename =
h->filename;
251 ret = rmdir(filename);
252 if (
ret < 0 && (errno == ENOTDIR
257 ret = unlink(filename);
269 const char *filename_src = h_src->
filename;
270 const char *filename_dst = h_dst->
filename;
274 if (rename(filename_src, filename_dst) < 0)
290 access = O_CREAT | O_RDWR;
294 access = O_CREAT | O_WRONLY;
308 h->is_streamed = !fstat(fd, &st) &&
S_ISFIFO(st.st_mode);
313 h->min_packet_size =
h->max_packet_size = 262144;
315 if (
c->seekable >= 0)
316 h->is_streamed = !
c->seekable;
326 c->dir = opendir(
h->filename);
341 char *fullpath =
NULL;
348 dir = readdir(
c->dir);
353 }
while (!strcmp(dir->d_name,
".") || !strcmp(dir->d_name,
".."));
358 if (!lstat(fullpath, &st)) {
359 if (S_ISDIR(st.st_mode))
363 else if (S_ISCHR(st.st_mode))
376 (*next)->group_id = st.st_gid;
377 (*next)->user_id = st.st_uid;
378 (*next)->size = st.st_size;
379 (*next)->filemode = st.st_mode & 0777;
380 (*next)->modification_timestamp = INT64_C(1000000) * st.st_mtime;
381 (*next)->access_timestamp = INT64_C(1000000) * st.st_atime;
382 (*next)->status_change_timestamp = INT64_C(1000000) * st.st_ctime;
407 .url_open = file_open,
414 .url_delete = file_delete,
415 .url_move = file_move,
418 .url_open_dir = file_open_dir,
419 .url_read_dir = file_read_dir,
420 .url_close_dir = file_close_dir,
421 .default_whitelist =
"file,crypto,data"
426 #if CONFIG_PIPE_PROTOCOL
437 fd = strtol(filename, &
final, 10);
438 if((filename ==
final) || *
final ) {
457 .url_open = pipe_open,
465 .default_whitelist =
"crypto,data"
470 #if CONFIG_FD_PROTOCOL
477 if (strcmp(filename,
"fd:") != 0) {
479 " please set it via -fd {num}\n");
490 if (fstat(
c->fd, &st) < 0)
511 .default_whitelist =
"crypto,data"
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
char * filename
specified URL
#define AVERROR_EOF
End of file.
#define AVSEEK_SIZE
ORing this as the "whence" parameter to a seek function causes it to return the filesize without seek...
char * av_append_path_component(const char *path, const char *component)
Append path component to the existing path.
static __device__ float trunc(float a)
@ AVIO_ENTRY_CHARACTER_DEVICE
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const URLProtocol ff_fd_protocol
@ AVIO_ENTRY_SYMBOLIC_LINK
static const uint16_t mask[17]
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
int avpriv_open(const char *filename, int flags,...)
A wrapper for open() setting O_CLOEXEC.
#define AVIO_FLAG_WRITE
write-only
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
const char * av_default_item_name(void *ptr)
Return the context name.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
const URLProtocol ff_file_protocol
Describes single entry of the directory.
int av_strstart(const char *str, const char *pfx, const char **ptr)
Return non-zero if pfx is a prefix of str.
AVIODirEntry * ff_alloc_dir_entry(void)
Allocate directory entry with default values.
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
const URLProtocol ff_pipe_protocol
@ AVIO_ENTRY_BLOCK_DEVICE
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
#define AVIO_FLAG_READ
read-only
char * av_strdup(const char *s)
Duplicate a string.
#define flags(name, subs,...)
static uint32_t BS_FUNC() read(BSCTX *bc, unsigned int n)
Return n bits from the buffer, n has to be in the 0-32 range.