avutil

package
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2024 License: LGPL-2.1 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FF_LAMBDA_SHIFT = C.FF_LAMBDA_SHIFT
	FF_LAMBDA_SCALE = C.FF_LAMBDA_SCALE
	FF_QP2LAMBDA    = C.FF_QP2LAMBDA ///< factor to convert from H.263 QP to lambda
	FF_LAMBDA_MAX   = C.FF_LAMBDA_MAX
)
View Source
const (
	AV_CH_FRONT_LEFT            = C.AV_CH_FRONT_LEFT
	AV_CH_FRONT_RIGHT           = C.AV_CH_FRONT_RIGHT
	AV_CH_FRONT_CENTER          = C.AV_CH_FRONT_CENTER
	AV_CH_LOW_FREQUENCY         = C.AV_CH_LOW_FREQUENCY
	AV_CH_BACK_LEFT             = C.AV_CH_BACK_LEFT
	AV_CH_BACK_RIGHT            = C.AV_CH_BACK_RIGHT
	AV_CH_FRONT_LEFT_OF_CENTER  = C.AV_CH_FRONT_LEFT_OF_CENTER
	AV_CH_FRONT_RIGHT_OF_CENTER = C.AV_CH_FRONT_RIGHT_OF_CENTER
	AV_CH_BACK_CENTER           = C.AV_CH_BACK_CENTER
	AV_CH_SIDE_LEFT             = C.AV_CH_SIDE_LEFT
	AV_CH_SIDE_RIGHT            = C.AV_CH_SIDE_RIGHT
	AV_CH_TOP_CENTER            = C.AV_CH_TOP_CENTER
	AV_CH_TOP_FRONT_LEFT        = C.AV_CH_TOP_FRONT_LEFT
	AV_CH_TOP_FRONT_CENTER      = C.AV_CH_TOP_FRONT_CENTER
	AV_CH_TOP_FRONT_RIGHT       = C.AV_CH_TOP_FRONT_RIGHT
	AV_CH_TOP_BACK_LEFT         = C.AV_CH_TOP_BACK_LEFT
	AV_CH_TOP_BACK_CENTER       = C.AV_CH_TOP_BACK_CENTER
	AV_CH_TOP_BACK_RIGHT        = C.AV_CH_TOP_BACK_RIGHT
	AV_CH_STEREO_LEFT           = C.AV_CH_STEREO_LEFT
	AV_CH_STEREO_RIGHT          = C.AV_CH_STEREO_RIGHT
	AV_CH_WIDE_LEFT             = C.AV_CH_WIDE_LEFT
	AV_CH_WIDE_RIGHT            = C.AV_CH_WIDE_RIGHT
	AV_CH_SURROUND_DIRECT_LEFT  = C.AV_CH_SURROUND_DIRECT_LEFT
	AV_CH_SURROUND_DIRECT_RIGHT = C.AV_CH_SURROUND_DIRECT_RIGHT
	AV_CH_LOW_FREQUENCY_2       = C.AV_CH_LOW_FREQUENCY_2
	AV_CH_TOP_SIDE_LEFT         = C.AV_CH_TOP_SIDE_LEFT
	AV_CH_TOP_SIDE_RIGHT        = C.AV_CH_TOP_SIDE_RIGHT
	AV_CH_BOTTOM_FRONT_CENTER   = C.AV_CH_BOTTOM_FRONT_CENTER
	AV_CH_BOTTOM_FRONT_LEFT     = C.AV_CH_BOTTOM_FRONT_LEFT
	AV_CH_BOTTOM_FRONT_RIGHT    = C.AV_CH_BOTTOM_FRONT_RIGHT
)

