FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
ftp.c File Reference
#include "libavutil/avstring.h"
#include "avformat.h"
#include "internal.h"
#include "url.h"
#include "libavutil/opt.h"
#include "libavutil/bprint.h"

Go to the source code of this file.

Data Structures

struct  FTPContext
 

Macros

#define CONTROL_BUFFER_SIZE   1024
 
#define OFFSET(x)   offsetof(FTPContext, x)
 
#define D   AV_OPT_FLAG_DECODING_PARAM
 
#define E   AV_OPT_FLAG_ENCODING_PARAM
 

Enumerations

enum  FTPState {
  UNKNOWN, READY, DOWNLOADING, UPLOADING,
  DISCONNECTED
}
 

Functions

static int ftp_close (URLContext *h)
 
static int ftp_getc (FTPContext *s)
 
static int ftp_get_line (FTPContext *s, char *line, int line_size)
 
static int ftp_status (FTPContext *s, char **line, const int response_codes[])
 
static int ftp_send_command (FTPContext *s, const char *command, const int response_codes[], char **response)
 
static void ftp_close_data_connection (FTPContext *s)
 
static void ftp_close_both_connections (FTPContext *s)
 
static int ftp_auth (FTPContext *s)
 
static int ftp_passive_mode_epsv (FTPContext *s)
 
static int ftp_passive_mode (FTPContext *s)
 
static int ftp_current_dir (FTPContext *s)
 
static int ftp_file_size (FTPContext *s)
 
static int ftp_retrieve (FTPContext *s)
 
static int ftp_store (FTPContext *s)
 
static int ftp_type (FTPContext *s)
 
static int ftp_restart (FTPContext *s, int64_t pos)
 
static int ftp_features (FTPContext *s)
 
static int ftp_connect_control_connection (URLContext *h)
 
static int ftp_connect_data_connection (URLContext *h)
 
static int ftp_abort (URLContext *h)
 
static int ftp_open (URLContext *h, const char *url, int flags)
 
static int64_t ftp_seek (URLContext *h, int64_t pos, int whence)
 
static int ftp_read (URLContext *h, unsigned char *buf, int size)
 
static int ftp_write (URLContext *h, const unsigned char *buf, int size)
 
static int ftp_get_file_handle (URLContext *h)
 
static int ftp_shutdown (URLContext *h, int flags)
 

Variables

static const AVOption options []
 
static const AVClass ftp_context_class
 
URLProtocol ff_ftp_protocol
 

Macro Definition Documentation

#define CONTROL_BUFFER_SIZE   1024
#define OFFSET (   x)    offsetof(FTPContext, x)

Definition at line 58 of file ftp.c.

Definition at line 59 of file ftp.c.

Definition at line 60 of file ftp.c.

Enumeration Type Documentation

enum FTPState
Enumerator
UNKNOWN 
READY 
DOWNLOADING 
UPLOADING 
DISCONNECTED 

Definition at line 30 of file ftp.c.

Function Documentation

static int ftp_close ( URLContext h)
static

Definition at line 768 of file ftp.c.

Referenced by ftp_open().

static int ftp_getc ( FTPContext s)
static

Definition at line 77 of file ftp.c.

Referenced by ftp_get_line().

static int ftp_get_line ( FTPContext s,
char *  line,
int  line_size 
)
static

Definition at line 94 of file ftp.c.

Referenced by ftp_status().

static int ftp_status ( FTPContext s,
char **  line,
const int  response_codes[] 
)
static

Definition at line 122 of file ftp.c.

Referenced by ftp_abort(), ftp_connect_control_connection(), and ftp_send_command().

static int ftp_send_command ( FTPContext s,
const char *  command,
const int  response_codes[],
char **  response 
)
static
static void ftp_close_data_connection ( FTPContext s)
static

Definition at line 203 of file ftp.c.

Referenced by ftp_abort(), and ftp_close_both_connections().

static void ftp_close_both_connections ( FTPContext s)
static

Definition at line 210 of file ftp.c.

Referenced by ftp_abort(), and ftp_close().

static int ftp_auth ( FTPContext s)
static

Definition at line 216 of file ftp.c.

Referenced by ftp_connect_control_connection().

static int ftp_passive_mode_epsv ( FTPContext s)
static

Definition at line 238 of file ftp.c.

Referenced by ftp_connect_data_connection().

