VLC 4.0.0-dev
Loading...
Searching...
No Matches
fourcc.c File Reference
Include dependency graph for fourcc.c:

Macros

#define PLANAR(subtype_, n, w_den, h_den, bits)
 
#define PLANAR_8(subtype_, n, w_den, h_den)   PLANAR(subtype_, n, w_den, h_den, 8)
 
#define PLANAR_16(subtype_, n, w_den, h_den, bits)   PLANAR(subtype_, n, w_den, h_den, bits)
 
#define SEMIPLANAR(subtype_, w_den, h_den, bits)
 
#define PACKED_FMT(subtype_, size, bits, color_bits_)
 
#define GPU_FMT(subtype_, color_bits_)
 

Functions

static int fourcc_cmp (const void *key, const void *ent)
 
static vlc_fourcc_t Lookup (vlc_fourcc_t fourcc, const char **restrict dsc, const struct fourcc_mapping *mapv, size_t mapc, const struct fourcc_desc *dscv, size_t dscc)
 
static vlc_fourcc_t LookupVideo (vlc_fourcc_t fourcc, const char **restrict dsc)
 
static vlc_fourcc_t LookupAudio (vlc_fourcc_t fourcc, const char **restrict dsc)
 
static vlc_fourcc_t LookupSpu (vlc_fourcc_t fourcc, const char **restrict dsc)
 
static vlc_fourcc_t LookupCat (vlc_fourcc_t fourcc, const char **restrict dsc, int cat)
 
vlc_fourcc_t vlc_fourcc_GetCodec (int cat, vlc_fourcc_t fourcc)
 It returns the codec associated to a fourcc within an ES category.
 
vlc_fourcc_t vlc_fourcc_GetCodecFromString (int i_cat, const char *psz_fourcc)
 It returns the codec associated to a fourcc stored in a zero terminated string.
 
vlc_fourcc_t vlc_fourcc_GetCodecAudio (vlc_fourcc_t i_fourcc, int i_bits)
 It converts the given fourcc to an audio codec when possible.
 
const char * vlc_fourcc_GetDescription (int cat, vlc_fourcc_t fourcc)
 It returns the description of the given fourcc or NULL if not found.
 
static vlc_fourcc_tGetFallback (vlc_fourcc_t i_fourcc, int flags)
 
vlc_fourcc_tvlc_fourcc_GetYUVFallback (vlc_fourcc_t i_fourcc)
 It returns a list (terminated with the value 0) of YUV fourccs in decreasing priority order for the given chroma.
 
vlc_fourcc_tvlc_fourcc_GetRGBFallback (vlc_fourcc_t i_fourcc)
 It returns a list (terminated with the value 0) of RGB fourccs in decreasing priority order for the given chroma.
 
vlc_fourcc_tvlc_fourcc_GetFallback (vlc_fourcc_t i_fourcc)
 It returns a list (terminated with the value 0) of fourccs in decreasing priority order for the given chroma.
 
const vlc_chroma_description_tvlc_fourcc_GetChromaDescription (vlc_fourcc_t i_fourcc)
 It returns a vlc_chroma_description_t describing the requested fourcc or NULL if not found.
 

Variables

static const vlc_chroma_description_t p_list_chroma_description []
 

Macro Definition Documentation

◆ GPU_FMT

#define GPU_FMT (   subtype_,
  color_bits_ 
)
Value:
.subtype = VLC_CHROMA_SUBTYPE_##subtype_, \
.plane_count = 0, \
.p = { {.w = {1,1}, .h = {1,1}} }, \
.pixel_size = 0, \
.pixel_bits = 0, \
.color_bits = color_bits_

◆ PACKED_FMT

#define PACKED_FMT (   subtype_,
  size,
  bits,
  color_bits_ 
)
Value:
.subtype = VLC_CHROMA_SUBTYPE_##subtype_, \
.plane_count = 1, \
.p = { {.w = {1,1}, .h = {1,1}} }, \
.pixel_size = size, \
.pixel_bits = bits, \
.color_bits = color_bits_

◆ PLANAR

#define PLANAR (   subtype_,
  n,
  w_den,
  h_den,
  bits 
)
Value:
.subtype = VLC_CHROMA_SUBTYPE_##subtype_, \
.plane_count = n, \
.p = { {.w = {1, 1}, .h = {1, 1}}, \
{.w = {1,w_den}, .h = {1,h_den}}, \
{.w = {1,w_den}, .h = {1,h_den}}, \
{.w = {1, 1}, .h = {1, 1}} }, \
.pixel_size = ((bits + 7) / 8), \
.pixel_bits = bits, \
.color_bits = bits

◆ PLANAR_16

#define PLANAR_16 (   subtype_,
  n,
  w_den,
  h_den,
  bits 
)    PLANAR(subtype_, n, w_den, h_den, bits)

◆ PLANAR_8

#define PLANAR_8 (   subtype_,
  n,
  w_den,
  h_den 
)    PLANAR(subtype_, n, w_den, h_den, 8)

◆ SEMIPLANAR

#define SEMIPLANAR (   subtype_,
  w_den,
  h_den,
  bits 
)
Value:
.subtype = VLC_CHROMA_SUBTYPE_##subtype_, \
.plane_count = 2, \
.p = { {.w = {1, 1}, .h = {1, 1}}, \
{.w = {2,w_den}, .h = {1,h_den}} }, \
.pixel_size = ((bits + 7) / 8), \
.pixel_bits = bits, \
.color_bits = bits

Function Documentation

◆ fourcc_cmp()

static int fourcc_cmp ( const void *  key,
const void *  ent 
)
static

Referenced by Lookup().

◆ GetFallback()

◆ Lookup()

