FFmpeg
Macros | Functions
url.c File Reference
#include "avformat.h"
#include "internal.h"
#include "config.h"
#include "url.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"

Go to the source code of this file.

Macros

#define KEEP(component, also)
 
#define COPY(start, end)
 

Functions

int ff_url_join (char *str, int size, const char *proto, const char *authorization, const char *hostname, int port, const char *fmt,...)
 
static const char * find_delim (const char *delim, const char *cur, const char *end)
 
int ff_url_decompose (URLComponents *uc, const char *url, const char *end)
 Parse an URL to find the components. More...
 
static int is_fq_dos_path (const char *path)
 
static int append_path (char *root, char *out_end, char **rout, const char *in, const char *in_end)
 
int ff_make_absolute_url2 (char *buf, int size, const char *base, const char *rel, int handle_dos_paths)
 Convert a relative url into an absolute url, given a base url. More...
 
int ff_make_absolute_url (char *buf, int size, const char *base, const char *rel)
 Convert a relative url into an absolute url, given a base url. More...
 
AVIODirEntryff_alloc_dir_entry (void)
 Allocate directory entry with default values. More...
 

Detailed Description

URL utility functions.

Definition in file url.c.

Macro Definition Documentation

◆ KEEP

#define KEEP (   component,
  also 
)
Value:
do { \
if (uc.url_component_end_##component == uc.url && \
ub.url_component_end_##component > keep) { \
keep = ub.url_component_end_##component; \
also \
} \
} while (0)

◆ COPY

#define COPY (   start,
  end 
)
Value:
do { \
size_t len = end - start; \
if (len > out_end - out) { \
ret = AVERROR(ENOMEM); \
goto error; \
} \
memmove(out, start, len); \
out += len; \
} while (0)

Function Documentation

◆ ff_url_join()

int ff_url_join ( char *  str,
int  size,
const char *  proto,
const char *  authorization,
const char *  hostname,
int  port,
const char *  fmt,
  ... 
)

◆ find_delim()

static const char* find_delim ( const char *  delim,
const char *  cur,
const char *  end 
)
static

Definition at line 82 of file url.c.

Referenced by append_path(), and ff_url_decompose().

◆ ff_url_decompose()

int ff_url_decompose ( URLComponents uc,
const char *  url,
const char *  end 
)

Parse an URL to find the components.

Each component runs until the start of the next component, possibly including a mandatory delimiter.

Parameters
ucstructure to fill with pointers to the components.
urlURL to parse.
endend of the URL, or NULL to parse to the end of string.
Returns
>= 0 for success or an AVERROR code, especially if the URL is malformed.

Definition at line 89 of file url.c.

Referenced by ff_make_absolute_url2(), and test_decompose().

◆ is_fq_dos_path()

static int is_fq_dos_path ( const char *  path)
static

Definition at line 152 of file url.c.

Referenced by ff_make_absolute_url2().

◆ append_path()

static int append_path ( char *  root,
char *  out_end,
char **  rout,
const char *  in,
const char *  in_end 
)
static

Definition at line 164 of file url.c.

Referenced by ff_make_absolute_url2().

◆ ff_make_absolute_url2()

int ff_make_absolute_url2 ( char *  buf,
int  size,
const char *  base,
const char *  rel,
int  handle_dos_paths 
)

Convert a relative url into an absolute url, given a base url.

Parameters
bufthe buffer where output absolute url is written
sizethe size of buf
basethe base url, may be equal to buf.
relthe new url, which is interpreted relative to base
handle_dos_pathshandle DOS paths for file or unspecified protocol

Definition at line 193 of file url.c.

Referenced by ff_make_absolute_url(), and test().

◆ ff_make_absolute_url()

int ff_make_absolute_url ( char *  buf,
int  size,
const char *  base,
const char *  rel 
)

Convert a relative url into an absolute url, given a base url.

Same as ff_make_absolute_url2 with handle_dos_paths being equal to HAVE_DOS_PATHS config variable.

Definition at line 319 of file url.c.

Referenced by add_file(), get_content_url(), new_init_section(), new_playlist(), open_input(), parse_location(), parse_playlist(), and test().

◆ ff_alloc_dir_entry()

AVIODirEntry* ff_alloc_dir_entry ( void  )

Allocate directory entry with default values.

Returns
entry or NULL on error

Definition at line 325 of file url.c.

Referenced by ftp_read_dir(), libsmbc_read_dir(), and libssh_read_dir().

error
static void error(const char *err)
Definition: target_bsf_fuzzer.c:29
AVERROR
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
out
FILE * out
Definition: movenc.c:54
end
static av_cold int end(AVCodecContext *avctx)
Definition: avrndec.c:92
ub
#define ub(width, name)
Definition: cbs_h2645.c:264
len
int len
Definition: vorbis_enc_data.h:452