avutil

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: MIT Imports: 4 Imported by: 2

Documentation

Overview

Package avutil is a utility library to aid portable multimedia programming. It contains safe portable string functions, random number generators, data structures, additional mathematics functions, cryptography and multimedia related functionality. Some generic features and utilities provided by the libavutil library

Index

Constants

View Source
const (
	AV_TIME_BASE   = C.AV_TIME_BASE
	AV_NOPTS_VALUE = C.AV_NOPTS_VALUE
)
View Source
const (
	AVMEDIA_TYPE_UNKNOWN    = C.AVMEDIA_TYPE_UNKNOWN
	AVMEDIA_TYPE_VIDEO      = C.AVMEDIA_TYPE_VIDEO
	AVMEDIA_TYPE_AUDIO      = C.AVMEDIA_TYPE_AUDIO
	AVMEDIA_TYPE_DATA       = C.AVMEDIA_TYPE_DATA
	AVMEDIA_TYPE_SUBTITLE   = C.AVMEDIA_TYPE_SUBTITLE
	AVMEDIA_TYPE_ATTACHMENT = C.AVMEDIA_TYPE_ATTACHMENT
	AVMEDIA_TYPE_NB         = C.AVMEDIA_TYPE_NB
)
View Source
const (
	AV_CH_FRONT_LEFT    = 0x1
	AV_CH_FRONT_RIGHT   = 0x2
	AV_CH_LAYOUT_STEREO = 0x3 //(AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT)
)
View Source
const (
	AVERROR_EAGAIN    = -(C.EAGAIN)
	AVERROR_EIO       = -(C.EIO)
	AVERROR_EOF       = C.AVERROR_EOF
	AVERROR_EPERM     = -(C.EPERM)
	AVERROR_EPIPE     = -(C.EPIPE)
	AVERROR_ETIMEDOUT = -(C.ETIMEDOUT)
)
View Source
const (
	MAX_AVERROR_STR_LEN        = 255
	MAX_CHANNEL_LAYOUT_STR_LEN = 64
)
View Source
const (
	AV_PICTURE_TYPE_NONE = C.AV_PICTURE_TYPE_NONE
	AV_PICTURE_TYPE_I    = C.AV_PICTURE_TYPE_I
	AV_PICTURE_TYPE_B    = C.AV_PICTURE_TYPE_B
	AV_PICTURE_TYPE_P    = C.AV_PICTURE_TYPE_P
)
View Source
const (
	AV_LOG_QUIET   = C.AV_LOG_QUIET
	AV_LOG_PANIC   = C.AV_LOG_PANIC
	AV_LOG_FATAL   = C.AV_LOG_FATAL
	AV_LOG_ERROR   = C.AV_LOG_ERROR
	AV_LOG_WARNING = C.AV_LOG_WARNING
	AV_LOG_INFO    = C.AV_LOG_INFO
	AV_LOG_VERBOSE = C.AV_LOG_VERBOSE
	AV_LOG_DEBUG   = C.AV_LOG_DEBUG
)

Logging constants

View Source
const (
	AV_ROUND_NEAR_INF    = C.AV_ROUND_NEAR_INF
	AV_ROUND_PASS_MINMAX = C.AV_ROUND_PASS_MINMAX
)
View Source
const (
	AV_PIX_FMT_BGR24    = C.AV_PIX_FMT_BGR24
	AV_PIX_FMT_NONE     = C.AV_PIX_FMT_NONE
	AV_PIX_FMT_RGB24    = C.AV_PIX_FMT_RGB24
	AV_PIX_FMT_RGBA     = C.AV_PIX_FMT_RGBA
	AV_PIX_FMT_YUV420P  = C.AV_PIX_FMT_YUV420P
	AV_PIX_FMT_YUVA420P = C.AV_PIX_FMT_YUVA420P
	AV_PIX_FMT_YUVJ420P = C.AV_PIX_FMT_YUVJ420P
)
View Source
const (
	AV_SAMPLE_FMT_NONE = int(C.AV_SAMPLE_FMT_NONE)
	AV_SAMPLE_FMT_U8   = int(C.AV_SAMPLE_FMT_U8)
	AV_SAMPLE_FMT_S16  = int(C.AV_SAMPLE_FMT_S16)
	AV_SAMPLE_FMT_S32  = int(C.AV_SAMPLE_FMT_S32)
	AV_SAMPLE_FMT_FLT  = int(C.AV_SAMPLE_FMT_FLT)
	AV_SAMPLE_FMT_DBL  = int(C.AV_SAMPLE_FMT_DBL)

	AV_SAMPLE_FMT_U8P  = int(C.AV_SAMPLE_FMT_U8P)
	AV_SAMPLE_FMT_S16P = int(C.AV_SAMPLE_FMT_S16P)
	AV_SAMPLE_FMT_S32P = int(C.AV_SAMPLE_FMT_S32P)
	AV_SAMPLE_FMT_FLTP = int(C.AV_SAMPLE_FMT_FLTP)
	AV_SAMPLE_FMT_DBLP = int(C.AV_SAMPLE_FMT_DBLP)
	AV_SAMPLE_FMT_S64  = int(C.AV_SAMPLE_FMT_S64)
	AV_SAMPLE_FMT_S64P = int(C.AV_SAMPLE_FMT_S64P)

	AV_SAMPLE_FMT_NB = int(C.AV_SAMPLE_FMT_NB)
)