static vlc_fourcc_t Lookup ( vlc_fourcc_t  fourcc,
const char **restrict  dsc,
const struct fourcc_mapping *  mapv,
size_t  mapc,
const struct fourcc_desc *  dscv,
size_t  dscc 
)
static

References fourcc_cmp().

Referenced by LookupAudio(), LookupSpu(), and LookupVideo().

◆ LookupAudio()

static vlc_fourcc_t LookupAudio ( vlc_fourcc_t  fourcc,
const char **restrict  dsc 
)
static

References ARRAY_SIZE, and Lookup().

Referenced by LookupCat().

◆ LookupCat()

static vlc_fourcc_t LookupCat ( vlc_fourcc_t  fourcc,
const char **restrict  dsc,
int  cat 
)
static

◆ LookupSpu()

static vlc_fourcc_t LookupSpu ( vlc_fourcc_t  fourcc,
const char **restrict  dsc 
)
static

References ARRAY_SIZE, and Lookup().

Referenced by LookupCat().

◆ LookupVideo()

static vlc_fourcc_t LookupVideo ( vlc_fourcc_t  fourcc,
const char **restrict  dsc 
)
static

References ARRAY_SIZE, and Lookup().

Referenced by LookupCat().

◆ vlc_fourcc_GetChromaDescription()

const vlc_chroma_description_t * vlc_fourcc_GetChromaDescription ( vlc_fourcc_t  i_fourcc)

◆ vlc_fourcc_GetCodec()

vlc_fourcc_t vlc_fourcc_GetCodec ( int  i_cat,
vlc_fourcc_t  i_fourcc 
)

It returns the codec associated to a fourcc within an ES category.

If not found, it will return the given fourcc. If found, it will always be one of the VLC_CODEC_ defined above.

You may use UNKNOWN_ES for the ES category if you don't have the information.

References LookupCat().

Referenced by aout_BitsPerSample(), es_format_IsSimilar(), es_format_LogDifferences(), EsOutFillEsFmt(), video_format_Setup(), vlc_fourcc_GetCodecAudio(), vlc_fourcc_GetCodecFromString(), and VoutFixFormat().

◆ vlc_fourcc_GetCodecAudio()

vlc_fourcc_t vlc_fourcc_GetCodecAudio ( vlc_fourcc_t  i_fourcc,
int  i_bits 
)

It converts the given fourcc to an audio codec when possible.

The fourccs converted are aflt, araw/pcm , twos, sowt. When an incompatible i_bits is detected, 0 is returned. The other fourccs go through vlc_fourcc_GetCodec and i_bits is not checked.

References AUDIO_ES, i_fourcc, VLC_CODEC_FL32, VLC_CODEC_FL64, VLC_CODEC_S16B, VLC_CODEC_S16L, VLC_CODEC_S24B, VLC_CODEC_S24L, VLC_CODEC_S32B, VLC_CODEC_S32L, VLC_CODEC_S8, VLC_CODEC_U8, VLC_FOURCC, and vlc_fourcc_GetCodec().

Referenced by EsOutFillEsFmt().

◆ vlc_fourcc_GetCodecFromString()

vlc_fourcc_t vlc_fourcc_GetCodecFromString ( int  i_cat,
const char *  psz_fourcc 
)

It returns the codec associated to a fourcc stored in a zero terminated string.

If the string is NULL or has more than 4 characters or doesn't correspond to a string associated with a VLC_CODEC_, it will return 0, otherwise it will one of the VLC_CODEC_ defined above.

You may use UNKNOWN_ES for the ES category if you don't have the information.

Provided for convenience.

References VLC_FOURCC, and vlc_fourcc_GetCodec().

◆ vlc_fourcc_GetDescription()

const char * vlc_fourcc_GetDescription ( int  i_cat,
vlc_fourcc_t  i_fourcc 
)

It returns the description of the given fourcc or NULL if not found.

You may use UNKNOWN_ES for the ES category if you don't have the information.

References LookupCat().

Referenced by DecoderUnsupportedCodec(), and EsOutUpdateInfo().

◆ vlc_fourcc_GetFallback()

vlc_fourcc_t * vlc_fourcc_GetFallback ( vlc_fourcc_t  i_fourcc)

It returns a list (terminated with the value 0) of fourccs in decreasing priority order for the given chroma.

It will return either YUV or RGB fallbacks depending on whether or not the fourcc given is YUV.

It can return a NULL pointer, it must be freed.

References i_fourcc, vlc_fourcc_GetRGBFallback(), vlc_fourcc_GetYUVFallback(), and vlc_fourcc_IsYUV().

◆ vlc_fourcc_GetRGBFallback()

vlc_fourcc_t * vlc_fourcc_GetRGBFallback ( vlc_fourcc_t  i_fourcc)

It returns a list (terminated with the value 0) of RGB fourccs in decreasing priority order for the given chroma.

It can return a NULL pointer, it must be freed.

References GetFallback(), i_fourcc, and VLC_CHROMA_CONV_FLAG_ONLY_RGB.

Referenced by vlc_fourcc_GetFallback().

◆ vlc_fourcc_GetYUVFallback()

vlc_fourcc_t * vlc_fourcc_GetYUVFallback ( vlc_fourcc_t  i_fourcc)

It returns a list (terminated with the value 0) of YUV fourccs in decreasing priority order for the given chroma.

It can return a NULL pointer, it must be freed.

References GetFallback(), i_fourcc, and VLC_CHROMA_CONV_FLAG_ONLY_YUV.

Referenced by vlc_fourcc_GetFallback().

Variable Documentation

◆ p_list_chroma_description

const vlc_chroma_description_t p_list_chroma_description[]
static