UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
utils.c File Reference
#include "libavcodec/utils.h"
Include dependency graph for utils.c:

Go to the source code of this file.

Functions

codec_t get_av_to_ug_pixfmt (enum AVPixelFormat av_pixfmt)
 
const struct uv_to_av_pixfmt * get_av_to_ug_pixfmts ()
 
enum AVPixelFormat get_ug_to_av_pixfmt (codec_t ug_codec)
 

Variables

static const struct uv_to_av_pixfmt uv_to_av_pixfmts []
 

Detailed Description

Function Documentation

◆ get_av_to_ug_pixfmt()

codec_t get_av_to_ug_pixfmt ( enum AVPixelFormat av_pixfmt)

Definition at line 75 of file utils.c.

75 {
76 for (unsigned int i = 0; uv_to_av_pixfmts[i].uv_codec != VIDEO_CODEC_NONE; ++i) {
78 return uv_to_av_pixfmts[i].uv_codec;
79 }
80 }
81 return VIDEO_CODEC_NONE;
82}
enum AVPixelFormat av_pixfmt
codec_t uv_codec
Definition utils.h:53
@ VIDEO_CODEC_NONE
dummy color spec
Definition types.h:66
static const struct uv_to_av_pixfmt uv_to_av_pixfmts[]
Definition utils.c:49

References av_pixfmt, uv_to_av_pixfmt::uv_codec, uv_to_av_pixfmts, and VIDEO_CODEC_NONE.

Referenced by get_av_to_uv_conversion(), and get_ug_codec_to_av().

◆ get_av_to_ug_pixfmts()

const struct uv_to_av_pixfmt * get_av_to_ug_pixfmts ( void )

Returns list all known FFMPEG to UG pixfmt conversions. Terminated with NULL element.

Definition at line 97 of file utils.c.

97 {
98 return uv_to_av_pixfmts;
99}

References uv_to_av_pixfmts.

Referenced by get_intermediate_codecs_from_uv_to_av(), and set_convertible_formats().

◆ get_ug_to_av_pixfmt()

enum AVPixelFormat get_ug_to_av_pixfmt ( codec_t ug_codec)

Variable Documentation

◆ uv_to_av_pixfmts

const struct uv_to_av_pixfmt uv_to_av_pixfmts[]
static
Initial value:
= {
{RGBA, AV_PIX_FMT_RGBA},
{UYVY, AV_PIX_FMT_UYVY422},
{YUYV,AV_PIX_FMT_YUYV422},
{RGB, AV_PIX_FMT_RGB24},
{BGR, AV_PIX_FMT_BGR24},
{I420, AV_PIX_FMT_YUVJ420P},
{RG48, AV_PIX_FMT_RGB48LE},
{0, 0}
}
@ YUYV
YCbCr 422 8-bit - Y0 Cb Y1 Cr.
Definition types.h:72
@ RGB
RGB 8-bit (packed into 24-bit word)
Definition types.h:80
@ UYVY
YCbCr 422 8-bit - Cb Y0 Cr Y1.
Definition types.h:71
@ BGR
8-bit BGR
Definition types.h:88
@ RG48
16-bit RGB little-endian (RlRhGl...)
Definition types.h:95
@ I420
planar YCbCr 4:2:0
Definition types.h:97
@ RGBA
RGBA 8-bit, big-endian.
Definition types.h:70

known UG<->AV pixfmt conversions, terminate with NULL (returned by get_av_to_ug_pixfmts())

Definition at line 49 of file utils.c.

49 {
50 {RGBA, AV_PIX_FMT_RGBA},
51 {UYVY, AV_PIX_FMT_UYVY422},
52 {YUYV,AV_PIX_FMT_YUYV422},
53 //R10k,
54 //v210,
55 //DVS10,
56 //DXT1,
57 //DXT1_YUV,
58 //DXT5,
59 {RGB, AV_PIX_FMT_RGB24},
60 //JPEG,
61 //RAW,
62 //H264,
63 //MJPG,
64 //VP8,
65 {BGR, AV_PIX_FMT_BGR24},
66 //J2K,
67 {I420, AV_PIX_FMT_YUVJ420P},
68 {RG48, AV_PIX_FMT_RGB48LE},
69#if XV3X_PRESENT
70 {Y416, AV_PIX_FMT_XV36},
71#endif
72 {0, 0}
73};
@ Y416
interleaved little-endian YCbCr 4444 16-bit - UYVA
Definition types.h:99

Referenced by get_av_to_ug_pixfmt(), get_av_to_ug_pixfmts(), and get_ug_to_av_pixfmt().