*

  • @defgroup channel_masks Audio channel masks *
  • A channel layout is a 64-bits integer with a bit set for every channel.
  • The number of bits set must be equal to the number of channels.
  • The value 0 means that the channel layout is not known.
  • @note this data structure is not powerful enough to handle channels
  • combinations that have the same channel multiple times, such as
  • dual-mono. *
  • @{
View Source
const (
	AV_CH_LAYOUT_MONO               = C.AV_CH_LAYOUT_MONO
	AV_CH_LAYOUT_STEREO             = C.AV_CH_LAYOUT_STEREO
	AV_CH_LAYOUT_2POINT1            = C.AV_CH_LAYOUT_2POINT1
	AV_CH_LAYOUT_2_1                = C.AV_CH_LAYOUT_2_1
	AV_CH_LAYOUT_SURROUND           = C.AV_CH_LAYOUT_SURROUND
	AV_CH_LAYOUT_3POINT1            = C.AV_CH_LAYOUT_3POINT1
	AV_CH_LAYOUT_4POINT0            = C.AV_CH_LAYOUT_4POINT0
	AV_CH_LAYOUT_4POINT1            = C.AV_CH_LAYOUT_4POINT1
	AV_CH_LAYOUT_2_2                = C.AV_CH_LAYOUT_2_2
	AV_CH_LAYOUT_QUAD               = C.AV_CH_LAYOUT_QUAD
	AV_CH_LAYOUT_5POINT0            = C.AV_CH_LAYOUT_5POINT0
	AV_CH_LAYOUT_5POINT1            = C.AV_CH_LAYOUT_5POINT1
	AV_CH_LAYOUT_5POINT0_BACK       = C.AV_CH_LAYOUT_5POINT0_BACK
	AV_CH_LAYOUT_5POINT1_BACK       = C.AV_CH_LAYOUT_5POINT1_BACK
	AV_CH_LAYOUT_6POINT0            = C.AV_CH_LAYOUT_6POINT0
	AV_CH_LAYOUT_6POINT0_FRONT      = C.AV_CH_LAYOUT_6POINT0_FRONT
	AV_CH_LAYOUT_HEXAGONAL          = C.AV_CH_LAYOUT_HEXAGONAL
	AV_CH_LAYOUT_3POINT1POINT2      = C.AV_CH_LAYOUT_3POINT1POINT2
	AV_CH_LAYOUT_6POINT1            = C.AV_CH_LAYOUT_6POINT1
	AV_CH_LAYOUT_6POINT1_BACK       = C.AV_CH_LAYOUT_6POINT1_BACK
	AV_CH_LAYOUT_6POINT1_FRONT      = C.AV_CH_LAYOUT_6POINT1_FRONT
	AV_CH_LAYOUT_7POINT0            = C.AV_CH_LAYOUT_7POINT0
	AV_CH_LAYOUT_7POINT0_FRONT      = C.AV_CH_LAYOUT_7POINT0_FRONT
	AV_CH_LAYOUT_7POINT1            = C.AV_CH_LAYOUT_7POINT1
	AV_CH_LAYOUT_7POINT1_WIDE       = C.AV_CH_LAYOUT_7POINT1_WIDE
	AV_CH_LAYOUT_7POINT1_WIDE_BACK  = C.AV_CH_LAYOUT_7POINT1_WIDE_BACK
	AV_CH_LAYOUT_5POINT1POINT2_BACK = C.AV_CH_LAYOUT_5POINT1POINT2_BACK
	AV_CH_LAYOUT_OCTAGONAL          = C.AV_CH_LAYOUT_OCTAGONAL
	AV_CH_LAYOUT_CUBE               = C.AV_CH_LAYOUT_CUBE
	AV_CH_LAYOUT_5POINT1POINT4_BACK = C.AV_CH_LAYOUT_5POINT1POINT4_BACK
	AV_CH_LAYOUT_7POINT1POINT2      = C.AV_CH_LAYOUT_7POINT1POINT2
	AV_CH_LAYOUT_7POINT1POINT4_BACK = C.AV_CH_LAYOUT_7POINT1POINT4_BACK
	AV_CH_LAYOUT_HEXADECAGONAL      = C.AV_CH_LAYOUT_HEXADECAGONAL
	AV_CH_LAYOUT_STEREO_DOWNMIX     = C.AV_CH_LAYOUT_STEREO_DOWNMIX
	AV_CH_LAYOUT_22POINT2           = C.AV_CH_LAYOUT_22POINT2

	AV_CH_LAYOUT_7POINT1_TOP_BACK = C.AV_CH_LAYOUT_7POINT1_TOP_BACK
)

*

  • @}
  • @defgroup channel_mask_c Audio channel layouts
  • @{ *
View Source
const (
	AV_DICT_MATCH_CASE    = C.AV_DICT_MATCH_CASE    /**< Only get an entry with exact-case key match. Only relevant in av_dict_get(). */
	AV_DICT_IGNORE_SUFFIX = C.AV_DICT_IGNORE_SUFFIX /**< Return first entry in a dictionary whose first part corresponds to the search key,
	  ignoring the suffix of the found key string. Only relevant in av_dict_get(). */
	AV_DICT_DONT_STRDUP_KEY = C.AV_DICT_DONT_STRDUP_KEY /**< Take ownership of a key that's been
	  allocated with av_malloc() or another memory allocation function. */
	AV_DICT_DONT_STRDUP_VAL = C.AV_DICT_DONT_STRDUP_VAL /**< Take ownership of a value that's been
	  allocated with av_malloc() or another memory allocation function. */
	AV_DICT_DONT_OVERWRITE = C.AV_DICT_DONT_OVERWRITE /**< Don't overwrite existing entries. */
	AV_DICT_APPEND         = C.AV_DICT_APPEND         /**< If the entry already exists, append to it.  Note that no
	  delimiter is added, the strings are simply concatenated. */
	AV_DICT_MULTIKEY = C.AV_DICT_MULTIKEY /**< Allow to store several equal keys in the dictionary */
)

*

  • @name AVDictionary Flags
  • Flags that influence behavior of the matching of keys or insertion to the dictionary.
  • @{
View Source
const (
	AVERROR_BSF_NOT_FOUND      = C.AVERROR_BSF_NOT_FOUND
	AVERROR_BUG                = C.AVERROR_BUG
	AVERROR_BUFFER_TOO_SMALL   = C.AVERROR_BUFFER_TOO_SMALL
	AVERROR_DECODER_NOT_FOUND  = C.AVERROR_DECODER_NOT_FOUND
	AVERROR_DEMUXER_NOT_FOUND  = C.AVERROR_DEMUXER_NOT_FOUND
	AVERROR_ENCODER_NOT_FOUND  = C.AVERROR_ENCODER_NOT_FOUND
	AVERROR_EOF                = C.AVERROR_EOF
	AVERROR_EXIT               = C.AVERROR_EXIT
	AVERROR_EXTERNAL           = C.AVERROR_EXTERNAL
	AVERROR_FILTER_NOT_FOUND   = C.AVERROR_FILTER_NOT_FOUND
	AVERROR_INVALIDDATA        = C.AVERROR_INVALIDDATA
	AVERROR_MUXER_NOT_FOUND    = C.AVERROR_MUXER_NOT_FOUND
	AVERROR_OPTION_NOT_FOUND   = C.AVERROR_OPTION_NOT_FOUND
	AVERROR_PATCHWELCOME       = C.AVERROR_PATCHWELCOME
	AVERROR_PROTOCOL_NOT_FOUND = C.AVERROR_PROTOCOL_NOT_FOUND

	AVERROR_STREAM_NOT_FOUND = C.AVERROR_STREAM_NOT_FOUND
	/**
	 * This is semantically identical to AVERROR_BUG
	 * it has been introduced in Libav after our AVERROR_BUG and with a modified value.
	 */
	AVERROR_BUG2           = C.AVERROR_BUG2
	AVERROR_UNKNOWN        = C.AVERROR_UNKNOWN
	AVERROR_EXPERIMENTAL   = C.AVERROR_EXPERIMENTAL
	AVERROR_INPUT_CHANGED  = C.AVERROR_INPUT_CHANGED
	AVERROR_OUTPUT_CHANGED = C.AVERROR_OUTPUT_CHANGED
	/* HTTP & RTSP errors */
	AVERROR_HTTP_BAD_REQUEST  = C.AVERROR_HTTP_BAD_REQUEST
	AVERROR_HTTP_UNAUTHORIZED = C.AVERROR_HTTP_UNAUTHORIZED
	AVERROR_HTTP_FORBIDDEN    = C.AVERROR_HTTP_FORBIDDEN
	AVERROR_HTTP_NOT_FOUND    = C.AVERROR_HTTP_NOT_FOUND
	AVERROR_HTTP_OTHER_4XX    = C.AVERROR_HTTP_OTHER_4XX
	AVERROR_HTTP_SERVER_ERROR = C.AVERROR_HTTP_SERVER_ERROR
)
View Source
const (
	FF_DECODE_ERROR_INVALID_BITSTREAM  = C.FF_DECODE_ERROR_INVALID_BITSTREAM
	FF_DECODE_ERROR_MISSING_REFERENCE  = C.FF_DECODE_ERROR_MISSING_REFERENCE
	FF_DECODE_ERROR_CONCEALMENT_ACTIVE = C.FF_DECODE_ERROR_CONCEALMENT_ACTIVE
	FF_DECODE_ERROR_DECODE_SLICES      = C.FF_DECODE_ERROR_DECODE_SLICES
)
View Source
const (

	/**
	 * Print no output.
	 */
	AV_LOG_QUIET = C.AV_LOG_QUIET

	/**
	 * Something went really wrong and we will crash now.
	 */
	AV_LOG_PANIC = C.AV_LOG_PANIC

	/**
	 * Something went wrong and recovery is not possible.
	 * For example, no header was found for a format which depends
	 * on headers or an illegal combination of parameters is used.
	 */
	AV_LOG_FATAL = C.AV_LOG_FATAL

	/**
	 * Something went wrong and cannot losslessly be recovered.
	 * However, not all future data is affected.
	 */
	AV_LOG_ERROR = C.AV_LOG_ERROR

	/**
	 * Something somehow does not look correct. This may or may not
	 * lead to problems. An example would be the use of '-vstrict -2'.
	 */
	AV_LOG_WARNING = C.AV_LOG_WARNING

	/**
	 * Standard information.
	 */
	AV_LOG_INFO = C.AV_LOG_INFO

	/**
	 * Detailed information.
	 */
	AV_LOG_VERBOSE = C.AV_LOG_VERBOSE

	/**
	 * Stuff which is only useful for libav* developers.
	 */
	AV_LOG_DEBUG = C.AV_LOG_DEBUG

	/**
	 * Extremely verbose debugging, useful for libav* development.
	 */
	AV_LOG_TRACE = C.AV_LOG_TRACE

	AV_LOG_MAX_OFFSET = C.AV_LOG_MAX_OFFSET
)

*

  • @addtogroup lavu_log *
  • @{ *
  • @defgroup lavu_log_constants Logging Constants *
  • @{
View Source
const (
	LIBAVUTIL_IDENT       = C.LIBAVUTIL_IDENT
	LIBAVUTIL_VERSION_INT = C.LIBAVUTIL_VERSION_INT
)
View Source
const AVPALETTE_COUNT = C.AVPALETTE_COUNT
View Source
const AVPALETTE_SIZE = C.AVPALETTE_SIZE
View Source
const AV_ERROR_MAX_STRING_SIZE = C.AV_ERROR_MAX_STRING_SIZE
View Source
const (
	/**
	 * Apply the maximum possible cropping, even if it requires setting the
	 * AVFrame.data[] entries to unaligned pointers. Passing unaligned data
	 * to FFmpeg API is generally not allowed, and causes undefined behavior
	 * (such as crashes). You can pass unaligned data only to FFmpeg APIs that
	 * are explicitly documented to accept it. Use this flag only if you
	 * absolutely know what you are doing.
	 */
	AV_FRAME_CROP_UNALIGNED = C.AV_FRAME_CROP_UNALIGNED
)

*

  • Flags for frame cropping.
View Source
const AV_FRAME_FLAG_CORRUPT = C.AV_FRAME_FLAG_CORRUPT

*

  • The frame data may be corrupted, e.g. due to decoding errors.
View Source
const AV_FRAME_FLAG_DISCARD = C.AV_FRAME_FLAG_DISCARD

*

  • A flag to mark the frames which need to be decoded, but shouldn't be output.
View Source
const AV_FRAME_FLAG_INTERLACED = C.AV_FRAME_FLAG_INTERLACED

*

  • A flag to mark frames whose content is interlaced.
View Source
const AV_FRAME_FLAG_KEY = C.AV_FRAME_FLAG_KEY

*

  • A flag to mark frames that are keyframes.
View Source
const AV_FRAME_FLAG_TOP_FIELD_FIRST = C.AV_FRAME_FLAG_TOP_FIELD_FIRST

*

  • A flag to mark frames where the top field is displayed first if the content
  • is interlaced.
View Source
const AV_HAVE_BIGENDIAN = C.AV_HAVE_BIGENDIAN

#if AV_HAVE_BIGENDIAN # define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##be #else

View Source
const AV_NOPTS_VALUE = C.AV_NOPTS_VALUE

*

  • @brief Undefined timestamp value *
  • Usually reported by demuxer that work on containers that do not provide
  • either pts or dts.
View Source
const AV_NUM_DATA_POINTERS = C.AV_NUM_DATA_POINTERS

#region CAVFrame

View Source
const AV_OPT_SEARCH_CHILDREN = C.AV_OPT_SEARCH_CHILDREN /**< Search in possible children of the
given object first. */
View Source
const AV_TIME_BASE = C.AV_TIME_BASE

*

  • Internal time base represented as integer
View Source
const AV_TS_MAX_STRING_SIZE = C.AV_TS_MAX_STRING_SIZE
View Source
const FF_QUALITY_SCALE = C.FF_QUALITY_SCALE //FIXME maybe remove

Variables

This section is empty.

Functions

func AVERROR

func AVERROR(e int) int
/* error handling */

/< Returns a negative error code from a POSIX error code, to return from library functions.

func AvAssert0

func AvAssert0(cond bool)

*

  • assert() equivalent, that is always enabled.

func AvAudioFifoDrain added in v0.0.5

func AvAudioFifoDrain(af *CAVAudioFifo, nbSamples int) int

*

  • Drain data from an AVAudioFifo. *
  • Removes the data without reading it. *
  • @param af AVAudioFifo to drain
  • @param nb_samples number of samples to drain
  • @return 0 if OK, or negative AVERROR code on failure

func AvAudioFifoFree added in v0.0.5

func AvAudioFifoFree(af *CAVAudioFifo)

*

  • Free an AVAudioFifo. *
  • @param af AVAudioFifo to free

func AvAudioFifoPeek added in v0.0.5

func AvAudioFifoPeek(af *CAVAudioFifo, data *unsafe.Pointer, nbSamples int) int

*

  • Peek data from an AVAudioFifo. *
  • @see enum AVSampleFormat
  • The documentation for AVSampleFormat describes the data layout. *
  • @param af AVAudioFifo to read from
  • @param data audio data plane pointers
  • @param nb_samples number of samples to peek
  • @return number of samples actually peek, or negative AVERROR code
  • on failure. The number of samples actually peek will not
  • be greater than nb_samples, and will only be less than
  • nb_samples if av_audio_fifo_size is less than nb_samples.

func AvAudioFifoPeekAt added in v0.0.5

func AvAudioFifoPeekAt(af *CAVAudioFifo, data *unsafe.Pointer,
	nbSamples int, offset int) int

*

  • Peek data from an AVAudioFifo. *
  • @see enum AVSampleFormat
  • The documentation for AVSampleFormat describes the data layout. *
  • @param af AVAudioFifo to read from
  • @param data audio data plane pointers
  • @param nb_samples number of samples to peek
  • @param offset offset from current read position
  • @return number of samples actually peek, or negative AVERROR code
  • on failure. The number of samples actually peek will not
  • be greater than nb_samples, and will only be less than
  • nb_samples if av_audio_fifo_size is less than nb_samples.

func AvAudioFifoRead added in v0.0.5

func AvAudioFifoRead(af *CAVAudioFifo, data *unsafe.Pointer, nbSamples int) int

*

  • Read data from an AVAudioFifo. *
  • @see enum AVSampleFormat
  • The documentation for AVSampleFormat describes the data layout. *
  • @param af AVAudioFifo to read from
  • @param data audio data plane pointers
  • @param nb_samples number of samples to read
  • @return number of samples actually read, or negative AVERROR code
  • on failure. The number of samples actually read will not
  • be greater than nb_samples, and will only be less than
  • nb_samples if av_audio_fifo_size is less than nb_samples.

func AvAudioFifoRealloc added in v0.0.5

func AvAudioFifoRealloc(af *CAVAudioFifo, nbSamples int) int

*

  • Reallocate an AVAudioFifo. *
  • @param af AVAudioFifo to reallocate
  • @param nb_samples new allocation size, in samples
  • @return 0 if OK, or negative AVERROR code on failure

func AvAudioFifoReset added in v0.0.5

func AvAudioFifoReset(af *CAVAudioFifo)

*

  • Reset the AVAudioFifo buffer. *
  • This empties all data in the buffer. *
  • @param af AVAudioFifo to reset

func AvAudioFifoSize added in v0.0.5

func AvAudioFifoSize(af *CAVAudioFifo) int

*

  • Get the current number of samples in the AVAudioFifo available for reading. *
  • @param af the AVAudioFifo to query
  • @return number of samples available for reading

func AvAudioFifoSpace added in v0.0.5

func AvAudioFifoSpace(af *CAVAudioFifo) int

*

  • Get the current number of samples in the AVAudioFifo available for writing. *
  • @param af the AVAudioFifo to query
  • @return number of samples available for writing

func AvAudioFifoWrite added in v0.0.5

func AvAudioFifoWrite(af *CAVAudioFifo, data *unsafe.Pointer, nbSamples int) int

*

  • Write data to an AVAudioFifo. *
  • The AVAudioFifo will be reallocated automatically if the available space
  • is less than nb_samples. *
  • @see enum AVSampleFormat
  • The documentation for AVSampleFormat describes the data layout. *
  • @param af AVAudioFifo to write to
  • @param data audio data plane pointers
  • @param nb_samples number of samples to write
  • @return number of samples actually written, or negative AVERROR
  • code on failure. If successful, the number of samples
  • actually written will always be nb_samples.

func AvCalloc

func AvCalloc(nmemb ctypes.SizeT, size ctypes.SizeT) unsafe.Pointer

*

  • Allocate a memory block for an array with av_mallocz(). *
  • The allocated memory will have size `size * nmemb` bytes. *
  • @param nmemb Number of elements
  • @param size Size of the single element
  • @return Pointer to the allocated block, or `NULL` if the block cannot
  • be allocated *
  • @see av_mallocz()
  • @see av_malloc_array()

func AvChannelLayoutCheck added in v0.0.4

func AvChannelLayoutCheck(channelLayout *CAVChannelLayout) int

*

  • Check whether a channel layout is valid, i.e. can possibly describe audio
  • data. *
  • @param channel_layout input channel layout
  • @return 1 if channel_layout is valid, 0 otherwise.

func AvChannelLayoutCompare added in v0.0.4

func AvChannelLayoutCompare(chl *CAVChannelLayout, chl1 *CAVChannelLayout) int

*

  • Check whether two channel layouts are semantically the same, i.e. the same
  • channels are present on the same positions in both. *
  • If one of the channel layouts is AV_CHANNEL_ORDER_UNSPEC, while the other is
  • not, they are considered to be unequal. If both are AV_CHANNEL_ORDER_UNSPEC,
  • they are considered equal iff the channel counts are the same in both. *
  • @param chl input channel layout
  • @param chl1 input channel layout
  • @return 0 if chl and chl1 are equal, 1 if they are not equal. A negative
  • AVERROR code if one or both are invalid.

func AvChannelLayoutCopy

func AvChannelLayoutCopy(dst *CAVChannelLayout, src *CAVChannelLayout) int

*

  • Make a copy of a channel layout. This differs from just assigning src to dst
  • in that it allocates and copies the map for AV_CHANNEL_ORDER_CUSTOM. *
  • @note the destination channel_layout will be always uninitialized before copy. *
  • @param dst destination channel layout
  • @param src source channel layout
  • @return 0 on success, a negative AVERROR on error.

func AvChannelLayoutDefault

func AvChannelLayoutDefault(chLayout *CAVChannelLayout, nbChannels int)

*

  • Get the default channel layout for a given number of channels. *
  • @param ch_layout the layout structure to be initialized
  • @param nb_channels number of channels

func AvChannelLayoutFromMask

func AvChannelLayoutFromMask(channelLayout *CAVChannelLayout, mask uint64) int

*

  • Initialize a native channel layout from a bitmask indicating which channels
  • are present. *
  • @param channel_layout the layout structure to be initialized
  • @param mask bitmask describing the channel layout *
  • @return 0 on success
  • AVERROR(EINVAL) for invalid mask values

func AvChannelLayoutFromString

func AvChannelLayoutFromString(channelLayout *CAVChannelLayout, str string) int

*

  • Initialize a channel layout from a given string description.
  • The input string can be represented by:
  • - the formal channel layout name (returned by av_channel_layout_describe())
  • - single or multiple channel names (returned by av_channel_name(), eg. "FL",
  • or concatenated with "+", each optionally containing a custom name after
  • a "@", eg. "FL@Left+FR@Right+LFE")
  • - a decimal or hexadecimal value of a native channel layout (eg. "4" or "0x4")
  • - the number of channels with default layout (eg. "4c")
  • - the number of unordered channels (eg. "4C" or "4 channels")
  • - the ambisonic order followed by optional non-diegetic channels (eg.
  • "ambisonic 2+stereo") *
  • @param channel_layout input channel layout
  • @param str string describing the channel layout
  • @return 0 channel layout was detected, AVERROR_INVALIDATATA otherwise

func AvChannelLayoutUninit

func AvChannelLayoutUninit(channelLayout *CAVChannelLayout)

*

  • Free any allocated data in the channel layout and reset the channel
  • count to 0. *
  • @param channel_layout the layout structure to be uninitialized

func AvCompareTs

func AvCompareTs(ts_a int64, tb_a CAVRational, ts_b int64, tb_b CAVRational) int

*

  • Compare two timestamps each in its own time base. *
  • @return One of the following values:
  • - -1 if `ts_a` is before `ts_b`
  • - 1 if `ts_a` is after `ts_b`
  • - 0 if they represent the same position *
  • @warning
  • The result of the function is undefined if one of the timestamps is outside
  • the `int64_t` range when represented in the other's timebase.

func AvDictCopy

func AvDictCopy(dst **CAVDictionary, src *CAVDictionary, flags int) int

*

  • Copy entries from one AVDictionary struct into another. *
  • @note Metadata is read using the ::AV_DICT_IGNORE_SUFFIX flag *
  • @param dst Pointer to a pointer to a AVDictionary struct to copy into. If *dst is NULL,
  • this function will allocate a struct for you and put it in *dst
  • @param src Pointer to the source AVDictionary struct to copy items from.
  • @param flags Flags to use when setting entries in *dst *
  • @return 0 on success, negative AVERROR code on failure. If dst was allocated
  • by this function, callers should free the associated memory.

func AvDictCount

func AvDictCount(m *CAVDictionary) int

*

  • Get number of entries in dictionary. *
  • @param m dictionary
  • @return number of entries in dictionary

func AvDictFree

func AvDictFree(m **CAVDictionary)

*

  • Free all the memory allocated for an AVDictionary struct
  • and all keys and values.

func AvDictGetString

func AvDictGetString(m *CAVDictionary, buffer unsafe.Pointer, keyValSep byte, pairsSep byte) int

*

  • Get dictionary entries as a string. *
  • Create a string containing dictionary's entries.
  • Such string may be passed back to av_dict_parse_string().
  • @note String is escaped with backslashes ('\'). *
  • @warning Separators cannot be neither '\\' nor '\0'. They also cannot be the same. *
  • @param[in] m The dictionary
  • @param[out] buffer Pointer to buffer that will be allocated with string containg entries.
  • Buffer must be freed by the caller when is no longer needed.
  • @param[in] key_val_sep Character used to separate key from value
  • @param[in] pairs_sep Character used to separate two pairs from each other *
  • @return >= 0 on success, negative on error

func AvDictParseString

func AvDictParseString(pm **CAVDictionary, str string, keyValSep string, pairsSep string, flags int) int

*

  • Parse the key/value pairs list and add the parsed entries to a dictionary. *
  • In case of failure, all the successfully set entries are stored in
  • *pm. You may need to manually free the created dictionary. *
  • @param key_val_sep A 0-terminated list of characters used to separate
  • key from value
  • @param pairs_sep A 0-terminated list of characters used to separate
  • two pairs from each other
  • @param flags Flags to use when adding to the dictionary.
  • ::AV_DICT_DONT_STRDUP_KEY and ::AV_DICT_DONT_STRDUP_VAL
  • are ignored since the key/value tokens will always
  • be duplicated. *
  • @return 0 on success, negative AVERROR code on failure

func AvDictSet

func AvDictSet(pm **CAVDictionary, key string, value string, flags int) int

*

  • Set the given entry in *pm, overwriting an existing entry. *
  • Note: If AV_DICT_DONT_STRDUP_KEY or AV_DICT_DONT_STRDUP_VAL is set,
  • these arguments will be freed on error. *
  • @warning Adding a new entry to a dictionary invalidates all existing entries
  • previously returned with av_dict_get() or av_dict_iterate(). *
  • @param pm Pointer to a pointer to a dictionary struct. If *pm is NULL
  • a dictionary struct is allocated and put in *pm.
  • @param key Entry key to add to *pm (will either be av_strduped or added as a new key depending on flags)
  • @param value Entry value to add to *pm (will be av_strduped or added as a new key depending on flags).
  • Passing a NULL value will cause an existing entry to be deleted. *
  • @return >= 0 on success otherwise an error code <0

func AvDictSetInt

func AvDictSetInt(pm **CAVDictionary, key string, value int64, flags int) int

*

  • Convenience wrapper for av_dict_set() that converts the value to a string
  • and stores it. *
  • Note: If ::AV_DICT_DONT_STRDUP_KEY is set, key will be freed on error.

func AvDynarray2Add added in v0.0.4

func AvDynarray2Add(tab_ptr *unsafe.Pointer, nb_ptr *ctypes.Int, elem_size ctypes.SizeT, elem_data unsafe.Pointer) unsafe.Pointer

*

  • Add an element of size `elem_size` to a dynamic array. *
  • The array is reallocated when its number of elements reaches powers of 2.
  • Therefore, the amortized cost of adding an element is constant. *
  • In case of success, the pointer to the array is updated in order to
  • point to the new grown array, and the number pointed to by `nb_ptr`
  • is incremented.
  • In case of failure, the array is freed, `*tab_ptr` is set to `NULL` and
  • `*nb_ptr` is set to 0. *
  • @param[in,out] tab_ptr Pointer to the array to grow
  • @param[in,out] nb_ptr Pointer to the number of elements in the array
  • @param[in] elem_size Size in bytes of an element in the array
  • @param[in] elem_data Pointer to the data of the element to add. If
  • `NULL`, the space of the newly added element is
  • allocated but left uninitialized. *
  • @return Pointer to the data of the element to copy in the newly allocated
  • space
  • @see av_dynarray_add(), av_dynarray_add_nofree()

func AvDynarrayAdd added in v0.0.4

func AvDynarrayAdd(tab_ptr unsafe.Pointer, nb_ptr *ctypes.Int, elem unsafe.Pointer)

*

  • Add the pointer to an element to a dynamic array. *
  • The array to grow is supposed to be an array of pointers to
  • structures, and the element to add must be a pointer to an already
  • allocated structure. *
  • The array is reallocated when its size reaches powers of 2.
  • Therefore, the amortized cost of adding an element is constant. *
  • In case of success, the pointer to the array is updated in order to
  • point to the new grown array, and the number pointed to by `nb_ptr`
  • is incremented.
  • In case of failure, the array is freed, `*tab_ptr` is set to `NULL` and
  • `*nb_ptr` is set to 0. *
  • @param[in,out] tab_ptr Pointer to the array to grow
  • @param[in,out] nb_ptr Pointer to the number of elements in the array
  • @param[in] elem Element to add
  • @see av_dynarray_add_nofree(), av_dynarray2_add()

func AvDynarrayAddNofree added in v0.0.4

func AvDynarrayAddNofree(tab_ptr unsafe.Pointer, nb_ptr *ctypes.Int, elem unsafe.Pointer) int

*

  • Add an element to a dynamic array. *
  • Function has the same functionality as av_dynarray_add(),
  • but it doesn't free memory on fails. It returns error code
  • instead and leave current buffer untouched. *
  • @return >=0 on success, negative otherwise
  • @see av_dynarray_add(), av_dynarray2_add()

func AvErr2str

func AvErr2str(code int) string

*

  • Convenience macro, the return value should be used only directly in
  • function arguments but never stand-alone.

func AvFastMalloc added in v0.0.4

func AvFastMalloc(ptr unsafe.Pointer, size *ctypes.UInt, min_size ctypes.SizeT)

*

  • Allocate a buffer, reusing the given one if large enough. *
  • Contrary to av_fast_realloc(), the current buffer contents might not be
  • preserved and on error the old buffer is freed, thus no special handling to
  • avoid memleaks is necessary. *
  • `*ptr` is allowed to be `NULL`, in which case allocation always happens if
  • `size_needed` is greater than 0. *
  • @code{.c}
  • uint8_t *buf = ...;
  • av_fast_malloc(&buf, &current_size, size_needed);
  • if (!buf) {
  • // Allocation failed; buf already freed
  • return AVERROR(ENOMEM);
  • }
  • @endcode *
  • @param[in,out] ptr Pointer to pointer to an already allocated buffer.
  • `*ptr` will be overwritten with pointer to new
  • buffer on success or `NULL` on failure
  • @param[in,out] size Pointer to the size of buffer `*ptr`. `*size` is
  • updated to the new allocated size, in particular 0
  • in case of failure.
  • @param[in] min_size Desired minimal size of buffer `*ptr`
  • @see av_realloc()
  • @see av_fast_mallocz()

func AvFastMallocz added in v0.0.4

func AvFastMallocz(ptr unsafe.Pointer, size *ctypes.UInt, min_size ctypes.SizeT)

*

  • Allocate and clear a buffer, reusing the given one if large enough. *
  • Like av_fast_malloc(), but all newly allocated space is initially cleared.
  • Reused buffer is not cleared. *
  • `*ptr` is allowed to be `NULL`, in which case allocation always happens if
  • `size_needed` is greater than 0. *
  • @param[in,out] ptr Pointer to pointer to an already allocated buffer.
  • `*ptr` will be overwritten with pointer to new
  • buffer on success or `NULL` on failure
  • @param[in,out] size Pointer to the size of buffer `*ptr`. `*size` is
  • updated to the new allocated size, in particular 0
  • in case of failure.
  • @param[in] min_size Desired minimal size of buffer `*ptr`
  • @see av_fast_malloc()

func AvFastRealloc added in v0.0.4

func AvFastRealloc(ptr unsafe.Pointer, size *ctypes.UInt, min_size ctypes.SizeT) unsafe.Pointer

*

  • Reallocate the given buffer if it is not large enough, otherwise do nothing. *
  • If the given buffer is `NULL`, then a new uninitialized buffer is allocated. *
  • If the given buffer is not large enough, and reallocation fails, `NULL` is
  • returned and `*size` is set to 0, but the original buffer is not changed or
  • freed. *
  • A typical use pattern follows: *
  • @code{.c}
  • uint8_t *buf = ...;
  • uint8_t *new_buf = av_fast_realloc(buf, &current_size, size_needed);
  • if (!new_buf) {
  • // Allocation failed; clean up original buffer
  • av_freep(&buf);
  • return AVERROR(ENOMEM);
  • }
  • @endcode *
  • @param[in,out] ptr Already allocated buffer, or `NULL`
  • @param[in,out] size Pointer to the size of buffer `ptr`. `*size` is
  • updated to the new allocated size, in particular 0
  • in case of failure.
  • @param[in] min_size Desired minimal size of buffer `ptr`
  • @return `ptr` if the buffer is large enough, a pointer to newly reallocated
  • buffer if the buffer was not large enough, or `NULL` in case of
  • error
  • @see av_realloc()
  • @see av_fast_malloc()

func AvFrameApplyCropping

func AvFrameApplyCropping(frame *CAVFrame, flags int) int

*

  • Crop the given video AVFrame according to its crop_left/crop_top/crop_right/
  • crop_bottom fields. If cropping is successful, the function will adjust the
  • data pointers and the width/height fields, and set the crop fields to 0. *
  • In all cases, the cropping boundaries will be rounded to the inherent
  • alignment of the pixel format. In some cases, such as for opaque hwaccel
  • formats, the left/top cropping is ignored. The crop fields are set to 0 even
  • if the cropping was rounded or ignored. *
  • @param frame the frame which should be cropped
  • @param flags Some combination of AV_FRAME_CROP_* flags, or 0. *
  • @return >= 0 on success, a negative AVERROR on error. If the cropping fields
  • were invalid, AVERROR(ERANGE) is returned, and nothing is changed.

func AvFrameCopy

func AvFrameCopy(dst *CAVFrame, src *CAVFrame) int

*

  • Copy the frame data from src to dst. *
  • This function does not allocate anything, dst must be already initialized and
  • allocated with the same parameters as src. *
  • This function only copies the frame data (i.e. the contents of the data /
  • extended data arrays), not any other properties. *
  • @return >= 0 on success, a negative AVERROR on error.

func AvFrameCopyProps

func AvFrameCopyProps(dst *CAVFrame, src *CAVFrame) int

*

  • Copy only "metadata" fields from src to dst. *
  • Metadata for the purpose of this function are those fields that do not affect
  • the data layout in the buffers. E.g. pts, sample rate (for audio) or sample
  • aspect ratio (for video), but not width/height or channel layout.
  • Side data is also copied.

func AvFrameFree

func AvFrameFree(frame **CAVFrame)

*

  • Free the frame and any dynamically allocated objects in it,
  • e.g. extended_data. If the frame is reference counted, it will be
  • unreferenced first. *
  • @param frame frame to be freed. The pointer will be set to NULL.

func AvFrameGetBuffer

func AvFrameGetBuffer(frame *CAVFrame, align int) int

*

  • Allocate new buffer(s) for audio or video data. *
  • The following fields must be set on frame before calling this function:
  • - format (pixel format for video, sample format for audio)
  • - width and height for video
  • - nb_samples and ch_layout for audio *
  • This function will fill AVFrame.data and AVFrame.buf arrays and, if
  • necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf.
  • For planar formats, one buffer will be allocated for each plane. *
  • @warning: if frame already has been allocated, calling this function will
  • leak memory. In addition, undefined behavior can occur in certain
  • cases. *
  • @param frame frame in which to store the new buffers.
  • @param align Required buffer size alignment. If equal to 0, alignment will be
  • chosen automatically for the current CPU. It is highly
  • recommended to pass 0 here unless you know what you are doing. *
  • @return 0 on success, a negative AVERROR on error.

func AvFrameIsWritable

func AvFrameIsWritable(frame *CAVFrame) int

*

  • Check if the frame data is writable. *
  • @return A positive value if the frame data is writable (which is true if and
  • only if each of the underlying buffers has only one reference, namely the one
  • stored in this frame). Return 0 otherwise. *
  • If 1 is returned the answer is valid until av_buffer_ref() is called on any
  • of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly). *
  • @see av_frame_make_writable(), av_buffer_is_writable()

func AvFrameMakeWritable

func AvFrameMakeWritable(frame *CAVFrame) int

*

  • Ensure that the frame data is writable, avoiding data copy if possible. *
  • Do nothing if the frame is writable, allocate new buffers and copy the data
  • if it is not. Non-refcounted frames behave as non-writable, i.e. a copy
  • is always made. *
  • @return 0 on success, a negative AVERROR on error. *
  • @see av_frame_is_writable(), av_buffer_is_writable(),
  • av_buffer_make_writable()

func AvFrameMoveRef

func AvFrameMoveRef(dst *CAVFrame, src *CAVFrame)

*

  • Move everything contained in src to dst and reset src. *
  • @warning: dst is not unreferenced, but directly overwritten without reading
  • or deallocating its contents. Call av_frame_unref(dst) manually
  • before calling this function to ensure that no memory is leaked.

func AvFrameRef

func AvFrameRef(dst *CAVFrame, src *CAVFrame) int

*

  • Set up a new reference to the data described by the source frame. *
  • Copy frame properties from src to dst and create a new reference for each
  • AVBufferRef from src. *
  • If src is not reference counted, new buffers are allocated and the data is
  • copied. *
  • @warning: dst MUST have been either unreferenced with av_frame_unref(dst),
  • or newly allocated with av_frame_alloc() before calling this
  • function, or undefined behavior will occur. *
  • @return 0 on success, a negative AVERROR on error

func AvFrameRemoveSideData

func AvFrameRemoveSideData(frame *CAVFrame, _type CAVFrameSideDataType)

*

  • Remove and free all side data instances of the given type.

func AvFrameReplace

func AvFrameReplace(dst *CAVFrame, src *CAVFrame) int

*

  • Ensure the destination frame refers to the same data described by the source
  • frame, either by creating a new reference for each AVBufferRef from src if
  • they differ from those in dst, by allocating new buffers and copying data if
  • src is not reference counted, or by unrefencing it if src is empty. *
  • Frame properties on dst will be replaced by those from src. *
  • @return 0 on success, a negative AVERROR on error. On error, dst is
  • unreferenced.

func AvFrameSideDataName

func AvFrameSideDataName(_type CAVFrameSideDataType) string

*

  • @return a string identifying the side data type

func AvFrameUnref

func AvFrameUnref(frame *CAVFrame)

*

  • Unreference all the buffers referenced by frame and reset the frame fields.

func AvFree

func AvFree(ptr unsafe.Pointer)

*

  • Free a memory block which has been allocated with a function of av_malloc()
  • or av_realloc() family. *
  • @param ptr Pointer to the memory block which should be freed. *
  • @note `ptr = NULL` is explicitly allowed.
  • @note It is recommended that you use av_freep() instead, to prevent leaving
  • behind dangling pointers.
  • @see av_freep()

func AvFreep

func AvFreep(ptr *unsafe.Pointer)

*

  • Free a memory block which has been allocated with a function of av_malloc()
  • or av_realloc() family, and set the pointer pointing to it to `NULL`. *
  • @code{.c}
  • uint8_t *buf = av_malloc(16);
  • av_free(buf);
  • // buf now contains a dangling pointer to freed memory, and accidental
  • // dereference of buf will result in a use-after-free, which may be a
  • // security risk. *
  • uint8_t *buf = av_malloc(16);
  • av_freep(&buf);
  • // buf is now NULL, and accidental dereference will only result in a
  • // NULL-pointer dereference.
  • @endcode *
  • @param ptr Pointer to the pointer to the memory block which should be freed
  • @note `*ptr = NULL` is safe and leads to no action.
  • @see av_free()

func AvGetBytesPerSample

func AvGetBytesPerSample(sampleFmt CAVSampleFormat) int

*

  • Return number of bytes per sample. *
  • @param sample_fmt the sample format
  • @return number of bytes per sample or zero if unknown for the given
  • sample format

func AvGetSampleFmtName added in v0.0.5

func AvGetSampleFmtName(sampleFmt CAVSampleFormat) string

*

  • Return the name of sample_fmt, or NULL if sample_fmt is not
  • recognized.

func AvGetSampleFmtString added in v0.0.5

func AvGetSampleFmtString(buf unsafe.Pointer, bufSize int, sampleFmt CAVSampleFormat) string

*

  • Generate a string corresponding to the sample format with
  • sample_fmt, or a header if sample_fmt is negative. *
  • @param buf the buffer where to write the string
  • @param buf_size the size of buf
  • @param sample_fmt the number of the sample format to print the
  • corresponding info string, or a negative value to print the
  • corresponding header.
  • @return the pointer to the filled buffer or NULL if sample_fmt is
  • unknown or in case of other errors

func AvLog

func AvLog(avcl unsafe.Pointer, level int, fmt string)

*

  • Send the specified message to the log if the level is less than or equal
  • to the current av_log_level. By default, all logging messages are sent to
  • stderr. This behavior can be altered by setting a different logging callback
  • function.
  • @see av_log_set_callback *
  • @param avcl A pointer to an arbitrary struct of which the first field is a
  • pointer to an AVClass struct or NULL if general log.
  • @param level The importance level of the message expressed using a @ref
  • lavu_log_constants "Logging Constant".
  • @param fmt The format string (printf-compatible) that specifies how
  • subsequent arguments are converted to output.

func AvMalloc

func AvMalloc(size ctypes.SizeT) unsafe.Pointer

*

  • Allocate a memory block with alignment suitable for all memory accesses
  • (including vectors if available on the CPU). *
  • @param size Size in bytes for the memory block to be allocated
  • @return Pointer to the allocated block, or `NULL` if the block cannot
  • be allocated
  • @see av_mallocz()

func AvMallocArray

func AvMallocArray(nmemb ctypes.SizeT, size ctypes.SizeT) unsafe.Pointer

*

  • Allocate a memory block for an array with av_malloc(). *
  • The allocated memory will have size `size * nmemb` bytes. *
  • @param nmemb Number of element
  • @param size Size of a single element
  • @return Pointer to the allocated block, or `NULL` if the block cannot
  • be allocated
  • @see av_malloc()

func AvMallocz

func AvMallocz(size ctypes.SizeT) unsafe.Pointer

*

  • Allocate a memory block with alignment suitable for all memory accesses
  • (including vectors if available on the CPU) and zero all the bytes of the
  • block. *
  • @param size Size in bytes for the memory block to be allocated
  • @return Pointer to the allocated block, or `NULL` if it cannot be allocated
  • @see av_malloc()

func AvMaxAlloc added in v0.0.4

func AvMaxAlloc(max ctypes.SizeT)

*

  • Set the maximum size that may be allocated in one block. *
  • The value specified with this function is effective for all libavutil's @ref
  • lavu_mem_funcs "heap management functions." *
  • By default, the max value is defined as `INT_MAX`. *
  • @param max Value to be set as the new maximum size *
  • @warning Exercise extreme caution when using this function. Don't touch
  • this if you do not understand the full consequence of doing so.

func AvMemcpyBackptr added in v0.0.4

func AvMemcpyBackptr(dst *ctypes.UInt8, back int, cnt int)

*

  • Overlapping memcpy() implementation. *
  • @param dst Destination buffer
  • @param back Number of bytes back to start copying (i.e. the initial size of
  • the overlapping window); must be > 0
  • @param cnt Number of bytes to copy; must be >= 0 *
  • @note `cnt > back` is valid, this will copy the bytes we just copied,
  • thus creating a repeating pattern with a period length of `back`.

func AvMemdup added in v0.0.4

func AvMemdup(p unsafe.Pointer, size ctypes.SizeT) unsafe.Pointer

*

  • Duplicate a buffer with av_malloc(). *
  • @param p Buffer to be duplicated
  • @param size Size in bytes of the buffer copied
  • @return Pointer to a newly allocated buffer containing a
  • copy of `p` or `NULL` if the buffer cannot be allocated

func AvOptGet

func AvOptGet(obj unsafe.Pointer, name string, searchFlags int, outVal *unsafe.Pointer) int

*

  • @defgroup opt_get_funcs Option getting functions
  • @{
  • Those functions get a value of the option with the given name from an object. *
  • @param[in] obj a struct whose first element is a pointer to an AVClass.
  • @param[in] name name of the option to get.
  • @param[in] search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN
  • is passed here, then the option may be found in a child of obj.
  • @param[out] out_val value of the option will be written here
  • @return >=0 on success, a negative error code otherwise

*

  • @note the returned string will be av_malloc()ed and must be av_free()ed by the caller *
  • @note if AV_OPT_ALLOW_NULL is set in search_flags in av_opt_get, and the
  • option is of type AV_OPT_TYPE_STRING, AV_OPT_TYPE_BINARY or AV_OPT_TYPE_DICT
  • and is set to NULL, *out_val will be set to NULL instead of an allocated
  • empty string.

func AvOptGetChlayout

func AvOptGetChlayout(obj unsafe.Pointer, name string, searchFlags int, layout *CAVChannelLayout) int

func AvOptGetDouble

func AvOptGetDouble(obj unsafe.Pointer, name string, searchFlags int, outVal *float64) int

func AvOptGetImageSize

func AvOptGetImageSize(obj unsafe.Pointer, name string, searchFlags int, wOut *ctypes.Int, hOut *ctypes.Int) int

func AvOptGetInt

func AvOptGetInt(obj unsafe.Pointer, name string, searchFlags int, outVal *ctypes.Int64) int

func AvOptGetPixelFmt

func AvOptGetPixelFmt(obj unsafe.Pointer, name string, searchFlags int, outFmt *CAVPixelFormat) int

func AvOptGetQ

func AvOptGetQ(obj unsafe.Pointer, name string, searchFlags int, outVal *CAVRational) int

func AvOptGetSampleFmt

func AvOptGetSampleFmt(obj unsafe.Pointer, name string, searchFlags int, outFmt *CAVSampleFormat) int

func AvOptGetVideoRate

func AvOptGetVideoRate(obj unsafe.Pointer, name string, searchFlags int, outVal *CAVRational) int

func AvOptSet

func AvOptSet(obj unsafe.Pointer, name string, val string, searchFlags int) int

*

  • @defgroup opt_set_funcs Option setting functions
  • @{
  • Those functions set the field of obj with the given name to value. *
  • @param[in] obj A struct whose first element is a pointer to an AVClass.
  • @param[in] name the name of the field to set
  • @param[in] val The value to set. In case of av_opt_set() if the field is not
  • of a string type, then the given string is parsed.
  • SI postfixes and some named scalars are supported.
  • If the field is of a numeric type, it has to be a numeric or named
  • scalar. Behavior with more than one scalar and +- infix operators
  • is undefined.
  • If the field is of a flags type, it has to be a sequence of numeric
  • scalars or named flags separated by '+' or '-'. Prefixing a flag
  • with '+' causes it to be set without affecting the other flags;
  • similarly, '-' unsets a flag.
  • If the field is of a dictionary type, it has to be a ':' separated list of
  • key=value parameters. Values containing ':' special characters must be
  • escaped.
  • @param search_flags flags passed to av_opt_find2. I.e. if AV_OPT_SEARCH_CHILDREN
  • is passed here, then the option may be set on a child of obj. *
  • @return 0 if the value has been set, or an AVERROR code in case of
  • error:
  • AVERROR_OPTION_NOT_FOUND if no matching option exists
  • AVERROR(ERANGE) if the value is out of range
  • AVERROR(EINVAL) if the value is not valid

func AvOptSetBin

func AvOptSetBin(obj unsafe.Pointer, name string, val unsafe.Pointer, size int, searchFlags int) int

func AvOptSetChlayout

func AvOptSetChlayout(obj unsafe.Pointer, name string, layout *CAVChannelLayout, searchFlags int) int

func AvOptSetDouble

func AvOptSetDouble(obj unsafe.Pointer, name string, val float64, searchFlags int) int

func AvOptSetImageSize

func AvOptSetImageSize(obj unsafe.Pointer, name string, w int, h int, searchFlags int) int

func AvOptSetInt

func AvOptSetInt(obj unsafe.Pointer, name string, val int64, searchFlags int) int

func AvOptSetIntList

func AvOptSetIntList(obj unsafe.Pointer, name string, val unsafe.Pointer, term uint64, flags int) int

func AvOptSetPixelFmt

func AvOptSetPixelFmt(obj unsafe.Pointer, name string, fmt CAVPixelFormat, searchFlags int) int

func AvOptSetQ

func AvOptSetQ(obj unsafe.Pointer, name string, val CAVRational, searchFlags int) int

func AvOptSetSampleFmt

func AvOptSetSampleFmt(obj unsafe.Pointer, name string, fmt CAVSampleFormat, searchFlags int) int

func AvOptSetVideoRate

func AvOptSetVideoRate(obj unsafe.Pointer, name string, val CAVRational, searchFlags int) int

func AvRealloc

func AvRealloc(ptr unsafe.Pointer, size ctypes.SizeT) unsafe.Pointer

*

  • Allocate, reallocate, or free a block of memory. *
  • If `ptr` is `NULL` and `size` > 0, allocate a new block. Otherwise, expand or
  • shrink that block of memory according to `size`. *
  • @param ptr Pointer to a memory block already allocated with
  • av_realloc() or `NULL`
  • @param size Size in bytes of the memory block to be allocated or
  • reallocated *
  • @return Pointer to a newly-reallocated block or `NULL` if the block
  • cannot be reallocated *
  • @warning Unlike av_malloc(), the returned pointer is not guaranteed to be
  • correctly aligned. The returned pointer must be freed after even
  • if size is zero.
  • @see av_fast_realloc()
  • @see av_reallocp()

func AvReallocArray added in v0.0.4

func AvReallocArray(ptr unsafe.Pointer, nmemb ctypes.SizeT, size ctypes.SizeT) unsafe.Pointer

*

  • Allocate, reallocate, or free an array. *
  • If `ptr` is `NULL` and `nmemb` > 0, allocate a new block. *
  • @param ptr Pointer to a memory block already allocated with
  • av_realloc() or `NULL`
  • @param nmemb Number of elements in the array
  • @param size Size of the single element of the array *
  • @return Pointer to a newly-reallocated block or NULL if the block
  • cannot be reallocated *
  • @warning Unlike av_malloc(), the allocated memory is not guaranteed to be
  • correctly aligned. The returned pointer must be freed after even if
  • nmemb is zero.
  • @see av_reallocp_array()

func AvReallocF added in v0.0.4

func AvReallocF(ptr unsafe.Pointer, nelem ctypes.SizeT, elsize ctypes.SizeT) unsafe.Pointer

*

  • Allocate, reallocate, or free a block of memory. *
  • This function does the same thing as av_realloc(), except:
  • - It takes two size arguments and allocates `nelem * elsize` bytes,
  • after checking the result of the multiplication for integer overflow.
  • - It frees the input block in case of failure, thus avoiding the memory
  • leak with the classic
  • @code{.c}
  • buf = realloc(buf);
  • if (!buf)
  • return -1;
  • @endcode
  • pattern.

func AvReallocp

func AvReallocp(ptr unsafe.Pointer, size ctypes.SizeT) int

*

  • Allocate, reallocate, or free a block of memory through a pointer to a
  • pointer. *
  • If `*ptr` is `NULL` and `size` > 0, allocate a new block. If `size` is
  • zero, free the memory block pointed to by `*ptr`. Otherwise, expand or
  • shrink that block of memory according to `size`. *
  • @param[in,out] ptr Pointer to a pointer to a memory block already allocated
  • with av_realloc(), or a pointer to `NULL`. The pointer
  • is updated on success, or freed on failure.
  • @param[in] size Size in bytes for the memory block to be allocated or
  • reallocated *
  • @return Zero on success, an AVERROR error code on failure *
  • @warning Unlike av_malloc(), the allocated memory is not guaranteed to be
  • correctly aligned.

func AvReallocpArray added in v0.0.4

func AvReallocpArray(ptr unsafe.Pointer, nmemb ctypes.SizeT, size ctypes.SizeT) int

*

  • Allocate, reallocate an array through a pointer to a pointer. *
  • If `*ptr` is `NULL` and `nmemb` > 0, allocate a new block. *
  • @param[in,out] ptr Pointer to a pointer to a memory block already
  • allocated with av_realloc(), or a pointer to `NULL`.
  • The pointer is updated on success, or freed on failure.
  • @param[in] nmemb Number of elements
  • @param[in] size Size of the single element *
  • @return Zero on success, an AVERROR error code on failure *
  • @warning Unlike av_malloc(), the allocated memory is not guaranteed to be
  • correctly aligned. *ptr must be freed after even if nmemb is zero.

func AvRescaleQ

func AvRescaleQ(a int64, bq CAVRational, cq CAVRational) int64

*

  • Rescale a 64-bit integer by 2 rational numbers. *
  • The operation is mathematically equivalent to `a * bq / cq`. *
  • This function is equivalent to av_rescale_q_rnd() with #AV_ROUND_NEAR_INF. *
  • @see av_rescale(), av_rescale_rnd(), av_rescale_q_rnd()

func AvRescaleRnd

func AvRescaleRnd(a int64, b int64, c int64, rnd CAVRounding) int64

*

  • Rescale a 64-bit integer with specified rounding. *
  • The operation is mathematically equivalent to `a * b / c`, but writing that
  • directly can overflow, and does not support different rounding methods.
  • If the result is not representable then INT64_MIN is returned. *
  • @see av_rescale(), av_rescale_q(), av_rescale_q_rnd()

func AvSampleFmtIsPlanar

func AvSampleFmtIsPlanar(sampleFmt CAVSampleFormat) int

*

  • Check if the sample format is planar. *
  • @param sample_fmt the sample format to inspect
  • @return 1 if the sample format is planar, 0 if it is interleaved

func AvSamplesAlloc

func AvSamplesAlloc(audioData *unsafe.Pointer, linesize *ctypes.Int, nbChannels int,
	nbSamples int, sampleFmt CAVSampleFormat, align int) int

*

  • Allocate a samples buffer for nb_samples samples, and fill data pointers and
  • linesize accordingly.
  • The allocated samples buffer can be freed by using av_freep(&audio_data[0])
  • Allocated data will be initialized to silence. *
  • @see enum AVSampleFormat
  • The documentation for AVSampleFormat describes the data layout. *
  • @param[out] audio_data array to be filled with the pointer for each channel
  • @param[out] linesize aligned size for audio buffer(s), may be NULL
  • @param nb_channels number of audio channels
  • @param nb_samples number of samples per channel
  • @param sample_fmt the sample format
  • @param align buffer size alignment (0 = default, 1 = no alignment)
  • @return >=0 on success or a negative error code on failure
  • @todo return the size of the allocated buffer in case of success at the next bump
  • @see av_samples_fill_arrays()
  • @see av_samples_alloc_array_and_samples()

func AvSamplesAllocArrayAndSamples added in v0.0.5

func AvSamplesAllocArrayAndSamples(audioData **unsafe.Pointer, linesize *ctypes.Int, nbChannels int,
	nbSamples int, sampleFmt CAVSampleFormat, align int) int

*

  • Allocate a data pointers array, samples buffer for nb_samples
  • samples, and fill data pointers and linesize accordingly. *
  • This is the same as av_samples_alloc(), but also allocates the data
  • pointers array. *
  • @see av_samples_alloc()

func AvSamplesCopy added in v0.0.5

func AvSamplesCopy(dst *unsafe.Pointer, src *unsafe.Pointer, dstOffset int,
	srcOffset int, nbSamples int, nbChannels int,
	sampleFmt CAVSampleFormat) int

*

  • Copy samples from src to dst. *
  • @param dst destination array of pointers to data planes
  • @param src source array of pointers to data planes
  • @param dst_offset offset in samples at which the data will be written to dst
  • @param src_offset offset in samples at which the data will be read from src
  • @param nb_samples number of samples to be copied
  • @param nb_channels number of audio channels
  • @param sample_fmt audio sample format

func AvSamplesFillArrays added in v0.0.4

func AvSamplesFillArrays(audioData *unsafe.Pointer, linesize *ctypes.Int,
	buf unsafe.Pointer,
	nbChannels int, nbSamples int,
	sampleFmt CAVSampleFormat, align int) int

*

  • Fill plane data pointers and linesize for samples with sample
  • format sample_fmt. *
  • The audio_data array is filled with the pointers to the samples data planes:
  • for planar, set the start point of each channel's data within the buffer,
  • for packed, set the start point of the entire buffer only. *
  • The value pointed to by linesize is set to the aligned size of each
  • channel's data buffer for planar layout, or to the aligned size of the
  • buffer for all channels for packed layout. *
  • The buffer in buf must be big enough to contain all the samples
  • (use av_samples_get_buffer_size() to compute its minimum size),
  • otherwise the audio_data pointers will point to invalid data. *
  • @see enum AVSampleFormat
  • The documentation for AVSampleFormat describes the data layout. *
  • @param[out] audio_data array to be filled with the pointer for each channel
  • @param[out] linesize calculated linesize, may be NULL
  • @param buf the pointer to a buffer containing the samples
  • @param nb_channels the number of channels
  • @param nb_samples the number of samples in a single channel
  • @param sample_fmt the sample format
  • @param align buffer size alignment (0 = default, 1 = no alignment)
  • @return minimum size in bytes required for the buffer on success,
  • or a negative error code on failure

func AvSamplesGetBufferSize

func AvSamplesGetBufferSize(linesize []ctypes.Int, nbChannels int, nbSamples int,
	sampleFmt CAVSampleFormat, align int) int

*

  • Get the required buffer size for the given audio parameters. *
  • @param[out] linesize calculated linesize, may be NULL
  • @param nb_channels the number of channels
  • @param nb_samples the number of samples in a single channel
  • @param sample_fmt the sample format
  • @param align buffer size alignment (0 = default, 1 = no alignment)
  • @return required buffer size, or negative error code on failure

func AvSamplesSetSilence added in v0.0.5

func AvSamplesSetSilence(audioData *unsafe.Pointer, offset int, nbSamples int,
	nbChannels int, sampleFmt CAVSampleFormat) int

*

  • Fill an audio buffer with silence. *
  • @param audio_data array of pointers to data planes
  • @param offset offset in samples at which to start filling
  • @param nb_samples number of samples to fill
  • @param nb_channels number of audio channels
  • @param sample_fmt audio sample format

func AvSizeMult added in v0.0.4

func AvSizeMult(a ctypes.SizeT, b ctypes.SizeT, r *ctypes.SizeT) int

*

  • Multiply two `size_t` values checking for overflow. *
  • @param[in] a Operand of multiplication
  • @param[in] b Operand of multiplication
  • @param[out] r Pointer to the result of the operation
  • @return 0 on success, AVERROR(EINVAL) on overflow

func AvStrdup added in v0.0.4

func AvStrdup(s *ctypes.Char) *ctypes.Char

*

  • Duplicate a string. *
  • @param s String to be duplicated
  • @return Pointer to a newly-allocated string containing a
  • copy of `s` or `NULL` if the string cannot be allocated
  • @see av_strndup()

func AvStrndup added in v0.0.4

func AvStrndup(s *ctypes.Char, _len ctypes.SizeT) *ctypes.Char

*

  • Duplicate a substring of a string. *
  • @param s String to be duplicated
  • @param len Maximum length of the resulting string (not counting the
  • terminating byte)
  • @return Pointer to a newly-allocated string containing a
  • substring of `s` or `NULL` if the string cannot be allocated

func AvTs2Str

func AvTs2Str(ts int64) string

*

  • Convenience macro, the return value should be used only directly in
  • function arguments but never stand-alone.

func AvTs2Timestr

func AvTs2Timestr(ts int64, tb *CAVRational) string

*

  • Convenience macro, the return value should be used only directly in
  • function arguments but never stand-alone.

Types

type CAVAudioFifo added in v0.0.5

type CAVAudioFifo C.AVAudioFifo

*

  • Context for an Audio FIFO Buffer. *
  • - Operates at the sample level rather than the byte level.
  • - Supports multiple channels with either planar or packed sample format.
  • - Automatic reallocation when writing to a full buffer.

func AvAudioFifoAlloc added in v0.0.5

func AvAudioFifoAlloc(sampleFmt CAVSampleFormat, channels int, nbSamples int) *CAVAudioFifo

*

  • Allocate an AVAudioFifo. *
  • @param sample_fmt sample format
  • @param channels number of channels
  • @param nb_samples initial allocation size, in samples
  • @return newly allocated AVAudioFifo, or NULL on error

type CAVBuffer

type CAVBuffer C.AVBuffer

*

  • A reference counted buffer type. It is opaque and is meant to be used through
  • references (AVBufferRef).

type CAVBufferRef

type CAVBufferRef C.AVBufferRef

*

  • A reference to a data buffer. *
  • The size of this struct is not a part of the public ABI and it is not meant
  • to be allocated directly.

func AvFrameGetPlaneBuffer

func AvFrameGetPlaneBuffer(frame *CAVFrame, plane int) *CAVBufferRef

*

  • Get the buffer reference a given data plane is stored in. *
  • @param frame the frame to get the plane's buffer from
  • @param plane index of the data plane of interest in frame->extended_data. *
  • @return the buffer reference that contains the plane or NULL if the input
  • frame is not valid.

func (*CAVBufferRef) GetBuffer

func (br *CAVBufferRef) GetBuffer() *CAVBuffer

func (*CAVBufferRef) GetData

func (br *CAVBufferRef) GetData() unsafe.Pointer

*

  • The data buffer. It is considered writable if and only if
  • this is the only reference to the buffer, in which case
  • av_buffer_is_writable() returns 1.

func (*CAVBufferRef) GetSize

func (br *CAVBufferRef) GetSize() ctypes.SizeT

*

  • Size of data in bytes.

type CAVChannel

type CAVChannel C.enum_AVChannel
const (
	///< Invalid channel index
	AV_CHAN_NONE                  CAVChannel = C.AV_CHAN_NONE
	AV_CHAN_FRONT_LEFT            CAVChannel = C.AV_CHAN_FRONT_LEFT
	AV_CHAN_FRONT_RIGHT           CAVChannel = C.AV_CHAN_FRONT_RIGHT
	AV_CHAN_FRONT_CENTER          CAVChannel = C.AV_CHAN_FRONT_CENTER
	AV_CHAN_LOW_FREQUENCY         CAVChannel = C.AV_CHAN_LOW_FREQUENCY
	AV_CHAN_BACK_LEFT             CAVChannel = C.AV_CHAN_BACK_LEFT
	AV_CHAN_BACK_RIGHT            CAVChannel = C.AV_CHAN_BACK_RIGHT
	AV_CHAN_FRONT_LEFT_OF_CENTER  CAVChannel = C.AV_CHAN_FRONT_LEFT_OF_CENTER
	AV_CHAN_FRONT_RIGHT_OF_CENTER CAVChannel = C.AV_CHAN_FRONT_RIGHT_OF_CENTER
	AV_CHAN_BACK_CENTER           CAVChannel = C.AV_CHAN_BACK_CENTER
	AV_CHAN_SIDE_LEFT             CAVChannel = C.AV_CHAN_SIDE_LEFT
	AV_CHAN_SIDE_RIGHT            CAVChannel = C.AV_CHAN_SIDE_RIGHT
	AV_CHAN_TOP_CENTER            CAVChannel = C.AV_CHAN_TOP_CENTER
	AV_CHAN_TOP_FRONT_LEFT        CAVChannel = C.AV_CHAN_TOP_FRONT_LEFT
	AV_CHAN_TOP_FRONT_CENTER      CAVChannel = C.AV_CHAN_TOP_FRONT_CENTER
	AV_CHAN_TOP_FRONT_RIGHT       CAVChannel = C.AV_CHAN_TOP_FRONT_RIGHT
	AV_CHAN_TOP_BACK_LEFT         CAVChannel = C.AV_CHAN_TOP_BACK_LEFT
	AV_CHAN_TOP_BACK_CENTER       CAVChannel = C.AV_CHAN_TOP_BACK_CENTER
	AV_CHAN_TOP_BACK_RIGHT        CAVChannel = C.AV_CHAN_TOP_BACK_RIGHT
	/** Stereo downmix. */
	AV_CHAN_STEREO_LEFT CAVChannel = C.AV_CHAN_STEREO_LEFT
	/** See above. */
	AV_CHAN_STEREO_RIGHT          CAVChannel = C.AV_CHAN_STEREO_RIGHT
	AV_CHAN_WIDE_LEFT             CAVChannel = C.AV_CHAN_WIDE_LEFT
	AV_CHAN_WIDE_RIGHT            CAVChannel = C.AV_CHAN_WIDE_RIGHT
	AV_CHAN_SURROUND_DIRECT_LEFT  CAVChannel = C.AV_CHAN_SURROUND_DIRECT_LEFT
	AV_CHAN_SURROUND_DIRECT_RIGHT CAVChannel = C.AV_CHAN_SURROUND_DIRECT_RIGHT
	AV_CHAN_LOW_FREQUENCY_2       CAVChannel = C.AV_CHAN_LOW_FREQUENCY_2
	AV_CHAN_TOP_SIDE_LEFT         CAVChannel = C.AV_CHAN_TOP_SIDE_LEFT
	AV_CHAN_TOP_SIDE_RIGHT        CAVChannel = C.AV_CHAN_TOP_SIDE_RIGHT
	AV_CHAN_BOTTOM_FRONT_CENTER   CAVChannel = C.AV_CHAN_BOTTOM_FRONT_CENTER
	AV_CHAN_BOTTOM_FRONT_LEFT     CAVChannel = C.AV_CHAN_BOTTOM_FRONT_LEFT
	AV_CHAN_BOTTOM_FRONT_RIGHT    CAVChannel = C.AV_CHAN_BOTTOM_FRONT_RIGHT

	/** Channel is empty can be safely skipped. */
	AV_CHAN_UNUSED CAVChannel = C.AV_CHAN_UNUSED

	/** Channel contains data, but its position is unknown. */
	AV_CHAN_UNKNOWN CAVChannel = C.AV_CHAN_UNKNOWN

	/**
	 * Range of channels between AV_CHAN_AMBISONIC_BASE and
	 * AV_CHAN_AMBISONIC_END represent Ambisonic components using the ACN system.
	 *
	 * Given a channel id `<i>` between AV_CHAN_AMBISONIC_BASE and
	 * AV_CHAN_AMBISONIC_END (inclusive), the ACN index of the channel `<n>` is
	 * `<n> = <i> - AV_CHAN_AMBISONIC_BASE`.
	 *
	 * @note these values are only used for AV_CHANNEL_ORDER_CUSTOM channel
	 * orderings, the AV_CHANNEL_ORDER_AMBISONIC ordering orders the channels
	 * implicitly by their position in the stream.
	 */
	AV_CHAN_AMBISONIC_BASE CAVChannel = C.AV_CHAN_AMBISONIC_BASE
	// leave space for 1024 ids, which correspond to maximum order-32 harmonics CAVChannel = C.
	// which should be enough for the foreseeable use cases
	AV_CHAN_AMBISONIC_END CAVChannel = C.AV_CHAN_AMBISONIC_END
)

type CAVChannelCustom added in v0.0.4

type CAVChannelCustom C.AVChannelCustom

*

  • An AVChannelCustom defines a single channel within a custom order layout *
  • Unlike most structures in FFmpeg, sizeof(AVChannelCustom) is a part of the
  • public ABI. *
  • No new fields may be added to it without a major version bump.

func (*CAVChannelCustom) GetId added in v0.0.4

func (cc *CAVChannelCustom) GetId() CAVChannel

func (*CAVChannelCustom) GetName added in v0.0.4

func (cc *CAVChannelCustom) GetName() string

func (*CAVChannelCustom) GetOpaque added in v0.0.4

func (cc *CAVChannelCustom) GetOpaque() unsafe.Pointer

func (*CAVChannelCustom) SetId added in v0.0.4

func (cc *CAVChannelCustom) SetId(id CAVChannel)

func (*CAVChannelCustom) SetName added in v0.0.4

func (cc *CAVChannelCustom) SetName(name string)

WARNING: Characters exceeding 16 bytes will be discarded.

func (*CAVChannelCustom) SetOpaque added in v0.0.4

func (cc *CAVChannelCustom) SetOpaque(opaque unsafe.Pointer)

type CAVChannelLayout

type CAVChannelLayout C.AVChannelLayout

*

  • An AVChannelLayout holds information about the channel layout of audio data. *
  • A channel layout here is defined as a set of channels ordered in a specific
  • way (unless the channel order is AV_CHANNEL_ORDER_UNSPEC, in which case an
  • AVChannelLayout carries only the channel count).
  • All orders may be treated as if they were AV_CHANNEL_ORDER_UNSPEC by
  • ignoring everything but the channel count, as long as av_channel_layout_check()
  • considers they are valid. *
  • Unlike most structures in FFmpeg, sizeof(AVChannelLayout) is a part of the
  • public ABI and may be used by the caller. E.g. it may be allocated on stack
  • or embedded in caller-defined structs. *
  • AVChannelLayout can be initialized as follows:
  • - default initialization with {0}, followed by setting all used fields
  • correctly;
  • - by assigning one of the predefined AV_CHANNEL_LAYOUT_* initializers;
  • - with a constructor function, such as av_channel_layout_default(),
  • av_channel_layout_from_mask() or av_channel_layout_from_string(). *
  • The channel layout must be unitialized with av_channel_layout_uninit() *
  • Copying an AVChannelLayout via assigning is forbidden,
  • av_channel_layout_copy() must be used instead (and its return value should
  • be checked) *
  • No new fields may be added to it without a major version bump, except for
  • new elements of the union fitting in sizeof(uint64_t).

func AV_CHANNEL_LAYOUT_22POINT2

func AV_CHANNEL_LAYOUT_22POINT2() CAVChannelLayout

func AV_CHANNEL_LAYOUT_2POINT1

func AV_CHANNEL_LAYOUT_2POINT1() CAVChannelLayout

func AV_CHANNEL_LAYOUT_2_1

func AV_CHANNEL_LAYOUT_2_1() CAVChannelLayout

func AV_CHANNEL_LAYOUT_2_2

func AV_CHANNEL_LAYOUT_2_2() CAVChannelLayout

func AV_CHANNEL_LAYOUT_3POINT1

func AV_CHANNEL_LAYOUT_3POINT1() CAVChannelLayout

func AV_CHANNEL_LAYOUT_3POINT1POINT2

func AV_CHANNEL_LAYOUT_3POINT1POINT2() CAVChannelLayout

func AV_CHANNEL_LAYOUT_4POINT0

func AV_CHANNEL_LAYOUT_4POINT0() CAVChannelLayout

func AV_CHANNEL_LAYOUT_4POINT1

func AV_CHANNEL_LAYOUT_4POINT1() CAVChannelLayout

func AV_CHANNEL_LAYOUT_5POINT0

func AV_CHANNEL_LAYOUT_5POINT0() CAVChannelLayout

func AV_CHANNEL_LAYOUT_5POINT0_BACK

func AV_CHANNEL_LAYOUT_5POINT0_BACK() CAVChannelLayout

func AV_CHANNEL_LAYOUT_5POINT1

func AV_CHANNEL_LAYOUT_5POINT1() CAVChannelLayout

func AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK

func AV_CHANNEL_LAYOUT_5POINT1POINT2_BACK() CAVChannelLayout

func AV_CHANNEL_LAYOUT_5POINT1POINT4_BACK

func AV_CHANNEL_LAYOUT_5POINT1POINT4_BACK() CAVChannelLayout

func AV_CHANNEL_LAYOUT_5POINT1_BACK

func AV_CHANNEL_LAYOUT_5POINT1_BACK() CAVChannelLayout

func AV_CHANNEL_LAYOUT_6POINT0

func AV_CHANNEL_LAYOUT_6POINT0() CAVChannelLayout

func AV_CHANNEL_LAYOUT_6POINT0_FRONT

func AV_CHANNEL_LAYOUT_6POINT0_FRONT() CAVChannelLayout

func AV_CHANNEL_LAYOUT_6POINT1

func AV_CHANNEL_LAYOUT_6POINT1() CAVChannelLayout

func AV_CHANNEL_LAYOUT_6POINT1_BACK

func AV_CHANNEL_LAYOUT_6POINT1_BACK() CAVChannelLayout

func AV_CHANNEL_LAYOUT_6POINT1_FRONT

func AV_CHANNEL_LAYOUT_6POINT1_FRONT() CAVChannelLayout

func AV_CHANNEL_LAYOUT_7POINT0

func AV_CHANNEL_LAYOUT_7POINT0() CAVChannelLayout

func AV_CHANNEL_LAYOUT_7POINT0_FRONT

func AV_CHANNEL_LAYOUT_7POINT0_FRONT() CAVChannelLayout

func AV_CHANNEL_LAYOUT_7POINT1

func AV_CHANNEL_LAYOUT_7POINT1() CAVChannelLayout

func AV_CHANNEL_LAYOUT_7POINT1POINT2

func AV_CHANNEL_LAYOUT_7POINT1POINT2() CAVChannelLayout

func AV_CHANNEL_LAYOUT_7POINT1POINT4_BACK

func AV_CHANNEL_LAYOUT_7POINT1POINT4_BACK() CAVChannelLayout

func AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK

func AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK() CAVChannelLayout

func AV_CHANNEL_LAYOUT_7POINT1_WIDE

func AV_CHANNEL_LAYOUT_7POINT1_WIDE() CAVChannelLayout

func AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK

func AV_CHANNEL_LAYOUT_7POINT1_WIDE_BACK() CAVChannelLayout

func AV_CHANNEL_LAYOUT_CUBE

func AV_CHANNEL_LAYOUT_CUBE() CAVChannelLayout

func AV_CHANNEL_LAYOUT_HEXADECAGONAL

func AV_CHANNEL_LAYOUT_HEXADECAGONAL() CAVChannelLayout

func AV_CHANNEL_LAYOUT_HEXAGONAL

func AV_CHANNEL_LAYOUT_HEXAGONAL() CAVChannelLayout

func AV_CHANNEL_LAYOUT_MASK

func AV_CHANNEL_LAYOUT_MASK(nb int, m uint64) CAVChannelLayout

*

  • Macro to define native channel layouts *
  • @note This doesn't use designated initializers for compatibility with C++ 17 and older.

func AV_CHANNEL_LAYOUT_MONO

func AV_CHANNEL_LAYOUT_MONO() CAVChannelLayout

* * @name Common pre-defined channel layouts * @{

func AV_CHANNEL_LAYOUT_OCTAGONAL

func AV_CHANNEL_LAYOUT_OCTAGONAL() CAVChannelLayout

func AV_CHANNEL_LAYOUT_QUAD

func AV_CHANNEL_LAYOUT_QUAD() CAVChannelLayout

func AV_CHANNEL_LAYOUT_STEREO

func AV_CHANNEL_LAYOUT_STEREO() CAVChannelLayout

func AV_CHANNEL_LAYOUT_STEREO_DOWNMIX

func AV_CHANNEL_LAYOUT_STEREO_DOWNMIX() CAVChannelLayout

func AV_CHANNEL_LAYOUT_SURROUND

func AV_CHANNEL_LAYOUT_SURROUND() CAVChannelLayout

func AvChannelLayoutStandard

func AvChannelLayoutStandard(opaque *unsafe.Pointer) *CAVChannelLayout

*

  • Iterate over all standard channel layouts. *
  • @param opaque a pointer where libavutil will store the iteration state. Must
  • point to NULL to start the iteration. *
  • @return the standard channel layout or NULL when the iteration is
  • finished

func (CAVChannelLayout) GetMap added in v0.0.4

func (l CAVChannelLayout) GetMap() *CAVChannelCustom

*

  • This member must be used when the channel order is
  • AV_CHANNEL_ORDER_CUSTOM. It is a nb_channels-sized array, with each
  • element signalling the presence of the AVChannel with the
  • corresponding value in map[i].id. *
  • I.e. when map[i].id is equal to AV_CHAN_FOO, then AV_CH_FOO is the
  • i-th channel in the audio data. *
  • When map[i].id is in the range between AV_CHAN_AMBISONIC_BASE and
  • AV_CHAN_AMBISONIC_END (inclusive), the channel contains an ambisonic
  • component with ACN index (as defined above)
  • n = map[i].id - AV_CHAN_AMBISONIC_BASE. *
  • map[i].name may be filled with a 0-terminated string, in which case
  • it will be used for the purpose of identifying the channel with the
  • convenience functions below. Otherise it must be zeroed.

AVChannelCustom *map;

func (CAVChannelLayout) GetMask added in v0.0.4

func (l CAVChannelLayout) GetMask() uint64

*

  • This member must be used for AV_CHANNEL_ORDER_NATIVE, and may be used
  • for AV_CHANNEL_ORDER_AMBISONIC to signal non-diegetic channels.
  • It is a bitmask, where the position of each set bit means that the
  • AVChannel with the corresponding value is present. *
  • I.e. when (mask & (1 << AV_CHAN_FOO)) is non-zero, then AV_CHAN_FOO
  • is present in the layout. Otherwise it is not present. *
  • @note when a channel layout using a bitmask is constructed or
  • modified manually (i.e. not using any of the av_channel_layout_*
  • functions), the code doing it must ensure that the number of set bits
  • is equal to nb_channels.

uint64_t mask;

func (CAVChannelLayout) GetNbChannels

func (l CAVChannelLayout) GetNbChannels() int

*

  • Number of channels in this layout. Mandatory field.

func (*CAVChannelLayout) GetOpaque added in v0.0.4

func (l *CAVChannelLayout) GetOpaque() unsafe.Pointer

*

  • For some private data of the user.

func (CAVChannelLayout) GetOrder added in v0.0.4

func (l CAVChannelLayout) GetOrder() CAVChannelOrder

*

  • Channel order used in this layout.
  • This is a mandatory field.

func (*CAVChannelLayout) SetMap added in v0.0.4

func (l *CAVChannelLayout) SetMap(_map *CAVChannelCustom)

*

  • This member must be used when the channel order is
  • AV_CHANNEL_ORDER_CUSTOM. It is a nb_channels-sized array, with each
  • element signalling the presence of the AVChannel with the
  • corresponding value in map[i].id. *
  • I.e. when map[i].id is equal to AV_CHAN_FOO, then AV_CH_FOO is the
  • i-th channel in the audio data. *
  • When map[i].id is in the range between AV_CHAN_AMBISONIC_BASE and
  • AV_CHAN_AMBISONIC_END (inclusive), the channel contains an ambisonic
  • component with ACN index (as defined above)
  • n = map[i].id - AV_CHAN_AMBISONIC_BASE. *
  • map[i].name may be filled with a 0-terminated string, in which case
  • it will be used for the purpose of identifying the channel with the
  • convenience functions below. Otherise it must be zeroed.

AVChannelCustom *map;

func (*CAVChannelLayout) SetMask added in v0.0.4

func (l *CAVChannelLayout) SetMask(mask uint64)

*

  • This member must be used for AV_CHANNEL_ORDER_NATIVE, and may be used
  • for AV_CHANNEL_ORDER_AMBISONIC to signal non-diegetic channels.
  • It is a bitmask, where the position of each set bit means that the
  • AVChannel with the corresponding value is present. *
  • I.e. when (mask & (1 << AV_CHAN_FOO)) is non-zero, then AV_CHAN_FOO
  • is present in the layout. Otherwise it is not present. *
  • @note when a channel layout using a bitmask is constructed or
  • modified manually (i.e. not using any of the av_channel_layout_*
  • functions), the code doing it must ensure that the number of set bits
  • is equal to nb_channels.

uint64_t mask;

func (*CAVChannelLayout) SetNbChannels added in v0.0.4

func (l *CAVChannelLayout) SetNbChannels(nbChannels int)

*

  • Number of channels in this layout. Mandatory field.

func (*CAVChannelLayout) SetOpaque added in v0.0.4

func (l *CAVChannelLayout) SetOpaque(opaque unsafe.Pointer)

*

  • For some private data of the user.

func (*CAVChannelLayout) SetOrder added in v0.0.4

func (l *CAVChannelLayout) SetOrder(order CAVChannelOrder)

*

  • Channel order used in this layout.
  • This is a mandatory field.

type CAVChannelOrder

type CAVChannelOrder C.enum_AVChannelOrder
const (
	/**
	 * Only the channel count is specified, without any further information
	 * about the channel order.
	 */
	AV_CHANNEL_ORDER_UNSPEC CAVChannelOrder = C.AV_CHANNEL_ORDER_UNSPEC
	/**
	 * The native channel order, i.e. the channels are in the same order in
	 * which they are defined in the AVChannel enum. This supports up to 63
	 * different channels.
	 */
	AV_CHANNEL_ORDER_NATIVE CAVChannelOrder = C.AV_CHANNEL_ORDER_NATIVE
	/**
	 * The channel order does not correspond to any other predefined order and
	 * is stored as an explicit map. For example, this could be used to support
	 * layouts with 64 or more channels, or with empty/skipped (AV_CHAN_SILENCE)
	 * channels at arbitrary positions.
	 */
	AV_CHANNEL_ORDER_CUSTOM CAVChannelOrder = C.AV_CHANNEL_ORDER_CUSTOM
	/**
	 * The audio is represented as the decomposition of the sound field into
	 * spherical harmonics. Each channel corresponds to a single expansion
	 * component. Channels are ordered according to ACN (Ambisonic Channel
	 * Number).
	 *
	 * The channel with the index n in the stream contains the spherical
	 * harmonic of degree l and order m given by
	 * @code{.unparsed}
	 *   l   = floor(sqrt(n)),
	 *   m   = n - l * (l + 1).
	 * @endcode
	 *
	 * Conversely given a spherical harmonic of degree l and order m, the
	 * corresponding channel index n is given by
	 * @code{.unparsed}
	 *   n = l * (l + 1) + m.
	 * @endcode
	 *
	 * Normalization is assumed to be SN3D (Schmidt Semi-Normalization)
	 * as defined in AmbiX format $ 2.1.
	 */
	AV_CHANNEL_ORDER_AMBISONIC CAVChannelOrder = C.AV_CHANNEL_ORDER_AMBISONIC
)

type CAVChromaLocation

type CAVChromaLocation C.enum_AVChromaLocation

*

  • Location of chroma samples. *
  • Illustration showing the location of the first (top left) chroma sample of the
  • image, the left shows only luma, the right
  • shows the location of the chroma sample, the 2 could be imagined to overlay
  • each other but are drawn separately due to limitations of ASCII *
  • 1st 2nd 1st 2nd horizontal luma sample positions
  • v v v v
  • ______ ______ *1st luma line > |X X ... |3 4 X ... X are luma samples,
  • | |1 2 1-6 are possible chroma positions *2nd luma line > |X X ... |5 6 X ... 0 is undefined/unknown position
const (
	AVCHROMA_LOC_UNSPECIFIED CAVChromaLocation = C.AVCHROMA_LOC_UNSPECIFIED
	AVCHROMA_LOC_LEFT        CAVChromaLocation = C.AVCHROMA_LOC_LEFT    ///< MPEG-2/4 4:2:0, H.264 default for 4:2:0
	AVCHROMA_LOC_CENTER      CAVChromaLocation = C.AVCHROMA_LOC_CENTER  ///< MPEG-1 4:2:0, JPEG 4:2:0, H.263 4:2:0
	AVCHROMA_LOC_TOPLEFT     CAVChromaLocation = C.AVCHROMA_LOC_TOPLEFT ///< ITU-R 601, SMPTE 274M 296M S314M(DV 4:1:1), mpeg2 4:2:2
	AVCHROMA_LOC_TOP         CAVChromaLocation = C.AVCHROMA_LOC_TOP
	AVCHROMA_LOC_BOTTOMLEFT  CAVChromaLocation = C.AVCHROMA_LOC_BOTTOMLEFT
	AVCHROMA_LOC_BOTTOM      CAVChromaLocation = C.AVCHROMA_LOC_BOTTOM
	AVCHROMA_LOC_NB          CAVChromaLocation = C.AVCHROMA_LOC_NB ///< Not part of ABI
)

type CAVClass

type CAVClass C.AVClass

*

  • Describe the class of an AVClass context structure. That is an
  • arbitrary struct of which the first field is a pointer to an
  • AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).

type CAVColorPrimaries

type CAVColorPrimaries C.enum_AVColorPrimaries

*

  • Chromaticity coordinates of the source primaries.
  • These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.1 and ITU-T H.273.
const (
	AVCOL_PRI_RESERVED0   CAVColorPrimaries = C.AVCOL_PRI_RESERVED0
	AVCOL_PRI_BT709       CAVColorPrimaries = C.AVCOL_PRI_BT709 ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
	AVCOL_PRI_UNSPECIFIED CAVColorPrimaries = C.AVCOL_PRI_UNSPECIFIED
	AVCOL_PRI_RESERVED    CAVColorPrimaries = C.AVCOL_PRI_RESERVED
	AVCOL_PRI_BT470M      CAVColorPrimaries = C.AVCOL_PRI_BT470M ///< also FCC Title 47 Code of Federal Regulations 73.682 (a)(20)

	AVCOL_PRI_BT470BG      CAVColorPrimaries = C.AVCOL_PRI_BT470BG   ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
	AVCOL_PRI_SMPTE170M    CAVColorPrimaries = C.AVCOL_PRI_SMPTE170M ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
	AVCOL_PRI_SMPTE240M    CAVColorPrimaries = C.AVCOL_PRI_SMPTE240M ///< identical to above, also called "SMPTE C" even though it uses D65
	AVCOL_PRI_FILM         CAVColorPrimaries = C.AVCOL_PRI_FILM      ///< colour filters using Illuminant C
	AVCOL_PRI_BT2020       CAVColorPrimaries = C.AVCOL_PRI_BT2020    ///< ITU-R BT2020
	AVCOL_PRI_SMPTE428     CAVColorPrimaries = C.AVCOL_PRI_SMPTE428  ///< SMPTE ST 428-1 (CIE 1931 XYZ)
	AVCOL_PRI_SMPTEST428_1 CAVColorPrimaries = C.AVCOL_PRI_SMPTEST428_1
	AVCOL_PRI_SMPTE431     CAVColorPrimaries = C.AVCOL_PRI_SMPTE431 ///< SMPTE ST 431-2 (2011) / DCI P3
	AVCOL_PRI_SMPTE432     CAVColorPrimaries = C.AVCOL_PRI_SMPTE432 ///< SMPTE ST 432-1 (2010) / P3 D65 / Display P3
	AVCOL_PRI_EBU3213      CAVColorPrimaries = C.AVCOL_PRI_EBU3213  ///< EBU Tech. 3213-E (nothing there) / one of JEDEC P22 group phosphors
	AVCOL_PRI_JEDEC_P22    CAVColorPrimaries = C.AVCOL_PRI_JEDEC_P22
	AVCOL_PRI_NB           CAVColorPrimaries = C.AVCOL_PRI_NB ///< Not part of ABI
)

type CAVColorRange

type CAVColorRange C.enum_AVColorRange

*

  • Visual content value range. *
  • These values are based on definitions that can be found in multiple
  • specifications, such as ITU-T BT.709 (3.4 - Quantization of RGB, luminance
  • and colour-difference signals), ITU-T BT.2020 (Table 5 - Digital
  • Representation) as well as ITU-T BT.2100 (Table 9 - Digital 10- and 12-bit
  • integer representation). At the time of writing, the BT.2100 one is
  • recommended, as it also defines the full range representation. *
  • Common definitions:
  • - For RGB and luma planes such as Y in YCbCr and I in ICtCp,
  • 'E' is the original value in range of 0.0 to 1.0.
  • - For chroma planes such as Cb,Cr and Ct,Cp, 'E' is the original
  • value in range of -0.5 to 0.5.
  • - 'n' is the output bit depth.
  • - For additional definitions such as rounding and clipping to valid n
  • bit unsigned integer range, please refer to BT.2100 (Table 9).
const (
	AVCOL_RANGE_UNSPECIFIED CAVColorRange = C.AVCOL_RANGE_UNSPECIFIED

	/**
	 * Narrow or limited range content.
	 *
	 * - For luma planes:
	 *
	 *       (219 * E + 16) * 2^(n-8)
	 *
	 *   F.ex. the range of 16-235 for 8 bits
	 *
	 * - For chroma planes:
	 *
	 *       (224 * E + 128) * 2^(n-8)
	 *
	 *   F.ex. the range of 16-240 for 8 bits
	 */
	AVCOL_RANGE_MPEG CAVColorRange = C.AVCOL_RANGE_MPEG

	/**
	 * Full range content.
	 *
	 * - For RGB and luma planes:
	 *
	 *       (2^n - 1) * E
	 *
	 *   F.ex. the range of 0-255 for 8 bits
	 *
	 * - For chroma planes:
	 *
	 *       (2^n - 1) * E + 2^(n - 1)
	 *
	 *   F.ex. the range of 1-255 for 8 bits
	 */
	AVCOL_RANGE_JPEG CAVColorRange = C.AVCOL_RANGE_JPEG
	AVCOL_RANGE_NB   CAVColorRange = C.AVCOL_RANGE_NB ///< Not part of ABI
)

type CAVColorSpace

type CAVColorSpace C.enum_AVColorSpace

*

  • YUV colorspace type.
  • These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.3.
const (
	AVCOL_SPC_RGB                CAVColorSpace = C.AVCOL_SPC_RGB   ///< order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB), YZX and ST 428-1
	AVCOL_SPC_BT709              CAVColorSpace = C.AVCOL_SPC_BT709 ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / derived in SMPTE RP 177 Annex B
	AVCOL_SPC_UNSPECIFIED        CAVColorSpace = C.AVCOL_SPC_UNSPECIFIED
	AVCOL_SPC_RESERVED           CAVColorSpace = C.AVCOL_SPC_RESERVED  ///< reserved for future use by ITU-T and ISO/IEC just like 15-255 are
	AVCOL_SPC_FCC                CAVColorSpace = C.AVCOL_SPC_FCC       ///< FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
	AVCOL_SPC_BT470BG            CAVColorSpace = C.AVCOL_SPC_BT470BG   ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
	AVCOL_SPC_SMPTE170M          CAVColorSpace = C.AVCOL_SPC_SMPTE170M ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
	AVCOL_SPC_SMPTE240M          CAVColorSpace = C.AVCOL_SPC_SMPTE240M ///< derived from 170M primaries and D65 white point, 170M is derived from BT470 System M's primaries
	AVCOL_SPC_YCGCO              CAVColorSpace = C.AVCOL_SPC_YCGCO     ///< used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16
	AVCOL_SPC_YCOCG              CAVColorSpace = C.AVCOL_SPC_YCOCG
	AVCOL_SPC_BT2020_NCL         CAVColorSpace = C.AVCOL_SPC_BT2020_NCL         ///< ITU-R BT2020 non-constant luminance system
	AVCOL_SPC_BT2020_CL          CAVColorSpace = C.AVCOL_SPC_BT2020_CL          ///< ITU-R BT2020 constant luminance system
	AVCOL_SPC_SMPTE2085          CAVColorSpace = C.AVCOL_SPC_SMPTE2085          ///< SMPTE 2085, Y'D'zD'x
	AVCOL_SPC_CHROMA_DERIVED_NCL CAVColorSpace = C.AVCOL_SPC_CHROMA_DERIVED_NCL ///< Chromaticity-derived non-constant luminance system
	AVCOL_SPC_CHROMA_DERIVED_CL  CAVColorSpace = C.AVCOL_SPC_CHROMA_DERIVED_CL  ///< Chromaticity-derived constant luminance system
	AVCOL_SPC_ICTCP              CAVColorSpace = C.AVCOL_SPC_ICTCP              ///< ITU-R BT.2100-0, ICtCp
	AVCOL_SPC_NB                 CAVColorSpace = C.AVCOL_SPC_NB                 ///< Not part of ABI
)

type CAVColorTransferCharacteristic

type CAVColorTransferCharacteristic C.enum_AVColorTransferCharacteristic

*

  • Color Transfer Characteristic.
  • These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.2.
const (
	AVCOL_TRC_RESERVED0    CAVColorTransferCharacteristic = C.AVCOL_TRC_RESERVED0
	AVCOL_TRC_BT709        CAVColorTransferCharacteristic = C.AVCOL_TRC_BT709 ///< also ITU-R BT1361
	AVCOL_TRC_UNSPECIFIED  CAVColorTransferCharacteristic = C.AVCOL_TRC_UNSPECIFIED
	AVCOL_TRC_RESERVED     CAVColorTransferCharacteristic = C.AVCOL_TRC_RESERVED
	AVCOL_TRC_GAMMA22      CAVColorTransferCharacteristic = C.AVCOL_TRC_GAMMA22   ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
	AVCOL_TRC_GAMMA28      CAVColorTransferCharacteristic = C.AVCOL_TRC_GAMMA28   ///< also ITU-R BT470BG
	AVCOL_TRC_SMPTE170M    CAVColorTransferCharacteristic = C.AVCOL_TRC_SMPTE170M ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC
	AVCOL_TRC_SMPTE240M    CAVColorTransferCharacteristic = C.AVCOL_TRC_SMPTE240M
	AVCOL_TRC_LINEAR       CAVColorTransferCharacteristic = C.AVCOL_TRC_LINEAR       ///< "Linear transfer characteristics"
	AVCOL_TRC_LOG          CAVColorTransferCharacteristic = C.AVCOL_TRC_LOG          ///< "Logarithmic transfer characteristic (100:1 range)"
	AVCOL_TRC_LOG_SQRT     CAVColorTransferCharacteristic = C.AVCOL_TRC_LOG_SQRT     ///< "Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)"
	AVCOL_TRC_IEC61966_2_4 CAVColorTransferCharacteristic = C.AVCOL_TRC_IEC61966_2_4 ///< IEC 61966-2-4
	AVCOL_TRC_BT1361_ECG   CAVColorTransferCharacteristic = C.AVCOL_TRC_BT1361_ECG   ///< ITU-R BT1361 Extended Colour Gamut
	AVCOL_TRC_IEC61966_2_1 CAVColorTransferCharacteristic = C.AVCOL_TRC_IEC61966_2_1 ///< IEC 61966-2-1 (sRGB or sYCC)
	AVCOL_TRC_BT2020_10    CAVColorTransferCharacteristic = C.AVCOL_TRC_BT2020_10    ///< ITU-R BT2020 for 10-bit system
	AVCOL_TRC_BT2020_12    CAVColorTransferCharacteristic = C.AVCOL_TRC_BT2020_12    ///< ITU-R BT2020 for 12-bit system
	AVCOL_TRC_SMPTE2084    CAVColorTransferCharacteristic = C.AVCOL_TRC_SMPTE2084    ///< SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems
	AVCOL_TRC_SMPTEST2084  CAVColorTransferCharacteristic = C.AVCOL_TRC_SMPTEST2084
	AVCOL_TRC_SMPTE428     CAVColorTransferCharacteristic = C.AVCOL_TRC_SMPTE428 ///< SMPTE ST 428-1
	AVCOL_TRC_SMPTEST428_1 CAVColorTransferCharacteristic = C.AVCOL_TRC_SMPTEST428_1
	AVCOL_TRC_ARIB_STD_B67 CAVColorTransferCharacteristic = C.AVCOL_TRC_ARIB_STD_B67 ///< ARIB STD-B67, known as "Hybrid log-gamma"
	AVCOL_TRC_NB           CAVColorTransferCharacteristic = C.AVCOL_TRC_NB           ///< Not part of ABI
)

type CAVDictionary

type CAVDictionary C.AVDictionary

type CAVDictionaryEntry

type CAVDictionaryEntry C.AVDictionaryEntry

func AvDictGet

func AvDictGet(m *CAVDictionary, key string, prev *CAVDictionaryEntry, flags int) *CAVDictionaryEntry

*

  • Get a dictionary entry with matching key. *
  • The returned entry key or value must not be changed, or it will
  • cause undefined behavior. *
  • @param prev Set to the previous matching element to find the next.
  • If set to NULL the first matching element is returned.
  • @param key Matching key
  • @param flags A collection of AV_DICT_* flags controlling how the
  • entry is retrieved *
  • @return Found entry or NULL in case no matching entry was found in the dictionary

func AvDictIterate

func AvDictIterate(m *CAVDictionary, prev *CAVDictionaryEntry) *CAVDictionaryEntry

*

  • Iterate over a dictionary *
  • Iterates through all entries in the dictionary. *
  • @warning The returned AVDictionaryEntry key/value must not be changed. *
  • @warning As av_dict_set() invalidates all previous entries returned
  • by this function, it must not be called while iterating over the dict. *
  • Typical usage:
  • @code
  • const AVDictionaryEntry *e = NULL;
  • while ((e = av_dict_iterate(m, e))) {
  • // ...
  • }
  • @endcode *
  • @param m The dictionary to iterate over
  • @param prev Pointer to the previous AVDictionaryEntry, NULL initially *
  • @retval AVDictionaryEntry* The next element in the dictionary
  • @retval NULL No more elements in the dictionary

func (*CAVDictionaryEntry) GetKey

func (e *CAVDictionaryEntry) GetKey() string

#region CAVDictionaryEntry

func (*CAVDictionaryEntry) GetValue

func (e *CAVDictionaryEntry) GetValue() string

func (*CAVDictionaryEntry) SetKey

func (e *CAVDictionaryEntry) SetKey(key string)

func (*CAVDictionaryEntry) SetValue

func (e *CAVDictionaryEntry) SetValue(value string)

type CAVFrame

type CAVFrame C.AVFrame

*

  • This structure describes decoded (raw) audio or video data. *
  • AVFrame must be allocated using av_frame_alloc(). Note that this only
  • allocates the AVFrame itself, the buffers for the data must be managed
  • through other means (see below).
  • AVFrame must be freed with av_frame_free(). *
  • AVFrame is typically allocated once and then reused multiple times to hold
  • different data (e.g. a single AVFrame to hold frames received from a
  • decoder). In such a case, av_frame_unref() will free any references held by
  • the frame and reset it to its original clean state before it
  • is reused again. *
  • The data described by an AVFrame is usually reference counted through the
  • AVBuffer API. The underlying buffer references are stored in AVFrame.buf /
  • AVFrame.extended_buf. An AVFrame is considered to be reference counted if at
  • least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case,
  • every single data plane must be contained in one of the buffers in
  • AVFrame.buf or AVFrame.extended_buf.
  • There may be a single buffer for all the data, or one separate buffer for
  • each plane, or anything in between. *
  • sizeof(AVFrame) is not a part of the public ABI, so new fields may be added
  • to the end with a minor bump. *
  • Fields can be accessed through AVOptions, the name string used, matches the
  • C structure field name for fields accessible through AVOptions. The AVClass
  • for AVFrame can be obtained from avcodec_get_frame_class()

func AvFrameAlloc

func AvFrameAlloc() *CAVFrame

*

  • Allocate an AVFrame and set its fields to default values. The resulting
  • struct must be freed using av_frame_free(). *
  • @return An AVFrame filled with default values or NULL on failure. *
  • @note this only allocates the AVFrame itself, not the data buffers. Those
  • must be allocated through other means, e.g. with av_frame_get_buffer() or
  • manually.

func AvFrameClone

func AvFrameClone(src *CAVFrame) *CAVFrame

*

  • Create a new frame that references the same data as src. *
  • This is a shortcut for av_frame_alloc()+av_frame_ref(). *
  • @return newly created AVFrame on success, NULL on error.

func (*CAVFrame) GetBestEffortTimestamp

func (f *CAVFrame) GetBestEffortTimestamp() int64

*

  • frame timestamp estimated using various heuristics, in stream time base
  • - encoding: unused
  • - decoding: set by libavcodec, read by user.

func (*CAVFrame) GetBuf

*

  • AVBuffer references backing the data for this frame. All the pointers in
  • data and extended_data must point inside one of the buffers in buf or
  • extended_buf. This array must be filled contiguously -- if buf[i] is
  • non-NULL then buf[j] must also be non-NULL for all j < i. *
  • There may be at most one AVBuffer per data plane, so for video this array
  • always contains all the references. For planar audio with more than
  • AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in
  • this array. Then the extra AVBufferRef pointers are stored in the
  • extended_buf array.

func (*CAVFrame) GetChLayout

func (f *CAVFrame) GetChLayout() CAVChannelLayout

*

  • Channel layout of the audio data.

func (*CAVFrame) GetChLayoutPtr

func (f *CAVFrame) GetChLayoutPtr() *CAVChannelLayout

*

  • Channel layout of the audio data.

func (*CAVFrame) GetChromaLocation

func (f *CAVFrame) GetChromaLocation() CAVChromaLocation

func (*CAVFrame) GetColorPrimaries

func (f *CAVFrame) GetColorPrimaries() CAVColorPrimaries

func (*CAVFrame) GetColorRange

func (f *CAVFrame) GetColorRange() CAVColorRange

*

  • MPEG vs JPEG YUV range.
  • - encoding: Set by user
  • - decoding: Set by libavcodec

func (*CAVFrame) GetColorTrc

func (f *CAVFrame) GetColorTrc() CAVColorTransferCharacteristic

func (*CAVFrame) GetColorspace

func (f *CAVFrame) GetColorspace() CAVColorSpace

*

  • YUV colorspace type.
  • - encoding: Set by user
  • - decoding: Set by libavcodec

func (*CAVFrame) GetCropBottom

func (f *CAVFrame) GetCropBottom() ctypes.SizeT

func (*CAVFrame) GetCropLeft

func (f *CAVFrame) GetCropLeft() ctypes.SizeT

func (*CAVFrame) GetCropRight

func (f *CAVFrame) GetCropRight() ctypes.SizeT

func (*CAVFrame) GetCropTop

func (f *CAVFrame) GetCropTop() ctypes.SizeT

*

  • @anchor cropping
  • @name Cropping
  • Video frames only. The number of pixels to discard from the the
  • top/bottom/left/right border of the frame to obtain the sub-rectangle of
  • the frame intended for presentation.
  • @{

func (*CAVFrame) GetData

*

  • pointer to the picture/channel planes.
  • This might be different from the first allocated byte. For video,
  • it could even point to the end of the image data. *
  • All pointers in data and extended_data must point into one of the
  • AVBufferRef in buf or extended_buf. *
  • Some decoders access areas outside 0,0 - width,height, please
  • see avcodec_align_dimensions2(). Some filters and swscale can read
  • up to 16 bytes beyond the planes, if these filters are to be used,
  • then 16 extra bytes must be allocated. *
  • NOTE: Pointers not needed by the format MUST be set to NULL. *
  • @attention In case of video, the data[] pointers can point to the
  • end of image data in order to reverse line order, when used in
  • combination with negative values in the linesize[] array.

func (*CAVFrame) GetDecodeErrorFlags

func (f *CAVFrame) GetDecodeErrorFlags() int

*

  • decode error flags of the frame, set to a combination of
  • FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there
  • were errors during the decoding.
  • - encoding: unused
  • - decoding: set by libavcodec, read by user.

func (*CAVFrame) GetDuration

func (f *CAVFrame) GetDuration() int64

*

  • Duration of the frame, in the same units as pts. 0 if unknown.

func (*CAVFrame) GetExtendedBuf

func (f *CAVFrame) GetExtendedBuf() **CAVBufferRef

*

  • For planar audio which requires more than AV_NUM_DATA_POINTERS
  • AVBufferRef pointers, this array will hold all the references which
  • cannot fit into AVFrame.buf. *
  • Note that this is different from AVFrame.extended_data, which always
  • contains all the pointers. This array only contains the extra pointers,
  • which cannot fit into AVFrame.buf. *
  • This array is always allocated using av_malloc() by whoever constructs
  • the frame. It is freed in av_frame_unref().

func (*CAVFrame) GetExtendedData

func (f *CAVFrame) GetExtendedData() *unsafe.Pointer

*

  • pointers to the data planes/channels. *
  • For video, this should simply point to data[]. *
  • For planar audio, each channel has a separate data pointer, and
  • linesize[0] contains the size of each channel buffer.
  • For packed audio, there is just one data pointer, and linesize[0]
  • contains the total size of the buffer for all channels. *
  • Note: Both data and extended_data should always be set in a valid frame,
  • but for planar audio with more channels that can fit in data,
  • extended_data must be used in order to access all channels.

func (*CAVFrame) GetFlags

func (f *CAVFrame) GetFlags() int

*

  • Frame flags, a combination of @ref lavu_frame_flags

func (*CAVFrame) GetFormat

func (f *CAVFrame) GetFormat() int

*

  • format of the frame, -1 if unknown or unset
  • Values correspond to enum AVPixelFormat for video frames,
  • enum AVSampleFormat for audio)

func (*CAVFrame) GetHeight

func (f *CAVFrame) GetHeight() int

func (*CAVFrame) GetHwFramesCtx

func (f *CAVFrame) GetHwFramesCtx() *CAVBufferRef

*

  • For hwaccel-format frames, this should be a reference to the
  • AVHWFramesContext describing the frame.

func (*CAVFrame) GetLinesize

func (f *CAVFrame) GetLinesize() [AV_NUM_DATA_POINTERS]ctypes.Int

*

  • For video, a positive or negative value, which is typically indicating
  • the size in bytes of each picture line, but it can also be:
  • - the negative byte size of lines for vertical flipping
  • (with data[n] pointing to the end of the data
  • - a positive or negative multiple of the byte size as for accessing
  • even and odd fields of a frame (possibly flipped) *
  • For audio, only linesize[0] may be set. For planar audio, each channel
  • plane must be the same size. *
  • For video the linesizes should be multiples of the CPUs alignment
  • preference, this is 16 or 32 for modern desktop CPUs.
  • Some code requires such alignment other code can be slower without
  • correct alignment, for yet other it makes no difference. *
  • @note The linesize may be larger than the size of usable data -- there
  • may be extra padding present for performance reasons. *
  • @attention In case of video, line size values can be negative to achieve
  • a vertically inverted iteration over image lines.

func (*CAVFrame) GetMetadata

func (f *CAVFrame) GetMetadata() *CAVDictionary

*

  • metadata.
  • - encoding: Set by user.
  • - decoding: Set by libavcodec.

func (*CAVFrame) GetNbExtendedBuf

func (f *CAVFrame) GetNbExtendedBuf() int

*

  • Number of elements in extended_buf.

func (*CAVFrame) GetNbSamples

func (f *CAVFrame) GetNbSamples() int

*

  • number of audio samples (per channel) described by this frame

func (*CAVFrame) GetNbSideData

func (f *CAVFrame) GetNbSideData() int

func (*CAVFrame) GetOpaque

func (f *CAVFrame) GetOpaque() unsafe.Pointer

*

  • Frame owner's private data. *
  • This field may be set by the code that allocates/owns the frame data.
  • It is then not touched by any library functions, except:
  • - it is copied to other references by av_frame_copy_props() (and hence by
  • av_frame_ref());
  • - it is set to NULL when the frame is cleared by av_frame_unref()
  • - on the caller's explicit request. E.g. libavcodec encoders/decoders
  • will copy this field to/from @ref AVPacket "AVPackets" if the caller sets
  • @ref AV_CODEC_FLAG_COPY_OPAQUE. *
  • @see opaque_ref the reference-counted analogue

func (*CAVFrame) GetOpaqueRef

func (f *CAVFrame) GetOpaqueRef() *CAVBufferRef

*

  • Frame owner's private data. *
  • This field may be set by the code that allocates/owns the frame data.
  • It is then not touched by any library functions, except:
  • - a new reference to the underlying buffer is propagated by
  • av_frame_copy_props() (and hence by av_frame_ref());
  • - it is unreferenced in av_frame_unref();
  • - on the caller's explicit request. E.g. libavcodec encoders/decoders
  • will propagate a new reference to/from @ref AVPacket "AVPackets" if the
  • caller sets @ref AV_CODEC_FLAG_COPY_OPAQUE. *
  • @see opaque the plain pointer analogue

func (*CAVFrame) GetPictType

func (f *CAVFrame) GetPictType() CAVPictureType

*

  • Picture type of the frame.

func (*CAVFrame) GetPktDts

func (f *CAVFrame) GetPktDts() int64

*

  • DTS copied from the AVPacket that triggered returning this frame. (if frame threading isn't used)
  • This is also the Presentation time of this AVFrame calculated from
  • only AVPacket.dts values without pts values.

func (*CAVFrame) GetPrivateRef

func (f *CAVFrame) GetPrivateRef() *CAVBufferRef

*

  • AVBufferRef for internal use by a single libav* library.
  • Must not be used to transfer data between libraries.
  • Has to be NULL when ownership of the frame leaves the respective library. *
  • Code outside the FFmpeg libs should never check or change the contents of the buffer ref. *
  • FFmpeg calls av_buffer_unref() on it when the frame is unreferenced.
  • av_frame_copy_props() calls create a new reference with av_buffer_ref()
  • for the target frame's private_ref field.

func (*CAVFrame) GetPts

func (f *CAVFrame) GetPts() int64

*

  • Presentation timestamp in time_base units (time when frame should be shown to user).

func (*CAVFrame) GetQuality

func (f *CAVFrame) GetQuality() int

* * quality (between 1 (good) and FF_LAMBDA_MAX (bad))

func (*CAVFrame) GetRepeatPict

func (f *CAVFrame) GetRepeatPict() int

*

  • Number of fields in this frame which should be repeated, i.e. the total
  • duration of this frame should be repeat_pict + 2 normal field durations. *
  • For interlaced frames this field may be set to 1, which signals that this
  • frame should be presented as 3 fields: beginning with the first field (as
  • determined by AV_FRAME_FLAG_TOP_FIELD_FIRST being set or not), followed
  • by the second field, and then the first field again. *
  • For progressive frames this field may be set to a multiple of 2, which
  • signals that this frame's duration should be (repeat_pict + 2) / 2
  • normal frame durations. *
  • @note This field is computed from MPEG2 repeat_first_field flag and its
  • associated flags, H.264 pic_struct from picture timing SEI, and
  • their analogues in other codecs. Typically it should only be used when
  • higher-layer timing information is not available.

func (*CAVFrame) GetSampleAspectRatio

func (f *CAVFrame) GetSampleAspectRatio() CAVRational

*

  • Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.

func (*CAVFrame) GetSampleRate

func (f *CAVFrame) GetSampleRate() int

*

  • Sample rate of the audio data.

func (*CAVFrame) GetSideData

func (f *CAVFrame) GetSideData() **CAVFrameSideData

func (*CAVFrame) GetTimeBase

func (f *CAVFrame) GetTimeBase() CAVRational

*

  • Time base for the timestamps in this frame.
  • In the future, this field may be set on frames output by decoders or
  • filters, but its value will be by default ignored on input to encoders
  • or filters.

func (*CAVFrame) GetWidth

func (f *CAVFrame) GetWidth() int

func (*CAVFrame) SetBestEffortTimestamp

func (f *CAVFrame) SetBestEffortTimestamp(bestEffortTimestamp int64)

*

  • frame timestamp estimated using various heuristics, in stream time base
  • - encoding: unused
  • - decoding: set by libavcodec, read by user.

func (*CAVFrame) SetBuf

func (f *CAVFrame) SetBuf(buf [AV_NUM_DATA_POINTERS]*CAVBufferRef)

*

  • AVBuffer references backing the data for this frame. All the pointers in
  • data and extended_data must point inside one of the buffers in buf or
  • extended_buf. This array must be filled contiguously -- if buf[i] is
  • non-NULL then buf[j] must also be non-NULL for all j < i. *
  • There may be at most one AVBuffer per data plane, so for video this array
  • always contains all the references. For planar audio with more than
  • AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in
  • this array. Then the extra AVBufferRef pointers are stored in the
  • extended_buf array.

func (*CAVFrame) SetChLayout

func (f *CAVFrame) SetChLayout(chLayout CAVChannelLayout)

*

  • Channel layout of the audio data.

func (*CAVFrame) SetChromaLocation

func (f *CAVFrame) SetChromaLocation(chromaLocation CAVChromaLocation)

func (*CAVFrame) SetColorPrimaries

func (f *CAVFrame) SetColorPrimaries(colorPrimaries CAVColorPrimaries)

func (*CAVFrame) SetColorRange

func (f *CAVFrame) SetColorRange(colorRange CAVColorRange)

func (*CAVFrame) SetColorTrc

func (f *CAVFrame) SetColorTrc(colorTrc CAVColorTransferCharacteristic)

func (*CAVFrame) SetColorspace

func (f *CAVFrame) SetColorspace(colorspace CAVColorSpace)

func (*CAVFrame) SetCropBottom

func (f *CAVFrame) SetCropBottom(cropBottom ctypes.SizeT)

func (*CAVFrame) SetCropLeft

func (f *CAVFrame) SetCropLeft(cropLeft ctypes.SizeT)

func (*CAVFrame) SetCropRight

func (f *CAVFrame) SetCropRight(cropRight ctypes.SizeT)

func (*CAVFrame) SetCropTop

func (f *CAVFrame) SetCropTop(cropTop ctypes.SizeT)

func (*CAVFrame) SetData

func (f *CAVFrame) SetData(data [AV_NUM_DATA_POINTERS]unsafe.Pointer)

*

  • pointer to the picture/channel planes.
  • This might be different from the first allocated byte. For video,
  • it could even point to the end of the image data. *
  • All pointers in data and extended_data must point into one of the
  • AVBufferRef in buf or extended_buf. *
  • Some decoders access areas outside 0,0 - width,height, please
  • see avcodec_align_dimensions2(). Some filters and swscale can read
  • up to 16 bytes beyond the planes, if these filters are to be used,
  • then 16 extra bytes must be allocated. *
  • NOTE: Pointers not needed by the format MUST be set to NULL. *
  • @attention In case of video, the data[] pointers can point to the
  • end of image data in order to reverse line order, when used in
  • combination with negative values in the linesize[] array.

func (*CAVFrame) SetDecodeErrorFlags

func (f *CAVFrame) SetDecodeErrorFlags(decodeErrorFlags int)

*

  • decode error flags of the frame, set to a combination of
  • FF_DECODE_ERROR_xxx flags if the decoder produced a frame, but there
  • were errors during the decoding.
  • - encoding: unused
  • - decoding: set by libavcodec, read by user.

func (*CAVFrame) SetDuration

func (f *CAVFrame) SetDuration(duration int64)

*

  • Duration of the frame, in the same units as pts. 0 if unknown.

func (*CAVFrame) SetExtendedBuf

func (f *CAVFrame) SetExtendedBuf(extendedBuf **CAVBufferRef)

*

  • For planar audio which requires more than AV_NUM_DATA_POINTERS
  • AVBufferRef pointers, this array will hold all the references which
  • cannot fit into AVFrame.buf. *
  • Note that this is different from AVFrame.extended_data, which always
  • contains all the pointers. This array only contains the extra pointers,
  • which cannot fit into AVFrame.buf. *
  • This array is always allocated using av_malloc() by whoever constructs
  • the frame. It is freed in av_frame_unref().

func (*CAVFrame) SetExtendedData

func (f *CAVFrame) SetExtendedData(extendedData *unsafe.Pointer)

*

  • pointers to the data planes/channels. *
  • For video, this should simply point to data[]. *
  • For planar audio, each channel has a separate data pointer, and
  • linesize[0] contains the size of each channel buffer.
  • For packed audio, there is just one data pointer, and linesize[0]
  • contains the total size of the buffer for all channels. *
  • Note: Both data and extended_data should always be set in a valid frame,
  • but for planar audio with more channels that can fit in data,
  • extended_data must be used in order to access all channels.

func (*CAVFrame) SetFlags

func (f *CAVFrame) SetFlags(flags int)

*

  • Frame flags, a combination of @ref lavu_frame_flags

func (*CAVFrame) SetFormat

func (f *CAVFrame) SetFormat(format int)

*

  • format of the frame, -1 if unknown or unset
  • Values correspond to enum AVPixelFormat for video frames,
  • enum AVSampleFormat for audio)

func (*CAVFrame) SetHeight

func (f *CAVFrame) SetHeight(height int)

func (*CAVFrame) SetHwFramesCtx

func (f *CAVFrame) SetHwFramesCtx(hwFramesCtx *CAVBufferRef)

*

  • For hwaccel-format frames, this should be a reference to the
  • AVHWFramesContext describing the frame.

func (*CAVFrame) SetLinesize

func (f *CAVFrame) SetLinesize(linesize [AV_NUM_DATA_POINTERS]ctypes.Int)

*

  • For video, a positive or negative value, which is typically indicating
  • the size in bytes of each picture line, but it can also be:
  • - the negative byte size of lines for vertical flipping
  • (with data[n] pointing to the end of the data
  • - a positive or negative multiple of the byte size as for accessing
  • even and odd fields of a frame (possibly flipped) *
  • For audio, only linesize[0] may be set. For planar audio, each channel
  • plane must be the same size. *
  • For video the linesizes should be multiples of the CPUs alignment
  • preference, this is 16 or 32 for modern desktop CPUs.
  • Some code requires such alignment other code can be slower without
  • correct alignment, for yet other it makes no difference. *
  • @note The linesize may be larger than the size of usable data -- there
  • may be extra padding present for performance reasons. *
  • @attention In case of video, line size values can be negative to achieve
  • a vertically inverted iteration over image lines.

func (*CAVFrame) SetMetadata

func (f *CAVFrame) SetMetadata(metadata *CAVDictionary)

*

  • metadata.
  • - encoding: Set by user.
  • - decoding: Set by libavcodec.

func (*CAVFrame) SetNbExtendedBuf

func (f *CAVFrame) SetNbExtendedBuf(nbExtendedBuf int)

*

  • Number of elements in extended_buf.

func (*CAVFrame) SetNbSamples

func (f *CAVFrame) SetNbSamples(nbSamples int)

*

  • number of audio samples (per channel) described by this frame

func (*CAVFrame) SetNbSideData

func (f *CAVFrame) SetNbSideData(nbSideData int)

func (*CAVFrame) SetOpaque

func (f *CAVFrame) SetOpaque(opaque unsafe.Pointer)

*

  • Frame owner's private data. *
  • This field may be set by the code that allocates/owns the frame data.
  • It is then not touched by any library functions, except:
  • - it is copied to other references by av_frame_copy_props() (and hence by
  • av_frame_ref());
  • - it is set to NULL when the frame is cleared by av_frame_unref()
  • - on the caller's explicit request. E.g. libavcodec encoders/decoders
  • will copy this field to/from @ref AVPacket "AVPackets" if the caller sets
  • @ref AV_CODEC_FLAG_COPY_OPAQUE. *
  • @see opaque_ref the reference-counted analogue

func (*CAVFrame) SetOpaqueRef

func (f *CAVFrame) SetOpaqueRef(opaqueRef *CAVBufferRef)

*

  • Frame owner's private data. *
  • This field may be set by the code that allocates/owns the frame data.
  • It is then not touched by any library functions, except:
  • - a new reference to the underlying buffer is propagated by
  • av_frame_copy_props() (and hence by av_frame_ref());
  • - it is unreferenced in av_frame_unref();
  • - on the caller's explicit request. E.g. libavcodec encoders/decoders
  • will propagate a new reference to/from @ref AVPacket "AVPackets" if the
  • caller sets @ref AV_CODEC_FLAG_COPY_OPAQUE. *
  • @see opaque the plain pointer analogue

func (*CAVFrame) SetPictType

func (f *CAVFrame) SetPictType(pictType CAVPictureType)

*

  • Picture type of the frame.

func (*CAVFrame) SetPktDts

func (f *CAVFrame) SetPktDts(pktDts int64)

*

  • DTS copied from the AVPacket that triggered returning this frame. (if frame threading isn't used)
  • This is also the Presentation time of this AVFrame calculated from
  • only AVPacket.dts values without pts values.

func (*CAVFrame) SetPrivateRef

func (f *CAVFrame) SetPrivateRef(privateRef *CAVBufferRef)

*

  • AVBufferRef for internal use by a single libav* library.
  • Must not be used to transfer data between libraries.
  • Has to be NULL when ownership of the frame leaves the respective library. *
  • Code outside the FFmpeg libs should never check or change the contents of the buffer ref. *
  • FFmpeg calls av_buffer_unref() on it when the frame is unreferenced.
  • av_frame_copy_props() calls create a new reference with av_buffer_ref()
  • for the target frame's private_ref field.

func (*CAVFrame) SetPts

func (f *CAVFrame) SetPts(pts int64)

*

  • Presentation timestamp in time_base units (time when frame should be shown to user).

func (*CAVFrame) SetQuality

func (f *CAVFrame) SetQuality(quality int)

* * quality (between 1 (good) and FF_LAMBDA_MAX (bad))

func (*CAVFrame) SetRepeatPict

func (f *CAVFrame) SetRepeatPict(repeatPict int)

*

  • Number of fields in this frame which should be repeated, i.e. the total
  • duration of this frame should be repeat_pict + 2 normal field durations. *
  • For interlaced frames this field may be set to 1, which signals that this
  • frame should be presented as 3 fields: beginning with the first field (as
  • determined by AV_FRAME_FLAG_TOP_FIELD_FIRST being set or not), followed
  • by the second field, and then the first field again. *
  • For progressive frames this field may be set to a multiple of 2, which
  • signals that this frame's duration should be (repeat_pict + 2) / 2
  • normal frame durations. *
  • @note This field is computed from MPEG2 repeat_first_field flag and its
  • associated flags, H.264 pic_struct from picture timing SEI, and
  • their analogues in other codecs. Typically it should only be used when
  • higher-layer timing information is not available.

func (*CAVFrame) SetSampleAspectRatio

func (f *CAVFrame) SetSampleAspectRatio(sampleAspectRatio CAVRational)

*

  • Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.

func (*CAVFrame) SetSampleRate

func (f *CAVFrame) SetSampleRate(sampleRate int)

*

  • Sample rate of the audio data.

func (*CAVFrame) SetSideData

func (f *CAVFrame) SetSideData(sideData **CAVFrameSideData)

func (*CAVFrame) SetTimeBase

func (f *CAVFrame) SetTimeBase(timeBase CAVRational)

*

  • Time base for the timestamps in this frame.
  • In the future, this field may be set on frames output by decoders or
  • filters, but its value will be by default ignored on input to encoders
  • or filters.

func (*CAVFrame) SetWidth

func (f *CAVFrame) SetWidth(width int)

type CAVFrameSideData

type CAVFrameSideData C.AVFrameSideData

*

  • Structure to hold side data for an AVFrame. *
  • sizeof(AVFrameSideData) is not a part of the public ABI, so new fields may be added
  • to the end with a minor bump.

func AvFrameGetSideData

func AvFrameGetSideData(frame *CAVFrame, _type CAVFrameSideDataType) *CAVFrameSideData

*

  • @return a pointer to the side data of a given type on success, NULL if there
  • is no side data with such type in this frame.

func AvFrameNewSideData

func AvFrameNewSideData(frame *CAVFrame, _type CAVFrameSideDataType, size ctypes.SizeT) *CAVFrameSideData

*

  • Add a new side data to a frame. *
  • @param frame a frame to which the side data should be added
  • @param type type of the added side data
  • @param size size of the side data *
  • @return newly added side data on success, NULL on error

func AvFrameNewSideDataFromBuf

func AvFrameNewSideDataFromBuf(frame *CAVFrame, _type CAVFrameSideDataType, buf *CAVBufferRef) *CAVFrameSideData

*

  • Add a new side data to a frame from an existing AVBufferRef *
  • @param frame a frame to which the side data should be added
  • @param type the type of the added side data
  • @param buf an AVBufferRef to add as side data. The ownership of
  • the reference is transferred to the frame. *
  • @return newly added side data on success, NULL on error. On failure
  • the frame is unchanged and the AVBufferRef remains owned by
  • the caller.

func (*CAVFrameSideData) GetBuf

func (sd *CAVFrameSideData) GetBuf() *CAVBufferRef

func (*CAVFrameSideData) GetData

func (sd *CAVFrameSideData) GetData() unsafe.Pointer

func (*CAVFrameSideData) GetMetadata

func (sd *CAVFrameSideData) GetMetadata() *CAVDictionary

func (*CAVFrameSideData) GetSize

func (sd *CAVFrameSideData) GetSize() ctypes.SizeT

func (*CAVFrameSideData) GetType

func (sd *CAVFrameSideData) GetType() CAVFrameSideDataType

type CAVFrameSideDataType

type CAVFrameSideDataType C.enum_AVFrameSideDataType
const (
	/**
	 * The data is the AVPanScan struct defined in libavcodec.
	 */
	AV_FRAME_DATA_PANSCAN CAVFrameSideDataType = C.AV_FRAME_DATA_PANSCAN
	/**
	 * ATSC A53 Part 4 Closed Captions.
	 * A53 CC bitstream is stored as uint8_t in AVFrameSideData.data.
	 * The number of bytes of CC data is AVFrameSideData.size.
	 */
	AV_FRAME_DATA_A53_CC CAVFrameSideDataType = C.AV_FRAME_DATA_A53_CC
	/**
	 * Stereoscopic 3d metadata.
	 * The data is the AVStereo3D struct defined in libavutil/stereo3d.h.
	 */
	AV_FRAME_DATA_STEREO3D CAVFrameSideDataType = C.AV_FRAME_DATA_STEREO3D
	/**
	 * The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h.
	 */
	AV_FRAME_DATA_MATRIXENCODING CAVFrameSideDataType = C.AV_FRAME_DATA_MATRIXENCODING
	/**
	 * Metadata relevant to a downmix procedure.
	 * The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h.
	 */
	AV_FRAME_DATA_DOWNMIX_INFO CAVFrameSideDataType = C.AV_FRAME_DATA_DOWNMIX_INFO
	/**
	 * ReplayGain information in the form of the AVReplayGain struct.
	 */
	AV_FRAME_DATA_REPLAYGAIN CAVFrameSideDataType = C.AV_FRAME_DATA_REPLAYGAIN
	/**
	 * This side data contains a 3x3 transformation matrix describing an affine
	 * transformation that needs to be applied to the frame for correct
	 * presentation.
	 *
	 * See libavutil/display.h for a detailed description of the data.
	 */
	AV_FRAME_DATA_DISPLAYMATRIX CAVFrameSideDataType = C.AV_FRAME_DATA_DISPLAYMATRIX
	/**
	 * Active Format Description data consisting of a single byte as specified
	 * in ETSI TS 101 154 using AVActiveFormatDescription enum.
	 */
	AV_FRAME_DATA_AFD CAVFrameSideDataType = C.AV_FRAME_DATA_AFD
	/**
	 * Motion vectors exported by some codecs (on demand through the export_mvs
	 * flag set in the libavcodec AVCodecContext flags2 option).
	 * The data is the AVMotionVector struct defined in
	 * libavutil/motion_vector.h.
	 */
	AV_FRAME_DATA_MOTION_VECTORS CAVFrameSideDataType = C.AV_FRAME_DATA_MOTION_VECTORS
	/**
	 * Recommmends skipping the specified number of samples. This is exported
	 * only if the "skip_manual" AVOption is set in libavcodec.
	 * This has the same format as AV_PKT_DATA_SKIP_SAMPLES.
	 * @code
	 * u32le number of samples to skip from start of this packet
	 * u32le number of samples to skip from end of this packet
	 * u8    reason for start skip
	 * u8    reason for end   skip (0=padding silence, 1=convergence)
	 * @endcode
	 */
	AV_FRAME_DATA_SKIP_SAMPLES CAVFrameSideDataType = C.AV_FRAME_DATA_SKIP_SAMPLES
	/**
	 * This side data must be associated with an audio frame and corresponds to
	 * enum AVAudioServiceType defined in avcodec.h.
	 */
	AV_FRAME_DATA_AUDIO_SERVICE_TYPE CAVFrameSideDataType = C.AV_FRAME_DATA_AUDIO_SERVICE_TYPE
	/**
	 * Mastering display metadata associated with a video frame. The payload is
	 * an AVMasteringDisplayMetadata type and contains information about the
	 * mastering display color volume.
	 */
	AV_FRAME_DATA_MASTERING_DISPLAY_METADATA CAVFrameSideDataType = C.AV_FRAME_DATA_MASTERING_DISPLAY_METADATA
	/**
	 * The GOP timecode in 25 bit timecode format. Data format is 64-bit integer.
	 * This is set on the first frame of a GOP that has a temporal reference of 0.
	 */
	AV_FRAME_DATA_GOP_TIMECODE CAVFrameSideDataType = C.AV_FRAME_DATA_GOP_TIMECODE

	/**
	 * The data represents the AVSphericalMapping structure defined in
	 * libavutil/spherical.h.
	 */
	AV_FRAME_DATA_SPHERICAL CAVFrameSideDataType = C.AV_FRAME_DATA_SPHERICAL

	/**
	 * Content light level (based on CTA-861.3). This payload contains data in
	 * the form of the AVContentLightMetadata struct.
	 */
	AV_FRAME_DATA_CONTENT_LIGHT_LEVEL CAVFrameSideDataType = C.AV_FRAME_DATA_CONTENT_LIGHT_LEVEL

	/**
	 * The data contains an ICC profile as an opaque octet buffer following the
	 * format described by ISO 15076-1 with an optional name defined in the
	 * metadata key entry "name".
	 */
	AV_FRAME_DATA_ICC_PROFILE CAVFrameSideDataType = C.AV_FRAME_DATA_ICC_PROFILE

	/**
	 * Timecode which conforms to SMPTE ST 12-1. The data is an array of 4 uint32_t
	 * where the first uint32_t describes how many (1-3) of the other timecodes are used.
	 * The timecode format is described in the documentation of av_timecode_get_smpte_from_framenum()
	 * function in libavutil/timecode.h.
	 */
	AV_FRAME_DATA_S12M_TIMECODE CAVFrameSideDataType = C.AV_FRAME_DATA_S12M_TIMECODE

	/**
	 * HDR dynamic metadata associated with a video frame. The payload is
	 * an AVDynamicHDRPlus type and contains information for color
	 * volume transform - application 4 of SMPTE 2094-40:2016 standard.
	 */
	AV_FRAME_DATA_DYNAMIC_HDR_PLUS CAVFrameSideDataType = C.AV_FRAME_DATA_DYNAMIC_HDR_PLUS

	/**
	 * Regions Of Interest, the data is an array of AVRegionOfInterest type, the number of
	 * array element is implied by AVFrameSideData.size / AVRegionOfInterest.self_size.
	 */
	AV_FRAME_DATA_REGIONS_OF_INTEREST CAVFrameSideDataType = C.AV_FRAME_DATA_REGIONS_OF_INTEREST

	/**
	 * Encoding parameters for a video frame, as described by AVVideoEncParams.
	 */
	AV_FRAME_DATA_VIDEO_ENC_PARAMS CAVFrameSideDataType = C.AV_FRAME_DATA_VIDEO_ENC_PARAMS

	/**
	 * User data unregistered metadata associated with a video frame.
	 * This is the H.26[45] UDU SEI message, and shouldn't be used for any other purpose
	 * The data is stored as uint8_t in AVFrameSideData.data which is 16 bytes of
	 * uuid_iso_iec_11578 followed by AVFrameSideData.size - 16 bytes of user_data_payload_byte.
	 */
	AV_FRAME_DATA_SEI_UNREGISTERED CAVFrameSideDataType = C.AV_FRAME_DATA_SEI_UNREGISTERED

	/**
	 * Film grain parameters for a frame, described by AVFilmGrainParams.
	 * Must be present for every frame which should have film grain applied.
	 */
	AV_FRAME_DATA_FILM_GRAIN_PARAMS CAVFrameSideDataType = C.AV_FRAME_DATA_FILM_GRAIN_PARAMS

	/**
	 * Bounding boxes for object detection and classification,
	 * as described by AVDetectionBBoxHeader.
	 */
	AV_FRAME_DATA_DETECTION_BBOXES CAVFrameSideDataType = C.AV_FRAME_DATA_DETECTION_BBOXES

	/**
	 * Dolby Vision RPU raw data, suitable for passing to x265
	 * or other libraries. Array of uint8_t, with NAL emulation
	 * bytes intact.
	 */
	AV_FRAME_DATA_DOVI_RPU_BUFFER CAVFrameSideDataType = C.AV_FRAME_DATA_DOVI_RPU_BUFFER

	/**
	 * Parsed Dolby Vision metadata, suitable for passing to a software
	 * implementation. The payload is the AVDOVIMetadata struct defined in
	 * libavutil/dovi_meta.h.
	 */
	AV_FRAME_DATA_DOVI_METADATA CAVFrameSideDataType = C.AV_FRAME_DATA_DOVI_METADATA

	/**
	 * HDR Vivid dynamic metadata associated with a video frame. The payload is
	 * an AVDynamicHDRVivid type and contains information for color
	 * volume transform - CUVA 005.1-2021.
	 */
	AV_FRAME_DATA_DYNAMIC_HDR_VIVID CAVFrameSideDataType = C.AV_FRAME_DATA_DYNAMIC_HDR_VIVID

	/**
	 * Ambient viewing environment metadata, as defined by H.274.
	 */
	AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT CAVFrameSideDataType = C.AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT

	/**
	 * Provide encoder-specific hinting information about changed/unchanged
	 * portions of a frame.  It can be used to pass information about which
	 * macroblocks can be skipped because they didn't change from the
	 * corresponding ones in the previous frame. This could be useful for
	 * applications which know this information in advance to speed up
	 * encoding.
	 */
	AV_FRAME_DATA_VIDEO_HINT CAVFrameSideDataType = C.AV_FRAME_DATA_VIDEO_HINT
)

type CAVMatrixEncoding

type CAVMatrixEncoding C.enum_AVMatrixEncoding
const (
	AV_MATRIX_ENCODING_NONE           CAVMatrixEncoding = C.AV_MATRIX_ENCODING_NONE
	AV_MATRIX_ENCODING_DOLBY          CAVMatrixEncoding = C.AV_MATRIX_ENCODING_DOLBY
	AV_MATRIX_ENCODING_DPLII          CAVMatrixEncoding = C.AV_MATRIX_ENCODING_DPLII
	AV_MATRIX_ENCODING_DPLIIX         CAVMatrixEncoding = C.AV_MATRIX_ENCODING_DPLIIX
	AV_MATRIX_ENCODING_DPLIIZ         CAVMatrixEncoding = C.AV_MATRIX_ENCODING_DPLIIZ
	AV_MATRIX_ENCODING_DOLBYEX        CAVMatrixEncoding = C.AV_MATRIX_ENCODING_DOLBYEX
	AV_MATRIX_ENCODING_DOLBYHEADPHONE CAVMatrixEncoding = C.AV_MATRIX_ENCODING_DOLBYHEADPHONE
	AV_MATRIX_ENCODING_NB             CAVMatrixEncoding = C.AV_MATRIX_ENCODING_NB
)

type CAVMediaType

type CAVMediaType C.enum_AVMediaType
const (
	AVMEDIA_TYPE_UNKNOWN    CAVMediaType = C.AVMEDIA_TYPE_UNKNOWN ///< Usually treated as AVMEDIA_TYPE_DATA
	AVMEDIA_TYPE_VIDEO      CAVMediaType = C.AVMEDIA_TYPE_VIDEO
	AVMEDIA_TYPE_AUDIO      CAVMediaType = C.AVMEDIA_TYPE_AUDIO
	AVMEDIA_TYPE_DATA       CAVMediaType = C.AVMEDIA_TYPE_DATA ///< Opaque data information usually continuous
	AVMEDIA_TYPE_SUBTITLE   CAVMediaType = C.AVMEDIA_TYPE_SUBTITLE
	AVMEDIA_TYPE_ATTACHMENT CAVMediaType = C.AVMEDIA_TYPE_ATTACHMENT ///< Opaque data information usually sparse
	AVMEDIA_TYPE_NB         CAVMediaType = C.AVMEDIA_TYPE_NB
)

type CAVPictureType

type CAVPictureType C.enum_AVPictureType
const (
	AV_PICTURE_TYPE_NONE CAVPictureType = C.AV_PICTURE_TYPE_NONE ///< Undefined
	AV_PICTURE_TYPE_I    CAVPictureType = C.AV_PICTURE_TYPE_I    ///< Intra
	AV_PICTURE_TYPE_P    CAVPictureType = C.AV_PICTURE_TYPE_P    ///< Predicted
	AV_PICTURE_TYPE_B    CAVPictureType = C.AV_PICTURE_TYPE_B    ///< Bi-dir predicted
	AV_PICTURE_TYPE_S    CAVPictureType = C.AV_PICTURE_TYPE_S    ///< S(GMC)-VOP MPEG-4
	AV_PICTURE_TYPE_SI   CAVPictureType = C.AV_PICTURE_TYPE_SI   ///< Switching Intra
	AV_PICTURE_TYPE_SP   CAVPictureType = C.AV_PICTURE_TYPE_SP   ///< Switching Predicted
	AV_PICTURE_TYPE_BI   CAVPictureType = C.AV_PICTURE_TYPE_BI   ///< BI type
)

type CAVPixelFormat

type CAVPixelFormat C.enum_AVPixelFormat

*

  • Pixel format. *
  • @note
  • AV_PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA
  • color is put together as:
  • (A << 24) | (R << 16) | (G << 8) | B
  • This is stored as BGRA on little-endian CPU architectures and ARGB on
  • big-endian CPUs. *
  • @note
  • If the resolution is not a multiple of the chroma subsampling factor
  • then the chroma plane resolution must be rounded up. *
  • @par
  • When the pixel format is palettized RGB32 (AV_PIX_FMT_PAL8), the palettized
  • image data is stored in AVFrame.data[0]. The palette is transported in
  • AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is
  • formatted the same as in AV_PIX_FMT_RGB32 described above (i.e., it is
  • also endian-specific). Note also that the individual RGB32 palette
  • components stored in AVFrame.data[1] should be in the range 0..255.
  • This is important as many custom PAL8 video codecs that were designed
  • to run on the IBM VGA graphics adapter use 6-bit palette components. *
  • @par
  • For all the 8 bits per pixel formats, an RGB32 palette is in data[1] like
  • for pal8. This palette is filled in automatically by the function
  • allocating the picture.
const (
	AV_PIX_FMT_NONE      CAVPixelFormat = C.AV_PIX_FMT_NONE
	AV_PIX_FMT_YUV420P   CAVPixelFormat = C.AV_PIX_FMT_YUV420P   ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
	AV_PIX_FMT_YUYV422   CAVPixelFormat = C.AV_PIX_FMT_YUYV422   ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
	AV_PIX_FMT_RGB24     CAVPixelFormat = C.AV_PIX_FMT_RGB24     ///< packed RGB 8:8:8, 24bpp, RGBRGB...
	AV_PIX_FMT_BGR24     CAVPixelFormat = C.AV_PIX_FMT_BGR24     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
	AV_PIX_FMT_YUV422P   CAVPixelFormat = C.AV_PIX_FMT_YUV422P   ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
	AV_PIX_FMT_YUV444P   CAVPixelFormat = C.AV_PIX_FMT_YUV444P   ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
	AV_PIX_FMT_YUV410P   CAVPixelFormat = C.AV_PIX_FMT_YUV410P   ///< planar YUV 4:1:0,  9bpp, (1 Cr & Cb sample per 4x4 Y samples)
	AV_PIX_FMT_YUV411P   CAVPixelFormat = C.AV_PIX_FMT_YUV411P   ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
	AV_PIX_FMT_GRAY8     CAVPixelFormat = C.AV_PIX_FMT_GRAY8     ///<        Y        ,  8bpp
	AV_PIX_FMT_MONOWHITE CAVPixelFormat = C.AV_PIX_FMT_MONOWHITE ///<        Y        ,  1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
	AV_PIX_FMT_MONOBLACK CAVPixelFormat = C.AV_PIX_FMT_MONOBLACK ///<        Y        ,  1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
	AV_PIX_FMT_PAL8      CAVPixelFormat = C.AV_PIX_FMT_PAL8      ///< 8 bits with AV_PIX_FMT_RGB32 palette
	AV_PIX_FMT_YUVJ420P  CAVPixelFormat = C.AV_PIX_FMT_YUVJ420P  ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting color_range
	AV_PIX_FMT_YUVJ422P  CAVPixelFormat = C.AV_PIX_FMT_YUVJ422P  ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting color_range
	AV_PIX_FMT_YUVJ444P  CAVPixelFormat = C.AV_PIX_FMT_YUVJ444P  ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting color_range
	AV_PIX_FMT_UYVY422   CAVPixelFormat = C.AV_PIX_FMT_UYVY422   ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
	AV_PIX_FMT_UYYVYY411 CAVPixelFormat = C.AV_PIX_FMT_UYYVYY411 ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
	AV_PIX_FMT_BGR8      CAVPixelFormat = C.AV_PIX_FMT_BGR8      ///< packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)
	AV_PIX_FMT_BGR4      CAVPixelFormat = C.AV_PIX_FMT_BGR4      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
	AV_PIX_FMT_BGR4_BYTE CAVPixelFormat = C.AV_PIX_FMT_BGR4_BYTE ///< packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb)
	AV_PIX_FMT_RGB8      CAVPixelFormat = C.AV_PIX_FMT_RGB8      ///< packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb)
	AV_PIX_FMT_RGB4      CAVPixelFormat = C.AV_PIX_FMT_RGB4      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
	AV_PIX_FMT_RGB4_BYTE CAVPixelFormat = C.AV_PIX_FMT_RGB4_BYTE ///< packed RGB 1:2:1,  8bpp, (msb)1R 2G 1B(lsb)
	AV_PIX_FMT_NV12      CAVPixelFormat = C.AV_PIX_FMT_NV12      ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
	AV_PIX_FMT_NV21      CAVPixelFormat = C.AV_PIX_FMT_NV21      ///< as above, but U and V bytes are swapped

	AV_PIX_FMT_ARGB CAVPixelFormat = C.AV_PIX_FMT_ARGB ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
	AV_PIX_FMT_RGBA CAVPixelFormat = C.AV_PIX_FMT_RGBA ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
	AV_PIX_FMT_ABGR CAVPixelFormat = C.AV_PIX_FMT_ABGR ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
	AV_PIX_FMT_BGRA CAVPixelFormat = C.AV_PIX_FMT_BGRA ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...

	AV_PIX_FMT_GRAY16BE CAVPixelFormat = C.AV_PIX_FMT_GRAY16BE ///<        Y        , 16bpp, big-endian
	AV_PIX_FMT_GRAY16LE CAVPixelFormat = C.AV_PIX_FMT_GRAY16LE ///<        Y        , 16bpp, little-endian
	AV_PIX_FMT_YUV440P  CAVPixelFormat = C.AV_PIX_FMT_YUV440P  ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
	AV_PIX_FMT_YUVJ440P CAVPixelFormat = C.AV_PIX_FMT_YUVJ440P ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV440P and setting color_range
	AV_PIX_FMT_YUVA420P CAVPixelFormat = C.AV_PIX_FMT_YUVA420P ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
	AV_PIX_FMT_RGB48BE  CAVPixelFormat = C.AV_PIX_FMT_RGB48BE  ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
	AV_PIX_FMT_RGB48LE  CAVPixelFormat = C.AV_PIX_FMT_RGB48LE  ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian

	AV_PIX_FMT_RGB565BE CAVPixelFormat = C.AV_PIX_FMT_RGB565BE ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), big-endian
	AV_PIX_FMT_RGB565LE CAVPixelFormat = C.AV_PIX_FMT_RGB565LE ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), little-endian
	AV_PIX_FMT_RGB555BE CAVPixelFormat = C.AV_PIX_FMT_RGB555BE ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), big-endian   , X=unused/undefined
	AV_PIX_FMT_RGB555LE CAVPixelFormat = C.AV_PIX_FMT_RGB555LE ///< packed RGB 5:5:5, 16bpp, (msb)1X 5R 5G 5B(lsb), little-endian, X=unused/undefined

	AV_PIX_FMT_BGR565BE CAVPixelFormat = C.AV_PIX_FMT_BGR565BE ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), big-endian
	AV_PIX_FMT_BGR565LE CAVPixelFormat = C.AV_PIX_FMT_BGR565LE ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), little-endian
	AV_PIX_FMT_BGR555BE CAVPixelFormat = C.AV_PIX_FMT_BGR555BE ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), big-endian   , X=unused/undefined
	AV_PIX_FMT_BGR555LE CAVPixelFormat = C.AV_PIX_FMT_BGR555LE ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), little-endian, X=unused/undefined

	/**
	 *  Hardware acceleration through VA-API, data[3] contains a
	 *  VASurfaceID.
	 */
	AV_PIX_FMT_VAAPI CAVPixelFormat = C.AV_PIX_FMT_VAAPI

	AV_PIX_FMT_YUV420P16LE CAVPixelFormat = C.AV_PIX_FMT_YUV420P16LE ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
	AV_PIX_FMT_YUV420P16BE CAVPixelFormat = C.AV_PIX_FMT_YUV420P16BE ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
	AV_PIX_FMT_YUV422P16LE CAVPixelFormat = C.AV_PIX_FMT_YUV422P16LE ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
	AV_PIX_FMT_YUV422P16BE CAVPixelFormat = C.AV_PIX_FMT_YUV422P16BE ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
	AV_PIX_FMT_YUV444P16LE CAVPixelFormat = C.AV_PIX_FMT_YUV444P16LE ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
	AV_PIX_FMT_YUV444P16BE CAVPixelFormat = C.AV_PIX_FMT_YUV444P16BE ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
	AV_PIX_FMT_DXVA2_VLD   CAVPixelFormat = C.AV_PIX_FMT_DXVA2_VLD   ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer

	AV_PIX_FMT_RGB444LE CAVPixelFormat = C.AV_PIX_FMT_RGB444LE ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), little-endian, X=unused/undefined
	AV_PIX_FMT_RGB444BE CAVPixelFormat = C.AV_PIX_FMT_RGB444BE ///< packed RGB 4:4:4, 16bpp, (msb)4X 4R 4G 4B(lsb), big-endian,    X=unused/undefined
	AV_PIX_FMT_BGR444LE CAVPixelFormat = C.AV_PIX_FMT_BGR444LE ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), little-endian, X=unused/undefined
	AV_PIX_FMT_BGR444BE CAVPixelFormat = C.AV_PIX_FMT_BGR444BE ///< packed BGR 4:4:4, 16bpp, (msb)4X 4B 4G 4R(lsb), big-endian,    X=unused/undefined
	AV_PIX_FMT_YA8      CAVPixelFormat = C.AV_PIX_FMT_YA8      ///< 8 bits gray, 8 bits alpha

	AV_PIX_FMT_Y400A  CAVPixelFormat = C.AV_PIX_FMT_Y400A  ///< alias for AV_PIX_FMT_YA8
	AV_PIX_FMT_GRAY8A CAVPixelFormat = C.AV_PIX_FMT_GRAY8A ///< alias for AV_PIX_FMT_YA8

	AV_PIX_FMT_BGR48BE CAVPixelFormat = C.AV_PIX_FMT_BGR48BE ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
	AV_PIX_FMT_BGR48LE CAVPixelFormat = C.AV_PIX_FMT_BGR48LE ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian

	/**
	 * The following 12 formats have the disadvantage of needing 1 format for each bit depth.
	 * Notice that each 9/10 bits sample is stored in 16 bits with extra padding.
	 * If you want to support multiple bit depths, then using AV_PIX_FMT_YUV420P16* with the bpp stored separately is better.
	 */
	AV_PIX_FMT_YUV420P9BE   CAVPixelFormat = C.AV_PIX_FMT_YUV420P9BE   ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
	AV_PIX_FMT_YUV420P9LE   CAVPixelFormat = C.AV_PIX_FMT_YUV420P9LE   ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
	AV_PIX_FMT_YUV420P10BE  CAVPixelFormat = C.AV_PIX_FMT_YUV420P10BE  ///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
	AV_PIX_FMT_YUV420P10LE  CAVPixelFormat = C.AV_PIX_FMT_YUV420P10LE  ///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
	AV_PIX_FMT_YUV422P10BE  CAVPixelFormat = C.AV_PIX_FMT_YUV422P10BE  ///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
	AV_PIX_FMT_YUV422P10LE  CAVPixelFormat = C.AV_PIX_FMT_YUV422P10LE  ///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
	AV_PIX_FMT_YUV444P9BE   CAVPixelFormat = C.AV_PIX_FMT_YUV444P9BE   ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
	AV_PIX_FMT_YUV444P9LE   CAVPixelFormat = C.AV_PIX_FMT_YUV444P9LE   ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
	AV_PIX_FMT_YUV444P10BE  CAVPixelFormat = C.AV_PIX_FMT_YUV444P10BE  ///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
	AV_PIX_FMT_YUV444P10LE  CAVPixelFormat = C.AV_PIX_FMT_YUV444P10LE  ///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
	AV_PIX_FMT_YUV422P9BE   CAVPixelFormat = C.AV_PIX_FMT_YUV422P9BE   ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
	AV_PIX_FMT_YUV422P9LE   CAVPixelFormat = C.AV_PIX_FMT_YUV422P9LE   ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
	AV_PIX_FMT_GBRP         CAVPixelFormat = C.AV_PIX_FMT_GBRP         ///< planar GBR 4:4:4 24bpp
	AV_PIX_FMT_GBR24P       CAVPixelFormat = C.AV_PIX_FMT_GBR24P       // alias for #AV_PIX_FMT_GBRP
	AV_PIX_FMT_GBRP9BE      CAVPixelFormat = C.AV_PIX_FMT_GBRP9BE      ///< planar GBR 4:4:4 27bpp, big-endian
	AV_PIX_FMT_GBRP9LE      CAVPixelFormat = C.AV_PIX_FMT_GBRP9LE      ///< planar GBR 4:4:4 27bpp, little-endian
	AV_PIX_FMT_GBRP10BE     CAVPixelFormat = C.AV_PIX_FMT_GBRP10BE     ///< planar GBR 4:4:4 30bpp, big-endian
	AV_PIX_FMT_GBRP10LE     CAVPixelFormat = C.AV_PIX_FMT_GBRP10LE     ///< planar GBR 4:4:4 30bpp, little-endian
	AV_PIX_FMT_GBRP16BE     CAVPixelFormat = C.AV_PIX_FMT_GBRP16BE     ///< planar GBR 4:4:4 48bpp, big-endian
	AV_PIX_FMT_GBRP16LE     CAVPixelFormat = C.AV_PIX_FMT_GBRP16LE     ///< planar GBR 4:4:4 48bpp, little-endian
	AV_PIX_FMT_YUVA422P     CAVPixelFormat = C.AV_PIX_FMT_YUVA422P     ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
	AV_PIX_FMT_YUVA444P     CAVPixelFormat = C.AV_PIX_FMT_YUVA444P     ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
	AV_PIX_FMT_YUVA420P9BE  CAVPixelFormat = C.AV_PIX_FMT_YUVA420P9BE  ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
	AV_PIX_FMT_YUVA420P9LE  CAVPixelFormat = C.AV_PIX_FMT_YUVA420P9LE  ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian
	AV_PIX_FMT_YUVA422P9BE  CAVPixelFormat = C.AV_PIX_FMT_YUVA422P9BE  ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
	AV_PIX_FMT_YUVA422P9LE  CAVPixelFormat = C.AV_PIX_FMT_YUVA422P9LE  ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
	AV_PIX_FMT_YUVA444P9BE  CAVPixelFormat = C.AV_PIX_FMT_YUVA444P9BE  ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
	AV_PIX_FMT_YUVA444P9LE  CAVPixelFormat = C.AV_PIX_FMT_YUVA444P9LE  ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
	AV_PIX_FMT_YUVA420P10BE CAVPixelFormat = C.AV_PIX_FMT_YUVA420P10BE ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
	AV_PIX_FMT_YUVA420P10LE CAVPixelFormat = C.AV_PIX_FMT_YUVA420P10LE ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
	AV_PIX_FMT_YUVA422P10BE CAVPixelFormat = C.AV_PIX_FMT_YUVA422P10BE ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
	AV_PIX_FMT_YUVA422P10LE CAVPixelFormat = C.AV_PIX_FMT_YUVA422P10LE ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
	AV_PIX_FMT_YUVA444P10BE CAVPixelFormat = C.AV_PIX_FMT_YUVA444P10BE ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
	AV_PIX_FMT_YUVA444P10LE CAVPixelFormat = C.AV_PIX_FMT_YUVA444P10LE ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
	AV_PIX_FMT_YUVA420P16BE CAVPixelFormat = C.AV_PIX_FMT_YUVA420P16BE ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
	AV_PIX_FMT_YUVA420P16LE CAVPixelFormat = C.AV_PIX_FMT_YUVA420P16LE ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
	AV_PIX_FMT_YUVA422P16BE CAVPixelFormat = C.AV_PIX_FMT_YUVA422P16BE ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
	AV_PIX_FMT_YUVA422P16LE CAVPixelFormat = C.AV_PIX_FMT_YUVA422P16LE ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
	AV_PIX_FMT_YUVA444P16BE CAVPixelFormat = C.AV_PIX_FMT_YUVA444P16BE ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
	AV_PIX_FMT_YUVA444P16LE CAVPixelFormat = C.AV_PIX_FMT_YUVA444P16LE ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)

	AV_PIX_FMT_VDPAU CAVPixelFormat = C.AV_PIX_FMT_VDPAU ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface

	AV_PIX_FMT_XYZ12LE CAVPixelFormat = C.AV_PIX_FMT_XYZ12LE ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0
	AV_PIX_FMT_XYZ12BE CAVPixelFormat = C.AV_PIX_FMT_XYZ12BE ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0
	AV_PIX_FMT_NV16    CAVPixelFormat = C.AV_PIX_FMT_NV16    ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
	AV_PIX_FMT_NV20LE  CAVPixelFormat = C.AV_PIX_FMT_NV20LE  ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
	AV_PIX_FMT_NV20BE  CAVPixelFormat = C.AV_PIX_FMT_NV20BE  ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian

	AV_PIX_FMT_RGBA64BE CAVPixelFormat = C.AV_PIX_FMT_RGBA64BE ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
	AV_PIX_FMT_RGBA64LE CAVPixelFormat = C.AV_PIX_FMT_RGBA64LE ///< packed RGBA 16:16:16:16, 64bpp, 16R, 16G, 16B, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian
	AV_PIX_FMT_BGRA64BE CAVPixelFormat = C.AV_PIX_FMT_BGRA64BE ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as big-endian
	AV_PIX_FMT_BGRA64LE CAVPixelFormat = C.AV_PIX_FMT_BGRA64LE ///< packed RGBA 16:16:16:16, 64bpp, 16B, 16G, 16R, 16A, the 2-byte value for each R/G/B/A component is stored as little-endian

	AV_PIX_FMT_YVYU422 CAVPixelFormat = C.AV_PIX_FMT_YVYU422 ///< packed YUV 4:2:2, 16bpp, Y0 Cr Y1 Cb

	AV_PIX_FMT_YA16BE CAVPixelFormat = C.AV_PIX_FMT_YA16BE ///< 16 bits gray, 16 bits alpha (big-endian)
	AV_PIX_FMT_YA16LE CAVPixelFormat = C.AV_PIX_FMT_YA16LE ///< 16 bits gray, 16 bits alpha (little-endian)

	AV_PIX_FMT_GBRAP     CAVPixelFormat = C.AV_PIX_FMT_GBRAP     ///< planar GBRA 4:4:4:4 32bpp
	AV_PIX_FMT_GBRAP16BE CAVPixelFormat = C.AV_PIX_FMT_GBRAP16BE ///< planar GBRA 4:4:4:4 64bpp, big-endian
	AV_PIX_FMT_GBRAP16LE CAVPixelFormat = C.AV_PIX_FMT_GBRAP16LE ///< planar GBRA 4:4:4:4 64bpp, little-endian
	/**
	 * HW acceleration through QSV, data[3] contains a pointer to the
	 * mfxFrameSurface1 structure.
	 *
	 * Before FFmpeg 5.0:
	 * mfxFrameSurface1.Data.MemId contains a pointer when importing
	 * the following frames as QSV frames:
	 *
	 * VAAPI:
	 * mfxFrameSurface1.Data.MemId contains a pointer to VASurfaceID
	 *
	 * DXVA2:
	 * mfxFrameSurface1.Data.MemId contains a pointer to IDirect3DSurface9
	 *
	 * FFmpeg 5.0 and above:
	 * mfxFrameSurface1.Data.MemId contains a pointer to the mfxHDLPair
	 * structure when importing the following frames as QSV frames:
	 *
	 * VAAPI:
	 * mfxHDLPair.first contains a VASurfaceID pointer.
	 * mfxHDLPair.second is always MFX_INFINITE.
	 *
	 * DXVA2:
	 * mfxHDLPair.first contains IDirect3DSurface9 pointer.
	 * mfxHDLPair.second is always MFX_INFINITE.
	 *
	 * D3D11:
	 * mfxHDLPair.first contains a ID3D11Texture2D pointer.
	 * mfxHDLPair.second contains the texture array index of the frame if the
	 * ID3D11Texture2D is an array texture, or always MFX_INFINITE if it is a
	 * normal texture.
	 */
	AV_PIX_FMT_QSV CAVPixelFormat = C.AV_PIX_FMT_QSV

	/**
	 * HW acceleration though MMAL, data[3] contains a pointer to the
	 * MMAL_BUFFER_HEADER_T structure.
	 */
	AV_PIX_FMT_MMAL CAVPixelFormat = C.AV_PIX_FMT_MMAL

	AV_PIX_FMT_D3D11VA_VLD CAVPixelFormat = C.AV_PIX_FMT_D3D11VA_VLD ///< HW decoding through Direct3D11 via old API, Picture.data[3] contains a ID3D11VideoDecoderOutputView pointer

	/**
	 * HW acceleration through CUDA. data[i] contain CUdeviceptr pointers
	 * exactly as for system memory frames.
	 */
	AV_PIX_FMT_CUDA CAVPixelFormat = C.AV_PIX_FMT_CUDA

	AV_PIX_FMT_0RGB CAVPixelFormat = C.AV_PIX_FMT_0RGB ///< packed RGB 8:8:8, 32bpp, XRGBXRGB...   X=unused/undefined
	AV_PIX_FMT_RGB0 CAVPixelFormat = C.AV_PIX_FMT_RGB0 ///< packed RGB 8:8:8, 32bpp, RGBXRGBX...   X=unused/undefined
	AV_PIX_FMT_0BGR CAVPixelFormat = C.AV_PIX_FMT_0BGR ///< packed BGR 8:8:8, 32bpp, XBGRXBGR...   X=unused/undefined
	AV_PIX_FMT_BGR0 CAVPixelFormat = C.AV_PIX_FMT_BGR0 ///< packed BGR 8:8:8, 32bpp, BGRXBGRX...   X=unused/undefined

	AV_PIX_FMT_YUV420P12BE CAVPixelFormat = C.AV_PIX_FMT_YUV420P12BE ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
	AV_PIX_FMT_YUV420P12LE CAVPixelFormat = C.AV_PIX_FMT_YUV420P12LE ///< planar YUV 4:2:0,18bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
	AV_PIX_FMT_YUV420P14BE CAVPixelFormat = C.AV_PIX_FMT_YUV420P14BE ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
	AV_PIX_FMT_YUV420P14LE CAVPixelFormat = C.AV_PIX_FMT_YUV420P14LE ///< planar YUV 4:2:0,21bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
	AV_PIX_FMT_YUV422P12BE CAVPixelFormat = C.AV_PIX_FMT_YUV422P12BE ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
	AV_PIX_FMT_YUV422P12LE CAVPixelFormat = C.AV_PIX_FMT_YUV422P12LE ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
	AV_PIX_FMT_YUV422P14BE CAVPixelFormat = C.AV_PIX_FMT_YUV422P14BE ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
	AV_PIX_FMT_YUV422P14LE CAVPixelFormat = C.AV_PIX_FMT_YUV422P14LE ///< planar YUV 4:2:2,28bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
	AV_PIX_FMT_YUV444P12BE CAVPixelFormat = C.AV_PIX_FMT_YUV444P12BE ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
	AV_PIX_FMT_YUV444P12LE CAVPixelFormat = C.AV_PIX_FMT_YUV444P12LE ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
	AV_PIX_FMT_YUV444P14BE CAVPixelFormat = C.AV_PIX_FMT_YUV444P14BE ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
	AV_PIX_FMT_YUV444P14LE CAVPixelFormat = C.AV_PIX_FMT_YUV444P14LE ///< planar YUV 4:4:4,42bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
	AV_PIX_FMT_GBRP12BE    CAVPixelFormat = C.AV_PIX_FMT_GBRP12BE    ///< planar GBR 4:4:4 36bpp, big-endian
	AV_PIX_FMT_GBRP12LE    CAVPixelFormat = C.AV_PIX_FMT_GBRP12LE    ///< planar GBR 4:4:4 36bpp, little-endian
	AV_PIX_FMT_GBRP14BE    CAVPixelFormat = C.AV_PIX_FMT_GBRP14BE    ///< planar GBR 4:4:4 42bpp, big-endian
	AV_PIX_FMT_GBRP14LE    CAVPixelFormat = C.AV_PIX_FMT_GBRP14LE    ///< planar GBR 4:4:4 42bpp, little-endian
	AV_PIX_FMT_YUVJ411P    CAVPixelFormat = C.AV_PIX_FMT_YUVJ411P    ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV411P and setting color_range

	AV_PIX_FMT_BAYER_BGGR8    CAVPixelFormat = C.AV_PIX_FMT_BAYER_BGGR8    ///< bayer, BGBG..(odd line), GRGR..(even line), 8-bit samples
	AV_PIX_FMT_BAYER_RGGB8    CAVPixelFormat = C.AV_PIX_FMT_BAYER_RGGB8    ///< bayer, RGRG..(odd line), GBGB..(even line), 8-bit samples
	AV_PIX_FMT_BAYER_GBRG8    CAVPixelFormat = C.AV_PIX_FMT_BAYER_GBRG8    ///< bayer, GBGB..(odd line), RGRG..(even line), 8-bit samples
	AV_PIX_FMT_BAYER_GRBG8    CAVPixelFormat = C.AV_PIX_FMT_BAYER_GRBG8    ///< bayer, GRGR..(odd line), BGBG..(even line), 8-bit samples
	AV_PIX_FMT_BAYER_BGGR16LE CAVPixelFormat = C.AV_PIX_FMT_BAYER_BGGR16LE ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, little-endian
	AV_PIX_FMT_BAYER_BGGR16BE CAVPixelFormat = C.AV_PIX_FMT_BAYER_BGGR16BE ///< bayer, BGBG..(odd line), GRGR..(even line), 16-bit samples, big-endian
	AV_PIX_FMT_BAYER_RGGB16LE CAVPixelFormat = C.AV_PIX_FMT_BAYER_RGGB16LE ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, little-endian
	AV_PIX_FMT_BAYER_RGGB16BE CAVPixelFormat = C.AV_PIX_FMT_BAYER_RGGB16BE ///< bayer, RGRG..(odd line), GBGB..(even line), 16-bit samples, big-endian
	AV_PIX_FMT_BAYER_GBRG16LE CAVPixelFormat = C.AV_PIX_FMT_BAYER_GBRG16LE ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, little-endian
	AV_PIX_FMT_BAYER_GBRG16BE CAVPixelFormat = C.AV_PIX_FMT_BAYER_GBRG16BE ///< bayer, GBGB..(odd line), RGRG..(even line), 16-bit samples, big-endian
	AV_PIX_FMT_BAYER_GRBG16LE CAVPixelFormat = C.AV_PIX_FMT_BAYER_GRBG16LE ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, little-endian
	AV_PIX_FMT_BAYER_GRBG16BE CAVPixelFormat = C.AV_PIX_FMT_BAYER_GRBG16BE ///< bayer, GRGR..(odd line), BGBG..(even line), 16-bit samples, big-endian

	// #if FF_API_XVMC
	AV_PIX_FMT_XVMC CAVPixelFormat = C.AV_PIX_FMT_XVMC ///< XVideo Motion Acceleration via common packet passing

	AV_PIX_FMT_YUV440P10LE CAVPixelFormat = C.AV_PIX_FMT_YUV440P10LE ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
	AV_PIX_FMT_YUV440P10BE CAVPixelFormat = C.AV_PIX_FMT_YUV440P10BE ///< planar YUV 4:4:0,20bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
	AV_PIX_FMT_YUV440P12LE CAVPixelFormat = C.AV_PIX_FMT_YUV440P12LE ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), little-endian
	AV_PIX_FMT_YUV440P12BE CAVPixelFormat = C.AV_PIX_FMT_YUV440P12BE ///< planar YUV 4:4:0,24bpp, (1 Cr & Cb sample per 1x2 Y samples), big-endian
	AV_PIX_FMT_AYUV64LE    CAVPixelFormat = C.AV_PIX_FMT_AYUV64LE    ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
	AV_PIX_FMT_AYUV64BE    CAVPixelFormat = C.AV_PIX_FMT_AYUV64BE    ///< packed AYUV 4:4:4,64bpp (1 Cr & Cb sample per 1x1 Y & A samples), big-endian

	AV_PIX_FMT_VIDEOTOOLBOX CAVPixelFormat = C.AV_PIX_FMT_VIDEOTOOLBOX ///< hardware decoding through Videotoolbox

	AV_PIX_FMT_P010LE CAVPixelFormat = C.AV_PIX_FMT_P010LE ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, little-endian
	AV_PIX_FMT_P010BE CAVPixelFormat = C.AV_PIX_FMT_P010BE ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, big-endian

	AV_PIX_FMT_GBRAP12BE CAVPixelFormat = C.AV_PIX_FMT_GBRAP12BE ///< planar GBR 4:4:4:4 48bpp, big-endian
	AV_PIX_FMT_GBRAP12LE CAVPixelFormat = C.AV_PIX_FMT_GBRAP12LE ///< planar GBR 4:4:4:4 48bpp, little-endian

	AV_PIX_FMT_GBRAP10BE CAVPixelFormat = C.AV_PIX_FMT_GBRAP10BE ///< planar GBR 4:4:4:4 40bpp, big-endian
	AV_PIX_FMT_GBRAP10LE CAVPixelFormat = C.AV_PIX_FMT_GBRAP10LE ///< planar GBR 4:4:4:4 40bpp, little-endian

	AV_PIX_FMT_MEDIACODEC CAVPixelFormat = C.AV_PIX_FMT_MEDIACODEC ///< hardware decoding through MediaCodec

	AV_PIX_FMT_GRAY12BE CAVPixelFormat = C.AV_PIX_FMT_GRAY12BE ///<        Y        , 12bpp, big-endian
	AV_PIX_FMT_GRAY12LE CAVPixelFormat = C.AV_PIX_FMT_GRAY12LE ///<        Y        , 12bpp, little-endian
	AV_PIX_FMT_GRAY10BE CAVPixelFormat = C.AV_PIX_FMT_GRAY10BE ///<        Y        , 10bpp, big-endian
	AV_PIX_FMT_GRAY10LE CAVPixelFormat = C.AV_PIX_FMT_GRAY10LE ///<        Y        , 10bpp, little-endian

	AV_PIX_FMT_P016LE CAVPixelFormat = C.AV_PIX_FMT_P016LE ///< like NV12, with 16bpp per component, little-endian
	AV_PIX_FMT_P016BE CAVPixelFormat = C.AV_PIX_FMT_P016BE ///< like NV12, with 16bpp per component, big-endian

	/**
	 * Hardware surfaces for Direct3D11.
	 *
	 * This is preferred over the legacy AV_PIX_FMT_D3D11VA_VLD. The new D3D11
	 * hwaccel API and filtering support AV_PIX_FMT_D3D11 only.
	 *
	 * data[0] contains a ID3D11Texture2D pointer, and data[1] contains the
	 * texture array index of the frame as intptr_t if the ID3D11Texture2D is
	 * an array texture (or always 0 if it's a normal texture).
	 */
	AV_PIX_FMT_D3D11 CAVPixelFormat = C.AV_PIX_FMT_D3D11

	AV_PIX_FMT_GRAY9BE CAVPixelFormat = C.AV_PIX_FMT_GRAY9BE ///<        Y        , 9bpp, big-endian
	AV_PIX_FMT_GRAY9LE CAVPixelFormat = C.AV_PIX_FMT_GRAY9LE ///<        Y        , 9bpp, little-endian

	AV_PIX_FMT_GBRPF32BE  CAVPixelFormat = C.AV_PIX_FMT_GBRPF32BE  ///< IEEE-754 single precision planar GBR 4:4:4,     96bpp, big-endian
	AV_PIX_FMT_GBRPF32LE  CAVPixelFormat = C.AV_PIX_FMT_GBRPF32LE  ///< IEEE-754 single precision planar GBR 4:4:4,     96bpp, little-endian
	AV_PIX_FMT_GBRAPF32BE CAVPixelFormat = C.AV_PIX_FMT_GBRAPF32BE ///< IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, big-endian
	AV_PIX_FMT_GBRAPF32LE CAVPixelFormat = C.AV_PIX_FMT_GBRAPF32LE ///< IEEE-754 single precision planar GBRA 4:4:4:4, 128bpp, little-endian

	/**
	 * DRM-managed buffers exposed through PRIME buffer sharing.
	 *
	 * data[0] points to an AVDRMFrameDescriptor.
	 */
	AV_PIX_FMT_DRM_PRIME CAVPixelFormat = C.AV_PIX_FMT_DRM_PRIME
	/**
	 * Hardware surfaces for OpenCL.
	 *
	 * data[i] contain 2D image objects (typed in C as cl_mem, used
	 * in OpenCL as image2d_t) for each plane of the surface.
	 */
	AV_PIX_FMT_OPENCL CAVPixelFormat = C.AV_PIX_FMT_OPENCL

	AV_PIX_FMT_GRAY14BE CAVPixelFormat = C.AV_PIX_FMT_GRAY14BE ///<        Y        , 14bpp, big-endian
	AV_PIX_FMT_GRAY14LE CAVPixelFormat = C.AV_PIX_FMT_GRAY14LE ///<        Y        , 14bpp, little-endian

	AV_PIX_FMT_GRAYF32BE CAVPixelFormat = C.AV_PIX_FMT_GRAYF32BE ///< IEEE-754 single precision Y, 32bpp, big-endian
	AV_PIX_FMT_GRAYF32LE CAVPixelFormat = C.AV_PIX_FMT_GRAYF32LE ///< IEEE-754 single precision Y, 32bpp, little-endian

	AV_PIX_FMT_YUVA422P12BE CAVPixelFormat = C.AV_PIX_FMT_YUVA422P12BE ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), 12b alpha, big-endian
	AV_PIX_FMT_YUVA422P12LE CAVPixelFormat = C.AV_PIX_FMT_YUVA422P12LE ///< planar YUV 4:2:2,24bpp, (1 Cr & Cb sample per 2x1 Y samples), 12b alpha, little-endian
	AV_PIX_FMT_YUVA444P12BE CAVPixelFormat = C.AV_PIX_FMT_YUVA444P12BE ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha, big-endian
	AV_PIX_FMT_YUVA444P12LE CAVPixelFormat = C.AV_PIX_FMT_YUVA444P12LE ///< planar YUV 4:4:4,36bpp, (1 Cr & Cb sample per 1x1 Y samples), 12b alpha, little-endian

	AV_PIX_FMT_NV24 CAVPixelFormat = C.AV_PIX_FMT_NV24 ///< planar YUV 4:4:4, 24bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
	AV_PIX_FMT_NV42 CAVPixelFormat = C.AV_PIX_FMT_NV42 ///< as above, but U and V bytes are swapped

	/**
	 * Vulkan hardware images.
	 *
	 * data[0] points to an AVVkFrame
	 */
	AV_PIX_FMT_VULKAN CAVPixelFormat = C.AV_PIX_FMT_VULKAN

	AV_PIX_FMT_Y210BE CAVPixelFormat = C.AV_PIX_FMT_Y210BE ///< packed YUV 4:2:2 like YUYV422, 20bpp, data in the high bits, big-endian
	AV_PIX_FMT_Y210LE CAVPixelFormat = C.AV_PIX_FMT_Y210LE ///< packed YUV 4:2:2 like YUYV422, 20bpp, data in the high bits, little-endian

	AV_PIX_FMT_X2RGB10LE CAVPixelFormat = C.AV_PIX_FMT_X2RGB10LE ///< packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), little-endian, X=unused/undefined
	AV_PIX_FMT_X2RGB10BE CAVPixelFormat = C.AV_PIX_FMT_X2RGB10BE ///< packed RGB 10:10:10, 30bpp, (msb)2X 10R 10G 10B(lsb), big-endian, X=unused/undefined
	AV_PIX_FMT_X2BGR10LE CAVPixelFormat = C.AV_PIX_FMT_X2BGR10LE ///< packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G 10R(lsb), little-endian, X=unused/undefined
	AV_PIX_FMT_X2BGR10BE CAVPixelFormat = C.AV_PIX_FMT_X2BGR10BE ///< packed BGR 10:10:10, 30bpp, (msb)2X 10B 10G 10R(lsb), big-endian, X=unused/undefined

	AV_PIX_FMT_P210BE CAVPixelFormat = C.AV_PIX_FMT_P210BE ///< interleaved chroma YUV 4:2:2, 20bpp, data in the high bits, big-endian
	AV_PIX_FMT_P210LE CAVPixelFormat = C.AV_PIX_FMT_P210LE ///< interleaved chroma YUV 4:2:2, 20bpp, data in the high bits, little-endian

	AV_PIX_FMT_P410BE CAVPixelFormat = C.AV_PIX_FMT_P410BE ///< interleaved chroma YUV 4:4:4, 30bpp, data in the high bits, big-endian
	AV_PIX_FMT_P410LE CAVPixelFormat = C.AV_PIX_FMT_P410LE ///< interleaved chroma YUV 4:4:4, 30bpp, data in the high bits, little-endian

	AV_PIX_FMT_P216BE CAVPixelFormat = C.AV_PIX_FMT_P216BE ///< interleaved chroma YUV 4:2:2, 32bpp, big-endian
	AV_PIX_FMT_P216LE CAVPixelFormat = C.AV_PIX_FMT_P216LE ///< interleaved chroma YUV 4:2:2, 32bpp, little-endian

	AV_PIX_FMT_P416BE CAVPixelFormat = C.AV_PIX_FMT_P416BE ///< interleaved chroma YUV 4:4:4, 48bpp, big-endian
	AV_PIX_FMT_P416LE CAVPixelFormat = C.AV_PIX_FMT_P416LE ///< interleaved chroma YUV 4:4:4, 48bpp, little-endian

	AV_PIX_FMT_VUYA CAVPixelFormat = C.AV_PIX_FMT_VUYA ///< packed VUYA 4:4:4, 32bpp, VUYAVUYA...

	AV_PIX_FMT_RGBAF16BE CAVPixelFormat = C.AV_PIX_FMT_RGBAF16BE ///< IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., big-endian
	AV_PIX_FMT_RGBAF16LE CAVPixelFormat = C.AV_PIX_FMT_RGBAF16LE ///< IEEE-754 half precision packed RGBA 16:16:16:16, 64bpp, RGBARGBA..., little-endian

	AV_PIX_FMT_VUYX CAVPixelFormat = C.AV_PIX_FMT_VUYX ///< packed VUYX 4:4:4, 32bpp, Variant of VUYA where alpha channel is left undefined

	AV_PIX_FMT_P012LE CAVPixelFormat = C.AV_PIX_FMT_P012LE ///< like NV12, with 12bpp per component, data in the high bits, zeros in the low bits, little-endian
	AV_PIX_FMT_P012BE CAVPixelFormat = C.AV_PIX_FMT_P012BE ///< like NV12, with 12bpp per component, data in the high bits, zeros in the low bits, big-endian

	AV_PIX_FMT_Y212BE CAVPixelFormat = C.AV_PIX_FMT_Y212BE ///< packed YUV 4:2:2 like YUYV422, 24bpp, data in the high bits, zeros in the low bits, big-endian
	AV_PIX_FMT_Y212LE CAVPixelFormat = C.AV_PIX_FMT_Y212LE ///< packed YUV 4:2:2 like YUYV422, 24bpp, data in the high bits, zeros in the low bits, little-endian

	AV_PIX_FMT_XV30BE CAVPixelFormat = C.AV_PIX_FMT_XV30BE ///< packed XVYU 4:4:4, 32bpp, (msb)2X 10V 10Y 10U(lsb), big-endian, variant of Y410 where alpha channel is left undefined
	AV_PIX_FMT_XV30LE CAVPixelFormat = C.AV_PIX_FMT_XV30LE ///< packed XVYU 4:4:4, 32bpp, (msb)2X 10V 10Y 10U(lsb), little-endian, variant of Y410 where alpha channel is left undefined

	AV_PIX_FMT_XV36BE CAVPixelFormat = C.AV_PIX_FMT_XV36BE ///< packed XVYU 4:4:4, 48bpp, data in the high bits, zeros in the low bits, big-endian, variant of Y412 where alpha channel is left undefined
	AV_PIX_FMT_XV36LE CAVPixelFormat = C.AV_PIX_FMT_XV36LE ///< packed XVYU 4:4:4, 48bpp, data in the high bits, zeros in the low bits, little-endian, variant of Y412 where alpha channel is left undefined

	AV_PIX_FMT_RGBF32BE CAVPixelFormat = C.AV_PIX_FMT_RGBF32BE ///< IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., big-endian
	AV_PIX_FMT_RGBF32LE CAVPixelFormat = C.AV_PIX_FMT_RGBF32LE ///< IEEE-754 single precision packed RGB 32:32:32, 96bpp, RGBRGB..., little-endian

	AV_PIX_FMT_RGBAF32BE CAVPixelFormat = C.AV_PIX_FMT_RGBAF32BE ///< IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., big-endian
	AV_PIX_FMT_RGBAF32LE CAVPixelFormat = C.AV_PIX_FMT_RGBAF32LE ///< IEEE-754 single precision packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., little-endian

	AV_PIX_FMT_P212BE CAVPixelFormat = C.AV_PIX_FMT_P212BE ///< interleaved chroma YUV 4:2:2, 24bpp, data in the high bits, big-endian
	AV_PIX_FMT_P212LE CAVPixelFormat = C.AV_PIX_FMT_P212LE ///< interleaved chroma YUV 4:2:2, 24bpp, data in the high bits, little-endian

	AV_PIX_FMT_P412BE CAVPixelFormat = C.AV_PIX_FMT_P412BE ///< interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, big-endian
	AV_PIX_FMT_P412LE CAVPixelFormat = C.AV_PIX_FMT_P412LE ///< interleaved chroma YUV 4:4:4, 36bpp, data in the high bits, little-endian

	AV_PIX_FMT_GBRAP14BE CAVPixelFormat = C.AV_PIX_FMT_GBRAP14BE ///< planar GBR 4:4:4:4 56bpp, big-endian
	AV_PIX_FMT_GBRAP14LE CAVPixelFormat = C.AV_PIX_FMT_GBRAP14LE ///< planar GBR 4:4:4:4 56bpp, little-endian

	AV_PIX_FMT_NB CAVPixelFormat = C.AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
)
const (
	AV_PIX_FMT_RGB32   CAVPixelFormat = C.AV_PIX_FMT_RGB32
	AV_PIX_FMT_RGB32_1 CAVPixelFormat = C.AV_PIX_FMT_RGB32_1
	AV_PIX_FMT_BGR32   CAVPixelFormat = C.AV_PIX_FMT_BGR32
	AV_PIX_FMT_BGR32_1 CAVPixelFormat = C.AV_PIX_FMT_BGR32_1
	AV_PIX_FMT_0RGB32  CAVPixelFormat = C.AV_PIX_FMT_0RGB32
	AV_PIX_FMT_0BGR32  CAVPixelFormat = C.AV_PIX_FMT_0BGR32

	AV_PIX_FMT_GRAY9  CAVPixelFormat = C.AV_PIX_FMT_GRAY9
	AV_PIX_FMT_GRAY10 CAVPixelFormat = C.AV_PIX_FMT_GRAY10
	AV_PIX_FMT_GRAY12 CAVPixelFormat = C.AV_PIX_FMT_GRAY12
	AV_PIX_FMT_GRAY14 CAVPixelFormat = C.AV_PIX_FMT_GRAY14
	AV_PIX_FMT_GRAY16 CAVPixelFormat = C.AV_PIX_FMT_GRAY16
	AV_PIX_FMT_YA16   CAVPixelFormat = C.AV_PIX_FMT_YA16
	AV_PIX_FMT_RGB48  CAVPixelFormat = C.AV_PIX_FMT_RGB48
	AV_PIX_FMT_RGB565 CAVPixelFormat = C.AV_PIX_FMT_RGB565
	AV_PIX_FMT_RGB555 CAVPixelFormat = C.AV_PIX_FMT_RGB555
	AV_PIX_FMT_RGB444 CAVPixelFormat = C.AV_PIX_FMT_RGB444
	AV_PIX_FMT_RGBA64 CAVPixelFormat = C.AV_PIX_FMT_RGBA64
	AV_PIX_FMT_BGR48  CAVPixelFormat = C.AV_PIX_FMT_BGR48
	AV_PIX_FMT_BGR565 CAVPixelFormat = C.AV_PIX_FMT_BGR565
	AV_PIX_FMT_BGR555 CAVPixelFormat = C.AV_PIX_FMT_BGR555
	AV_PIX_FMT_BGR444 CAVPixelFormat = C.AV_PIX_FMT_BGR444
	AV_PIX_FMT_BGRA64 CAVPixelFormat = C.AV_PIX_FMT_BGRA64

	AV_PIX_FMT_YUV420P9  CAVPixelFormat = C.AV_PIX_FMT_YUV420P9
	AV_PIX_FMT_YUV422P9  CAVPixelFormat = C.AV_PIX_FMT_YUV422P9
	AV_PIX_FMT_YUV444P9  CAVPixelFormat = C.AV_PIX_FMT_YUV444P9
	AV_PIX_FMT_YUV420P10 CAVPixelFormat = C.AV_PIX_FMT_YUV420P10
	AV_PIX_FMT_YUV422P10 CAVPixelFormat = C.AV_PIX_FMT_YUV422P10
	AV_PIX_FMT_YUV440P10 CAVPixelFormat = C.AV_PIX_FMT_YUV440P10
	AV_PIX_FMT_YUV444P10 CAVPixelFormat = C.AV_PIX_FMT_YUV444P10
	AV_PIX_FMT_YUV420P12 CAVPixelFormat = C.AV_PIX_FMT_YUV420P12
	AV_PIX_FMT_YUV422P12 CAVPixelFormat = C.AV_PIX_FMT_YUV422P12
	AV_PIX_FMT_YUV440P12 CAVPixelFormat = C.AV_PIX_FMT_YUV440P12
	AV_PIX_FMT_YUV444P12 CAVPixelFormat = C.AV_PIX_FMT_YUV444P12
	AV_PIX_FMT_YUV420P14 CAVPixelFormat = C.AV_PIX_FMT_YUV420P14
	AV_PIX_FMT_YUV422P14 CAVPixelFormat = C.AV_PIX_FMT_YUV422P14
	AV_PIX_FMT_YUV444P14 CAVPixelFormat = C.AV_PIX_FMT_YUV444P14
	AV_PIX_FMT_YUV420P16 CAVPixelFormat = C.AV_PIX_FMT_YUV420P16
	AV_PIX_FMT_YUV422P16 CAVPixelFormat = C.AV_PIX_FMT_YUV422P16
	AV_PIX_FMT_YUV444P16 CAVPixelFormat = C.AV_PIX_FMT_YUV444P16

	AV_PIX_FMT_GBRP9   CAVPixelFormat = C.AV_PIX_FMT_GBRP9
	AV_PIX_FMT_GBRP10  CAVPixelFormat = C.AV_PIX_FMT_GBRP10
	AV_PIX_FMT_GBRP12  CAVPixelFormat = C.AV_PIX_FMT_GBRP12
	AV_PIX_FMT_GBRP14  CAVPixelFormat = C.AV_PIX_FMT_GBRP14
	AV_PIX_FMT_GBRP16  CAVPixelFormat = C.AV_PIX_FMT_GBRP16
	AV_PIX_FMT_GBRAP10 CAVPixelFormat = C.AV_PIX_FMT_GBRAP10
	AV_PIX_FMT_GBRAP12 CAVPixelFormat = C.AV_PIX_FMT_GBRAP12
	AV_PIX_FMT_GBRAP14 CAVPixelFormat = C.AV_PIX_FMT_GBRAP14
	AV_PIX_FMT_GBRAP16 CAVPixelFormat = C.AV_PIX_FMT_GBRAP16

	AV_PIX_FMT_BAYER_BGGR16 CAVPixelFormat = C.AV_PIX_FMT_BAYER_BGGR16
	AV_PIX_FMT_BAYER_RGGB16 CAVPixelFormat = C.AV_PIX_FMT_BAYER_RGGB16
	AV_PIX_FMT_BAYER_GBRG16 CAVPixelFormat = C.AV_PIX_FMT_BAYER_GBRG16
	AV_PIX_FMT_BAYER_GRBG16 CAVPixelFormat = C.AV_PIX_FMT_BAYER_GRBG16

	AV_PIX_FMT_GBRPF32  CAVPixelFormat = C.AV_PIX_FMT_GBRPF32
	AV_PIX_FMT_GBRAPF32 CAVPixelFormat = C.AV_PIX_FMT_GBRAPF32

	AV_PIX_FMT_GRAYF32 CAVPixelFormat = C.AV_PIX_FMT_GRAYF32

	AV_PIX_FMT_YUVA420P9  CAVPixelFormat = C.AV_PIX_FMT_YUVA420P9
	AV_PIX_FMT_YUVA422P9  CAVPixelFormat = C.AV_PIX_FMT_YUVA422P9
	AV_PIX_FMT_YUVA444P9  CAVPixelFormat = C.AV_PIX_FMT_YUVA444P9
	AV_PIX_FMT_YUVA420P10 CAVPixelFormat = C.AV_PIX_FMT_YUVA420P10
	AV_PIX_FMT_YUVA422P10 CAVPixelFormat = C.AV_PIX_FMT_YUVA422P10
	AV_PIX_FMT_YUVA444P10 CAVPixelFormat = C.AV_PIX_FMT_YUVA444P10
	AV_PIX_FMT_YUVA422P12 CAVPixelFormat = C.AV_PIX_FMT_YUVA422P12
	AV_PIX_FMT_YUVA444P12 CAVPixelFormat = C.AV_PIX_FMT_YUVA444P12
	AV_PIX_FMT_YUVA420P16 CAVPixelFormat = C.AV_PIX_FMT_YUVA420P16
	AV_PIX_FMT_YUVA422P16 CAVPixelFormat = C.AV_PIX_FMT_YUVA422P16
	AV_PIX_FMT_YUVA444P16 CAVPixelFormat = C.AV_PIX_FMT_YUVA444P16

	AV_PIX_FMT_XYZ12  CAVPixelFormat = C.AV_PIX_FMT_XYZ12
	AV_PIX_FMT_NV20   CAVPixelFormat = C.AV_PIX_FMT_NV20
	AV_PIX_FMT_AYUV64 CAVPixelFormat = C.AV_PIX_FMT_AYUV64
	AV_PIX_FMT_P010   CAVPixelFormat = C.AV_PIX_FMT_P010
	AV_PIX_FMT_P012   CAVPixelFormat = C.AV_PIX_FMT_P012
	AV_PIX_FMT_P016   CAVPixelFormat = C.AV_PIX_FMT_P016

	AV_PIX_FMT_Y210    CAVPixelFormat = C.AV_PIX_FMT_Y210
	AV_PIX_FMT_Y212    CAVPixelFormat = C.AV_PIX_FMT_Y212
	AV_PIX_FMT_XV30    CAVPixelFormat = C.AV_PIX_FMT_XV30
	AV_PIX_FMT_XV36    CAVPixelFormat = C.AV_PIX_FMT_XV36
	AV_PIX_FMT_X2RGB10 CAVPixelFormat = C.AV_PIX_FMT_X2RGB10
	AV_PIX_FMT_X2BGR10 CAVPixelFormat = C.AV_PIX_FMT_X2BGR10

	AV_PIX_FMT_P210 CAVPixelFormat = C.AV_PIX_FMT_P210
	AV_PIX_FMT_P410 CAVPixelFormat = C.AV_PIX_FMT_P410
	AV_PIX_FMT_P212 CAVPixelFormat = C.AV_PIX_FMT_P212
	AV_PIX_FMT_P412 CAVPixelFormat = C.AV_PIX_FMT_P412
	AV_PIX_FMT_P216 CAVPixelFormat = C.AV_PIX_FMT_P216
	AV_PIX_FMT_P416 CAVPixelFormat = C.AV_PIX_FMT_P416

	AV_PIX_FMT_RGBAF16 CAVPixelFormat = C.AV_PIX_FMT_RGBAF16

	AV_PIX_FMT_RGBF32  CAVPixelFormat = C.AV_PIX_FMT_RGBF32
	AV_PIX_FMT_RGBAF32 CAVPixelFormat = C.AV_PIX_FMT_RGBAF32
)

