formats.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/channel_layout.h"
#include "libavutil/common.h"
#include "libavutil/eval.h"
#include "libavutil/pixdesc.h"
#include "libavutil/parseutils.h"
#include "avfilter.h"
#include "internal.h"
#include "formats.h"
#include "all_channel_layouts.inc"
Include dependency graph for formats.c:

Go to the source code of this file.

Macros

#define KNOWN(l)   (!FF_LAYOUT2COUNT(l)) /* for readability */
 
#define MERGE_REF(ret, a, fmts, type, fail)
 Add all refs from a to ret and destroy a. More...
 
#define MERGE_FORMATS(ret, a, b, fmts, nb, type, fail)
 Add all formats common for a and b to ret, copy the refs and destroy a and b. More...
 
#define COPY_INT_LIST(list_copy, list, type)
 
#define MAKE_FORMAT_LIST(type, field, count_field)
 
#define ADD_FORMAT(f, fmt, type, list, nb)
 
#define FORMATS_REF(f, ref)
 
#define FIND_REF_INDEX(ref, idx)
 
#define FORMATS_UNREF(ref, list)
 
#define FORMATS_CHANGEREF(oldref, newref)
 
#define SET_COMMON_FORMATS(ctx, fmts, in_fmts, out_fmts, ref, list)
 

Functions

AVFilterFormatsff_merge_formats (AVFilterFormats *a, AVFilterFormats *b, enum AVMediaType type)
 Return a format list which contains the intersection of the formats of a and b. More...
 
AVFilterFormatsff_merge_samplerates (AVFilterFormats *a, AVFilterFormats *b)
 
AVFilterChannelLayoutsff_merge_channel_layouts (AVFilterChannelLayouts *a, AVFilterChannelLayouts *b)
 Return a channel layouts/samplerates list which contains the intersection of the layouts/samplerates of a and b. More...
 
int ff_fmt_is_in (int fmt, const int *fmts)
 Tell is a format is contained in the provided list terminated by -1. More...
 
int * ff_copy_int_list (const int *const list)
 Return a copy of a list of integers terminated by -1, or NULL in case of copy failure. More...
 
int64_t * ff_copy_int64_list (const int64_t *const list)
 Return a copy of a list of 64-bit integers, or NULL in case of copy failure. More...
 
AVFilterFormatsff_make_format_list (const int *fmts)
 Create a list of supported formats. More...
 
AVFilterChannelLayoutsavfilter_make_format64_list (const int64_t *fmts)
 
int ff_add_format (AVFilterFormats **avff, int64_t fmt)
 Add fmt to the list of media formats contained in *avff. More...
 
int ff_add_channel_layout (AVFilterChannelLayouts **l, uint64_t channel_layout)
 
AVFilterFormatsff_all_formats (enum AVMediaType type)
 Return a list of all formats supported by FFmpeg for the given media type. More...
 
AVFilterFormatsff_planar_sample_fmts (void)
 Construct a formats list containing all planar sample formats. More...
 
AVFilterFormatsff_all_samplerates (void)
 
AVFilterChannelLayoutsff_all_channel_layouts (void)
 Construct an empty AVFilterChannelLayouts/AVFilterFormats struct – representing any channel layout (with known disposition)/sample rate. More...
 
AVFilterChannelLayoutsff_all_channel_counts (void)
 Construct an AVFilterChannelLayouts coding for any channel layout, with known or unknown disposition. More...
 
void ff_channel_layouts_ref (AVFilterChannelLayouts *f, AVFilterChannelLayouts **ref)
 Add *ref as a new reference to f. More...
 
void ff_formats_ref (AVFilterFormats *f, AVFilterFormats **ref)
 Add *ref as a new reference to formats. More...
 
void ff_formats_unref (AVFilterFormats **ref)
 If *ref is non-NULL, remove *ref as a reference to the format list it currently points to, deallocates that list if this was the last reference, and sets *ref to NULL. More...
 
void ff_channel_layouts_unref (AVFilterChannelLayouts **ref)
 Remove a reference to a channel layouts list. More...
 
void ff_channel_layouts_changeref (AVFilterChannelLayouts **oldref, AVFilterChannelLayouts **newref)
 
void ff_formats_changeref (AVFilterFormats **oldref, AVFilterFormats **newref)
 Before After