Variables

This section is empty.

Functions

func AV_RL32

func AV_RL32(i *uint8, offset uint) uint32

func AvAllocateImageBuffer

func AvAllocateImageBuffer(size int) []uint8

func AvCalloc

func AvCalloc(n, s uintptr) unsafe.Pointer

Allocate a block of nmemb * size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU) and zero all the bytes of the block.

func AvDictFree

func AvDictFree(d **Dictionary)

func AvDictParseString

func AvDictParseString(d **Dictionary, i, keyValSep, pairsSep string, flags int) int

func AvDictSet

func AvDictSet(d **Dictionary, key, value string, flags int) int

func AvDynarray2Add

func AvDynarray2Add(t *unsafe.Pointer, n *int, e uintptr, d uint8) unsafe.Pointer

Add an element of size elem_size to a dynamic array.

func AvDynarrayAdd

func AvDynarrayAdd(t unsafe.Pointer, n *int, e unsafe.Pointer)

Add an element to a dynamic array.

func AvDynarrayAddNofree

func AvDynarrayAddNofree(p unsafe.Pointer, n *int, e unsafe.Pointer) int

Add an element to a dynamic array.

func AvFastMalloc

func AvFastMalloc(p unsafe.Pointer, s *uint, m uintptr)

Allocate a buffer, reusing the given one if large enough.

func AvFastRealloc

func AvFastRealloc(p unsafe.Pointer, s *uint, m uintptr) unsafe.Pointer

Reallocate the given block if it is not large enough, otherwise do nothing.

func AvFrameCopyProps

func AvFrameCopyProps(d, s *Frame) int

Copy only "metadata" fields from src to dst.

func AvFrameFree

func AvFrameFree(f *Frame)

Free the frame and any dynamically allocated objects in it, e.g.

func AvFrameGetBestEffortTimestamp

func AvFrameGetBestEffortTimestamp(f *Frame) int64

func AvFrameGetBuffer

func AvFrameGetBuffer(f *Frame, a int) int

Allocate new buffer(s) for audio or video data.

func AvFrameGetQpTable

func AvFrameGetQpTable(f *Frame, s, t *int) int8

func AvFrameIsWritable

func AvFrameIsWritable(f *Frame) int

Check if the frame data is writable.

func AvFrameMakeWritable

func AvFrameMakeWritable(f *Frame) int

Ensure that the frame data is writable, avoiding data copy if possible.

func AvFrameMoveRef

func AvFrameMoveRef(d, s *Frame)

Move everythnig contained in src to dst and reset src.

func AvFrameRef

func AvFrameRef(d, s *Frame) int

Setup a new reference to the data described by an given frame.

func AvFrameSetQpTable

func AvFrameSetQpTable(f *Frame, b *AvBufferRef, s, q int) int

func AvFrameUnref

func AvFrameUnref(f *Frame)

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

func AvFree

func AvFree(p unsafe.Pointer)

Free a memory block which has been allocated with av_malloc(z)() or av_realloc().

func AvFreeImageBuffer

func AvFreeImageBuffer(buffer []uint8)

func AvFreep

func AvFreep(p unsafe.Pointer)

Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer pointing to it to NULL.

func AvGetChannelLayoutNbChannels

func AvGetChannelLayoutNbChannels(channelLayout uint64) int

func AvGetChannelLayoutString

func AvGetChannelLayoutString(nbChannels int, channelLayout uint64) string

func AvGetMediaTypeString

func AvGetMediaTypeString(mt MediaType) string

Return a string describing the media_type enum, NULL if media_type is unknown.

func AvGetPictureTypeChar

func AvGetPictureTypeChar(pt AvPictureType) string