static int ftp_passive_mode ( FTPContext s)
static

Definition at line 280 of file ftp.c.

Referenced by ftp_connect_data_connection().

static int ftp_current_dir ( FTPContext s)
static

Definition at line 326 of file ftp.c.

Referenced by ftp_open().

static int ftp_file_size ( FTPContext s)
static

Definition at line 367 of file ftp.c.

Referenced by ftp_open().

static int ftp_retrieve ( FTPContext s)
static

Definition at line 386 of file ftp.c.

Referenced by ftp_read().

static int ftp_store ( FTPContext s)
static

Definition at line 400 of file ftp.c.

Referenced by ftp_write().

static int ftp_type ( FTPContext s)
static

Definition at line 414 of file ftp.c.

Referenced by ftp_connect_control_connection().

static int ftp_restart ( FTPContext s,
int64_t  pos 
)
static

Definition at line 425 of file ftp.c.

Referenced by ftp_connect_data_connection(), and ftp_open().

static int ftp_features ( FTPContext s)
static

Definition at line 437 of file ftp.c.

Referenced by ftp_connect_control_connection().

static int ftp_connect_control_connection ( URLContext h)
static

Definition at line 454 of file ftp.c.

Referenced by ftp_abort(), and ftp_open().

static int ftp_connect_data_connection ( URLContext h)
static

Definition at line 502 of file ftp.c.

Referenced by ftp_read(), and ftp_write().

static int ftp_abort ( URLContext h)
static

Definition at line 535 of file ftp.c.

Referenced by ftp_read(), and ftp_seek().

static int ftp_open ( URLContext h,
const char *  url,
int  flags 
)
static

Definition at line 573 of file ftp.c.

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

Definition at line 639 of file ftp.c.

Referenced by ftp_read().

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

Definition at line 682 of file ftp.c.

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

Definition at line 739 of file ftp.c.

static int ftp_get_file_handle ( URLContext h)
static

Definition at line 783 of file ftp.c.

static int ftp_shutdown ( URLContext h,
int  flags 
)
static

Definition at line 795 of file ftp.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{"timeout", "set timeout of socket I/O operations", OFFSET(rw_timeout), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, D|E },
{"ftp-write-seekable", "control seekability of connection during encoding", OFFSET(write_seekable), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, E },
{"ftp-anonymous-password", "password for anonymous login. E-mail address should be used.", OFFSET(anonymous_password), AV_OPT_TYPE_STRING, { 0 }, 0, 0, D|E },
{NULL}
}
#define NULL
Definition: coverity.c:32
#define E
Definition: ftp.c:60
#define OFFSET(x)
Definition: ftp.c:58
#define D
Definition: ftp.c:59

Definition at line 61 of file ftp.c.

const AVClass ftp_context_class
static
Initial value:
= {
.class_name = "ftp",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:62
av_default_item_name
static const AVOption options[]
Definition: ftp.c:61

Definition at line 68 of file ftp.c.

URLProtocol ff_ftp_protocol
Initial value:
= {
.name = "ftp",
.url_open = ftp_open,
.url_read = ftp_read,
.url_write = ftp_write,
.url_seek = ftp_seek,
.url_close = ftp_close,
.url_get_file_handle = ftp_get_file_handle,
.url_shutdown = ftp_shutdown,
.priv_data_size = sizeof(FTPContext),
.priv_data_class = &ftp_context_class,
}
#define URL_PROTOCOL_FLAG_NETWORK
Definition: url.h:35
static int ftp_open(URLContext *h, const char *url, int flags)
Definition: ftp.c:573
static int ftp_shutdown(URLContext *h, int flags)
Definition: ftp.c:795
static int ftp_read(URLContext *h, unsigned char *buf, int size)
Definition: ftp.c:682
static int ftp_close(URLContext *h)
Definition: ftp.c:768
static int64_t ftp_seek(URLContext *h, int64_t pos, int whence)
Definition: ftp.c:639
static int ftp_get_file_handle(URLContext *h)
Definition: ftp.c:783
static int flags
Definition: cpu.c:47
static int ftp_write(URLContext *h, const unsigned char *buf, int size)
Definition: ftp.c:739
static const AVClass ftp_context_class
Definition: ftp.c:68
Definition: ftp.c:38

Definition at line 807 of file ftp.c.