|formats |<------—. More...

 
void ff_set_common_channel_layouts (AVFilterContext *ctx, AVFilterChannelLayouts *layouts)
 A helper for query_formats() which sets all links to the same list of channel layouts/sample rates. More...
 
void ff_set_common_samplerates (AVFilterContext *ctx, AVFilterFormats *samplerates)
 
void ff_set_common_formats (AVFilterContext *ctx, AVFilterFormats *formats)
 A helper for query_formats() which sets all links to the same list of formats. More...
 
static int default_query_formats_common (AVFilterContext *ctx, AVFilterChannelLayouts *(layouts)(void))
 
int ff_default_query_formats (AVFilterContext *ctx)
 
int ff_query_formats_all (AVFilterContext *ctx)
 Set the formats list to all existing formats. More...
 
int ff_parse_pixel_format (enum AVPixelFormat *ret, const char *arg, void *log_ctx)
 Parse a pixel format. More...
 
int ff_parse_sample_format (int *ret, const char *arg, void *log_ctx)
 Parse a sample format name or a corresponding integer representation. More...
 
int ff_parse_time_base (AVRational *ret, const char *arg, void *log_ctx)
 Parse a time base. More...
 
int ff_parse_sample_rate (int *ret, const char *arg, void *log_ctx)
 Parse a sample rate. More...
 
int ff_parse_channel_layout (int64_t *ret, const char *arg, void *log_ctx)
 Parse a channel layout or a corresponding integer representation. More...
 

Variables

const int64_t avfilter_all_channel_layouts []
 

Macro Definition Documentation

#define ADD_FORMAT (   f,
  fmt,
  type,
  list,
  nb 
)
Value:
do { \
type *fmts; \
if (!(*f) && !(*f = av_mallocz(sizeof(**f)))) \
return AVERROR(ENOMEM); \
\
fmts = av_realloc((*f)->list, \
sizeof(*(*f)->list) * ((*f)->nb + 1));\
if (!fmts) \
return AVERROR(ENOMEM); \
\
(*f)->list = fmts; \
(*f)->list[(*f)->nb++] = fmt; \
} while (0)
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
Definition: mem.c:205
const char * fmt
Definition: avisynth_c.h:669
Sinusoidal phase f
void * av_realloc(void *ptr, size_t size)
Allocate or reallocate a block of memory.
Definition: mem.c:141
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFilterBuffer 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.Buffer references ownership and permissions
#define type
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame This method is called when a frame is wanted on an output For an it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return it should return

Definition at line 328 of file formats.c.

Referenced by ff_add_channel_layout(), and ff_add_format().

#define COPY_INT_LIST (   list_copy,
  list,
  type 
)
Value:
{ \
int count = 0; \
for (count = 0; list[count] != -1; count++) \
; \
list_copy = av_calloc(count+1, sizeof(type)); \
if (list_copy) { \
memcpy(list_copy, list, sizeof(type) * count); \
list_copy[count] = -1; \
} \
}
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFilterBuffer 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 list
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
#define type
void * av_calloc(size_t nmemb, size_t size)
Allocate a block of nmemb * size bytes with alignment suitable for all memory accesses (including vec...
Definition: mem.c:213
void INT64 INT64 count
Definition: avisynth_c.h:594
for(j=16;j >0;--j)

Definition at line 265 of file formats.c.

Referenced by ff_copy_int64_list(), and ff_copy_int_list().

#define FIND_REF_INDEX (   ref,
  idx 
)
Value:
do { \
int i; \
for (i = 0; i < (*ref)->refcount; i ++) \
if((*ref)->refs[i] == ref) { \
idx = i; \
break; \
} \
} while (0)
FIXME Range Coding of cr are ref
Definition: snow.txt:367
synthesis window for stochastic i
for(j=16;j >0;--j)

Definition at line 437 of file formats.c.

#define FORMATS_CHANGEREF (   oldref,
  newref 
)
Value:
do { \
int idx = -1; \
FIND_REF_INDEX(oldref, idx); \
if (idx >= 0) { \
(*oldref)->refs[idx] = newref; \
*newref = *oldref; \
*oldref = NULL; \
} \
} while (0)
#define FIND_REF_INDEX(ref, idx)
Definition: formats.c:437
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
NULL
Definition: eval.c:55