type CAVRational

type CAVRational C.AVRational

*

  • Rational number (pair of numerator and denominator).

func AV_TIME_BASE_Q

func AV_TIME_BASE_Q() CAVRational

*

  • Internal time base represented as fractional value

func (CAVRational) GetDen

func (r CAVRational) GetDen() int

/< Denominator

func (CAVRational) GetNum

func (r CAVRational) GetNum() int

/< Numerator

func (*CAVRational) SetDen

func (r *CAVRational) SetDen(den int)

/< Denominator

func (*CAVRational) SetNum

func (r *CAVRational) SetNum(num int)

/< Numerator

type CAVRegionOfInterest

type CAVRegionOfInterest C.AVRegionOfInterest

*

  • Structure describing a single Region Of Interest. *
  • When multiple regions are defined in a single side-data block, they
  • should be ordered from most to least important - some encoders are only
  • capable of supporting a limited number of distinct regions, so will have
  • to truncate the list. *
  • When overlapping regions are defined, the first region containing a given
  • area of the frame applies.

func (*CAVRegionOfInterest) GetBottom

func (roi *CAVRegionOfInterest) GetBottom() int

func (*CAVRegionOfInterest) GetLeft

func (roi *CAVRegionOfInterest) GetLeft() int

func (*CAVRegionOfInterest) GetQoffset

