FFmpeg
Macros | Functions
url.c File Reference

URL utility functions. More...

#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 append_path (char *root, char *out_end, char **rout, const char *in, const char *in_end)
 
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

#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)
if(ret)
#define ub(width, name)
Definition: cbs_h2645.c:264

Referenced by ff_make_absolute_url().

#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)
static void error(const char *err)
static av_cold int end(AVCodecContext *avctx)
Definition: avrndec.c:92
if(ret)
int len
FILE * out
Definition: movenc.c:54
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

Referenced by ff_make_absolute_url().

Function Documentation

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 
)
static

Definition at line 82 of file url.c.

Referenced by append_path(), and 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_url(), and test_decompose().

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

Definition at line 152 of file url.c.

Referenced by 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.

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

Definition at line 181 of file url.c.

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

AVIODirEntry* ff_alloc_dir_entry ( void  )

Allocate directory entry with default values.

Returns
entry or NULL on error

Definition at line 297 of file url.c.

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