Return a single letter to describe the given picture type pict_type.

func AvGetPixFmtName added in v1.2.4

func AvGetPixFmtName(pixFmt PixelFormat) string

func AvGetSampleFmtName

func AvGetSampleFmtName(sampleFmt int) string

func AvGetTimeRelative

func AvGetTimeRelative() int64

func AvImageAlloc

func AvImageAlloc(pointers [8]*uint8, linesizes [8]int32, w, h int, pix_fmt PixelFormat, align int) int

Allocate an image with size w and h and pixel format pix_fmt, and fill pointers and linesizes accordingly.

The allocated image buffer has to be freed by using AvFreeP(&pointers[0]).

func AvImageFillArrays

func AvImageFillArrays(dstData [8]*uint8, dstLinesize [8]int32, src []uint8,
	pixFmt PixelFormat, width, height, align int) int

Setup the data pointers and linesizes based on the specified image parameters and the provided array.

func AvImageGetBufferSize

func AvImageGetBufferSize(pixFmt PixelFormat, width, height, align int) int

Return the size in bytes of the amount of data required to store an image with the given parameters.

func AvIntListLengthForSize

func AvIntListLengthForSize(e uint, l int, t uint64) uint

Compute the length of an integer list.

func AvLogGetLevel

func AvLogGetLevel() int

AvLogGetLevel returns the current log level.

func AvLogResetCallback added in v1.2.1

func AvLogResetCallback()

AvLogResetCallback resets the log callback to the default callback

func AvLogSetCallback added in v1.2.1

func AvLogSetCallback(c AvLogCallback)

AvLogSetCallback sets the log callback to a custom callback

func AvLogSetLevel

func AvLogSetLevel(level int)

AvLogSetLevel sets the log level.

func AvMalloc

func AvMalloc(s uintptr) unsafe.Pointer

Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU).

func AvMallocArray

func AvMallocArray(n, s uintptr) unsafe.Pointer

func AvMallocz

func AvMallocz(s uintptr) unsafe.Pointer

Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU) and zero all the bytes of the block.

func AvMalloczArray

func AvMalloczArray(n, s uintptr) unsafe.Pointer

func AvMaxAlloc

func AvMaxAlloc(m uintptr)

Set the maximum size that may me allocated in one block.

func AvMemcpyBackptr

func AvMemcpyBackptr(d *uintptr, b, c int)

deliberately overlapping memcpy implementation

func AvMemdup

func AvMemdup(p *int, s uintptr) unsafe.Pointer

Duplicate the buffer p.

func AvRealloc

func AvRealloc(p *int, s uintptr) unsafe.Pointer

Allocate or reallocate a block of memory.

func AvReallocArray

func AvReallocArray(p int, n, s uintptr) unsafe.Pointer

func AvReallocF

func AvReallocF(p int, n, e uintptr) unsafe.Pointer

Allocate or reallocate a block of memory.

func AvReallocp

func AvReallocp(p int, s uintptr) int

Allocate or reallocate a block of memory.

func AvReallocpArray

func AvReallocpArray(p int, n, s uintptr) int

func AvRescaleQ

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

func AvRescaleQRnd

func AvRescaleQRnd(a int64, bq Rational, cq Rational, flags uint32) int64

func AvSamplesAlloc added in v1.3.0

func AvSamplesAlloc(data **uint8, linesize *int, nbChannels, nbSamples, sampleFmt, align int) int

func AvSizeMult

func AvSizeMult(a, b uintptr, r *uintptr) int

Multiply two size_t values checking for overflow.

func AvStrdup

func AvStrdup(s string) string

Duplicate the string s.

func AvStrerr

func AvStrerr(errcode int) string

func AvStrndup

func AvStrndup(s string, l uintptr) string

char * av_strndup (const char *s, size_t len) av_malloc_attrib Duplicate a substring of the string s.

func AvXIfNull

func AvXIfNull(p, x int)

Return x default pointer in case p is NULL.

func AvutilConfiguration

func AvutilConfiguration() string

Return the libavutil build-time configuration.

func AvutilLicense

func AvutilLicense() string

Return the libavutil license.

func AvutilVersion

func AvutilVersion() uint

Return the LIBAvUTIL_VERSION_INT constant.

Types

type AvBuffer

type AvBuffer C.struct_AVBuffer

type AvBufferPool

type AvBufferPool C.struct_AVBufferPool

type AvBufferRef

type AvBufferRef C.struct_AVBufferRef

func AvFrameGetPlaneBuffer