func (roi *CAVRegionOfInterest) GetQoffset() CAVRational

*

  • Quantisation offset. *
  • Must be in the range -1 to +1. A value of zero indicates no quality
  • change. A negative value asks for better quality (less quantisation),
  • while a positive value asks for worse quality (greater quantisation). *
  • The range is calibrated so that the extreme values indicate the
  • largest possible offset - if the rest of the frame is encoded with the
  • worst possible quality, an offset of -1 indicates that this region
  • should be encoded with the best possible quality anyway. Intermediate
  • values are then interpolated in some codec-dependent way. *
  • For example, in 10-bit H.264 the quantisation parameter varies between
  • -12 and 51. A typical qoffset value of -1/10 therefore indicates that
  • this region should be encoded with a QP around one-tenth of the full
  • range better than the rest of the frame. So, if most of the frame
  • were to be encoded with a QP of around 30, this region would get a QP
  • of around 24 (an offset of approximately -1/10 * (51 - -12) = -6.3).
  • An extreme value of -1 would indicate that this region should be
  • encoded with the best possible quality regardless of the treatment of
  • the rest of the frame - that is, should be encoded at a QP of -12.

func (*CAVRegionOfInterest) GetRight

func (roi *CAVRegionOfInterest) GetRight() int

func (*CAVRegionOfInterest) GetSelfSize

