Go to the documentation of this file.
30 #define CONTROL_BUFFER_SIZE 1024
31 #define DIR_BUFFER_SIZE 4096
74 #define OFFSET(x) offsetof(FTPContext, x)
75 #define D AV_OPT_FLAG_DECODING_PARAM
76 #define E AV_OPT_FLAG_ENCODING_PARAM
78 {
"timeout",
"set timeout of socket I/O operations",
OFFSET(rw_timeout),
AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX,
D|
E },
79 {
"ftp-write-seekable",
"control seekability of connection during encoding",
OFFSET(write_seekable),
AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1,
E },
80 {
"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 },
96 if (
s->control_buf_ptr >=
s->control_buf_end) {
103 s->control_buf_ptr =
s->control_buffer;
104 s->control_buf_end =
s->control_buffer +
len;
107 return *
s->control_buf_ptr++;
122 if (q >
line && q[-1] ==
'\r')
127 if ((q -
line) < line_size - 1)
140 int err,
i, dash = 0,
result = 0, code_found = 0, linesize;
142 AVBPrint line_buffer;
147 while (!code_found || dash) {
156 linesize = strlen(
buf);
159 for (
i = 0;
i < 3; ++
i) {
174 for (
i = 0; response_codes[
i]; ++
i) {
175 if (err == response_codes[
i]) {
186 if (!dash &&
buf[3] ==
'-')
188 else if (err == dash &&
buf[3] ==
' ')
200 const int response_codes[],
char **response)
209 if (!
s->conn_control)
218 if (response_codes) {
241 static const int user_codes[] = {331, 230, 0};
242 static const int pass_codes[] = {230, 0};
263 static const char d =
'|';
264 static const char *
command =
"EPSV\r\n";
265 static const int epsv_codes[] = {229, 0};
270 for (
i = 0; res[
i]; ++
i) {
273 }
else if (res[
i] ==
')') {
282 if (strlen(
start) < 5)
289 s->server_data_port = atoi(
start);
290 ff_dlog(
s,
"Server data port: %d\n",
s->server_data_port);
297 s->server_data_port = -1;
305 static const char *
command =
"PASV\r\n";
306 static const int pasv_codes[] = {227, 0};
311 for (
i = 0; res[
i]; ++
i) {
314 }
else if (res[
i] ==
')') {
332 s->server_data_port = atoi(
start) * 256;
335 s->server_data_port += atoi(
start);
336 ff_dlog(
s,
"Server data port: %d\n",
s->server_data_port);
343 s->server_data_port = -1;
351 static const char *
command =
"PWD\r\n";
352 static const int pwd_codes[] = {257, 0};
357 for (
i = 0; res[
i]; ++
i) {
389 static const int size_codes[] = {213, 0};
393 s->filesize = strtoll(&res[4],
NULL, 10);
407 static const int retr_codes[] = {150, 125, 0};
412 if (resp_code != 125 && resp_code != 150)
423 static const int stor_codes[] = {150, 125, 0};
428 if (resp_code != 125 && resp_code != 150)
438 static const char *
command =
"TYPE I\r\n";
439 static const int type_codes[] = {200, 0};
450 static const int rest_codes[] = {350, 0};
461 static const int cwd_codes[] = {250, 550, 0};
472 static const char *
command =
"MLSD\r\n";
473 static const int mlsd_codes[] = {150, 500, 0};
477 s->listing_method =
MLSD;
483 static const char *
command =
"NLST\r\n";
484 static const int nlst_codes[] = {226, 425, 426, 451, 450, 550, 0};
488 s->listing_method =
NLST;
513 static const char *feat_command =
"FEAT\r\n";
514 static const char *enable_utf8_command =
"OPTS UTF8 ON\r\n";
515 static const int feat_codes[] = {211, 0};
516 static const int opts_codes[] = {200, 202, 451, 0};
525 if (
ret == 200 ||
ret == 202)
538 static const int connect_codes[] = {220, 0};
540 if (!
s->conn_control) {
542 s->hostname,
s->server_control_port,
NULL);
543 if (
s->rw_timeout != -1) {
547 &
h->interrupt_callback, &
opts,
548 h->protocol_whitelist,
h->protocol_blacklist,
h);
562 av_log(
h,
AV_LOG_WARNING,
"Pure-FTPd server is used as an output protocol. It is known issue this implementation may produce incorrect content and it cannot be fixed at this moment.");
597 if (
s->rw_timeout != -1) {
601 &
h->interrupt_callback, &
opts,
602 h->protocol_whitelist,
h->protocol_blacklist,
h);
617 static const char *
command =
"ABOR\r\n";
619 static const int abor_codes[] = {225, 226, 0};
656 const char *tok_user =
NULL, *tok_pass =
NULL;
668 credencials,
sizeof(credencials),
669 hostname,
sizeof(hostname),
670 &
s->server_control_port,
677 tok_user =
"anonymous";
678 tok_pass =
av_x_if_null(
s->anonymous_password,
"nopassword");
683 if (!
s->hostname || !
s->user || (tok_pass && !
s->password)) {
687 if (
s->server_control_port < 0 ||
s->server_control_port > 65535)
688 s->server_control_port = 21;
736 int64_t new_pos, fake_pos;
738 ff_dlog(
h,
"ftp protocol seek %"PRId64
" %d\n", pos, whence);
747 new_pos =
s->position + pos;
752 new_pos =
s->filesize + pos;
766 fake_pos =
s->filesize != -1 ?
FFMIN(new_pos,
s->filesize) : new_pos;
767 if (fake_pos !=
s->position) {
770 s->position = fake_pos;
778 int read, err, retry_done = 0;
784 if (
s->position >=
s->filesize)
790 if (
s->position >=
s->filesize)
799 if (
s->position >=
s->filesize) {
802 int64_t pos =
s->position;
810 if (read <= 0 && s->position < s->filesize && !
h->is_streamed) {
812 int64_t pos =
s->position;
816 if ((err =
ftp_seek(
h, pos, SEEK_SET)) < 0) {
851 s->position += written;
852 s->filesize =
FFMAX(
s->filesize,
s->position);
881 ff_dlog(
h,
"ftp protocol get_file_handle\n");
893 ff_dlog(
h,
"ftp protocol shutdown\n");
915 if (!
s->dir_buffer) {
919 s->dir_buffer[0] = 0;
931 memset(&tv, 0,
sizeof(
struct tm));
933 return INT64_C(1000000) *
av_timegm(&tv);
946 while(fact =
av_strtok(mlsd,
";", &mlsd)) {
947 if (fact[0] ==
' ') {
984 switch (
s->listing_method) {
1003 start =
s->dir_buffer +
s->dir_buffer_offset;
1004 while (!(found = strstr(
start,
"\n"))) {
1007 s->dir_buffer_size -=
s->dir_buffer_offset;
1008 s->dir_buffer_offset = 0;
1009 if (
s->dir_buffer_size)
1010 memmove(
s->dir_buffer,
start,
s->dir_buffer_size);
1018 s->dir_buffer_size +=
ret;
1019 s->dir_buffer[
s->dir_buffer_size] = 0;
1023 s->dir_buffer_offset += (found + 1 -
start);
1025 if (found >
start && found[-1] ==
'\r')
1031 (*next)->utf8 =
s->utf8;
1055 static const int del_codes[] = {250, 421, 450, 500, 501, 502, 530, 550, 0};
1056 static const int rmd_codes[] = {250, 421, 500, 501, 502, 530, 550, 0};
1083 static const int rnfr_codes[] = {350, 421, 450, 500, 501, 502, 503, 530, 0};
1084 static const int rnto_codes[] = {250, 421, 500, 501, 502, 503, 530, 532, 553, 0};
1127 .default_whitelist =
"tcp",
static int64_t ftp_seek(URLContext *h, int64_t pos, int whence)
#define AV_LOG_WARNING
Something somehow does not look correct.
static int ftp_get_line(FTPContext *s, char *line, int line_size)
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
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
#define URL_PROTOCOL_FLAG_NETWORK
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
char * av_stristr(const char *s1, const char *s2)
Locate the first case-independent occurrence in the string haystack of the string needle.
#define AVERROR_EOF
End of file.
#define AVIO_FLAG_READ_WRITE
read-write pseudo flag
uint8_t pi<< 24) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_U8,(uint64_t)((*(const uint8_t *) pi - 0x80U))<< 56) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8,(*(const uint8_t *) pi - 0x80) *(1.0f/(1<< 7))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8,(*(const uint8_t *) pi - 0x80) *(1.0/(1<< 7))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16,(*(const int16_t *) pi >>8)+0x80) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_S16,(uint64_t)(*(const int16_t *) pi)<< 48) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, *(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, *(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32,(*(const int32_t *) pi >>24)+0x80) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_S32,(uint64_t)(*(const int32_t *) pi)<< 32) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, *(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, *(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S64,(*(const int64_t *) pi >>56)+0x80) CONV_FUNC(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S64, *(const int64_t *) pi *(1.0f/(INT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S64, *(const int64_t *) pi *(1.0/(INT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_FLT, llrintf(*(const float *) pi *(INT64_C(1)<< 63))) CONV_FUNC(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31)))) CONV_FUNC(AV_SAMPLE_FMT_S64, int64_t, AV_SAMPLE_FMT_DBL, llrint(*(const double *) pi *(INT64_C(1)<< 63))) #define FMT_PAIR_FUNC(out, in) static conv_func_type *const fmt_pair_to_conv_functions[AV_SAMPLE_FMT_NB *AV_SAMPLE_FMT_NB]={ FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_U8), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S16), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S32), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_FLT), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_DBL), FMT_PAIR_FUNC(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_S64), FMT_PAIR_FUNC(AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S64), };static void cpy1(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, len);} static void cpy2(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, 2 *len);} static void cpy4(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, 4 *len);} static void cpy8(uint8_t **dst, const uint8_t **src, int len){ memcpy(*dst, *src, 8 *len);} AudioConvert *swri_audio_convert_alloc(enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, const int *ch_map, int flags) { AudioConvert *ctx;conv_func_type *f=fmt_pair_to_conv_functions[av_get_packed_sample_fmt(out_fmt)+AV_SAMPLE_FMT_NB *av_get_packed_sample_fmt(in_fmt)];if(!f) return NULL;ctx=av_mallocz(sizeof(*ctx));if(!ctx) return NULL;if(channels==1){ in_fmt=av_get_planar_sample_fmt(in_fmt);out_fmt=av_get_planar_sample_fmt(out_fmt);} ctx->channels=channels;ctx->conv_f=f;ctx->ch_map=ch_map;if(in_fmt==AV_SAMPLE_FMT_U8||in_fmt==AV_SAMPLE_FMT_U8P) memset(ctx->silence, 0x80, sizeof(ctx->silence));if(out_fmt==in_fmt &&!ch_map) { switch(av_get_bytes_per_sample(in_fmt)){ case 1:ctx->simd_f=cpy1;break;case 2:ctx->simd_f=cpy2;break;case 4:ctx->simd_f=cpy4;break;case 8:ctx->simd_f=cpy8;break;} } if(HAVE_X86ASM &&1) swri_audio_convert_init_x86(ctx, out_fmt, in_fmt, channels);if(ARCH_ARM) swri_audio_convert_init_arm(ctx, out_fmt, in_fmt, channels);if(ARCH_AARCH64) swri_audio_convert_init_aarch64(ctx, out_fmt, in_fmt, channels);return ctx;} void swri_audio_convert_free(AudioConvert **ctx) { av_freep(ctx);} int swri_audio_convert(AudioConvert *ctx, AudioData *out, AudioData *in, int len) { int ch;int off=0;const int os=(out->planar ? 1 :out->ch_count) *out->bps;unsigned misaligned=0;av_assert0(ctx->channels==out->ch_count);if(ctx->in_simd_align_mask) { int planes=in->planar ? in->ch_count :1;unsigned m=0;for(ch=0;ch< planes;ch++) m|=(intptr_t) in->ch[ch];misaligned|=m &ctx->in_simd_align_mask;} if(ctx->out_simd_align_mask) { int planes=out->planar ? out->ch_count :1;unsigned m=0;for(ch=0;ch< planes;ch++) m|=(intptr_t) out->ch[ch];misaligned|=m &ctx->out_simd_align_mask;} if(ctx->simd_f &&!ctx->ch_map &&!misaligned){ off=len &~15;av_assert1(off >=0);av_assert1(off<=len);av_assert2(ctx->channels==SWR_CH_MAX||!in->ch[ctx->channels]);if(off >0){ if(out->planar==in->planar){ int planes=out->planar ? out->ch_count :1;for(ch=0;ch< planes;ch++){ ctx->simd_f(out-> ch ch
const char * anonymous_password
Password to be used for anonymous user.
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
static av_cold int end(AVCodecContext *avctx)
static int ftp_abort(URLContext *h)
static av_cold void cleanup(FlashSV2Context *s)
int type
Type of the entry.
static int ftp_write(URLContext *h, const unsigned char *buf, int size)
#define AVSEEK_SIZE
ORing this as the "whence" parameter to a seek function causes it to return the filesize without seek...
const URLProtocol ff_ftp_protocol
uint8_t * control_buf_ptr
char * password
Server user's password.
static int ftp_file_size(FTPContext *s)
char * av_append_path_component(const char *path, const char *component)
Append path component to the existing path.
int server_data_port
Data connection port opened by server, -1 on error.
static int ftp_open(URLContext *h, const char *url, int flags)
static int ftp_close(URLContext *h)
static int ftp_shutdown(URLContext *h, int flags)
#define AV_BPRINT_SIZE_AUTOMATIC
time_t av_timegm(struct tm *tm)
Convert the decomposed UTC time in tm to a time_t value.
void avio_free_directory_entry(AVIODirEntry **entry)
Free entry allocated by avio_read_dir().
int64_t modification_timestamp
Time of last modification in microseconds since unix epoch, -1 if unknown.
static int ftp_passive_mode_epsv(FTPContext *s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ AVIO_ENTRY_SYMBOLIC_LINK
static const AVClass ftp_context_class
int ffurl_open_whitelist(URLContext **puc, const char *filename, int flags, const AVIOInterruptCB *int_cb, AVDictionary **options, const char *whitelist, const char *blacklist, URLContext *parent)
Create an URLContext for accessing to the resource indicated by url, and open it.
int write_seekable
Control seekability, 0 = disable, 1 = enable.
static int ftp_read_dir(URLContext *h, AVIODirEntry **next)
char * av_strtok(char *s, const char *delim, char **saveptr)
Split the string into several tokens which can be accessed by successive calls to av_strtok().
int ff_url_join(char *str, int size, const char *proto, const char *authorization, const char *hostname, int port, const char *fmt,...)
static int ftp_parse_entry_nlst(char *line, AVIODirEntry *next)
#define AVIO_FLAG_WRITE
write-only
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
static int ftp_has_feature(FTPContext *s, const char *feature_name)
static int command(AVFilterContext *ctx, const char *cmd, const char *arg, char *res, int res_len, int flags)
#define LIBAVUTIL_VERSION_INT
Describe the class of an AVClass context structure.
and forward the result(frame or status change) to the corresponding input. If nothing is possible
int64_t size
File size in bytes, -1 if unknown.
FTPListingMethod listing_method
Called listing method.
static int ftp_auth(FTPContext *s)
const char * av_default_item_name(void *ptr)
Return the context name.
int ffurl_shutdown(URLContext *h, int flags)
Signal the URLContext that we are done reading or writing the stream.
static int ftp_get_file_handle(URLContext *h)
static int ftp_send_command(FTPContext *s, const char *command, const int response_codes[], char **response)
static int ftp_delete(URLContext *h)
static int ftp_list(FTPContext *s)
int64_t group_id
Group ID of owner, -1 if unknown.
int64_t filemode
Unix file mode, -1 if unknown.
static const AVOption options[]
static int64_t ftp_parse_date(const char *date)
#define CONTROL_BUFFER_SIZE
static int ftp_status(FTPContext *s, char **line, const int response_codes[])
Describes single entry of the directory.
FTPState state
State of data connection.
static int ftp_parse_entry(URLContext *h, char *line, AVIODirEntry *next)
URLContext * conn_control
Control connection.
static int ftp_close_dir(URLContext *h)
static int ftp_open_dir(URLContext *h)
char * hostname
Server address.
int64_t position
Current position, calculated.
void av_dict_free(AVDictionary **pm)
Free all the memory allocated for an AVDictionary struct and all keys and values.
int64_t filesize
Size of file on server, -1 on error.
#define AV_LOG_INFO
Standard information.
int64_t user_id
User ID of owner, -1 if unknown.
AVIODirEntry * ff_alloc_dir_entry(void)
Allocate directory entry with default values.
#define i(width, name, range_min, range_max)
static int ftp_read(URLContext *h, unsigned char *buf, int size)
static int ftp_list_nlst(FTPContext *s)
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
static int ftp_retrieve(FTPContext *s)
void av_url_split(char *proto, int proto_size, char *authorization, int authorization_size, char *hostname, int hostname_size, int *port_ptr, char *path, int path_size, const char *url)
Split a URL string into components.
static void ftp_close_both_connections(FTPContext *s)
int ffurl_closep(URLContext **hh)
Close the resource accessed by the URLContext h, and free the memory used by it.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
static int ftp_connect_control_connection(URLContext *h)
char * path
Path to resource on server.
void av_bprintf(AVBPrint *buf, const char *fmt,...)
char * av_small_strptime(const char *p, const char *fmt, struct tm *dt)
Simplified version of strptime.
URLContext * conn_data
Data connection, NULL when not connected.
static int ftp_passive_mode(FTPContext *s)
int ffurl_read(URLContext *h, unsigned char *buf, int size)
Read up to size bytes from the resource accessed by h, and store the read bytes in buf.
int ffurl_write(URLContext *h, const unsigned char *buf, int size)
Write size bytes from buf to the resource accessed by h.
static int ftp_features(FTPContext *s)
static int ftp_current_dir(FTPContext *s)
static int ftp_store(FTPContext *s)
static int ftp_getc(FTPContext *s)
int server_control_port
Control connection port, default is 21.
static int ftp_connect_data_connection(URLContext *h)
int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value, int flags)
Convenience wrapper for av_dict_set that converts the value to a string and stores it.
static int ftp_list_mlsd(FTPContext *s)
#define AVIO_FLAG_READ
read-only
char * av_strdup(const char *s)
Duplicate a string.
#define flags(name, subs,...)
static void ftp_close_data_connection(FTPContext *s)
static int ftp_type(FTPContext *s)
char * features
List of server's features represented as raw response.
static int ftp_parse_entry_mlsd(char *mlsd, AVIODirEntry *next)
static int ftp_restart(FTPContext *s, int64_t pos)
int rw_timeout
Network timeout.
static int ftp_move(URLContext *h_src, URLContext *h_dst)
static int ftp_set_dir(FTPContext *s)
int ffurl_get_file_handle(URLContext *h)
Return the file descriptor associated with this URL.
static int ftp_connect(URLContext *h, const char *url)
The official guide to swscale for confused that consecutive non overlapping rectangles of slice_bottom special converter These generally are unscaled converters of common like for each output line the vertical scaler pulls lines from a ring buffer When the ring buffer does not contain the wanted line
static void * av_x_if_null(const void *p, const void *x)
Return x default pointer in case p is NULL.