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
- func AV_RL32(i *uint8, offset uint) uint32
- func AvAllocateImageBuffer(size int) []uint8
- func AvCalloc(n, s uintptr) unsafe.Pointer
- func AvDictFree(d **Dictionary)
- func AvDictParseString(d **Dictionary, i, keyValSep, pairsSep string, flags int) int
- func AvDictSet(d **Dictionary, key, value string, flags int) int
- func AvDynarray2Add(t *unsafe.Pointer, n *int, e uintptr, d uint8) unsafe.Pointer
- func AvDynarrayAdd(t unsafe.Pointer, n *int, e unsafe.Pointer)
- func AvDynarrayAddNofree(p unsafe.Pointer, n *int, e unsafe.Pointer) int
- func AvFastMalloc(p unsafe.Pointer, s *uint, m uintptr)
- func AvFastRealloc(p unsafe.Pointer, s *uint, m uintptr) unsafe.Pointer
- func AvFrameCopyProps(d, s *Frame) int
- func AvFrameFree(f *Frame)
- func AvFrameGetBestEffortTimestamp(f *Frame) int64
- func AvFrameGetBuffer(f *Frame, a int) int
- func AvFrameGetQpTable(f *Frame, s, t *int) int8
- func AvFrameIsWritable(f *Frame) int
- func AvFrameMakeWritable(f *Frame) int
- func AvFrameMoveRef(d, s *Frame)
- func AvFrameRef(d, s *Frame) int
- func AvFrameSetQpTable(f *Frame, b *AvBufferRef, s, q int) int
- func AvFrameUnref(f *Frame)
- func AvFree(p unsafe.Pointer)
- func AvFreeImageBuffer(buffer []uint8)
- func AvFreep(p unsafe.Pointer)
- func AvGetChannelLayoutNbChannels(channelLayout uint64) int
- func AvGetChannelLayoutString(nbChannels int, channelLayout uint64) string
- func AvGetMediaTypeString(mt MediaType) string
- func AvGetPictureTypeChar(pt AvPictureType) string
- func AvGetPixFmtName(pixFmt PixelFormat) string
- func AvGetSampleFmtName(sampleFmt int) string
- func AvGetTimeRelative() int64
- func AvImageAlloc(pointers [8]*uint8, linesizes [8]int32, w, h int, pix_fmt PixelFormat, ...) int
- func AvImageFillArrays(dstData [8]*uint8, dstLinesize [8]int32, src []uint8, pixFmt PixelFormat, ...) int
- func AvImageGetBufferSize(pixFmt PixelFormat, width, height, align int) int
- func AvIntListLengthForSize(e uint, l int, t uint64) uint
- func AvLogGetLevel() int
- func AvLogResetCallback()
- func AvLogSetCallback(c AvLogCallback)
- func AvLogSetLevel(level int)
- func AvMalloc(s uintptr) unsafe.Pointer
- func AvMallocArray(n, s uintptr) unsafe.Pointer
- func AvMallocz(s uintptr) unsafe.Pointer
- func AvMalloczArray(n, s uintptr) unsafe.Pointer
- func AvMaxAlloc(m uintptr)
- func AvMemcpyBackptr(d *uintptr, b, c int)
- func AvMemdup(p *int, s uintptr) unsafe.Pointer
- func AvRealloc(p *int, s uintptr) unsafe.Pointer
- func AvReallocArray(p int, n, s uintptr) unsafe.Pointer
- func AvReallocF(p int, n, e uintptr) unsafe.Pointer
- func AvReallocp(p int, s uintptr) int
- func AvReallocpArray(p int, n, s uintptr) int
- func AvRescaleQ(a int64, bq Rational, cq Rational) int64
- func AvRescaleQRnd(a int64, bq Rational, cq Rational, flags uint32) int64
- func AvSamplesAlloc(data **uint8, linesize *int, nbChannels, nbSamples, sampleFmt, align int) int
- func AvSizeMult(a, b uintptr, r *uintptr) int
- func AvStrdup(s string) string
- func AvStrerr(errcode int) string
- func AvStrndup(s string, l uintptr) string
- func AvXIfNull(p, x int)
- func AvutilConfiguration() string
- func AvutilLicense() string
- func AvutilVersion() uint
- type AvBuffer
- type AvBufferPool
- type AvBufferRef
- type AvFrameSideData
- type AvFrameSideDataType
- type AvLogCallback
- type AvPictureType
- type AvTree
- type Dictionary
- type DictionaryEntry
- type File
- type Frame
- func (f *Frame) Data() *uint8
- func (f *Frame) DataItem(idx int) **uint8
- func (f *Frame) Format() int
- func (f *Frame) Height() int
- func (f *Frame) Linesize() int
- func (f *Frame) LinesizePtr() *int
- func (f *Frame) NbSamples() int
- func (f *Frame) PktDts() int64
- func (f *Frame) PktPts() int64
- func (f *Frame) Pts() int64
- func (f *Frame) SampleRate() int
- func (f *Frame) SetChannelLayout(l uint64)
- func (f *Frame) SetFormat(fmt int)
- func (f *Frame) SetHeight(h int)
- func (f *Frame) SetKeyFrame(k int)
- func (f *Frame) SetNbSamples(n int)
- func (f *Frame) SetPictType(t AvPictureType)
- func (f *Frame) SetPts(i int64)
- func (f *Frame) SetSampleRate(r int)
- func (f *Frame) SetWidth(w int)
- func (f *Frame) Width() int
- type MediaType
- type Options
- type PixelFormat
- type Rational
Constants ¶
const ( AV_TIME_BASE = C.AV_TIME_BASE AV_NOPTS_VALUE = C.AV_NOPTS_VALUE )
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 )
const ( AV_CH_FRONT_LEFT = 0x1 AV_CH_FRONT_RIGHT = 0x2 AV_CH_LAYOUT_STEREO = 0x3 //(AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT) )
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) )
const ( MAX_AVERROR_STR_LEN = 255 MAX_CHANNEL_LAYOUT_STR_LEN = 64 )
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 )
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
const ( AV_ROUND_NEAR_INF = C.AV_ROUND_NEAR_INF AV_ROUND_PASS_MINMAX = C.AV_ROUND_PASS_MINMAX )
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 )
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 AvAllocateImageBuffer ¶
func AvCalloc ¶
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 AvDynarray2Add ¶
Add an element of size elem_size to a dynamic array.
func AvDynarrayAdd ¶
Add an element to a dynamic array.
func AvDynarrayAddNofree ¶
Add an element to a dynamic array.
func AvFastMalloc ¶
Allocate a buffer, reusing the given one if large enough.
func AvFastRealloc ¶
Reallocate the given block if it is not large enough, otherwise do nothing.
func AvFrameCopyProps ¶
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 AvFrameGetBuffer ¶
Allocate new buffer(s) for audio or video data.
func AvFrameGetQpTable ¶
func AvFrameMakeWritable ¶
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 ¶
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 AvFreeImageBuffer ¶
func AvFreeImageBuffer(buffer []uint8)
func AvFreep ¶
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 AvGetMediaTypeString ¶
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 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 ¶
Compute the length of an integer list.
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 AvMalloc ¶
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if available on the CPU).
func AvMallocArray ¶
func AvMallocz ¶
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 AvMaxAlloc ¶
func AvMaxAlloc(m uintptr)
Set the maximum size that may me allocated in one block.
func AvMemcpyBackptr ¶
deliberately overlapping memcpy implementation
func AvReallocF ¶
Allocate or reallocate a block of memory.
func AvReallocpArray ¶
func AvSamplesAlloc ¶ added in v1.3.0
func AvSizeMult ¶
Multiply two size_t values checking for overflow.
func AvStrndup ¶
char * av_strndup (const char *s, size_t len) av_malloc_attrib Duplicate a substring of the string s.
func AvutilConfiguration ¶
func AvutilConfiguration() string
Return the libavutil build-time configuration.
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
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 Frame ¶
type Frame C.struct_AVFrame
func AvFrameAlloc ¶
func AvFrameAlloc() *Frame
Allocate an Frame and set its fields to default values.
func AvFrameClone ¶
Create a new frame that references the same data as src.
func (*Frame) LinesizePtr ¶ added in v1.3.0
func (*Frame) SampleRate ¶
func (*Frame) SetChannelLayout ¶
func (*Frame) SetKeyFrame ¶
func (*Frame) SetNbSamples ¶
func (*Frame) SetPictType ¶
func (f *Frame) SetPictType(t AvPictureType)
func (*Frame) SetSampleRate ¶
type MediaType ¶
type MediaType C.enum_AVMediaType
func MediaTypeFromString ¶
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.