func (roi *CAVRegionOfInterest) GetSelfSize() uint32

*

  • Must be set to the size of this data structure (that is,
  • sizeof(AVRegionOfInterest)).

func (*CAVRegionOfInterest) GetTop

func (roi *CAVRegionOfInterest) GetTop() int

*

  • Distance in pixels from the top edge of the frame to the top and
  • bottom edges and from the left edge of the frame to the left and
  • right edges of the rectangle defining this region of interest. *
  • The constraints on a region are encoder dependent, so the region
  • actually affected may be slightly larger for alignment or other
  • reasons.

type CAVRounding

type CAVRounding C.enum_AVRounding

*

  • Rounding methods.
const (
	AV_ROUND_ZERO     CAVRounding = C.AV_ROUND_ZERO     ///< Round toward zero.
	AV_ROUND_INF      CAVRounding = C.AV_ROUND_INF      ///< Round away from zero.
	AV_ROUND_DOWN     CAVRounding = C.AV_ROUND_DOWN     ///< Round toward -infinity.
	AV_ROUND_UP       CAVRounding = C.AV_ROUND_UP       ///< Round toward +infinity.
	AV_ROUND_NEAR_INF CAVRounding = C.AV_ROUND_NEAR_INF ///< Round to nearest and halfway cases away from zero.
	/**
	 * Flag telling rescaling functions to pass `INT64_MIN`/`MAX` through
	 * unchanged, avoiding special cases for #AV_NOPTS_VALUE.
	 *
	 * Unlike other values of the enumeration AVRounding, this value is a
	 * bitmask that must be used in conjunction with another value of the
	 * enumeration through a bitwise OR, in order to set behavior for normal
	 * cases.
	 *
	 * @code{.c}
	 * av_rescale_rnd(3, 1, 2, AV_ROUND_UP | AV_ROUND_PASS_MINMAX);
	 * // Rescaling 3:
	 * //     Calculating 3 * 1 / 2
	 * //     3 / 2 is rounded up to 2
	 * //     => 2
	 *
	 * av_rescale_rnd(AV_NOPTS_VALUE, 1, 2, AV_ROUND_UP | AV_ROUND_PASS_MINMAX);
	 * // Rescaling AV_NOPTS_VALUE:
	 * //     AV_NOPTS_VALUE == INT64_MIN
	 * //     AV_NOPTS_VALUE is passed through
	 * //     => AV_NOPTS_VALUE
	 * @endcode
	 */
	AV_ROUND_PASS_MINMAX CAVRounding = C.AV_ROUND_PASS_MINMAX
)

