FFmpeg
Data Structures | Macros | Functions | Variables
file.c File Reference
#include "config_components.h"
#include "libavutil/avstring.h"
#include "libavutil/file_open.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "avio.h"
#include <fcntl.h>
#include <sys/stat.h>
#include <stdlib.h>
#include "os_support.h"
#include "url.h"

Go to the source code of this file.

Data Structures

struct  FileContext
 

Macros

#define S_ISFIFO(m)   0
 
#define S_ISLNK(m)   0
 
#define S_ISSOCK(m)   0
 
#define S_ISREG(m)   0
 
#define S_ISBLK(m)   0
 

Functions

static int file_read (URLContext *h, unsigned char *buf, int size)
 
static int file_write (URLContext *h, const unsigned char *buf, int size)
 
static int file_get_handle (URLContext *h)
 
static int file_check (URLContext *h, int mask)
 
static int fd_dup (URLContext *h, int oldfd)
 
static int file_close (URLContext *h)
 
static int64_t file_seek (URLContext *h, int64_t pos, int whence)
 

Variables

static const AVOption file_options []
 
static const AVOption pipe_options []
 
static const AVClass file_class
 
static const AVClass pipe_class
 
static const AVClass fd_class
 

Macro Definition Documentation

◆ S_ISFIFO

#define S_ISFIFO (   m)    0

Definition at line 49 of file file.c.

◆ S_ISLNK

#define S_ISLNK (   m)    0

Definition at line 58 of file file.c.

◆ S_ISSOCK

#define S_ISSOCK (   m)    0

Definition at line 67 of file file.c.

◆ S_ISREG

#define S_ISREG (   m)    0

Definition at line 76 of file file.c.

◆ S_ISBLK

#define S_ISBLK (   m)    0

Definition at line 85 of file file.c.

Function Documentation

◆ file_read()

static int file_read ( URLContext h,
unsigned char *  buf,
int  size 
)
static

Definition at line 138 of file file.c.

◆ file_write()

static int file_write ( URLContext h,
const unsigned char *  buf,
int  size 
)
static

Definition at line 151 of file file.c.

◆ file_get_handle()

static int file_get_handle ( URLContext h)
static

Definition at line 160 of file file.c.

◆ file_check()

static int file_check ( URLContext h,
int  mask 
)
static

Definition at line 166 of file file.c.

◆ fd_dup()

static int fd_dup ( URLContext h,
int  oldfd 
)
static

Definition at line 195 of file file.c.

◆ file_close()

static int file_close ( URLContext h)
static

Definition at line 218 of file file.c.

◆ file_seek()

static int64_t file_seek ( URLContext h,
int64_t  pos,
int  whence 
)
static

Definition at line 226 of file file.c.

Variable Documentation

◆ file_options

const AVOption file_options[]
static
Initial value:
= {
{ "truncate", "truncate existing files on write", 0x42, AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, AV_OPT_FLAG_ENCODING_PARAM },
{ "blocksize", "set I/O operation maximum block size", 0x42, AV_OPT_TYPE_INT, { .i64 = INT_MAX }, 1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ "follow", "Follow a file as it is being written", 0x42, AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM },
{ "seekable", "Sets if the file is seekable", 0x42, AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 0, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_ENCODING_PARAM },
{ NULL }
}

Definition at line 103 of file file.c.

◆ pipe_options

const AVOption pipe_options[]
static
Initial value:
= {
{ "blocksize", "set I/O operation maximum block size", 0x42, AV_OPT_TYPE_INT, { .i64 = INT_MAX }, 1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ "fd", "set file descriptor", 0x42, AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ NULL }
}

Definition at line 111 of file file.c.

◆ file_class

const AVClass file_class
static
Initial value:
= {
.class_name = "file",
.item_name = av_default_item_name,
.option = file_options,
}

Definition at line 117 of file file.c.

◆ pipe_class

const AVClass pipe_class
static
Initial value:
= {
.class_name = "pipe",
.item_name = av_default_item_name,
.option = pipe_options,
}

Definition at line 124 of file file.c.

◆ fd_class

const AVClass fd_class
static
Initial value:
= {
.class_name = "fd",
.item_name = av_default_item_name,
.option = pipe_options,
}

Definition at line 131 of file file.c.

AV_OPT_FLAG_ENCODING_PARAM
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
Definition: opt.h:281
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
pipe_options
static const AVOption pipe_options[]
Definition: file.c:111
file_options
static const AVOption file_options[]
Definition: file.c:103
AV_OPT_FLAG_DECODING_PARAM
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
Definition: opt.h:282
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Definition: opt.h:244