FFmpeg  4.0
Data Structures | Macros | Functions | Variables
file.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "avformat.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
 

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 file_delete (URLContext *h)
 
static int file_move (URLContext *h_src, URLContext *h_dst)
 

Variables

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

Macro Definition Documentation

◆ S_ISFIFO

#define S_ISFIFO (   m)    0

Definition at line 46 of file file.c.

Referenced by file_move().

◆ S_ISLNK

#define S_ISLNK (   m)    0

Definition at line 55 of file file.c.

Referenced by file_move().

◆ S_ISSOCK

#define S_ISSOCK (   m)    0

Definition at line 64 of file file.c.

Referenced by file_move().

Function Documentation

◆ file_read()

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

Definition at line 107 of file file.c.

Referenced by file_move().

◆ file_write()

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

Definition at line 120 of file file.c.

Referenced by file_move().

◆ file_get_handle()

static int file_get_handle ( URLContext h)
static

Definition at line 129 of file file.c.

Referenced by file_move().

◆ file_check()

static int file_check ( URLContext h,
int  mask 
)
static

Definition at line 135 of file file.c.

Referenced by file_move().

◆ file_delete()

static int file_delete ( URLContext h)
static

Definition at line 168 of file file.c.

Referenced by file_move().

◆ file_move()

static int file_move ( URLContext h_src,
URLContext h_dst 
)
static

Definition at line 187 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 },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
Definition: opt.h:276
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
Definition: opt.h:277

Definition at line 81 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 },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define AV_OPT_FLAG_ENCODING_PARAM
a generic parameter which can be set by the user for muxing or encoding
Definition: opt.h:276

Definition at line 88 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,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191
static const AVOption file_options[]
Definition: file.c:81

Definition at line 93 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,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
static const AVOption pipe_options[]
Definition: file.c:88
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:191

Definition at line 100 of file file.c.