func AvFrameGetPlaneBuffer(f *Frame, p int) *AvBufferRef

Get the buffer reference a given data plane is stored in.

type AvFrameSideData

type AvFrameSideData C.struct_AVFrameSideData

func AvFrameGetSideData

func AvFrameGetSideData(f *Frame, t AvFrameSideDataType) *AvFrameSideData

func AvFrameNewSideData

func AvFrameNewSideData(f *Frame, d AvFrameSideDataType, s int) *AvFrameSideData

Add a new side data to a frame.

type AvFrameSideDataType

type AvFrameSideDataType C.enum_AVFrameSideDataType

type AvLogCallback added in v1.2.1

type AvLogCallback func(level int, msg, parent string)

AvLogCallback represents a log callback

type AvPictureType

type AvPictureType C.enum_AVPictureType

type AvTree

type AvTree C.struct_AVTree

type Dictionary

type Dictionary C.struct_AVDictionary

type DictionaryEntry

type DictionaryEntry C.struct_AVDictionaryEntry

func AvDictGet

func AvDictGet(d *Dictionary, key string, prev *DictionaryEntry, flags int) *DictionaryEntry

func (*DictionaryEntry) Key

func (e *DictionaryEntry) Key() string

func (*DictionaryEntry) Value

func (e *DictionaryEntry) Value() string

type File

type File C.FILE

func AvFopenUtf8

func AvFopenUtf8(p, m string) *File

Open a file using a UTF-8 filename.

type Frame

type Frame C.struct_AVFrame

func AvFrameAlloc

func AvFrameAlloc() *Frame

Allocate an Frame and set its fields to default values.

func AvFrameClone

func AvFrameClone(f *Frame) *Frame

Create a new frame that references the same data as src.

func (*Frame) Data

func (f *Frame) Data() *uint8

func (*Frame) DataItem added in v1.3.0

func (f *Frame) DataItem(idx int) **uint8

func (*Frame) Format

func (f *Frame) Format() int

func (*Frame) Height

func (f *Frame) Height() int

func (*Frame) Linesize

func (f *Frame) Linesize() int

func (*Frame) LinesizePtr added in v1.3.0

func (f *Frame) LinesizePtr() *int

func (*Frame) NbSamples

func (f *Frame) NbSamples() int

func (*Frame) PktDts

func (f *Frame) PktDts() int64

func (*Frame) PktPts

func (f *Frame) PktPts() int64

func (*Frame) Pts

func (f *Frame) Pts() int64

func (*Frame) SampleRate

func (f *Frame) SampleRate() int

func (*Frame) SetChannelLayout

func (f *Frame) SetChannelLayout(l uint64)

func (*Frame) SetFormat

func (f *Frame) SetFormat(fmt int)

func (*Frame) SetHeight

func (f *Frame) SetHeight(h int)

func (*Frame) SetKeyFrame

func (f *Frame) SetKeyFrame(k int)

func (*Frame) SetNbSamples

func (f *Frame) SetNbSamples(n int)

func (*Frame) SetPictType

func (f *Frame) SetPictType(t AvPictureType)

func (*Frame) SetPts

func (f *Frame) SetPts(i int64)

func (*Frame) SetSampleRate

func (f *Frame) SetSampleRate(r int)

func (*Frame) SetWidth

func (f *Frame) SetWidth(w int)

func (*Frame) Width

func (f *Frame) Width() int

type MediaType

type MediaType C.enum_AVMediaType

func MediaTypeFromString

func MediaTypeFromString(i string) MediaType

MediaTypeFromString returns a media type from a string

type Options

type Options C.struct_AVOptions

type PixelFormat

type PixelFormat C.enum_AVPixelFormat

func PixelFormatFromString

func PixelFormatFromString(i string) PixelFormat

PixelFormatFromString returns a pixel format from a string

type Rational

type Rational C.struct_AVRational
var AV_TIME_BASE_Q Rational = NewRational(1, AV_TIME_BASE)

func AvGetTimeBaseQ

func AvGetTimeBaseQ() Rational

Return the fractional representation of the internal time base.

func NewRational

func NewRational(num, den int) Rational

func (Rational) Den

func (r Rational) Den() int

func (Rational) Num

func (r Rational) Num() int

func (*Rational) SetDen

func (r *Rational) SetDen(den int)

func (*Rational) SetNum

func (r *Rational) SetNum(num int)

func (Rational) String added in v1.2.0

func (r Rational) String() string

func (Rational) ToDouble

func (r Rational) ToDouble() float64

Jump to

Keyboard shortcuts

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