type CAVSampleFormat

type CAVSampleFormat C.enum_AVSampleFormat

*

  • Audio sample formats *
  • - The data described by the sample format is always in native-endian order.
  • Sample values can be expressed by native C types, hence the lack of a signed
  • 24-bit sample format even though it is a common raw audio data format. *
  • - The floating-point formats are based on full volume being in the range
  • [-1.0, 1.0]. Any values outside this range are beyond full volume level. *
  • - The data layout as used in av_samples_fill_arrays() and elsewhere in FFmpeg
  • (such as AVFrame in libavcodec) is as follows: *
  • @par
  • For planar sample formats, each audio channel is in a separate data plane,
  • and linesize is the buffer size, in bytes, for a single plane. All data
  • planes must be the same size. For packed sample formats, only the first data
  • plane is used, and samples for each channel are interleaved. In this case,
  • linesize is the buffer size, in bytes, for the 1 plane. *
const (
	AV_SAMPLE_FMT_NONE CAVSampleFormat = C.AV_SAMPLE_FMT_NONE
	AV_SAMPLE_FMT_U8   CAVSampleFormat = C.AV_SAMPLE_FMT_U8  ///< unsigned 8 bits
	AV_SAMPLE_FMT_S16  CAVSampleFormat = C.AV_SAMPLE_FMT_S16 ///< signed 16 bits
	AV_SAMPLE_FMT_S32  CAVSampleFormat = C.AV_SAMPLE_FMT_S32 ///< signed 32 bits
	AV_SAMPLE_FMT_FLT  CAVSampleFormat = C.AV_SAMPLE_FMT_FLT ///< float
	AV_SAMPLE_FMT_DBL  CAVSampleFormat = C.AV_SAMPLE_FMT_DBL ///< double

	AV_SAMPLE_FMT_U8P  CAVSampleFormat = C.AV_SAMPLE_FMT_U8P  ///< unsigned 8 bits, planar
	AV_SAMPLE_FMT_S16P CAVSampleFormat = C.AV_SAMPLE_FMT_S16P ///< signed 16 bits, planar
	AV_SAMPLE_FMT_S32P CAVSampleFormat = C.AV_SAMPLE_FMT_S32P ///< signed 32 bits, planar
	AV_SAMPLE_FMT_FLTP CAVSampleFormat = C.AV_SAMPLE_FMT_FLTP ///< float, planar
	AV_SAMPLE_FMT_DBLP CAVSampleFormat = C.AV_SAMPLE_FMT_DBLP ///< double, planar
	AV_SAMPLE_FMT_S64  CAVSampleFormat = C.AV_SAMPLE_FMT_S64  ///< signed 64 bits
	AV_SAMPLE_FMT_S64P CAVSampleFormat = C.AV_SAMPLE_FMT_S64P ///< signed 64 bits, planar

	AV_SAMPLE_FMT_NB CAVSampleFormat = C.AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically
)