Definition at line 478 of file formats.c.

Referenced by ff_channel_layouts_changeref(), and ff_formats_changeref().

#define FORMATS_REF (   f,
  ref 
)
Value:
do { \
*ref = f; \
f->refs = av_realloc(f->refs, sizeof(*f->refs) * ++f->refcount); \
f->refs[f->refcount-1] = ref; \
} while (0)
FIXME Range Coding of cr are ref
Definition: snow.txt:367
Sinusoidal phase f
void * av_realloc(void *ptr, size_t size)
Allocate or reallocate a block of memory.
Definition: mem.c:141

Definition at line 420 of file formats.c.

Referenced by ff_channel_layouts_ref(), and ff_formats_ref().

#define FORMATS_UNREF (   ref,
  list 
)
Value:
do { \
int idx = -1; \
if (!*ref) \
if (idx >= 0) \
memmove((*ref)->refs + idx, (*ref)->refs + idx + 1, \
sizeof(*(*ref)->refs) * ((*ref)->refcount - idx - 1)); \
if(!--(*ref)->refcount) { \
av_free((*ref)->list); \
av_free((*ref)->refs); \
} \
*ref = NULL; \
} while (0)
FIXME Range Coding of cr are ref
Definition: snow.txt:367
#define FIND_REF_INDEX(ref, idx)
Definition: formats.c:437
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
Definition: mem.c:183
NULL
Definition: eval.c:55
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame This method is called when a frame is wanted on an output For an it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return it should return

Definition at line 447 of file formats.c.

Referenced by ff_channel_layouts_unref(), and ff_formats_unref().

#define KNOWN (   l)    (!FF_LAYOUT2COUNT(l)) /* for readability */

Definition at line 32 of file formats.c.

Referenced by ff_merge_channel_layouts().

#define MAKE_FORMAT_LIST (   type,
  field,
  count_field 
)
Value:
int count = 0; \
if (fmts) \
for (count = 0; fmts[count] != -1; count++) \
; \
formats->count_field = count; \
if (count) { \
formats->field = av_malloc(sizeof(*formats->field)*count); \
if (!formats->field) { \
} \
}
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
Definition: mem.c:205
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
Definition: mem.c:183
NULL
Definition: eval.c:55
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
Definition: mem.c:73
#define type
The official guide to swscale for confused that consecutive non overlapping rectangles of slice_bottom special converter These generally are unscaled converters of common formats
Definition: swscale.txt:33
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame This method is called when a frame is wanted on an output For an it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return it should return
void INT64 INT64 count
Definition: avisynth_c.h:594
for(j=16;j >0;--j)

Definition at line 291 of file formats.c.

Referenced by avfilter_make_format64_list(), and ff_make_format_list().

#define MERGE_FORMATS (   ret,
  a,
  b,
  fmts,
  nb,
  type,
  fail 
)
Value:
do { \
int i, j, k = 0, count = FFMIN(a->nb, b->nb); \
if (!(ret = av_mallocz(sizeof(*ret)))) \
goto fail; \
if (count) { \
if (!(ret->fmts = av_malloc(sizeof(*ret->fmts) * count))) \
goto fail; \
for (i = 0; i < a->nb; i++) \
for (j = 0; j < b->nb; j++) \
if (a->fmts[i] == b->fmts[j]) { \
if(k >= FFMIN(a->nb, b->nb)){ \
av_log(NULL, AV_LOG_ERROR, "Duplicate formats in avfilter_merge_formats() detected\n"); \
av_free(ret->fmts); \
} \
ret->fmts[k++] = a->fmts[i]; \
} \
} \
ret->nb = k; \
/* check that there was at least one common format */ \
if (!ret->nb) \
goto fail; \
MERGE_REF(ret, a, fmts, type, fail); \
MERGE_REF(ret, b, fmts, type, fail); \
} while (0)
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
Definition: mem.c:205
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
#define b
Definition: input.c:42
void av_free(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). ...
Definition: mem.c:183
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:246
#define FFMIN(a, b)
Definition: common.h:58
ret
Definition: avfilter.c:821
for k
NULL
Definition: eval.c:55
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:148
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
Definition: mem.c:73
synthesis window for stochastic i
#define type
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame This method is called when a frame is wanted on an output For an it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return it should return
void INT64 INT64 count
Definition: avisynth_c.h:594
for(j=16;j >0;--j)
#define MERGE_REF(ret, a, fmts, type, fail)
Add all refs from a to ret and destroy a.
Definition: formats.c:37

Add all formats common for a and b to ret, copy the refs and destroy a and b.

Definition at line 61 of file formats.c.

Referenced by ff_merge_formats(), and ff_merge_samplerates().

#define MERGE_REF (   ret,
  a,
  fmts,
  type,
  fail 
)
Value:
do { \
type ***tmp; \
int i; \
if (!(tmp = av_realloc(ret->refs, \
sizeof(*tmp) * (ret->refcount + a->refcount)))) \
goto fail; \
ret->refs = tmp; \
for (i = 0; i < a->refcount; i ++) { \
ret->refs[ret->refcount] = a->refs[i]; \
*ret->refs[ret->refcount++] = ret; \
} \
av_freep(&a->refs); \
av_freep(&a->fmts); \
} while (0)
void * av_realloc(void *ptr, size_t size)
Allocate or reallocate a block of memory.
Definition: mem.c:141
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
Definition: mem.c:198
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
ret
Definition: avfilter.c:821
synthesis window for stochastic i
#define type
for(j=16;j >0;--j)

Add all refs from a to ret and destroy a.

Definition at line 37 of file formats.c.

Referenced by ff_merge_channel_layouts(), and ff_merge_samplerates().

#define SET_COMMON_FORMATS (   ctx,
  fmts,
  in_fmts,
  out_fmts,
  ref,
  list 
)
Value:
{ \
int count = 0, i; \
for (i = 0; i < ctx->nb_inputs; i++) { \
if (ctx->inputs[i] && !ctx->inputs[i]->out_fmts) { \
ref(fmts, &ctx->inputs[i]->out_fmts); \
count++; \
} \
} \
for (i = 0; i < ctx->nb_outputs; i++) { \
if (ctx->outputs[i] && !ctx->outputs[i]->in_fmts) { \
ref(fmts, &ctx->outputs[i]->in_fmts); \
count++; \
} \
} \
if (!count) { \
av_freep(&fmts->list); \
av_freep(&fmts->refs); \
av_freep(&fmts); \
} \
}
FIXME Range Coding of cr are ref
Definition: snow.txt:367
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
Definition: mem.c:198
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
synthesis window for stochastic i
void INT64 INT64 count
Definition: avisynth_c.h:594
for(j=16;j >0;--j)

Definition at line 502 of file formats.c.

Referenced by ff_set_common_channel_layouts(), ff_set_common_formats(), and ff_set_common_samplerates().

Function Documentation

AVFilterChannelLayouts* avfilter_make_format64_list ( const int64_t *  fmts)

Definition at line 317 of file formats.c.

Referenced by movie_query_formats(), and query_formats().

static int default_query_formats_common ( AVFilterContext ctx,
AVFilterChannelLayouts layouts)(void 
)
static

Definition at line 551 of file formats.c.

Referenced by ff_default_query_formats(), and ff_query_formats_all().

int ff_add_channel_layout ( AVFilterChannelLayouts **  l,
uint64_t  channel_layout 
)
int ff_add_format ( AVFilterFormats **  avff,
int64_t  fmt 
)

Add fmt to the list of media formats contained in *avff.

If *avff is NULL the function allocates the filter formats struct and puts its pointer in *avff.

Returns
a non negative value in case of success, or a negative value corresponding to an AVERROR code in case of error

Definition at line 344 of file formats.c.

Referenced by asink_query_formats(), ff_all_formats(), ff_planar_sample_fmts(), init(), query_formats(), reduce_formats_on_filter(), and vsink_query_formats().

AVFilterChannelLayouts* ff_all_channel_counts ( void  )

Construct an AVFilterChannelLayouts coding for any channel layout, with known or unknown disposition.

Definition at line 411 of file formats.c.

Referenced by asink_query_formats(), ff_query_formats_all(), and query_formats().

AVFilterChannelLayouts* ff_all_channel_layouts ( void  )

Construct an empty AVFilterChannelLayouts/AVFilterFormats struct – representing any channel layout (with known disposition)/sample rate.

Definition at line 402 of file formats.c.

Referenced by channelmap_query_formats(), ff_default_query_formats(), filter_query_formats(), join_query_formats(), and query_formats().

AVFilterFormats* ff_all_formats ( enum AVMediaType  type)

Return a list of all formats supported by FFmpeg for the given media type.

Definition at line 357 of file formats.c.

Referenced by default_query_formats_common(), filter_query_formats(), and query_formats().

void ff_channel_layouts_changeref ( AVFilterChannelLayouts **  oldref,
AVFilterChannelLayouts **  newref 
)

Definition at line 491 of file formats.c.

Referenced by avfilter_insert_filter().

void ff_channel_layouts_ref ( AVFilterChannelLayouts f,
AVFilterChannelLayouts **  ref 
)

Add *ref as a new reference to f.

Definition at line 427 of file formats.c.

Referenced by channelmap_query_formats(), ff_set_common_channel_layouts(), join_query_formats(), movie_query_formats(), and query_formats().

void ff_channel_layouts_unref ( AVFilterChannelLayouts **  ref)

Remove a reference to a channel layouts list.

Definition at line 473 of file formats.c.

Referenced by avfilter_free(), and pick_format().

int64_t* ff_copy_int64_list ( const int64_t *const  list)

Return a copy of a list of 64-bit integers, or NULL in case of copy failure.

Definition at line 284 of file formats.c.

int* ff_copy_int_list ( const int *const  list)

Return a copy of a list of integers terminated by -1, or NULL in case of copy failure.

Definition at line 277 of file formats.c.

int ff_default_query_formats ( AVFilterContext ctx)

Definition at line 567 of file formats.c.

Referenced by main(), query_formats(), and vsink_query_formats().

int ff_fmt_is_in ( int  fmt,
const int *  fmts 
)

Tell is a format is contained in the provided list terminated by -1.

Definition at line 254 of file formats.c.

Referenced by config_input(), config_input_main(), config_input_overlay(), config_out_props(), and config_props().

void ff_formats_changeref ( AVFilterFormats **  oldref,
AVFilterFormats **  newref 
)

Before After


|formats |<------—.

|formats |<------—. | ____ | ___|___ | ____ | ___|___ | |refs| | | | | | |refs| | | | | NULL | |* *------—>|*oldref| | |* *------—>|*newref| ^ | |* * | | |_______| | |* * | | |_______| ___|___ | |____| | | |____| | | | | |________| |________| |*oldref| |_______|

Definition at line 497 of file formats.c.

Referenced by avfilter_insert_filter().

void ff_formats_ref ( AVFilterFormats formats,
AVFilterFormats **  ref 
)

Add *ref as a new reference to formats.

That is the pointers will point like in the ascii art below:


|formats |<-----—. | ____ | ____|___________________ | |refs| | | __|_ | |* * | | | | | | AVFilterLink | |* *------—>|*ref| | |____| | | |____| |________| |________________________

Definition at line 432 of file formats.c.

Referenced by ff_set_common_formats(), ff_set_common_samplerates(), movie_query_formats(), and query_formats().

void ff_formats_unref ( AVFilterFormats **  ref)

If *ref is non-NULL, remove *ref as a reference to the format list it currently points to, deallocates that list if this was the last reference, and sets *ref to NULL.

Before After ________ ________ NULL |formats |<-----—. |formats | ^ | ____ | ____|________________ | ____ | ____|________________ | |refs| | | __|_ | |refs| | | __|_ | |* * | | | | | | AVFilterLink | |* * | | | | | | AVFilterLink | |* *------—>|*ref| | |* | | | |*ref| | |____| | | |____| | |____| | | |____| |________| |_____________________ |________| |_____________________

Definition at line 468 of file formats.c.

Referenced by avfilter_free(), pick_format(), and query_formats().

AVFilterFormats* ff_make_format_list ( const int *  fmts)

Create a list of supported formats.

This is intended for use in AVFilter->query_formats().

Parameters
fmtslist of media formats, terminated by -1
Returns
the format list, with no existing references

Definition at line 308 of file formats.c.

Referenced by ff_draw_supported_pixel_formats(), geq_query_formats(), movie_query_formats(), pp_query_formats(), query_formats(), and request_frame().

AVFilterChannelLayouts* ff_merge_channel_layouts ( AVFilterChannelLayouts a,
AVFilterChannelLayouts b 
)

Return a channel layouts/samplerates list which contains the intersection of the layouts/samplerates of a and b.

Also, all the references of a, all the references of b, and a and b themselves will be deallocated.

If a and b do not share any common elements, neither is modified, and NULL is returned.

Definition at line 166 of file formats.c.

Referenced by query_formats().

AVFilterFormats* ff_merge_formats ( AVFilterFormats a,
AVFilterFormats b,
enum AVMediaType  type 
)

Return a format list which contains the intersection of the formats of a and b.

Also, all the references of a, all the references of b, and a and b themselves will be deallocated.

If a and b do not share any common formats, neither is modified, and NULL is returned.

Definition at line 92 of file formats.c.

Referenced by query_formats().

AVFilterFormats* ff_merge_samplerates ( AVFilterFormats a,
AVFilterFormats b 
)

Definition at line 139 of file formats.c.

Referenced by query_formats().

int ff_parse_channel_layout ( int64_t *  ret,
const char *  arg,
void log_ctx 
)

Parse a channel layout or a corresponding integer representation.

Parameters
ret64bit integer pointer to where the value should be written.
argstring to parse
log_ctxlog context
Returns
0 in case of success, a negative AVERROR code on error

Definition at line 632 of file formats.c.

Referenced by init().

int ff_parse_pixel_format ( enum AVPixelFormat ret,
const char *  arg,
void log_ctx 
)

Parse a pixel format.

Parameters
retpixel format pointer to where the value should be written
argstring to parse
log_ctxlog context
Returns
0 in case of success, a negative AVERROR code on error

Definition at line 579 of file formats.c.

Referenced by init().

int ff_parse_sample_format ( int *  ret,
const char *  arg,
void log_ctx 
)

Parse a sample format name or a corresponding integer representation.

Parameters
retinteger pointer to where the value should be written
argstring to parse
log_ctxlog context
Returns
0 in case of success, a negative AVERROR code on error

Definition at line 594 of file formats.c.

Referenced by init().

int ff_parse_sample_rate ( int *  ret,
const char *  arg,
void log_ctx 
)

Parse a sample rate.

Parameters
retunsigned integer pointer to where the value should be written
argstring to parse
log_ctxlog context
Returns
0 in case of success, a negative AVERROR code on error

Definition at line 620 of file formats.c.

Referenced by init().

int ff_parse_time_base ( AVRational ret,
const char *  arg,
void log_ctx 
)

Parse a time base.

Parameters
retunsigned AVRational pointer to where the value should be written
argstring to parse
log_ctxlog context
Returns
0 in case of success, a negative AVERROR code on error

Definition at line 609 of file formats.c.

AVFilterFormats* ff_planar_sample_fmts ( void  )

Construct a formats list containing all planar sample formats.

Definition at line 384 of file formats.c.

Referenced by channelmap_query_formats(), join_query_formats(), and query_formats().

int ff_query_formats_all ( AVFilterContext ctx)

Set the formats list to all existing formats.

This function behaves like ff_default_query_formats(), except it also accepts channel layouts with unknown disposition. It should only be used with audio filters.

Definition at line 572 of file formats.c.

void ff_set_common_channel_layouts ( AVFilterContext ctx,
AVFilterChannelLayouts layouts 
)

A helper for query_formats() which sets all links to the same list of channel layouts/sample rates.

If there are no links hooked to this filter, the list is freed.

Definition at line 526 of file formats.c.

Referenced by asink_query_formats(), default_query_formats_common(), filter_query_formats(), and query_formats().

void ff_set_common_formats ( AVFilterContext ctx,
AVFilterFormats formats 
)

A helper for query_formats() which sets all links to the same list of formats.

If there are no links hooked to this filter, the list of formats is freed.

Definition at line 545 of file formats.c.

Referenced by asink_query_formats(), channelmap_query_formats(), default_query_formats_common(), filter_query_formats(), geq_query_formats(), join_query_formats(), pp_query_formats(), query_formats(), request_frame(), and vsink_query_formats().

void ff_set_common_samplerates ( AVFilterContext ctx,
AVFilterFormats samplerates 
)

Variable Documentation

const int64_t avfilter_all_channel_layouts[]

Definition at line 374 of file formats.c.

Referenced by ff_parse_channel_layout().