FFmpeg
Macros | Functions
channel_layout.c File Reference
#include <inttypes.h>
#include <stdio.h>
#include <string.h>
#include "libavutil/bprint.h"
#include "libavutil/channel_layout.h"
#include "libavutil/internal.h"
#include "libavutil/mem.h"

Go to the source code of this file.

Macros

#define BPRINT_ARGS1(bp, ...)   (bp), __VA_ARGS__
 
#define BPRINT_ARGS0(bp, ...)   __VA_ARGS__, (bp)
 
#define ORD_ARGS1(str, size, ...)   (str), (size), __VA_ARGS__
 
#define ORD_ARGS0(str, size, ...)   __VA_ARGS__, (str), (size)
 
#define CMP_BPRINT_AND_NONBPRINT(bp, func_name, ARG_ORDER, ...)
 
#define CHANNEL_NAME(x)   channel_name(&bp, (x));
 
#define CHANNEL_DESCRIPTION(x)   channel_description(&bp, (x));
 
#define CHANNEL_LAYOUT_FROM_MASK(x)   channel_layout_from_mask(&layout, &bp, (x));
 
#define CHANNEL_LAYOUT_FROM_STRING(x)   channel_layout_from_string(&layout, &bp, (x));
 
#define CHANNEL_LAYOUT_CHANNEL_FROM_INDEX(x)
 
#define CHANNEL_LAYOUT_SUBSET(x)   mask = av_channel_layout_subset(&layout, x)
 
#define CHANNEL_LAYOUT_INDEX_FROM_CHANNEL(x)
 
#define CHANNEL_LAYOUT_CHANNEL_FROM_STRING(x)
 
#define CHANNEL_LAYOUT_INDEX_FROM_STRING(x)
 

Functions

static void channel_name (AVBPrint *bp, enum AVChannel channel)
 
static void channel_description (AVBPrint *bp, enum AVChannel channel)
 
static void channel_layout_from_mask (AVChannelLayout *layout, AVBPrint *bp, uint64_t channel_layout)
 
static void channel_layout_from_string (AVChannelLayout *layout, AVBPrint *bp, const char *channel_layout)
 
int main (void)
 

Macro Definition Documentation

◆ BPRINT_ARGS1

#define BPRINT_ARGS1 (   bp,
  ... 
)    (bp), __VA_ARGS__

Definition at line 30 of file channel_layout.c.

◆ BPRINT_ARGS0

#define BPRINT_ARGS0 (   bp,
  ... 
)    __VA_ARGS__, (bp)

Definition at line 31 of file channel_layout.c.

◆ ORD_ARGS1

#define ORD_ARGS1 (   str,
  size,
  ... 
)    (str), (size), __VA_ARGS__

Definition at line 32 of file channel_layout.c.

◆ ORD_ARGS0

#define ORD_ARGS0 (   str,
  size,
  ... 
)    __VA_ARGS__, (str), (size)

Definition at line 33 of file channel_layout.c.

◆ CMP_BPRINT_AND_NONBPRINT

#define CMP_BPRINT_AND_NONBPRINT (   bp,
  func_name,
  ARG_ORDER,
  ... 
)

Definition at line 36 of file channel_layout.c.

◆ CHANNEL_NAME

#define CHANNEL_NAME (   x)    channel_name(&bp, (x));

Definition at line 115 of file channel_layout.c.

◆ CHANNEL_DESCRIPTION

#define CHANNEL_DESCRIPTION (   x)    channel_description(&bp, (x));

Definition at line 118 of file channel_layout.c.

◆ CHANNEL_LAYOUT_FROM_MASK

#define CHANNEL_LAYOUT_FROM_MASK (   x)    channel_layout_from_mask(&layout, &bp, (x));

Definition at line 121 of file channel_layout.c.

◆ CHANNEL_LAYOUT_FROM_STRING

#define CHANNEL_LAYOUT_FROM_STRING (   x)    channel_layout_from_string(&layout, &bp, (x));

Definition at line 124 of file channel_layout.c.

◆ CHANNEL_LAYOUT_CHANNEL_FROM_INDEX

#define CHANNEL_LAYOUT_CHANNEL_FROM_INDEX (   x)
Value:
if (ret < 0) \
ret = -1

Definition at line 127 of file channel_layout.c.

◆ CHANNEL_LAYOUT_SUBSET

#define CHANNEL_LAYOUT_SUBSET (   x)    mask = av_channel_layout_subset(&layout, x)

Definition at line 132 of file channel_layout.c.

◆ CHANNEL_LAYOUT_INDEX_FROM_CHANNEL

#define CHANNEL_LAYOUT_INDEX_FROM_CHANNEL (   x)
Value:
if (ret < 0) \
ret = -1

Definition at line 135 of file channel_layout.c.

◆ CHANNEL_LAYOUT_CHANNEL_FROM_STRING

#define CHANNEL_LAYOUT_CHANNEL_FROM_STRING (   x)
Value:
if (ret < 0) \
ret = -1

Definition at line 140 of file channel_layout.c.

◆ CHANNEL_LAYOUT_INDEX_FROM_STRING

#define CHANNEL_LAYOUT_INDEX_FROM_STRING (   x)
Value:
if (ret < 0) \
ret = -1

Definition at line 145 of file channel_layout.c.

Function Documentation

◆ channel_name()

static void channel_name ( AVBPrint *  bp,
enum AVChannel  channel 
)
static

Definition at line 79 of file channel_layout.c.

◆ channel_description()

static void channel_description ( AVBPrint *  bp,
enum AVChannel  channel 
)
static

Definition at line 85 of file channel_layout.c.

◆ channel_layout_from_mask()

static void channel_layout_from_mask ( AVChannelLayout layout,
AVBPrint *  bp,
uint64_t  channel_layout 
)
static

Definition at line 91 of file channel_layout.c.

◆ channel_layout_from_string()

static void channel_layout_from_string ( AVChannelLayout layout,
AVBPrint *  bp,
const char *  channel_layout 
)
static

Definition at line 103 of file channel_layout.c.

◆ main()

int main ( void  )

Definition at line 150 of file channel_layout.c.

av_channel_layout_channel_from_index
enum AVChannel av_channel_layout_channel_from_index(const AVChannelLayout *channel_layout, unsigned int idx)
Get the channel with the given index in a channel layout.
Definition: channel_layout.c:806
av_channel_layout_index_from_string
int av_channel_layout_index_from_string(const AVChannelLayout *channel_layout, const char *str)
Get the index in a channel layout of a channel described by the given string.
Definition: channel_layout.c:880
layout
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 layout
Definition: filter_design.txt:18
ret
ret
Definition: filter_design.txt:187
av_channel_layout_channel_from_string
enum AVChannel av_channel_layout_channel_from_string(const AVChannelLayout *channel_layout, const char *str)
Get a channel described by the given string.
Definition: channel_layout.c:835
av_channel_layout_index_from_channel
int av_channel_layout_index_from_channel(const AVChannelLayout *channel_layout, enum AVChannel channel)
Get the index of a given channel in a channel layout.
Definition: channel_layout.c:846