func AvGetAltSampleFmt added in v0.0.5

func AvGetAltSampleFmt(sampleFmt CAVSampleFormat, planar int) CAVSampleFormat

*

  • Return the planar<->packed alternative form of the given sample format, or
  • AV_SAMPLE_FMT_NONE on error. If the passed sample_fmt is already in the
  • requested planar/packed format, the format returned is the same as the
  • input.

func AvGetPackedSampleFmt added in v0.0.5

func AvGetPackedSampleFmt(sampleFmt CAVSampleFormat) CAVSampleFormat

*

  • Get the packed alternative form of the given sample format. *
  • If the passed sample_fmt is already in packed format, the format returned is
  • the same as the input. *
  • @return the packed alternative form of the given sample format or
  • AV_SAMPLE_FMT_NONE on error.

func AvGetPlanarSampleFmt added in v0.0.5

func AvGetPlanarSampleFmt(sampleFmt CAVSampleFormat) CAVSampleFormat

*

  • Get the planar alternative form of the given sample format. *
  • If the passed sample_fmt is already in planar format, the format returned is
  • the same as the input. *
  • @return the planar alternative form of the given sample format or
  • AV_SAMPLE_FMT_NONE on error.

func AvGetSampleFmt added in v0.0.5

func AvGetSampleFmt(name string) CAVSampleFormat

*

  • Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE
  • on error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL