mirror of
https://github.com/qrtc/ffmpeg-dev-go.git
synced 2025-10-09 09:30:17 +08:00
2023-10-31 09:16:44 CST W44D2
This commit is contained in:
2108
avcodec.go
2108
avcodec.go
File diff suppressed because it is too large
Load Diff
@@ -10,7 +10,6 @@ package ffmpeg
|
|||||||
typedef void (*avdct_idct_func)(int16_t *block);
|
typedef void (*avdct_idct_func)(int16_t *block);
|
||||||
typedef void (*avdct_fdct_func)(int16_t *block);
|
typedef void (*avdct_fdct_func)(int16_t *block);
|
||||||
typedef void (*avdct_get_pixels_func)(int16_t *block, const uint8_t *pixels, ptrdiff_t line_size);
|
typedef void (*avdct_get_pixels_func)(int16_t *block, const uint8_t *pixels, ptrdiff_t line_size);
|
||||||
typedef void (*avdct_get_pixels_unaligned_func)(int16_t *block, const uint8_t *pixels, ptrdiff_t line_size);
|
|
||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
import "unsafe"
|
import "unsafe"
|
||||||
@@ -27,9 +26,6 @@ type AVDCTFdctFunc = C.avdct_fdct_func
|
|||||||
// typedef void (*avdct_get_pixels_func)(int16_t *block, const uint8_t *pixels, ptrdiff_t line_size);
|
// typedef void (*avdct_get_pixels_func)(int16_t *block, const uint8_t *pixels, ptrdiff_t line_size);
|
||||||
type AVDCTGetPixelsFunc = C.avdct_get_pixels_func
|
type AVDCTGetPixelsFunc = C.avdct_get_pixels_func
|
||||||
|
|
||||||
// typedef void (*avdct_get_pixels_unaligned_func)(int16_t *block, const uint8_t *pixels, ptrdiff_t line_size);
|
|
||||||
type AVDCTGetPixelsUnalignedFunc = C.avdct_get_pixels_unaligned_func
|
|
||||||
|
|
||||||
// GetAvClass gets `AVDCT.av_class` value.
|
// GetAvClass gets `AVDCT.av_class` value.
|
||||||
func (dct *AVDCT) GetAvClass() *AVClass {
|
func (dct *AVDCT) GetAvClass() *AVClass {
|
||||||
return (*AVClass)(dct.av_class)
|
return (*AVClass)(dct.av_class)
|
||||||
@@ -152,21 +148,6 @@ func (dct *AVDCT) GetBitsPerSampleAddr() *int32 {
|
|||||||
return (*int32)(&dct.bits_per_sample)
|
return (*int32)(&dct.bits_per_sample)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetGetPixelsUnaligned gets `AVDCT.get_pixels_unaligned` value.
|
|
||||||
func (dct *AVDCT) GetGetPixelsUnaligned() AVDCTGetPixelsUnalignedFunc {
|
|
||||||
return (AVDCTGetPixelsUnalignedFunc)(dct.get_pixels_unaligned)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetGetPixelsUnaligned sets `AVDCT.get_pixels_unaligned` value.
|
|
||||||
func (dct *AVDCT) SetGetPixelsUnaligned(v AVDCTGetPixelsUnalignedFunc) {
|
|
||||||
dct.get_pixels_unaligned = (C.avdct_get_pixels_unaligned_func)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetGetPixelsUnalignedAddr gets `AVDCT.get_pixels_unaligned` address.
|
|
||||||
func (dct *AVDCT) GetGetPixelsUnalignedAddr() *AVDCTGetPixelsUnalignedFunc {
|
|
||||||
return (*AVDCTGetPixelsUnalignedFunc)(&dct.get_pixels_unaligned)
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvCodecDctAlloc allocates a AVDCT context.
|
// AvCodecDctAlloc allocates a AVDCT context.
|
||||||
func AvCodecDctAlloc() *AVDCT {
|
func AvCodecDctAlloc() *AVDCT {
|
||||||
return (*AVDCT)(C.avcodec_dct_alloc())
|
return (*AVDCT)(C.avcodec_dct_alloc())
|
||||||
|
264
avcodec_bsf.go
264
avcodec_bsf.go
@@ -1,264 +0,0 @@
|
|||||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
|
||||||
// Use of this source code is governed by a MIT
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package ffmpeg
|
|
||||||
|
|
||||||
/*
|
|
||||||
#include <libavcodec/bsf.h>
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
import "unsafe"
|
|
||||||
|
|
||||||
// AVBSFInternal
|
|
||||||
type AVBSFInternal C.struct_AVBSFInternal
|
|
||||||
|
|
||||||
// AVBSFContext
|
|
||||||
type AVBSFContext C.struct_AVBSFContext
|
|
||||||
|
|
||||||
// GetAvClass gets `AVBSFContext.av_class` value.
|
|
||||||
func (bsfc *AVBSFContext) GetAvClass() *AVClass {
|
|
||||||
return (*AVClass)(bsfc.av_class)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetAvClass sets `AVBSFContext.av_class` value.
|
|
||||||
func (bsfc *AVBSFContext) SetAvClass(v *AVClass) {
|
|
||||||
bsfc.av_class = (*C.struct_AVClass)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetAvClassAddr gets `AVBSFContext.av_class` address.
|
|
||||||
func (bsfc *AVBSFContext) GetAvClassAddr() **AVClass {
|
|
||||||
return (**AVClass)(unsafe.Pointer(&bsfc.av_class))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetFilter gets `AVBSFContext.filter` value.
|
|
||||||
func (bsfc *AVBSFContext) GetFilter() *AVBitStreamFilter {
|
|
||||||
return (*AVBitStreamFilter)(bsfc.filter)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetFilter sets `AVBSFContext.filter` value.
|
|
||||||
func (bsfc *AVBSFContext) SetFilter(v *AVBitStreamFilter) {
|
|
||||||
bsfc.filter = (*C.struct_AVBitStreamFilter)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetFilterAddr gets `AVBSFContext.filter` address.
|
|
||||||
func (bsfc *AVBSFContext) GetFilterAddr() **AVBitStreamFilter {
|
|
||||||
return (**AVBitStreamFilter)(unsafe.Pointer(&bsfc.filter))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetInternal gets `AVBSFContext.internal` value.
|
|
||||||
func (bsfc *AVBSFContext) GetInternal() *AVBSFInternal {
|
|
||||||
return (*AVBSFInternal)(bsfc.internal)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetInternal sets `AVBSFContext.internal` value.
|
|
||||||
func (bsfc *AVBSFContext) SetInternal(v *AVBSFInternal) {
|
|
||||||
bsfc.internal = (*C.struct_AVBSFInternal)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetInternalAddr gets `AVBSFContext.internal` address.
|
|
||||||
func (bsfc *AVBSFContext) GetInternalAddr() **AVBSFInternal {
|
|
||||||
return (**AVBSFInternal)(unsafe.Pointer(&bsfc.internal))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetPrivData gets `AVBSFContext.priv_data` value.
|
|
||||||
func (bsfc *AVBSFContext) GetPrivData() unsafe.Pointer {
|
|
||||||
return bsfc.priv_data
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetPrivData sets `AVBSFContext.priv_data` value.
|
|
||||||
func (bsfc *AVBSFContext) SetPrivData(v CVoidPointer) {
|
|
||||||
bsfc.priv_data = VoidPointer(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetPrivDataAddr gets `AVBSFContext.priv_data` address.
|
|
||||||
func (bsfc *AVBSFContext) GetPrivDataAddr() unsafe.Pointer {
|
|
||||||
return (unsafe.Pointer)(&bsfc.priv_data)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetParIn gets `AVBSFContext.par_in` value.
|
|
||||||
func (bsfc *AVBSFContext) GetParIn() *AVCodecParameters {
|
|
||||||
return (*AVCodecParameters)(bsfc.par_in)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetParIn sets `AVBSFContext.par_in` value.
|
|
||||||
func (bsfc *AVBSFContext) SetParIn(v *AVCodecParameters) {
|
|
||||||
bsfc.par_in = (*C.struct_AVCodecParameters)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetParInAddr gets `AVBSFContext.par_in` address.
|
|
||||||
func (bsfc *AVBSFContext) GetParInAddr() **AVCodecParameters {
|
|
||||||
return (**AVCodecParameters)(unsafe.Pointer(&bsfc.par_in))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetParOut gets `AVBSFContext.par_out` value.
|
|
||||||
func (bsfc *AVBSFContext) GetParOut() *AVCodecParameters {
|
|
||||||
return (*AVCodecParameters)(bsfc.par_out)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetParOut sets `AVBSFContext.par_out` value.
|
|
||||||
func (bsfc *AVBSFContext) SetParOut(v *AVCodecParameters) {
|
|
||||||
bsfc.par_out = (*C.struct_AVCodecParameters)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetParOutAddr gets `AVBSFContext.par_out` address.
|
|
||||||
func (bsfc *AVBSFContext) GetParOutAddr() **AVCodecParameters {
|
|
||||||
return (**AVCodecParameters)(unsafe.Pointer(&bsfc.par_out))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetTimeBaseIn gets `AVBSFContext.time_base_in` value.
|
|
||||||
func (bsfc *AVBSFContext) GetTimeBaseIn() AVRational {
|
|
||||||
return (AVRational)(bsfc.time_base_in)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetTimeBaseIn sets `AVBSFContext.time_base_in` value.
|
|
||||||
func (bsfc *AVBSFContext) SetTimeBaseIn(v AVRational) {
|
|
||||||
bsfc.time_base_in = (C.struct_AVRational)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetTimeBaseInAddr gets `AVBSFContext.time_base_in` address.
|
|
||||||
func (bsfc *AVBSFContext) GetTimeBaseInAddr() *AVRational {
|
|
||||||
return (*AVRational)(&bsfc.time_base_in)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetTimeBaseOut gets `AVBSFContext.time_base_out` value.
|
|
||||||
func (bsfc *AVBSFContext) GetTimeBaseOut() AVRational {
|
|
||||||
return (AVRational)(bsfc.time_base_out)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetTimeBaseOut sets `AVBSFContext.time_base_out` value.
|
|
||||||
func (bsfc *AVBSFContext) SetTimeBaseOut(v AVRational) {
|
|
||||||
bsfc.time_base_out = (C.struct_AVRational)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetTimeBaseOutAddr gets `AVBSFContext.time_base_out` address.
|
|
||||||
func (bsfc *AVBSFContext) GetTimeBaseOutAddr() *AVRational {
|
|
||||||
return (*AVRational)(&bsfc.time_base_out)
|
|
||||||
}
|
|
||||||
|
|
||||||
// AVBitStreamFilter
|
|
||||||
type AVBitStreamFilter C.struct_AVBitStreamFilter
|
|
||||||
|
|
||||||
// GetName gets `AVBitStreamFilter.name` value.
|
|
||||||
func (bsf *AVBitStreamFilter) GetName() string {
|
|
||||||
return C.GoString(bsf.name)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCodecIds gets `AVBitStreamFilter.codec_ids` value.
|
|
||||||
func (bsf *AVBitStreamFilter) GetCodecIds() []AVCodecID {
|
|
||||||
return SliceTrunc((*AVCodecID)(bsf.codec_ids), func(ac AVCodecID) bool {
|
|
||||||
return ac == AV_CODEC_ID_NONE
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetPrivClass gets `AVBitStreamFilter.priv_class` value.
|
|
||||||
func (bsf *AVBitStreamFilter) GetPrivClass() *AVClass {
|
|
||||||
return (*AVClass)(bsf.priv_class)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetPrivClass sets `AVBitStreamFilter.priv_class` value.
|
|
||||||
func (bsf *AVBitStreamFilter) SetPrivClass(v *AVClass) {
|
|
||||||
bsf.priv_class = (*C.struct_AVClass)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetPrivClassAddr gets `AVBitStreamFilter.priv_class` address.
|
|
||||||
func (bsf *AVBitStreamFilter) GetPrivClassAddr() **AVClass {
|
|
||||||
return (**AVClass)(unsafe.Pointer(&bsf.priv_class))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvBsfGetByName returns a bitstream filter with the specified name or NULL if no such
|
|
||||||
// bitstream filter exists.
|
|
||||||
func AvBsfGetByName(name string) *AVBitStreamFilter {
|
|
||||||
namePtr, nameFunc := StringCasting(name)
|
|
||||||
defer nameFunc()
|
|
||||||
return (*AVBitStreamFilter)(C.av_bsf_get_by_name((*C.char)(namePtr)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvBsfIterate iterates over all registered bitstream filters.
|
|
||||||
func AvBsfIterate(opaque CVoidPointerPointer) *AVBitStreamFilter {
|
|
||||||
return (*AVBitStreamFilter)(C.av_bsf_iterate(VoidPointerPointer(opaque)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvBsfAlloc allocates a context for a given bitstream filter.
|
|
||||||
func AvBsfAlloc(filter *AVBitStreamFilter, ctx **AVBSFContext) int32 {
|
|
||||||
return (int32)(C.av_bsf_alloc((*C.struct_AVBitStreamFilter)(filter),
|
|
||||||
(**C.struct_AVBSFContext)(unsafe.Pointer(ctx))))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvBsfInit prepares the filter for use, after all the parameters and options have been set.
|
|
||||||
func AvBsfInit(ctx *AVBSFContext) int32 {
|
|
||||||
return (int32)(C.av_bsf_init((*C.struct_AVBSFContext)(ctx)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvBsfSendPacket submits a packet for filtering.
|
|
||||||
func AvBsfSendPacket(ctx *AVBSFContext, pkt *AVPacket) int32 {
|
|
||||||
return (int32)(C.av_bsf_send_packet((*C.struct_AVBSFContext)(ctx),
|
|
||||||
(*C.struct_AVPacket)(pkt)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvBsfReceivePacket retrieves a filtered packet.
|
|
||||||
func AvBsfReceivePacket(ctx *AVBSFContext, pkt *AVPacket) int32 {
|
|
||||||
return (int32)(C.av_bsf_receive_packet((*C.struct_AVBSFContext)(ctx),
|
|
||||||
(*C.struct_AVPacket)(pkt)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvBsfFlush resets the internal bitstream filter state. Should be called e.g. when seeking.
|
|
||||||
func AvBsfFlush(ctx *AVBSFContext) {
|
|
||||||
C.av_bsf_flush((*C.struct_AVBSFContext)(ctx))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvBsfFree frees a bitstream filter context.
|
|
||||||
func AvBsfFree(ctx **AVBSFContext) {
|
|
||||||
C.av_bsf_free((**C.struct_AVBSFContext)(unsafe.Pointer(ctx)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvBsfGetClass gets the AVClass for AVBSFContext.
|
|
||||||
func AvBsfGetClass() *AVClass {
|
|
||||||
return (*AVClass)(C.av_bsf_get_class())
|
|
||||||
}
|
|
||||||
|
|
||||||
// AVBSFList
|
|
||||||
type AVBSFList C.struct_AVBSFList
|
|
||||||
|
|
||||||
// AvBsfListAlloc allocates empty list of bitstream filters.
|
|
||||||
func AvBsfListAlloc() *AVBSFList {
|
|
||||||
return (*AVBSFList)(C.av_bsf_list_alloc())
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvBsfListFree frees list of bitstream filters.
|
|
||||||
func AvBsfListFree(lst **AVBSFList) {
|
|
||||||
C.av_bsf_list_free((**C.struct_AVBSFList)(unsafe.Pointer(lst)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvBsfListAppend appends bitstream filter to the list of bitstream filters.
|
|
||||||
func AvBsfListAppend(lst *AVBSFList, bsf *AVBSFContext) {
|
|
||||||
C.av_bsf_list_append((*C.struct_AVBSFList)(lst),
|
|
||||||
(*C.struct_AVBSFContext)(bsf))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvBsfListAppend2
|
|
||||||
func AvBsfListAppend2(lst *AVBSFList, bsfName string, options **AVDictionary) {
|
|
||||||
bsfNamePtr, bsfNameFunc := StringCasting(bsfName)
|
|
||||||
defer bsfNameFunc()
|
|
||||||
C.av_bsf_list_append2((*C.struct_AVBSFList)(lst),
|
|
||||||
(*C.char)(bsfNamePtr), (**C.struct_AVDictionary)(unsafe.Pointer(options)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvBsfListFinalize finalizes list of bitstream filters.
|
|
||||||
func AvBsfListFinalize(lst **AVBSFList, bsf **AVBSFContext) int32 {
|
|
||||||
return (int32)(C.av_bsf_list_finalize((**C.struct_AVBSFList)(unsafe.Pointer(lst)),
|
|
||||||
(**C.struct_AVBSFContext)(unsafe.Pointer(bsf))))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvBsfListParseStr parses string describing list of bitstream filters and creates single
|
|
||||||
// AvBSFContext describing the whole chain of bitstream filters.
|
|
||||||
func AvBsfListParseStr(str string, bsf **AVBSFContext) {
|
|
||||||
strPtr, strFunc := StringCasting(str)
|
|
||||||
defer strFunc()
|
|
||||||
C.av_bsf_list_parse_str((*C.char)(strPtr), (**C.struct_AVBSFContext)(unsafe.Pointer(bsf)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvBsfGetNullFilter gets null/pass-through bitstream filter.
|
|
||||||
func AvBsfGetNullFilter(bsf **AVBSFContext) int32 {
|
|
||||||
return (int32)(C.av_bsf_get_null_filter((**C.struct_AVBSFContext)(unsafe.Pointer(bsf))))
|
|
||||||
}
|
|
226
avcodec_codec.go
226
avcodec_codec.go
@@ -1,226 +0,0 @@
|
|||||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
|
||||||
// Use of this source code is governed by a MIT
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package ffmpeg
|
|
||||||
|
|
||||||
/*
|
|
||||||
#include <libavcodec/codec.h>
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
|
|
||||||
const (
|
|
||||||
AV_CODEC_CAP_DRAW_HORIZ_BAND = C.AV_CODEC_CAP_DRAW_HORIZ_BAND
|
|
||||||
AV_CODEC_CAP_DR1 = C.AV_CODEC_CAP_DR1
|
|
||||||
AV_CODEC_CAP_TRUNCATED = C.AV_CODEC_CAP_TRUNCATED
|
|
||||||
AV_CODEC_CAP_DELAY = C.AV_CODEC_CAP_DELAY
|
|
||||||
AV_CODEC_CAP_SMALL_LAST_FRAME = C.AV_CODEC_CAP_SMALL_LAST_FRAME
|
|
||||||
AV_CODEC_CAP_SUBFRAMES = C.AV_CODEC_CAP_SUBFRAMES
|
|
||||||
AV_CODEC_CAP_EXPERIMENTAL = C.AV_CODEC_CAP_EXPERIMENTAL
|
|
||||||
AV_CODEC_CAP_CHANNEL_CONF = C.AV_CODEC_CAP_CHANNEL_CONF
|
|
||||||
AV_CODEC_CAP_FRAME_THREADS = C.AV_CODEC_CAP_FRAME_THREADS
|
|
||||||
AV_CODEC_CAP_SLICE_THREADS = C.AV_CODEC_CAP_SLICE_THREADS
|
|
||||||
AV_CODEC_CAP_PARAM_CHANGE = C.AV_CODEC_CAP_PARAM_CHANGE
|
|
||||||
AV_CODEC_CAP_OTHER_THREADS = C.AV_CODEC_CAP_OTHER_THREADS
|
|
||||||
AV_CODEC_CAP_AUTO_THREADS = C.AV_CODEC_CAP_AUTO_THREADS
|
|
||||||
AV_CODEC_CAP_VARIABLE_FRAME_SIZE = C.AV_CODEC_CAP_VARIABLE_FRAME_SIZE
|
|
||||||
AV_CODEC_CAP_AVOID_PROBING = C.AV_CODEC_CAP_AVOID_PROBING
|
|
||||||
AV_CODEC_CAP_INTRA_ONLY = C.AV_CODEC_CAP_INTRA_ONLY
|
|
||||||
AV_CODEC_CAP_LOSSLESS = C.AV_CODEC_CAP_LOSSLESS
|
|
||||||
AV_CODEC_CAP_HARDWARE = C.AV_CODEC_CAP_HARDWARE
|
|
||||||
AV_CODEC_CAP_HYBRID = C.AV_CODEC_CAP_HYBRID
|
|
||||||
AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE = C.AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
|
|
||||||
AV_CODEC_CAP_ENCODER_FLUSH = C.AV_CODEC_CAP_ENCODER_FLUSH
|
|
||||||
)
|
|
||||||
|
|
||||||
// AVProfile
|
|
||||||
type AVProfile C.struct_AVProfile
|
|
||||||
|
|
||||||
// GetProfile gets `AVProfile.profile` value.
|
|
||||||
func (p *AVProfile) GetProfile() int32 {
|
|
||||||
return (int32)(p.profile)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetName gets `AVProfile.name` value.
|
|
||||||
func (p *AVProfile) GetName() string {
|
|
||||||
return C.GoString(p.name)
|
|
||||||
}
|
|
||||||
|
|
||||||
// AVCodec
|
|
||||||
type AVCodec C.struct_AVCodec
|
|
||||||
|
|
||||||
// GetName gets `AVCodec.name` value.
|
|
||||||
func (codec *AVCodec) GetName() string {
|
|
||||||
return C.GoString(codec.name)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetLongName gets `AVCodec.long_name` value.
|
|
||||||
func (codec *AVCodec) GetLongName() string {
|
|
||||||
return C.GoString(codec.long_name)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetType gets `AVCodec.type` value.
|
|
||||||
func (codec *AVCodec) GetType() AVMediaType {
|
|
||||||
return (AVMediaType)(codec._type)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetType gets `AVCodec.id` value.
|
|
||||||
func (codec *AVCodec) GetID() AVCodecID {
|
|
||||||
return (AVCodecID)(codec.id)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCapabilities gets `AVCodec.capabilities` value.
|
|
||||||
func (codec *AVCodec) GetCapabilities() int32 {
|
|
||||||
return (int32)(codec.capabilities)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSupportedFramerates gets `AVCodec.supportedFramerates` value.
|
|
||||||
func (codec *AVCodec) GetSupportedFramerates() []AVRational {
|
|
||||||
return SliceTrunc((*AVRational)(codec.supported_framerates), func(ar AVRational) bool {
|
|
||||||
return ar.GetNum() == 0 && ar.GetDen() == 0
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetPixFmts gets `AVCodec.pix_fmts` value.
|
|
||||||
func (codec *AVCodec) GetPixFmts() []AVPixelFormat {
|
|
||||||
return SliceTrunc((*AVPixelFormat)(codec.pix_fmts), func(pf AVPixelFormat) bool {
|
|
||||||
return pf == AV_PIX_FMT_NONE
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSupportedSamplerates gets `AVCodec.supported_samplerates` value.
|
|
||||||
func (codec *AVCodec) GetSupportedSamplerates() []int32 {
|
|
||||||
return SliceTrunc((*int32)(codec.supported_samplerates), func(i int32) bool {
|
|
||||||
return i == 0
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSampleFmts gets `AVCodec.sample_fmts` value.
|
|
||||||
func (codec *AVCodec) GetSampleFmts() []AVSampleFormat {
|
|
||||||
return SliceTrunc((*AVSampleFormat)(codec.sample_fmts), func(sf AVSampleFormat) bool {
|
|
||||||
return sf == AV_SAMPLE_FMT_NONE
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetChannelLayouts gets `AVCodec.channel_layouts` value.
|
|
||||||
func (codec *AVCodec) GetChannelLayouts() []uint64 {
|
|
||||||
return SliceTrunc((*uint64)(codec.channel_layouts), func(u uint64) bool {
|
|
||||||
return u == 0
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetMaxLowres gets `AVCodec.max_lowres` value.
|
|
||||||
func (codec *AVCodec) GetMaxLowres() uint8 {
|
|
||||||
return (uint8)(codec.max_lowres)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetProfiles gets `AVCodec.profiles` value.
|
|
||||||
func (codec *AVCodec) GetProfiles() []AVProfile {
|
|
||||||
return SliceTrunc((*AVProfile)(codec.profiles), func(ap AVProfile) bool {
|
|
||||||
return ap.GetProfile() == FF_PROFILE_UNKNOWN
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetWrapperName gets `AVCodec.wrapper_name` value.
|
|
||||||
func (codec *AVCodec) GetWrapperName() string {
|
|
||||||
return C.GoString(codec.wrapper_name)
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvCodecIterate iterates over all registered codecs.
|
|
||||||
func AvCodecIterate(opaque CVoidPointerPointer) *AVCodec {
|
|
||||||
return (*AVCodec)(C.av_codec_iterate(VoidPointerPointer(opaque)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvCodecFindDecoder finds a registered decoder with a matching codec ID.
|
|
||||||
func AvCodecFindDecoder(id AVCodecID) *AVCodec {
|
|
||||||
return (*AVCodec)(C.avcodec_find_decoder((C.enum_AVCodecID)(id)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvCodecFindDecoderByName finds a registered decoder with the specified name.
|
|
||||||
func AvCodecFindDecoderByName(name string) *AVCodec {
|
|
||||||
namePtr, nameFunc := StringCasting(name)
|
|
||||||
defer nameFunc()
|
|
||||||
return (*AVCodec)(C.avcodec_find_decoder_by_name((*C.char)(namePtr)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvCodecFindEncoder finds a registered encoder with a matching codec ID.
|
|
||||||
func AvCodecFindEncoder(id AVCodecID) *AVCodec {
|
|
||||||
return (*AVCodec)(C.avcodec_find_encoder((C.enum_AVCodecID)(id)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvCodecFindEncoderByName finds a registered encoder with the specified name.
|
|
||||||
func AvCodecFindEncoderByName(name string) *AVCodec {
|
|
||||||
namePtr, nameFunc := StringCasting(name)
|
|
||||||
defer nameFunc()
|
|
||||||
return (*AVCodec)(C.avcodec_find_encoder_by_name((*C.char)(namePtr)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvCodecIsEncoder returns a non-zero number if codec is an encoder, zero otherwise
|
|
||||||
func AvCodecIsEncoder(codec *AVCodec) int32 {
|
|
||||||
return (int32)(C.av_codec_is_encoder((*C.struct_AVCodec)(codec)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvCodecIsDecoder returns a non-zero number if codec is an decoder, zero otherwise
|
|
||||||
func AvCodecIsDecoder(codec *AVCodec) int32 {
|
|
||||||
return (int32)(C.av_codec_is_decoder((*C.struct_AVCodec)(codec)))
|
|
||||||
}
|
|
||||||
|
|
||||||
const (
|
|
||||||
AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX = int32(C.AV_CODEC_HW_CONFIG_METHOD_HW_DEVICE_CTX)
|
|
||||||
AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX = int32(C.AV_CODEC_HW_CONFIG_METHOD_HW_FRAMES_CTX)
|
|
||||||
AV_CODEC_HW_CONFIG_METHOD_INTERNAL = int32(C.AV_CODEC_HW_CONFIG_METHOD_INTERNAL)
|
|
||||||
AV_CODEC_HW_CONFIG_METHOD_AD_HOC = int32(C.AV_CODEC_HW_CONFIG_METHOD_AD_HOC)
|
|
||||||
)
|
|
||||||
|
|
||||||
// AVCodecHWConfig
|
|
||||||
type AVCodecHWConfig C.struct_AVCodecHWConfig
|
|
||||||
|
|
||||||
// GetPixFmt gets `AVCodecHWConfig.pix_fmt` value.
|
|
||||||
func (hwc *AVCodecHWConfig) GetPixFmt() AVPixelFormat {
|
|
||||||
return (AVPixelFormat)(hwc.pix_fmt)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetPixFmt sets `AVCodecHWConfig.pix_fmt` value.
|
|
||||||
func (hwc *AVCodecHWConfig) SetPixFmt(v AVPixelFormat) {
|
|
||||||
hwc.pix_fmt = (C.enum_AVPixelFormat)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetPixFmtAddr gets `AVCodecHWConfig.pix_fmt` address.
|
|
||||||
func (hwc *AVCodecHWConfig) GetPixFmtAddr() *AVPixelFormat {
|
|
||||||
return (*AVPixelFormat)(&hwc.pix_fmt)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetMethods gets `AVCodecHWConfig.methods` value.
|
|
||||||
func (hwc *AVCodecHWConfig) GetMethods() int32 {
|
|
||||||
return (int32)(hwc.methods)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetMethods sets `AVCodecHWConfig.methods` value.
|
|
||||||
func (hwc *AVCodecHWConfig) SetMethods(v int32) {
|
|
||||||
hwc.methods = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetMethodsAddr gets `AVCodecHWConfig.methods` address.
|
|
||||||
func (hwc *AVCodecHWConfig) GetMethodsAddr() *int32 {
|
|
||||||
return (*int32)(&hwc.methods)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDeviceType gets `AVCodecHWConfig.devicetype` value.
|
|
||||||
func (hwc *AVCodecHWConfig) GetDeviceType() AVHWDeviceType {
|
|
||||||
return (AVHWDeviceType)(hwc.device_type)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetDeviceType sets `AVCodecHWConfig.devicetype` value.
|
|
||||||
func (hwc *AVCodecHWConfig) SetDeviceType(v AVHWDeviceType) {
|
|
||||||
hwc.device_type = (C.enum_AVHWDeviceType)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDeviceTypeAddr gets `AVCodecHWConfig.devicetype` address.
|
|
||||||
func (hwc *AVCodecHWConfig) GetDeviceTypeAddr() *AVHWDeviceType {
|
|
||||||
return (*AVHWDeviceType)(&hwc.device_type)
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvCodecGetHwConfig retrieves supported hardware configurations for a codec.
|
|
||||||
func AvCodecGetHwConfig[T Integer](codec *AVCodec, index T) *AVCodecHWConfig {
|
|
||||||
return (*AVCodecHWConfig)(C.avcodec_get_hw_config((*C.struct_AVCodec)(codec), (C.int)(index)))
|
|
||||||
}
|
|
@@ -1,77 +0,0 @@
|
|||||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
|
||||||
// Use of this source code is governed by a MIT
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package ffmpeg
|
|
||||||
|
|
||||||
/*
|
|
||||||
#include <libavcodec/codec_desc.h>
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
|
|
||||||
// AVCodecDescriptor
|
|
||||||
type AVCodecDescriptor C.struct_AVCodecDescriptor
|
|
||||||
|
|
||||||
// GetId gets `AVCodecDescriptor.id` value.
|
|
||||||
func (hwc *AVCodecDescriptor) GetId() AVCodecID {
|
|
||||||
return (AVCodecID)(hwc.id)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetType gets `AVCodecDescriptor.type` value.
|
|
||||||
func (hwc *AVCodecDescriptor) GetType() AVMediaType {
|
|
||||||
return (AVMediaType)(hwc._type)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetName gets `AVCodecDescriptor.name` value.
|
|
||||||
func (hwc *AVCodecDescriptor) GetName() string {
|
|
||||||
return C.GoString(hwc.name)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetLongName gets `AVCodecDescriptor.long_name` value.
|
|
||||||
func (hwc *AVCodecDescriptor) GetLongName() string {
|
|
||||||
return C.GoString(hwc.long_name)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetProps gets `AVCodecDescriptor.props` value.
|
|
||||||
func (hwc *AVCodecDescriptor) GetProps() int32 {
|
|
||||||
return (int32)(hwc.props)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetMimeTypes gets `AVCodecDescriptor.mime_types` value.
|
|
||||||
func (hwc *AVCodecDescriptor) GetMimeTypes() (v []string) {
|
|
||||||
return SliceTruncString(hwc.mime_types)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetProfiles gets `AVCodecDescriptor.profiles` value.
|
|
||||||
func (hwc *AVCodecDescriptor) GetProfiles() []AVProfile {
|
|
||||||
return SliceTrunc((*AVProfile)(hwc.profiles), func(ap AVProfile) bool {
|
|
||||||
return ap.GetProfile() == FF_PROFILE_UNKNOWN
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
const (
|
|
||||||
AV_CODEC_PROP_INTRA_ONLY = C.AV_CODEC_PROP_INTRA_ONLY
|
|
||||||
AV_CODEC_PROP_LOSSY = C.AV_CODEC_PROP_LOSSY
|
|
||||||
AV_CODEC_PROP_LOSSLESS = C.AV_CODEC_PROP_LOSSLESS
|
|
||||||
AV_CODEC_PROP_REORDER = C.AV_CODEC_PROP_REORDER
|
|
||||||
AV_CODEC_PROP_BITMAP_SUB = C.AV_CODEC_PROP_BITMAP_SUB
|
|
||||||
AV_CODEC_PROP_TEXT_SUB = C.AV_CODEC_PROP_TEXT_SUB
|
|
||||||
)
|
|
||||||
|
|
||||||
// AvCodecDescriptorGet returns descriptor for given codec ID or NULL if no descriptor exists.
|
|
||||||
func AvCodecDescriptorGet(id AVCodecID) *AVCodecDescriptor {
|
|
||||||
return (*AVCodecDescriptor)(C.avcodec_descriptor_get((C.enum_AVCodecID)(id)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvCodecDescriptorNext iterates over all codec descriptors known to libavcodec.
|
|
||||||
func AvCodecDescriptorNext(prev *AVCodecDescriptor) *AVCodecDescriptor {
|
|
||||||
return (*AVCodecDescriptor)(C.avcodec_descriptor_next((*C.struct_AVCodecDescriptor)(prev)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvCodecDescriptorGetByName returns codec descriptor with the given name or NULL
|
|
||||||
// if no such descriptor exists.
|
|
||||||
func AvCodecDescriptorGetByName(name string) *AVCodecDescriptor {
|
|
||||||
namePtr, nameFunc := StringCasting(name)
|
|
||||||
defer nameFunc()
|
|
||||||
return (*AVCodecDescriptor)(C.avcodec_descriptor_get_by_name((*C.char)(namePtr)))
|
|
||||||
}
|
|
@@ -1,555 +0,0 @@
|
|||||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
|
||||||
// Use of this source code is governed by a MIT
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package ffmpeg
|
|
||||||
|
|
||||||
/*
|
|
||||||
#include <libavcodec/codec_id.h>
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
|
|
||||||
// AVCodecID
|
|
||||||
type AVCodecID = C.enum_AVCodecID
|
|
||||||
|
|
||||||
const (
|
|
||||||
AV_CODEC_ID_NONE = AVCodecID(C.AV_CODEC_ID_NONE)
|
|
||||||
|
|
||||||
// video codecs
|
|
||||||
AV_CODEC_ID_MPEG1VIDEO = AVCodecID(C.AV_CODEC_ID_MPEG1VIDEO)
|
|
||||||
AV_CODEC_ID_MPEG2VIDEO = AVCodecID(C.AV_CODEC_ID_MPEG2VIDEO)
|
|
||||||
AV_CODEC_ID_H261 = AVCodecID(C.AV_CODEC_ID_H261)
|
|
||||||
AV_CODEC_ID_H263 = AVCodecID(C.AV_CODEC_ID_H263)
|
|
||||||
AV_CODEC_ID_RV10 = AVCodecID(C.AV_CODEC_ID_RV10)
|
|
||||||
AV_CODEC_ID_RV20 = AVCodecID(C.AV_CODEC_ID_RV20)
|
|
||||||
AV_CODEC_ID_MJPEG = AVCodecID(C.AV_CODEC_ID_MJPEG)
|
|
||||||
AV_CODEC_ID_MJPEGB = AVCodecID(C.AV_CODEC_ID_MJPEGB)
|
|
||||||
AV_CODEC_ID_LJPEG = AVCodecID(C.AV_CODEC_ID_LJPEG)
|
|
||||||
AV_CODEC_ID_SP5X = AVCodecID(C.AV_CODEC_ID_SP5X)
|
|
||||||
AV_CODEC_ID_JPEGLS = AVCodecID(C.AV_CODEC_ID_JPEGLS)
|
|
||||||
AV_CODEC_ID_MPEG4 = AVCodecID(C.AV_CODEC_ID_MPEG4)
|
|
||||||
AV_CODEC_ID_RAWVIDEO = AVCodecID(C.AV_CODEC_ID_RAWVIDEO)
|
|
||||||
AV_CODEC_ID_MSMPEG4V1 = AVCodecID(C.AV_CODEC_ID_MSMPEG4V1)
|
|
||||||
AV_CODEC_ID_MSMPEG4V2 = AVCodecID(C.AV_CODEC_ID_MSMPEG4V2)
|
|
||||||
AV_CODEC_ID_MSMPEG4V3 = AVCodecID(C.AV_CODEC_ID_MSMPEG4V3)
|
|
||||||
AV_CODEC_ID_WMV1 = AVCodecID(C.AV_CODEC_ID_WMV1)
|
|
||||||
AV_CODEC_ID_WMV2 = AVCodecID(C.AV_CODEC_ID_WMV2)
|
|
||||||
AV_CODEC_ID_H263P = AVCodecID(C.AV_CODEC_ID_H263P)
|
|
||||||
AV_CODEC_ID_H263I = AVCodecID(C.AV_CODEC_ID_H263I)
|
|
||||||
AV_CODEC_ID_FLV1 = AVCodecID(C.AV_CODEC_ID_FLV1)
|
|
||||||
AV_CODEC_ID_SVQ1 = AVCodecID(C.AV_CODEC_ID_SVQ1)
|
|
||||||
AV_CODEC_ID_SVQ3 = AVCodecID(C.AV_CODEC_ID_SVQ3)
|
|
||||||
AV_CODEC_ID_DVVIDEO = AVCodecID(C.AV_CODEC_ID_DVVIDEO)
|
|
||||||
AV_CODEC_ID_HUFFYUV = AVCodecID(C.AV_CODEC_ID_HUFFYUV)
|
|
||||||
AV_CODEC_ID_CYUV = AVCodecID(C.AV_CODEC_ID_CYUV)
|
|
||||||
AV_CODEC_ID_H264 = AVCodecID(C.AV_CODEC_ID_H264)
|
|
||||||
AV_CODEC_ID_INDEO3 = AVCodecID(C.AV_CODEC_ID_INDEO3)
|
|
||||||
AV_CODEC_ID_VP3 = AVCodecID(C.AV_CODEC_ID_VP3)
|
|
||||||
AV_CODEC_ID_THEORA = AVCodecID(C.AV_CODEC_ID_THEORA)
|
|
||||||
AV_CODEC_ID_ASV1 = AVCodecID(C.AV_CODEC_ID_ASV1)
|
|
||||||
AV_CODEC_ID_ASV2 = AVCodecID(C.AV_CODEC_ID_ASV2)
|
|
||||||
AV_CODEC_ID_FFV1 = AVCodecID(C.AV_CODEC_ID_FFV1)
|
|
||||||
AV_CODEC_ID_4XM = AVCodecID(C.AV_CODEC_ID_4XM)
|
|
||||||
AV_CODEC_ID_VCR1 = AVCodecID(C.AV_CODEC_ID_VCR1)
|
|
||||||
AV_CODEC_ID_CLJR = AVCodecID(C.AV_CODEC_ID_CLJR)
|
|
||||||
AV_CODEC_ID_MDEC = AVCodecID(C.AV_CODEC_ID_MDEC)
|
|
||||||
AV_CODEC_ID_ROQ = AVCodecID(C.AV_CODEC_ID_ROQ)
|
|
||||||
AV_CODEC_ID_INTERPLAY_VIDEO = AVCodecID(C.AV_CODEC_ID_INTERPLAY_VIDEO)
|
|
||||||
AV_CODEC_ID_XAN_WC3 = AVCodecID(C.AV_CODEC_ID_XAN_WC3)
|
|
||||||
AV_CODEC_ID_XAN_WC4 = AVCodecID(C.AV_CODEC_ID_XAN_WC4)
|
|
||||||
AV_CODEC_ID_RPZA = AVCodecID(C.AV_CODEC_ID_RPZA)
|
|
||||||
AV_CODEC_ID_CINEPAK = AVCodecID(C.AV_CODEC_ID_CINEPAK)
|
|
||||||
AV_CODEC_ID_WS_VQA = AVCodecID(C.AV_CODEC_ID_WS_VQA)
|
|
||||||
AV_CODEC_ID_MSRLE = AVCodecID(C.AV_CODEC_ID_MSRLE)
|
|
||||||
AV_CODEC_ID_MSVIDEO1 = AVCodecID(C.AV_CODEC_ID_MSVIDEO1)
|
|
||||||
AV_CODEC_ID_IDCIN = AVCodecID(C.AV_CODEC_ID_IDCIN)
|
|
||||||
AV_CODEC_ID_8BPS = AVCodecID(C.AV_CODEC_ID_8BPS)
|
|
||||||
AV_CODEC_ID_SMC = AVCodecID(C.AV_CODEC_ID_SMC)
|
|
||||||
AV_CODEC_ID_FLIC = AVCodecID(C.AV_CODEC_ID_FLIC)
|
|
||||||
AV_CODEC_ID_TRUEMOTION1 = AVCodecID(C.AV_CODEC_ID_TRUEMOTION1)
|
|
||||||
AV_CODEC_ID_VMDVIDEO = AVCodecID(C.AV_CODEC_ID_VMDVIDEO)
|
|
||||||
AV_CODEC_ID_MSZH = AVCodecID(C.AV_CODEC_ID_MSZH)
|
|
||||||
AV_CODEC_ID_ZLIB = AVCodecID(C.AV_CODEC_ID_ZLIB)
|
|
||||||
AV_CODEC_ID_QTRLE = AVCodecID(C.AV_CODEC_ID_QTRLE)
|
|
||||||
AV_CODEC_ID_TSCC = AVCodecID(C.AV_CODEC_ID_TSCC)
|
|
||||||
AV_CODEC_ID_ULTI = AVCodecID(C.AV_CODEC_ID_ULTI)
|
|
||||||
AV_CODEC_ID_QDRAW = AVCodecID(C.AV_CODEC_ID_QDRAW)
|
|
||||||
AV_CODEC_ID_VIXL = AVCodecID(C.AV_CODEC_ID_VIXL)
|
|
||||||
AV_CODEC_ID_QPEG = AVCodecID(C.AV_CODEC_ID_QPEG)
|
|
||||||
AV_CODEC_ID_PNG = AVCodecID(C.AV_CODEC_ID_PNG)
|
|
||||||
AV_CODEC_ID_PPM = AVCodecID(C.AV_CODEC_ID_PPM)
|
|
||||||
AV_CODEC_ID_PBM = AVCodecID(C.AV_CODEC_ID_PBM)
|
|
||||||
AV_CODEC_ID_PGM = AVCodecID(C.AV_CODEC_ID_PGM)
|
|
||||||
AV_CODEC_ID_PGMYUV = AVCodecID(C.AV_CODEC_ID_PGMYUV)
|
|
||||||
AV_CODEC_ID_PAM = AVCodecID(C.AV_CODEC_ID_PAM)
|
|
||||||
AV_CODEC_ID_FFVHUFF = AVCodecID(C.AV_CODEC_ID_FFVHUFF)
|
|
||||||
AV_CODEC_ID_RV30 = AVCodecID(C.AV_CODEC_ID_RV30)
|
|
||||||
AV_CODEC_ID_RV40 = AVCodecID(C.AV_CODEC_ID_RV40)
|
|
||||||
AV_CODEC_ID_VC1 = AVCodecID(C.AV_CODEC_ID_VC1)
|
|
||||||
AV_CODEC_ID_WMV3 = AVCodecID(C.AV_CODEC_ID_WMV3)
|
|
||||||
AV_CODEC_ID_LOCO = AVCodecID(C.AV_CODEC_ID_LOCO)
|
|
||||||
AV_CODEC_ID_WNV1 = AVCodecID(C.AV_CODEC_ID_WNV1)
|
|
||||||
AV_CODEC_ID_AASC = AVCodecID(C.AV_CODEC_ID_AASC)
|
|
||||||
AV_CODEC_ID_INDEO2 = AVCodecID(C.AV_CODEC_ID_INDEO2)
|
|
||||||
AV_CODEC_ID_FRAPS = AVCodecID(C.AV_CODEC_ID_FRAPS)
|
|
||||||
AV_CODEC_ID_TRUEMOTION2 = AVCodecID(C.AV_CODEC_ID_TRUEMOTION2)
|
|
||||||
AV_CODEC_ID_BMP = AVCodecID(C.AV_CODEC_ID_BMP)
|
|
||||||
AV_CODEC_ID_CSCD = AVCodecID(C.AV_CODEC_ID_CSCD)
|
|
||||||
AV_CODEC_ID_MMVIDEO = AVCodecID(C.AV_CODEC_ID_MMVIDEO)
|
|
||||||
AV_CODEC_ID_ZMBV = AVCodecID(C.AV_CODEC_ID_ZMBV)
|
|
||||||
AV_CODEC_ID_AVS = AVCodecID(C.AV_CODEC_ID_AVS)
|
|
||||||
AV_CODEC_ID_SMACKVIDEO = AVCodecID(C.AV_CODEC_ID_SMACKVIDEO)
|
|
||||||
AV_CODEC_ID_NUV = AVCodecID(C.AV_CODEC_ID_NUV)
|
|
||||||
AV_CODEC_ID_KMVC = AVCodecID(C.AV_CODEC_ID_KMVC)
|
|
||||||
AV_CODEC_ID_FLASHSV = AVCodecID(C.AV_CODEC_ID_FLASHSV)
|
|
||||||
AV_CODEC_ID_CAVS = AVCodecID(C.AV_CODEC_ID_CAVS)
|
|
||||||
AV_CODEC_ID_JPEG2000 = AVCodecID(C.AV_CODEC_ID_JPEG2000)
|
|
||||||
AV_CODEC_ID_VMNC = AVCodecID(C.AV_CODEC_ID_VMNC)
|
|
||||||
AV_CODEC_ID_VP5 = AVCodecID(C.AV_CODEC_ID_VP5)
|
|
||||||
AV_CODEC_ID_VP6 = AVCodecID(C.AV_CODEC_ID_VP6)
|
|
||||||
AV_CODEC_ID_VP6F = AVCodecID(C.AV_CODEC_ID_VP6F)
|
|
||||||
AV_CODEC_ID_TARGA = AVCodecID(C.AV_CODEC_ID_TARGA)
|
|
||||||
AV_CODEC_ID_DSICINVIDEO = AVCodecID(C.AV_CODEC_ID_DSICINVIDEO)
|
|
||||||
AV_CODEC_ID_TIERTEXSEQVIDEO = AVCodecID(C.AV_CODEC_ID_TIERTEXSEQVIDEO)
|
|
||||||
AV_CODEC_ID_TIFF = AVCodecID(C.AV_CODEC_ID_TIFF)
|
|
||||||
AV_CODEC_ID_GIF = AVCodecID(C.AV_CODEC_ID_GIF)
|
|
||||||
AV_CODEC_ID_DXA = AVCodecID(C.AV_CODEC_ID_DXA)
|
|
||||||
AV_CODEC_ID_DNXHD = AVCodecID(C.AV_CODEC_ID_DNXHD)
|
|
||||||
AV_CODEC_ID_THP = AVCodecID(C.AV_CODEC_ID_THP)
|
|
||||||
AV_CODEC_ID_SGI = AVCodecID(C.AV_CODEC_ID_SGI)
|
|
||||||
AV_CODEC_ID_C93 = AVCodecID(C.AV_CODEC_ID_C93)
|
|
||||||
AV_CODEC_ID_BETHSOFTVID = AVCodecID(C.AV_CODEC_ID_BETHSOFTVID)
|
|
||||||
AV_CODEC_ID_PTX = AVCodecID(C.AV_CODEC_ID_PTX)
|
|
||||||
AV_CODEC_ID_TXD = AVCodecID(C.AV_CODEC_ID_TXD)
|
|
||||||
AV_CODEC_ID_VP6A = AVCodecID(C.AV_CODEC_ID_VP6A)
|
|
||||||
AV_CODEC_ID_AMV = AVCodecID(C.AV_CODEC_ID_AMV)
|
|
||||||
AV_CODEC_ID_VB = AVCodecID(C.AV_CODEC_ID_VB)
|
|
||||||
AV_CODEC_ID_PCX = AVCodecID(C.AV_CODEC_ID_PCX)
|
|
||||||
AV_CODEC_ID_SUNRAST = AVCodecID(C.AV_CODEC_ID_SUNRAST)
|
|
||||||
AV_CODEC_ID_INDEO4 = AVCodecID(C.AV_CODEC_ID_INDEO4)
|
|
||||||
AV_CODEC_ID_INDEO5 = AVCodecID(C.AV_CODEC_ID_INDEO5)
|
|
||||||
AV_CODEC_ID_MIMIC = AVCodecID(C.AV_CODEC_ID_MIMIC)
|
|
||||||
AV_CODEC_ID_RL2 = AVCodecID(C.AV_CODEC_ID_RL2)
|
|
||||||
AV_CODEC_ID_ESCAPE124 = AVCodecID(C.AV_CODEC_ID_ESCAPE124)
|
|
||||||
AV_CODEC_ID_DIRAC = AVCodecID(C.AV_CODEC_ID_DIRAC)
|
|
||||||
AV_CODEC_ID_BFI = AVCodecID(C.AV_CODEC_ID_BFI)
|
|
||||||
AV_CODEC_ID_CMV = AVCodecID(C.AV_CODEC_ID_CMV)
|
|
||||||
AV_CODEC_ID_MOTIONPIXELS = AVCodecID(C.AV_CODEC_ID_MOTIONPIXELS)
|
|
||||||
AV_CODEC_ID_TGV = AVCodecID(C.AV_CODEC_ID_TGV)
|
|
||||||
AV_CODEC_ID_TGQ = AVCodecID(C.AV_CODEC_ID_TGQ)
|
|
||||||
AV_CODEC_ID_TQI = AVCodecID(C.AV_CODEC_ID_TQI)
|
|
||||||
AV_CODEC_ID_AURA = AVCodecID(C.AV_CODEC_ID_AURA)
|
|
||||||
AV_CODEC_ID_AURA2 = AVCodecID(C.AV_CODEC_ID_AURA2)
|
|
||||||
AV_CODEC_ID_V210X = AVCodecID(C.AV_CODEC_ID_V210X)
|
|
||||||
AV_CODEC_ID_TMV = AVCodecID(C.AV_CODEC_ID_TMV)
|
|
||||||
AV_CODEC_ID_V210 = AVCodecID(C.AV_CODEC_ID_V210)
|
|
||||||
AV_CODEC_ID_DPX = AVCodecID(C.AV_CODEC_ID_DPX)
|
|
||||||
AV_CODEC_ID_MAD = AVCodecID(C.AV_CODEC_ID_MAD)
|
|
||||||
AV_CODEC_ID_FRWU = AVCodecID(C.AV_CODEC_ID_FRWU)
|
|
||||||
AV_CODEC_ID_FLASHSV2 = AVCodecID(C.AV_CODEC_ID_FLASHSV2)
|
|
||||||
AV_CODEC_ID_CDGRAPHICS = AVCodecID(C.AV_CODEC_ID_CDGRAPHICS)
|
|
||||||
AV_CODEC_ID_R210 = AVCodecID(C.AV_CODEC_ID_R210)
|
|
||||||
AV_CODEC_ID_ANM = AVCodecID(C.AV_CODEC_ID_ANM)
|
|
||||||
AV_CODEC_ID_BINKVIDEO = AVCodecID(C.AV_CODEC_ID_BINKVIDEO)
|
|
||||||
AV_CODEC_ID_IFF_ILBM = AVCodecID(C.AV_CODEC_ID_IFF_ILBM)
|
|
||||||
AV_CODEC_ID_IFF_BYTERUN1 = AVCodecID(C.AV_CODEC_ID_IFF_BYTERUN1)
|
|
||||||
AV_CODEC_ID_KGV1 = AVCodecID(C.AV_CODEC_ID_KGV1)
|
|
||||||
AV_CODEC_ID_YOP = AVCodecID(C.AV_CODEC_ID_YOP)
|
|
||||||
AV_CODEC_ID_VP8 = AVCodecID(C.AV_CODEC_ID_VP8)
|
|
||||||
AV_CODEC_ID_PICTOR = AVCodecID(C.AV_CODEC_ID_PICTOR)
|
|
||||||
AV_CODEC_ID_ANSI = AVCodecID(C.AV_CODEC_ID_ANSI)
|
|
||||||
AV_CODEC_ID_A64_MULTI = AVCodecID(C.AV_CODEC_ID_A64_MULTI)
|
|
||||||
AV_CODEC_ID_A64_MULTI5 = AVCodecID(C.AV_CODEC_ID_A64_MULTI5)
|
|
||||||
AV_CODEC_ID_R10K = AVCodecID(C.AV_CODEC_ID_R10K)
|
|
||||||
AV_CODEC_ID_MXPEG = AVCodecID(C.AV_CODEC_ID_MXPEG)
|
|
||||||
AV_CODEC_ID_LAGARITH = AVCodecID(C.AV_CODEC_ID_LAGARITH)
|
|
||||||
AV_CODEC_ID_PRORES = AVCodecID(C.AV_CODEC_ID_PRORES)
|
|
||||||
AV_CODEC_ID_JV = AVCodecID(C.AV_CODEC_ID_JV)
|
|
||||||
AV_CODEC_ID_DFA = AVCodecID(C.AV_CODEC_ID_DFA)
|
|
||||||
AV_CODEC_ID_WMV3IMAGE = AVCodecID(C.AV_CODEC_ID_WMV3IMAGE)
|
|
||||||
AV_CODEC_ID_VC1IMAGE = AVCodecID(C.AV_CODEC_ID_VC1IMAGE)
|
|
||||||
AV_CODEC_ID_UTVIDEO = AVCodecID(C.AV_CODEC_ID_UTVIDEO)
|
|
||||||
AV_CODEC_ID_BMV_VIDEO = AVCodecID(C.AV_CODEC_ID_BMV_VIDEO)
|
|
||||||
AV_CODEC_ID_VBLE = AVCodecID(C.AV_CODEC_ID_VBLE)
|
|
||||||
AV_CODEC_ID_DXTORY = AVCodecID(C.AV_CODEC_ID_DXTORY)
|
|
||||||
AV_CODEC_ID_V410 = AVCodecID(C.AV_CODEC_ID_V410)
|
|
||||||
AV_CODEC_ID_XWD = AVCodecID(C.AV_CODEC_ID_XWD)
|
|
||||||
AV_CODEC_ID_CDXL = AVCodecID(C.AV_CODEC_ID_CDXL)
|
|
||||||
AV_CODEC_ID_XBM = AVCodecID(C.AV_CODEC_ID_XBM)
|
|
||||||
AV_CODEC_ID_ZEROCODEC = AVCodecID(C.AV_CODEC_ID_ZEROCODEC)
|
|
||||||
AV_CODEC_ID_MSS1 = AVCodecID(C.AV_CODEC_ID_MSS1)
|
|
||||||
AV_CODEC_ID_MSA1 = AVCodecID(C.AV_CODEC_ID_MSA1)
|
|
||||||
AV_CODEC_ID_TSCC2 = AVCodecID(C.AV_CODEC_ID_TSCC2)
|
|
||||||
AV_CODEC_ID_MTS2 = AVCodecID(C.AV_CODEC_ID_MTS2)
|
|
||||||
AV_CODEC_ID_CLLC = AVCodecID(C.AV_CODEC_ID_CLLC)
|
|
||||||
AV_CODEC_ID_MSS2 = AVCodecID(C.AV_CODEC_ID_MSS2)
|
|
||||||
AV_CODEC_ID_VP9 = AVCodecID(C.AV_CODEC_ID_VP9)
|
|
||||||
AV_CODEC_ID_AIC = AVCodecID(C.AV_CODEC_ID_AIC)
|
|
||||||
AV_CODEC_ID_ESCAPE130 = AVCodecID(C.AV_CODEC_ID_ESCAPE130)
|
|
||||||
AV_CODEC_ID_G2M = AVCodecID(C.AV_CODEC_ID_G2M)
|
|
||||||
AV_CODEC_ID_WEBP = AVCodecID(C.AV_CODEC_ID_WEBP)
|
|
||||||
AV_CODEC_ID_HNM4_VIDEO = AVCodecID(C.AV_CODEC_ID_HNM4_VIDEO)
|
|
||||||
AV_CODEC_ID_HEVC = AVCodecID(C.AV_CODEC_ID_HEVC)
|
|
||||||
AV_CODEC_ID_H265 = AVCodecID(C.AV_CODEC_ID_H265)
|
|
||||||
AV_CODEC_ID_FIC = AVCodecID(C.AV_CODEC_ID_FIC)
|
|
||||||
AV_CODEC_ID_ALIAS_PIX = AVCodecID(C.AV_CODEC_ID_ALIAS_PIX)
|
|
||||||
AV_CODEC_ID_BRENDER_PIX = AVCodecID(C.AV_CODEC_ID_BRENDER_PIX)
|
|
||||||
AV_CODEC_ID_PAF_VIDEO = AVCodecID(C.AV_CODEC_ID_PAF_VIDEO)
|
|
||||||
AV_CODEC_ID_EXR = AVCodecID(C.AV_CODEC_ID_EXR)
|
|
||||||
AV_CODEC_ID_VP7 = AVCodecID(C.AV_CODEC_ID_VP7)
|
|
||||||
AV_CODEC_ID_SANM = AVCodecID(C.AV_CODEC_ID_SANM)
|
|
||||||
AV_CODEC_ID_SGIRLE = AVCodecID(C.AV_CODEC_ID_SGIRLE)
|
|
||||||
AV_CODEC_ID_MVC1 = AVCodecID(C.AV_CODEC_ID_MVC1)
|
|
||||||
AV_CODEC_ID_MVC2 = AVCodecID(C.AV_CODEC_ID_MVC2)
|
|
||||||
AV_CODEC_ID_HQX = AVCodecID(C.AV_CODEC_ID_HQX)
|
|
||||||
AV_CODEC_ID_TDSC = AVCodecID(C.AV_CODEC_ID_TDSC)
|
|
||||||
AV_CODEC_ID_HQ_HQA = AVCodecID(C.AV_CODEC_ID_HQ_HQA)
|
|
||||||
AV_CODEC_ID_HAP = AVCodecID(C.AV_CODEC_ID_HAP)
|
|
||||||
AV_CODEC_ID_DDS = AVCodecID(C.AV_CODEC_ID_DDS)
|
|
||||||
AV_CODEC_ID_DXV = AVCodecID(C.AV_CODEC_ID_DXV)
|
|
||||||
AV_CODEC_ID_SCREENPRESSO = AVCodecID(C.AV_CODEC_ID_SCREENPRESSO)
|
|
||||||
AV_CODEC_ID_RSCC = AVCodecID(C.AV_CODEC_ID_RSCC)
|
|
||||||
AV_CODEC_ID_AVS2 = AVCodecID(C.AV_CODEC_ID_AVS2)
|
|
||||||
AV_CODEC_ID_PGX = AVCodecID(C.AV_CODEC_ID_PGX)
|
|
||||||
AV_CODEC_ID_AVS3 = AVCodecID(C.AV_CODEC_ID_AVS3)
|
|
||||||
AV_CODEC_ID_MSP2 = AVCodecID(C.AV_CODEC_ID_MSP2)
|
|
||||||
AV_CODEC_ID_VVC = AVCodecID(C.AV_CODEC_ID_VVC)
|
|
||||||
AV_CODEC_ID_H266 = AVCodecID(C.AV_CODEC_ID_H266)
|
|
||||||
AV_CODEC_ID_Y41P = AVCodecID(C.AV_CODEC_ID_Y41P)
|
|
||||||
AV_CODEC_ID_AVRP = AVCodecID(C.AV_CODEC_ID_AVRP)
|
|
||||||
AV_CODEC_ID_012V = AVCodecID(C.AV_CODEC_ID_012V)
|
|
||||||
AV_CODEC_ID_AVUI = AVCodecID(C.AV_CODEC_ID_AVUI)
|
|
||||||
AV_CODEC_ID_AYUV = AVCodecID(C.AV_CODEC_ID_AYUV)
|
|
||||||
AV_CODEC_ID_TARGA_Y216 = AVCodecID(C.AV_CODEC_ID_TARGA_Y216)
|
|
||||||
AV_CODEC_ID_V308 = AVCodecID(C.AV_CODEC_ID_V308)
|
|
||||||
AV_CODEC_ID_V408 = AVCodecID(C.AV_CODEC_ID_V408)
|
|
||||||
AV_CODEC_ID_YUV4 = AVCodecID(C.AV_CODEC_ID_YUV4)
|
|
||||||
AV_CODEC_ID_AVRN = AVCodecID(C.AV_CODEC_ID_AVRN)
|
|
||||||
AV_CODEC_ID_CPIA = AVCodecID(C.AV_CODEC_ID_CPIA)
|
|
||||||
AV_CODEC_ID_XFACE = AVCodecID(C.AV_CODEC_ID_XFACE)
|
|
||||||
AV_CODEC_ID_SNOW = AVCodecID(C.AV_CODEC_ID_SNOW)
|
|
||||||
AV_CODEC_ID_SMVJPEG = AVCodecID(C.AV_CODEC_ID_SMVJPEG)
|
|
||||||
AV_CODEC_ID_APNG = AVCodecID(C.AV_CODEC_ID_APNG)
|
|
||||||
AV_CODEC_ID_DAALA = AVCodecID(C.AV_CODEC_ID_DAALA)
|
|
||||||
AV_CODEC_ID_CFHD = AVCodecID(C.AV_CODEC_ID_CFHD)
|
|
||||||
AV_CODEC_ID_TRUEMOTION2RT = AVCodecID(C.AV_CODEC_ID_TRUEMOTION2RT)
|
|
||||||
AV_CODEC_ID_M101 = AVCodecID(C.AV_CODEC_ID_M101)
|
|
||||||
AV_CODEC_ID_MAGICYUV = AVCodecID(C.AV_CODEC_ID_MAGICYUV)
|
|
||||||
AV_CODEC_ID_SHEERVIDEO = AVCodecID(C.AV_CODEC_ID_SHEERVIDEO)
|
|
||||||
AV_CODEC_ID_YLC = AVCodecID(C.AV_CODEC_ID_YLC)
|
|
||||||
AV_CODEC_ID_PSD = AVCodecID(C.AV_CODEC_ID_PSD)
|
|
||||||
AV_CODEC_ID_PIXLET = AVCodecID(C.AV_CODEC_ID_PIXLET)
|
|
||||||
AV_CODEC_ID_SPEEDHQ = AVCodecID(C.AV_CODEC_ID_SPEEDHQ)
|
|
||||||
AV_CODEC_ID_FMVC = AVCodecID(C.AV_CODEC_ID_FMVC)
|
|
||||||
AV_CODEC_ID_SCPR = AVCodecID(C.AV_CODEC_ID_SCPR)
|
|
||||||
AV_CODEC_ID_CLEARVIDEO = AVCodecID(C.AV_CODEC_ID_CLEARVIDEO)
|
|
||||||
AV_CODEC_ID_XPM = AVCodecID(C.AV_CODEC_ID_XPM)
|
|
||||||
AV_CODEC_ID_AV1 = AVCodecID(C.AV_CODEC_ID_AV1)
|
|
||||||
AV_CODEC_ID_BITPACKED = AVCodecID(C.AV_CODEC_ID_BITPACKED)
|
|
||||||
AV_CODEC_ID_MSCC = AVCodecID(C.AV_CODEC_ID_MSCC)
|
|
||||||
AV_CODEC_ID_SRGC = AVCodecID(C.AV_CODEC_ID_SRGC)
|
|
||||||
AV_CODEC_ID_SVG = AVCodecID(C.AV_CODEC_ID_SVG)
|
|
||||||
AV_CODEC_ID_GDV = AVCodecID(C.AV_CODEC_ID_GDV)
|
|
||||||
AV_CODEC_ID_FITS = AVCodecID(C.AV_CODEC_ID_FITS)
|
|
||||||
AV_CODEC_ID_IMM4 = AVCodecID(C.AV_CODEC_ID_IMM4)
|
|
||||||
AV_CODEC_ID_PROSUMER = AVCodecID(C.AV_CODEC_ID_PROSUMER)
|
|
||||||
AV_CODEC_ID_MWSC = AVCodecID(C.AV_CODEC_ID_MWSC)
|
|
||||||
AV_CODEC_ID_WCMV = AVCodecID(C.AV_CODEC_ID_WCMV)
|
|
||||||
AV_CODEC_ID_RASC = AVCodecID(C.AV_CODEC_ID_RASC)
|
|
||||||
AV_CODEC_ID_HYMT = AVCodecID(C.AV_CODEC_ID_HYMT)
|
|
||||||
AV_CODEC_ID_ARBC = AVCodecID(C.AV_CODEC_ID_ARBC)
|
|
||||||
AV_CODEC_ID_AGM = AVCodecID(C.AV_CODEC_ID_AGM)
|
|
||||||
AV_CODEC_ID_LSCR = AVCodecID(C.AV_CODEC_ID_LSCR)
|
|
||||||
AV_CODEC_ID_VP4 = AVCodecID(C.AV_CODEC_ID_VP4)
|
|
||||||
AV_CODEC_ID_IMM5 = AVCodecID(C.AV_CODEC_ID_IMM5)
|
|
||||||
AV_CODEC_ID_MVDV = AVCodecID(C.AV_CODEC_ID_MVDV)
|
|
||||||
AV_CODEC_ID_MVHA = AVCodecID(C.AV_CODEC_ID_MVHA)
|
|
||||||
AV_CODEC_ID_CDTOONS = AVCodecID(C.AV_CODEC_ID_CDTOONS)
|
|
||||||
AV_CODEC_ID_MV30 = AVCodecID(C.AV_CODEC_ID_MV30)
|
|
||||||
AV_CODEC_ID_NOTCHLC = AVCodecID(C.AV_CODEC_ID_NOTCHLC)
|
|
||||||
AV_CODEC_ID_PFM = AVCodecID(C.AV_CODEC_ID_PFM)
|
|
||||||
AV_CODEC_ID_MOBICLIP = AVCodecID(C.AV_CODEC_ID_MOBICLIP)
|
|
||||||
AV_CODEC_ID_PHOTOCD = AVCodecID(C.AV_CODEC_ID_PHOTOCD)
|
|
||||||
AV_CODEC_ID_IPU = AVCodecID(C.AV_CODEC_ID_IPU)
|
|
||||||
AV_CODEC_ID_ARGO = AVCodecID(C.AV_CODEC_ID_ARGO)
|
|
||||||
AV_CODEC_ID_CRI = AVCodecID(C.AV_CODEC_ID_CRI)
|
|
||||||
AV_CODEC_ID_SIMBIOSIS_IMX = AVCodecID(C.AV_CODEC_ID_SIMBIOSIS_IMX)
|
|
||||||
AV_CODEC_ID_SGA_VIDEO = AVCodecID(C.AV_CODEC_ID_SGA_VIDEO)
|
|
||||||
|
|
||||||
// various PCM "codecs"
|
|
||||||
AV_CODEC_ID_FIRST_AUDIO = AVCodecID(C.AV_CODEC_ID_FIRST_AUDIO)
|
|
||||||
AV_CODEC_ID_PCM_S16LE = AVCodecID(C.AV_CODEC_ID_PCM_S16LE)
|
|
||||||
AV_CODEC_ID_PCM_S16BE = AVCodecID(C.AV_CODEC_ID_PCM_S16BE)
|
|
||||||
AV_CODEC_ID_PCM_U16LE = AVCodecID(C.AV_CODEC_ID_PCM_U16LE)
|
|
||||||
AV_CODEC_ID_PCM_U16BE = AVCodecID(C.AV_CODEC_ID_PCM_U16BE)
|
|
||||||
AV_CODEC_ID_PCM_S8 = AVCodecID(C.AV_CODEC_ID_PCM_S8)
|
|
||||||
AV_CODEC_ID_PCM_U8 = AVCodecID(C.AV_CODEC_ID_PCM_U8)
|
|
||||||
AV_CODEC_ID_PCM_MULAW = AVCodecID(C.AV_CODEC_ID_PCM_MULAW)
|
|
||||||
AV_CODEC_ID_PCM_ALAW = AVCodecID(C.AV_CODEC_ID_PCM_ALAW)
|
|
||||||
AV_CODEC_ID_PCM_S32LE = AVCodecID(C.AV_CODEC_ID_PCM_S32LE)
|
|
||||||
AV_CODEC_ID_PCM_S32BE = AVCodecID(C.AV_CODEC_ID_PCM_S32BE)
|
|
||||||
AV_CODEC_ID_PCM_U32LE = AVCodecID(C.AV_CODEC_ID_PCM_U32LE)
|
|
||||||
AV_CODEC_ID_PCM_U32BE = AVCodecID(C.AV_CODEC_ID_PCM_U32BE)
|
|
||||||
AV_CODEC_ID_PCM_S24LE = AVCodecID(C.AV_CODEC_ID_PCM_S24LE)
|
|
||||||
AV_CODEC_ID_PCM_S24BE = AVCodecID(C.AV_CODEC_ID_PCM_S24BE)
|
|
||||||
AV_CODEC_ID_PCM_U24LE = AVCodecID(C.AV_CODEC_ID_PCM_U24LE)
|
|
||||||
AV_CODEC_ID_PCM_U24BE = AVCodecID(C.AV_CODEC_ID_PCM_U24BE)
|
|
||||||
AV_CODEC_ID_PCM_S24DAUD = AVCodecID(C.AV_CODEC_ID_PCM_S24DAUD)
|
|
||||||
AV_CODEC_ID_PCM_ZORK = AVCodecID(C.AV_CODEC_ID_PCM_ZORK)
|
|
||||||
AV_CODEC_ID_PCM_S16LE_PLANAR = AVCodecID(C.AV_CODEC_ID_PCM_S16LE_PLANAR)
|
|
||||||
AV_CODEC_ID_PCM_DVD = AVCodecID(C.AV_CODEC_ID_PCM_DVD)
|
|
||||||
AV_CODEC_ID_PCM_F32BE = AVCodecID(C.AV_CODEC_ID_PCM_F32BE)
|
|
||||||
AV_CODEC_ID_PCM_F32LE = AVCodecID(C.AV_CODEC_ID_PCM_F32LE)
|
|
||||||
AV_CODEC_ID_PCM_F64BE = AVCodecID(C.AV_CODEC_ID_PCM_F64BE)
|
|
||||||
AV_CODEC_ID_PCM_F64LE = AVCodecID(C.AV_CODEC_ID_PCM_F64LE)
|
|
||||||
AV_CODEC_ID_PCM_BLURAY = AVCodecID(C.AV_CODEC_ID_PCM_BLURAY)
|
|
||||||
AV_CODEC_ID_PCM_LXF = AVCodecID(C.AV_CODEC_ID_PCM_LXF)
|
|
||||||
AV_CODEC_ID_S302M = AVCodecID(C.AV_CODEC_ID_S302M)
|
|
||||||
AV_CODEC_ID_PCM_S8_PLANAR = AVCodecID(C.AV_CODEC_ID_PCM_S8_PLANAR)
|
|
||||||
AV_CODEC_ID_PCM_S24LE_PLANAR = AVCodecID(C.AV_CODEC_ID_PCM_S24LE_PLANAR)
|
|
||||||
AV_CODEC_ID_PCM_S32LE_PLANAR = AVCodecID(C.AV_CODEC_ID_PCM_S32LE_PLANAR)
|
|
||||||
AV_CODEC_ID_PCM_S16BE_PLANAR = AVCodecID(C.AV_CODEC_ID_PCM_S16BE_PLANAR)
|
|
||||||
AV_CODEC_ID_PCM_S64LE = AVCodecID(C.AV_CODEC_ID_PCM_S64LE)
|
|
||||||
AV_CODEC_ID_PCM_S64BE = AVCodecID(C.AV_CODEC_ID_PCM_S64BE)
|
|
||||||
AV_CODEC_ID_PCM_F16LE = AVCodecID(C.AV_CODEC_ID_PCM_F16LE)
|
|
||||||
AV_CODEC_ID_PCM_F24LE = AVCodecID(C.AV_CODEC_ID_PCM_F24LE)
|
|
||||||
AV_CODEC_ID_PCM_VIDC = AVCodecID(C.AV_CODEC_ID_PCM_VIDC)
|
|
||||||
AV_CODEC_ID_PCM_SGA = AVCodecID(C.AV_CODEC_ID_PCM_SGA)
|
|
||||||
|
|
||||||
// various ADPCM codecs
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_QT = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_QT)
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_WAV = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_WAV)
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_DK3 = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_DK3)
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_DK4 = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_DK4)
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_WS = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_WS)
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_SMJPEG = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_SMJPEG)
|
|
||||||
AV_CODEC_ID_ADPCM_MS = AVCodecID(C.AV_CODEC_ID_ADPCM_MS)
|
|
||||||
AV_CODEC_ID_ADPCM_4XM = AVCodecID(C.AV_CODEC_ID_ADPCM_4XM)
|
|
||||||
AV_CODEC_ID_ADPCM_XA = AVCodecID(C.AV_CODEC_ID_ADPCM_XA)
|
|
||||||
AV_CODEC_ID_ADPCM_ADX = AVCodecID(C.AV_CODEC_ID_ADPCM_ADX)
|
|
||||||
AV_CODEC_ID_ADPCM_EA = AVCodecID(C.AV_CODEC_ID_ADPCM_EA)
|
|
||||||
AV_CODEC_ID_ADPCM_G726 = AVCodecID(C.AV_CODEC_ID_ADPCM_G726)
|
|
||||||
AV_CODEC_ID_ADPCM_CT = AVCodecID(C.AV_CODEC_ID_ADPCM_CT)
|
|
||||||
AV_CODEC_ID_ADPCM_SWF = AVCodecID(C.AV_CODEC_ID_ADPCM_SWF)
|
|
||||||
AV_CODEC_ID_ADPCM_YAMAHA = AVCodecID(C.AV_CODEC_ID_ADPCM_YAMAHA)
|
|
||||||
AV_CODEC_ID_ADPCM_SBPRO_4 = AVCodecID(C.AV_CODEC_ID_ADPCM_SBPRO_4)
|
|
||||||
AV_CODEC_ID_ADPCM_SBPRO_3 = AVCodecID(C.AV_CODEC_ID_ADPCM_SBPRO_3)
|
|
||||||
AV_CODEC_ID_ADPCM_SBPRO_2 = AVCodecID(C.AV_CODEC_ID_ADPCM_SBPRO_2)
|
|
||||||
AV_CODEC_ID_ADPCM_THP = AVCodecID(C.AV_CODEC_ID_ADPCM_THP)
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_AMV = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_AMV)
|
|
||||||
AV_CODEC_ID_ADPCM_EA_R1 = AVCodecID(C.AV_CODEC_ID_ADPCM_EA_R1)
|
|
||||||
AV_CODEC_ID_ADPCM_EA_R3 = AVCodecID(C.AV_CODEC_ID_ADPCM_EA_R3)
|
|
||||||
AV_CODEC_ID_ADPCM_EA_R2 = AVCodecID(C.AV_CODEC_ID_ADPCM_EA_R2)
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_EA_SEAD = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_EA_SEAD)
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_EA_EACS = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_EA_EACS)
|
|
||||||
AV_CODEC_ID_ADPCM_EA_XAS = AVCodecID(C.AV_CODEC_ID_ADPCM_EA_XAS)
|
|
||||||
AV_CODEC_ID_ADPCM_EA_MAXIS_XA = AVCodecID(C.AV_CODEC_ID_ADPCM_EA_MAXIS_XA)
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_ISS = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_ISS)
|
|
||||||
AV_CODEC_ID_ADPCM_G722 = AVCodecID(C.AV_CODEC_ID_ADPCM_G722)
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_APC = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_APC)
|
|
||||||
AV_CODEC_ID_ADPCM_VIMA = AVCodecID(C.AV_CODEC_ID_ADPCM_VIMA)
|
|
||||||
AV_CODEC_ID_ADPCM_AFC = AVCodecID(C.AV_CODEC_ID_ADPCM_AFC)
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_OKI = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_OKI)
|
|
||||||
AV_CODEC_ID_ADPCM_DTK = AVCodecID(C.AV_CODEC_ID_ADPCM_DTK)
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_RAD = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_RAD)
|
|
||||||
AV_CODEC_ID_ADPCM_G726LE = AVCodecID(C.AV_CODEC_ID_ADPCM_G726LE)
|
|
||||||
AV_CODEC_ID_ADPCM_THP_LE = AVCodecID(C.AV_CODEC_ID_ADPCM_THP_LE)
|
|
||||||
AV_CODEC_ID_ADPCM_PSX = AVCodecID(C.AV_CODEC_ID_ADPCM_PSX)
|
|
||||||
AV_CODEC_ID_ADPCM_AICA = AVCodecID(C.AV_CODEC_ID_ADPCM_AICA)
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_DAT4 = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_DAT4)
|
|
||||||
AV_CODEC_ID_ADPCM_MTAF = AVCodecID(C.AV_CODEC_ID_ADPCM_MTAF)
|
|
||||||
AV_CODEC_ID_ADPCM_AGM = AVCodecID(C.AV_CODEC_ID_ADPCM_AGM)
|
|
||||||
AV_CODEC_ID_ADPCM_ARGO = AVCodecID(C.AV_CODEC_ID_ADPCM_ARGO)
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_SSI = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_SSI)
|
|
||||||
AV_CODEC_ID_ADPCM_ZORK = AVCodecID(C.AV_CODEC_ID_ADPCM_ZORK)
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_APM = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_APM)
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_ALP = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_ALP)
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_MTF = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_MTF)
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_CUNNING = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_CUNNING)
|
|
||||||
AV_CODEC_ID_ADPCM_IMA_MOFLEX = AVCodecID(C.AV_CODEC_ID_ADPCM_IMA_MOFLEX)
|
|
||||||
|
|
||||||
// AMR
|
|
||||||
AV_CODEC_ID_AMR_NB = AVCodecID(C.AV_CODEC_ID_AMR_NB)
|
|
||||||
AV_CODEC_ID_AMR_WB = AVCodecID(C.AV_CODEC_ID_AMR_WB)
|
|
||||||
|
|
||||||
// RealAudio codecs
|
|
||||||
AV_CODEC_ID_RA_144 = AVCodecID(C.AV_CODEC_ID_RA_144)
|
|
||||||
AV_CODEC_ID_RA_288 = AVCodecID(C.AV_CODEC_ID_RA_288)
|
|
||||||
|
|
||||||
// various DPCM codecs
|
|
||||||
AV_CODEC_ID_ROQ_DPCM = AVCodecID(C.AV_CODEC_ID_ROQ_DPCM)
|
|
||||||
AV_CODEC_ID_INTERPLAY_DPCM = AVCodecID(C.AV_CODEC_ID_INTERPLAY_DPCM)
|
|
||||||
AV_CODEC_ID_XAN_DPCM = AVCodecID(C.AV_CODEC_ID_XAN_DPCM)
|
|
||||||
AV_CODEC_ID_SOL_DPCM = AVCodecID(C.AV_CODEC_ID_SOL_DPCM)
|
|
||||||
|
|
||||||
AV_CODEC_ID_SDX2_DPCM = AVCodecID(C.AV_CODEC_ID_SDX2_DPCM)
|
|
||||||
AV_CODEC_ID_GREMLIN_DPCM = AVCodecID(C.AV_CODEC_ID_GREMLIN_DPCM)
|
|
||||||
AV_CODEC_ID_DERF_DPCM = AVCodecID(C.AV_CODEC_ID_DERF_DPCM)
|
|
||||||
|
|
||||||
// audio codecs
|
|
||||||
AV_CODEC_ID_MP2 = AVCodecID(C.AV_CODEC_ID_MP2)
|
|
||||||
AV_CODEC_ID_MP3 = AVCodecID(C.AV_CODEC_ID_MP3)
|
|
||||||
AV_CODEC_ID_AAC = AVCodecID(C.AV_CODEC_ID_AAC)
|
|
||||||
AV_CODEC_ID_AC3 = AVCodecID(C.AV_CODEC_ID_AC3)
|
|
||||||
AV_CODEC_ID_DTS = AVCodecID(C.AV_CODEC_ID_DTS)
|
|
||||||
AV_CODEC_ID_VORBIS = AVCodecID(C.AV_CODEC_ID_VORBIS)
|
|
||||||
AV_CODEC_ID_DVAUDIO = AVCodecID(C.AV_CODEC_ID_DVAUDIO)
|
|
||||||
AV_CODEC_ID_WMAV1 = AVCodecID(C.AV_CODEC_ID_WMAV1)
|
|
||||||
AV_CODEC_ID_WMAV2 = AVCodecID(C.AV_CODEC_ID_WMAV2)
|
|
||||||
AV_CODEC_ID_MACE3 = AVCodecID(C.AV_CODEC_ID_MACE3)
|
|
||||||
AV_CODEC_ID_MACE6 = AVCodecID(C.AV_CODEC_ID_MACE6)
|
|
||||||
AV_CODEC_ID_VMDAUDIO = AVCodecID(C.AV_CODEC_ID_VMDAUDIO)
|
|
||||||
AV_CODEC_ID_FLAC = AVCodecID(C.AV_CODEC_ID_FLAC)
|
|
||||||
AV_CODEC_ID_MP3ADU = AVCodecID(C.AV_CODEC_ID_MP3ADU)
|
|
||||||
AV_CODEC_ID_MP3ON4 = AVCodecID(C.AV_CODEC_ID_MP3ON4)
|
|
||||||
AV_CODEC_ID_SHORTEN = AVCodecID(C.AV_CODEC_ID_SHORTEN)
|
|
||||||
AV_CODEC_ID_ALAC = AVCodecID(C.AV_CODEC_ID_ALAC)
|
|
||||||
AV_CODEC_ID_WESTWOOD_SND1 = AVCodecID(C.AV_CODEC_ID_WESTWOOD_SND1)
|
|
||||||
AV_CODEC_ID_GSM = AVCodecID(C.AV_CODEC_ID_GSM)
|
|
||||||
AV_CODEC_ID_QDM2 = AVCodecID(C.AV_CODEC_ID_QDM2)
|
|
||||||
AV_CODEC_ID_COOK = AVCodecID(C.AV_CODEC_ID_COOK)
|
|
||||||
AV_CODEC_ID_TRUESPEECH = AVCodecID(C.AV_CODEC_ID_TRUESPEECH)
|
|
||||||
AV_CODEC_ID_TTA = AVCodecID(C.AV_CODEC_ID_TTA)
|
|
||||||
AV_CODEC_ID_SMACKAUDIO = AVCodecID(C.AV_CODEC_ID_SMACKAUDIO)
|
|
||||||
AV_CODEC_ID_QCELP = AVCodecID(C.AV_CODEC_ID_QCELP)
|
|
||||||
AV_CODEC_ID_WAVPACK = AVCodecID(C.AV_CODEC_ID_WAVPACK)
|
|
||||||
AV_CODEC_ID_DSICINAUDIO = AVCodecID(C.AV_CODEC_ID_DSICINAUDIO)
|
|
||||||
AV_CODEC_ID_IMC = AVCodecID(C.AV_CODEC_ID_IMC)
|
|
||||||
AV_CODEC_ID_MUSEPACK7 = AVCodecID(C.AV_CODEC_ID_MUSEPACK7)
|
|
||||||
AV_CODEC_ID_MLP = AVCodecID(C.AV_CODEC_ID_MLP)
|
|
||||||
AV_CODEC_ID_GSM_MS = AVCodecID(C.AV_CODEC_ID_GSM_MS)
|
|
||||||
AV_CODEC_ID_ATRAC3 = AVCodecID(C.AV_CODEC_ID_ATRAC3)
|
|
||||||
AV_CODEC_ID_APE = AVCodecID(C.AV_CODEC_ID_APE)
|
|
||||||
AV_CODEC_ID_NELLYMOSER = AVCodecID(C.AV_CODEC_ID_NELLYMOSER)
|
|
||||||
AV_CODEC_ID_MUSEPACK8 = AVCodecID(C.AV_CODEC_ID_MUSEPACK8)
|
|
||||||
AV_CODEC_ID_SPEEX = AVCodecID(C.AV_CODEC_ID_SPEEX)
|
|
||||||
AV_CODEC_ID_WMAVOICE = AVCodecID(C.AV_CODEC_ID_WMAVOICE)
|
|
||||||
AV_CODEC_ID_WMAPRO = AVCodecID(C.AV_CODEC_ID_WMAPRO)
|
|
||||||
AV_CODEC_ID_WMALOSSLESS = AVCodecID(C.AV_CODEC_ID_WMALOSSLESS)
|
|
||||||
AV_CODEC_ID_ATRAC3P = AVCodecID(C.AV_CODEC_ID_ATRAC3P)
|
|
||||||
AV_CODEC_ID_EAC3 = AVCodecID(C.AV_CODEC_ID_EAC3)
|
|
||||||
AV_CODEC_ID_SIPR = AVCodecID(C.AV_CODEC_ID_SIPR)
|
|
||||||
AV_CODEC_ID_MP1 = AVCodecID(C.AV_CODEC_ID_MP1)
|
|
||||||
AV_CODEC_ID_TWINVQ = AVCodecID(C.AV_CODEC_ID_TWINVQ)
|
|
||||||
AV_CODEC_ID_TRUEHD = AVCodecID(C.AV_CODEC_ID_TRUEHD)
|
|
||||||
AV_CODEC_ID_MP4ALS = AVCodecID(C.AV_CODEC_ID_MP4ALS)
|
|
||||||
AV_CODEC_ID_ATRAC1 = AVCodecID(C.AV_CODEC_ID_ATRAC1)
|
|
||||||
AV_CODEC_ID_BINKAUDIO_RDFT = AVCodecID(C.AV_CODEC_ID_BINKAUDIO_RDFT)
|
|
||||||
AV_CODEC_ID_BINKAUDIO_DCT = AVCodecID(C.AV_CODEC_ID_BINKAUDIO_DCT)
|
|
||||||
AV_CODEC_ID_AAC_LATM = AVCodecID(C.AV_CODEC_ID_AAC_LATM)
|
|
||||||
AV_CODEC_ID_QDMC = AVCodecID(C.AV_CODEC_ID_QDMC)
|
|
||||||
AV_CODEC_ID_CELT = AVCodecID(C.AV_CODEC_ID_CELT)
|
|
||||||
AV_CODEC_ID_G723_1 = AVCodecID(C.AV_CODEC_ID_G723_1)
|
|
||||||
AV_CODEC_ID_G729 = AVCodecID(C.AV_CODEC_ID_G729)
|
|
||||||
AV_CODEC_ID_8SVX_EXP = AVCodecID(C.AV_CODEC_ID_8SVX_EXP)
|
|
||||||
AV_CODEC_ID_8SVX_FIB = AVCodecID(C.AV_CODEC_ID_8SVX_FIB)
|
|
||||||
AV_CODEC_ID_BMV_AUDIO = AVCodecID(C.AV_CODEC_ID_BMV_AUDIO)
|
|
||||||
AV_CODEC_ID_RALF = AVCodecID(C.AV_CODEC_ID_RALF)
|
|
||||||
AV_CODEC_ID_IAC = AVCodecID(C.AV_CODEC_ID_IAC)
|
|
||||||
AV_CODEC_ID_ILBC = AVCodecID(C.AV_CODEC_ID_ILBC)
|
|
||||||
AV_CODEC_ID_OPUS = AVCodecID(C.AV_CODEC_ID_OPUS)
|
|
||||||
AV_CODEC_ID_COMFORT_NOISE = AVCodecID(C.AV_CODEC_ID_COMFORT_NOISE)
|
|
||||||
AV_CODEC_ID_TAK = AVCodecID(C.AV_CODEC_ID_TAK)
|
|
||||||
AV_CODEC_ID_METASOUND = AVCodecID(C.AV_CODEC_ID_METASOUND)
|
|
||||||
AV_CODEC_ID_PAF_AUDIO = AVCodecID(C.AV_CODEC_ID_PAF_AUDIO)
|
|
||||||
AV_CODEC_ID_ON2AVC = AVCodecID(C.AV_CODEC_ID_ON2AVC)
|
|
||||||
AV_CODEC_ID_DSS_SP = AVCodecID(C.AV_CODEC_ID_DSS_SP)
|
|
||||||
AV_CODEC_ID_CODEC2 = AVCodecID(C.AV_CODEC_ID_CODEC2)
|
|
||||||
|
|
||||||
AV_CODEC_ID_FFWAVESYNTH = AVCodecID(C.AV_CODEC_ID_FFWAVESYNTH)
|
|
||||||
AV_CODEC_ID_SONIC = AVCodecID(C.AV_CODEC_ID_SONIC)
|
|
||||||
AV_CODEC_ID_SONIC_LS = AVCodecID(C.AV_CODEC_ID_SONIC_LS)
|
|
||||||
AV_CODEC_ID_EVRC = AVCodecID(C.AV_CODEC_ID_EVRC)
|
|
||||||
AV_CODEC_ID_SMV = AVCodecID(C.AV_CODEC_ID_SMV)
|
|
||||||
AV_CODEC_ID_DSD_LSBF = AVCodecID(C.AV_CODEC_ID_DSD_LSBF)
|
|
||||||
AV_CODEC_ID_DSD_MSBF = AVCodecID(C.AV_CODEC_ID_DSD_MSBF)
|
|
||||||
AV_CODEC_ID_DSD_LSBF_PLANAR = AVCodecID(C.AV_CODEC_ID_DSD_LSBF_PLANAR)
|
|
||||||
AV_CODEC_ID_DSD_MSBF_PLANAR = AVCodecID(C.AV_CODEC_ID_DSD_MSBF_PLANAR)
|
|
||||||
AV_CODEC_ID_4GV = AVCodecID(C.AV_CODEC_ID_4GV)
|
|
||||||
AV_CODEC_ID_INTERPLAY_ACM = AVCodecID(C.AV_CODEC_ID_INTERPLAY_ACM)
|
|
||||||
AV_CODEC_ID_XMA1 = AVCodecID(C.AV_CODEC_ID_XMA1)
|
|
||||||
AV_CODEC_ID_XMA2 = AVCodecID(C.AV_CODEC_ID_XMA2)
|
|
||||||
AV_CODEC_ID_DST = AVCodecID(C.AV_CODEC_ID_DST)
|
|
||||||
AV_CODEC_ID_ATRAC3AL = AVCodecID(C.AV_CODEC_ID_ATRAC3AL)
|
|
||||||
AV_CODEC_ID_ATRAC3PAL = AVCodecID(C.AV_CODEC_ID_ATRAC3PAL)
|
|
||||||
AV_CODEC_ID_DOLBY_E = AVCodecID(C.AV_CODEC_ID_DOLBY_E)
|
|
||||||
AV_CODEC_ID_APTX = AVCodecID(C.AV_CODEC_ID_APTX)
|
|
||||||
AV_CODEC_ID_APTX_HD = AVCodecID(C.AV_CODEC_ID_APTX_HD)
|
|
||||||
AV_CODEC_ID_SBC = AVCodecID(C.AV_CODEC_ID_SBC)
|
|
||||||
AV_CODEC_ID_ATRAC9 = AVCodecID(C.AV_CODEC_ID_ATRAC9)
|
|
||||||
AV_CODEC_ID_HCOM = AVCodecID(C.AV_CODEC_ID_HCOM)
|
|
||||||
AV_CODEC_ID_ACELP_KELVIN = AVCodecID(C.AV_CODEC_ID_ACELP_KELVIN)
|
|
||||||
AV_CODEC_ID_MPEGH_3D_AUDIO = AVCodecID(C.AV_CODEC_ID_MPEGH_3D_AUDIO)
|
|
||||||
AV_CODEC_ID_SIREN = AVCodecID(C.AV_CODEC_ID_SIREN)
|
|
||||||
AV_CODEC_ID_HCA = AVCodecID(C.AV_CODEC_ID_HCA)
|
|
||||||
AV_CODEC_ID_FASTAUDIO = AVCodecID(C.AV_CODEC_ID_FASTAUDIO)
|
|
||||||
|
|
||||||
// subtitle codecs
|
|
||||||
AV_CODEC_ID_FIRST_SUBTITLE = AVCodecID(C.AV_CODEC_ID_FIRST_SUBTITLE)
|
|
||||||
AV_CODEC_ID_DVD_SUBTITLE = AVCodecID(C.AV_CODEC_ID_DVD_SUBTITLE)
|
|
||||||
AV_CODEC_ID_DVB_SUBTITLE = AVCodecID(C.AV_CODEC_ID_DVB_SUBTITLE)
|
|
||||||
AV_CODEC_ID_TEXT = AVCodecID(C.AV_CODEC_ID_TEXT)
|
|
||||||
AV_CODEC_ID_XSUB = AVCodecID(C.AV_CODEC_ID_XSUB)
|
|
||||||
AV_CODEC_ID_SSA = AVCodecID(C.AV_CODEC_ID_SSA)
|
|
||||||
AV_CODEC_ID_MOV_TEXT = AVCodecID(C.AV_CODEC_ID_MOV_TEXT)
|
|
||||||
AV_CODEC_ID_HDMV_PGS_SUBTITLE = AVCodecID(C.AV_CODEC_ID_HDMV_PGS_SUBTITLE)
|
|
||||||
AV_CODEC_ID_DVB_TELETEXT = AVCodecID(C.AV_CODEC_ID_DVB_TELETEXT)
|
|
||||||
AV_CODEC_ID_SRT = AVCodecID(C.AV_CODEC_ID_SRT)
|
|
||||||
|
|
||||||
AV_CODEC_ID_MICRODVD = AVCodecID(C.AV_CODEC_ID_MICRODVD)
|
|
||||||
AV_CODEC_ID_EIA_608 = AVCodecID(C.AV_CODEC_ID_EIA_608)
|
|
||||||
AV_CODEC_ID_JACOSUB = AVCodecID(C.AV_CODEC_ID_JACOSUB)
|
|
||||||
AV_CODEC_ID_SAMI = AVCodecID(C.AV_CODEC_ID_SAMI)
|
|
||||||
AV_CODEC_ID_REALTEXT = AVCodecID(C.AV_CODEC_ID_REALTEXT)
|
|
||||||
AV_CODEC_ID_STL = AVCodecID(C.AV_CODEC_ID_STL)
|
|
||||||
AV_CODEC_ID_SUBVIEWER1 = AVCodecID(C.AV_CODEC_ID_SUBVIEWER1)
|
|
||||||
AV_CODEC_ID_SUBVIEWER = AVCodecID(C.AV_CODEC_ID_SUBVIEWER)
|
|
||||||
AV_CODEC_ID_SUBRIP = AVCodecID(C.AV_CODEC_ID_SUBRIP)
|
|
||||||
AV_CODEC_ID_WEBVTT = AVCodecID(C.AV_CODEC_ID_WEBVTT)
|
|
||||||
AV_CODEC_ID_MPL2 = AVCodecID(C.AV_CODEC_ID_MPL2)
|
|
||||||
AV_CODEC_ID_VPLAYER = AVCodecID(C.AV_CODEC_ID_VPLAYER)
|
|
||||||
AV_CODEC_ID_PJS = AVCodecID(C.AV_CODEC_ID_PJS)
|
|
||||||
AV_CODEC_ID_ASS = AVCodecID(C.AV_CODEC_ID_ASS)
|
|
||||||
AV_CODEC_ID_HDMV_TEXT_SUBTITLE = AVCodecID(C.AV_CODEC_ID_HDMV_TEXT_SUBTITLE)
|
|
||||||
AV_CODEC_ID_TTML = AVCodecID(C.AV_CODEC_ID_TTML)
|
|
||||||
AV_CODEC_ID_ARIB_CAPTION = AVCodecID(C.AV_CODEC_ID_ARIB_CAPTION)
|
|
||||||
|
|
||||||
// other specific kind of codecs (generally used for attachments)
|
|
||||||
AV_CODEC_ID_FIRST_UNKNOWN = AVCodecID(C.AV_CODEC_ID_FIRST_UNKNOWN)
|
|
||||||
AV_CODEC_ID_TTF = AVCodecID(C.AV_CODEC_ID_TTF)
|
|
||||||
|
|
||||||
AV_CODEC_ID_SCTE_35 = AVCodecID(C.AV_CODEC_ID_SCTE_35)
|
|
||||||
AV_CODEC_ID_EPG = AVCodecID(C.AV_CODEC_ID_EPG)
|
|
||||||
AV_CODEC_ID_BINTEXT = AVCodecID(C.AV_CODEC_ID_BINTEXT)
|
|
||||||
AV_CODEC_ID_XBIN = AVCodecID(C.AV_CODEC_ID_XBIN)
|
|
||||||
AV_CODEC_ID_IDF = AVCodecID(C.AV_CODEC_ID_IDF)
|
|
||||||
AV_CODEC_ID_OTF = AVCodecID(C.AV_CODEC_ID_OTF)
|
|
||||||
AV_CODEC_ID_SMPTE_KLV = AVCodecID(C.AV_CODEC_ID_SMPTE_KLV)
|
|
||||||
AV_CODEC_ID_DVD_NAV = AVCodecID(C.AV_CODEC_ID_DVD_NAV)
|
|
||||||
AV_CODEC_ID_TIMED_ID3 = AVCodecID(C.AV_CODEC_ID_TIMED_ID3)
|
|
||||||
AV_CODEC_ID_BIN_DATA = AVCodecID(C.AV_CODEC_ID_BIN_DATA)
|
|
||||||
|
|
||||||
// codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it
|
|
||||||
AV_CODEC_ID_PROBE = AVCodecID(C.AV_CODEC_ID_PROBE)
|
|
||||||
|
|
||||||
// Fake codec to indicate a raw MPEG-2 TS stream (only used by libavformat)
|
|
||||||
AV_CODEC_ID_MPEG2TS = AVCodecID(C.AV_CODEC_ID_MPEG2TS)
|
|
||||||
|
|
||||||
// Fake codec to indicate a MPEG-4 Systems stream (only used by libavformat)
|
|
||||||
AV_CODEC_ID_MPEG4SYSTEMS = AVCodecID(C.AV_CODEC_ID_MPEG4SYSTEMS)
|
|
||||||
|
|
||||||
// Dummy codec for streams containing only metadata information.
|
|
||||||
AV_CODEC_ID_FFMETADATA = AVCodecID(C.AV_CODEC_ID_FFMETADATA)
|
|
||||||
// Passthrough codec, AVFrames wrapped in AVPacket.
|
|
||||||
AV_CODEC_ID_WRAPPED_AVFRAME = AVCodecID(C.AV_CODEC_ID_WRAPPED_AVFRAME)
|
|
||||||
)
|
|
||||||
|
|
||||||
// AvCodecGetType gets the type of the given codec.
|
|
||||||
func AvCodecGetType(codecID AVCodecID) AVMediaType {
|
|
||||||
return (AVMediaType)(C.avcodec_get_type((C.enum_AVCodecID)(codecID)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvCodecGetName gets the name of a codec.
|
|
||||||
func AvCodecGetName(codecID AVCodecID) string {
|
|
||||||
return C.GoString(C.avcodec_get_name((C.enum_AVCodecID)(codecID)))
|
|
||||||
}
|
|
@@ -1,479 +0,0 @@
|
|||||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
|
||||||
// Use of this source code is governed by a MIT
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package ffmpeg
|
|
||||||
|
|
||||||
/*
|
|
||||||
#include <libavcodec/codec_par.h>
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
import "unsafe"
|
|
||||||
|
|
||||||
// AVFieldOrder
|
|
||||||
type AVFieldOrder = C.enum_AVFieldOrder
|
|
||||||
|
|
||||||
const (
|
|
||||||
AV_FIELD_UNKNOWN = AVFieldOrder(C.AV_FIELD_UNKNOWN)
|
|
||||||
AV_FIELD_PROGRESSIVE = AVFieldOrder(C.AV_FIELD_PROGRESSIVE)
|
|
||||||
AV_FIELD_TT = AVFieldOrder(C.AV_FIELD_TT)
|
|
||||||
AV_FIELD_BB = AVFieldOrder(C.AV_FIELD_BB)
|
|
||||||
AV_FIELD_TB = AVFieldOrder(C.AV_FIELD_TB)
|
|
||||||
AV_FIELD_BT = AVFieldOrder(C.AV_FIELD_BT)
|
|
||||||
)
|
|
||||||
|
|
||||||
// AVCodecParameters
|
|
||||||
type AVCodecParameters C.struct_AVCodecParameters
|
|
||||||
|
|
||||||
// GetCodecType gets `AVCodecParameters.codectype` value.
|
|
||||||
func (par *AVCodecParameters) GetCodecType() AVMediaType {
|
|
||||||
return (AVMediaType)(par.codec_type)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetCodecType sets `AVCodecParameters.codectype` value.
|
|
||||||
func (par *AVCodecParameters) SetCodecType(v AVMediaType) {
|
|
||||||
par.codec_type = (C.enum_AVMediaType)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCodecTypeAddr gets `AVCodecParameters.codectype` address.
|
|
||||||
func (par *AVCodecParameters) GetCodecTypeAddr() *AVMediaType {
|
|
||||||
return (*AVMediaType)(unsafe.Pointer(&par.codec_type))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCodecId gets `AVCodecParameters.codec_id` value.
|
|
||||||
func (par *AVCodecParameters) GetCodecId() AVCodecID {
|
|
||||||
return (AVCodecID)(par.codec_id)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetCodecId sets `AVCodecParameters.codec_id` value.
|
|
||||||
func (par *AVCodecParameters) SetCodecId(v AVCodecID) {
|
|
||||||
par.codec_id = (C.enum_AVCodecID)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCodecIdAddr gets `AVCodecParameters.codec_id` address.
|
|
||||||
func (par *AVCodecParameters) GetCodecIdAddr() *AVCodecID {
|
|
||||||
return (*AVCodecID)(unsafe.Pointer(&par.codec_id))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCodecTag gets `AVCodecParameters.codec_tag` value.
|
|
||||||
func (par *AVCodecParameters) GetCodecTag() uint32 {
|
|
||||||
return (uint32)(par.codec_tag)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetCodecTag sets `AVCodecParameters.codec_tag` value.
|
|
||||||
func (par *AVCodecParameters) SetCodecTag(v uint32) {
|
|
||||||
par.codec_tag = (C.uint)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCodecTagAddr gets `AVCodecParameters.codec_tag` address.
|
|
||||||
func (par *AVCodecParameters) GetCodecTagAddr() *uint32 {
|
|
||||||
return (*uint32)(&par.codec_tag)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetExtradata gets `AVCodecParameters.extradata` value.
|
|
||||||
func (par *AVCodecParameters) GetExtradata() *uint8 {
|
|
||||||
return (*uint8)(par.extradata)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetExtradata sets `AVCodecParameters.extradata` value.
|
|
||||||
func (par *AVCodecParameters) SetExtradata(v *uint8) {
|
|
||||||
par.extradata = (*C.uint8_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetExtradataAddr gets `AVCodecParameters.extradata` address.
|
|
||||||
func (par *AVCodecParameters) GetExtradataAddr() *uint8 {
|
|
||||||
return (*uint8)(unsafe.Pointer(&par.extradata))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetExtradataSize gets `AVCodecParameters.extradata_size` value.
|
|
||||||
func (par *AVCodecParameters) GetExtradataSize() int32 {
|
|
||||||
return (int32)(par.extradata_size)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetExtradataSize sets `AVCodecParameters.extradata_size` value.
|
|
||||||
func (par *AVCodecParameters) SetExtradataSize(v int32) {
|
|
||||||
par.extradata_size = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetExtradataSizeAddr gets `AVCodecParameters.extradata_size` address.
|
|
||||||
func (par *AVCodecParameters) GetExtradataSizeAddr() *int32 {
|
|
||||||
return (*int32)(&par.extradata_size)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetFormat gets `AVCodecParameters.format` value.
|
|
||||||
func (par *AVCodecParameters) GetFormat() int32 {
|
|
||||||
return (int32)(par.format)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetFormat sets `AVCodecParameters.format` value.
|
|
||||||
func (par *AVCodecParameters) SetFormat(v int32) {
|
|
||||||
par.format = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetFormatAddr gets `AVCodecParameters.format` address.
|
|
||||||
func (par *AVCodecParameters) GetFormatAddr() *int32 {
|
|
||||||
return (*int32)(&par.format)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetBitRate gets `AVCodecParameters.bit_rate` value.
|
|
||||||
func (par *AVCodecParameters) GetBitRate() int64 {
|
|
||||||
return (int64)(par.bit_rate)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetBitRate sets `AVCodecParameters.bit_rate` value.
|
|
||||||
func (par *AVCodecParameters) SetBitRate(v int64) {
|
|
||||||
par.bit_rate = (C.int64_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetBitRateAddr gets `AVCodecParameters.bit_rate` address.
|
|
||||||
func (par *AVCodecParameters) GetBitRateAddr() *int64 {
|
|
||||||
return (*int64)(&par.bit_rate)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetBitsPerCodedSample gets `AVCodecParameters.bits_per_coded_sample` value.
|
|
||||||
func (par *AVCodecParameters) GetBitsPerCodedSample() int32 {
|
|
||||||
return (int32)(par.bits_per_coded_sample)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetBitsPerCodedSample sets `AVCodecParameters.bits_per_coded_sample` value.
|
|
||||||
func (par *AVCodecParameters) SetBitsPerCodedSample(v int32) {
|
|
||||||
par.bits_per_coded_sample = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetBitsPerCodedSampleAddr gets `AVCodecParameters.bits_per_coded_sample` address.
|
|
||||||
func (par *AVCodecParameters) GetBitsPerCodedSampleAddr() *int32 {
|
|
||||||
return (*int32)(&par.bits_per_coded_sample)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetBitsPerRawSample gets `AVCodecParameters.bits_per_raw_sample` value.
|
|
||||||
func (par *AVCodecParameters) GetBitsPerRawSample() int32 {
|
|
||||||
return (int32)(par.bits_per_raw_sample)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetBitsPerRawSample sets `AVCodecParameters.bits_per_raw_sample` value.
|
|
||||||
func (par *AVCodecParameters) SetBitsPerRawSample(v int32) {
|
|
||||||
par.bits_per_raw_sample = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetBitsPerRawSampleAddr gets `AVCodecParameters.bits_per_raw_sample` address.
|
|
||||||
func (par *AVCodecParameters) GetBitsPerRawSampleAddr() *int32 {
|
|
||||||
return (*int32)(&par.bits_per_raw_sample)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetProfile gets `AVCodecParameters.profile` value.
|
|
||||||
func (par *AVCodecParameters) GetProfile() int32 {
|
|
||||||
return (int32)(par.profile)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetProfile sets `AVCodecParameters.profile` value.
|
|
||||||
func (par *AVCodecParameters) SetProfile(v int32) {
|
|
||||||
par.profile = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetProfileAddr gets `AVCodecParameters.profile` address.
|
|
||||||
func (par *AVCodecParameters) GetProfileAddr() *int32 {
|
|
||||||
return (*int32)(&par.profile)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetLevel gets `AVCodecParameters.level` value.
|
|
||||||
func (par *AVCodecParameters) GetLevel() int32 {
|
|
||||||
return (int32)(par.level)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetLevel sets `AVCodecParameters.level` value.
|
|
||||||
func (par *AVCodecParameters) SetLevel(v int32) {
|
|
||||||
par.level = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetLevelAddr gets `AVCodecParameters.level` address.
|
|
||||||
func (par *AVCodecParameters) GetLevelAddr() *int32 {
|
|
||||||
return (*int32)(&par.level)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetWidth gets `AVCodecParameters.width` value.
|
|
||||||
func (par *AVCodecParameters) GetWidth() int32 {
|
|
||||||
return (int32)(par.width)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetWidth sets `AVCodecParameters.width` value.
|
|
||||||
func (par *AVCodecParameters) SetWidth(v int32) {
|
|
||||||
par.width = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetWidthAddr gets `AVCodecParameters.width` address.
|
|
||||||
func (par *AVCodecParameters) GetWidthAddr() *int32 {
|
|
||||||
return (*int32)(&par.width)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetHeight gets `AVCodecParameters.height` value.
|
|
||||||
func (par *AVCodecParameters) GetHeight() int32 {
|
|
||||||
return (int32)(par.height)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetHeight sets `AVCodecParameters.height` value.
|
|
||||||
func (par *AVCodecParameters) SetHeight(v int32) {
|
|
||||||
par.height = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetHeightAddr gets `AVCodecParameters.height` address.
|
|
||||||
func (par *AVCodecParameters) GetHeightAddr() *int32 {
|
|
||||||
return (*int32)(&par.height)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSampleAspectRatio gets `AVCodecParameters.sample_aspect_ratio` value.
|
|
||||||
func (par *AVCodecParameters) GetSampleAspectRatio() AVRational {
|
|
||||||
return (AVRational)(par.sample_aspect_ratio)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetSampleAspectRatio sets `AVCodecParameters.sample_aspect_ratio` value.
|
|
||||||
func (par *AVCodecParameters) SetSampleAspectRatio(v AVRational) {
|
|
||||||
par.sample_aspect_ratio = (C.struct_AVRational)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSampleAspectRatioAddr gets `AVCodecParameters.sample_aspect_ratio` address.
|
|
||||||
func (par *AVCodecParameters) GetSampleAspectRatioAddr() *AVRational {
|
|
||||||
return (*AVRational)(&par.sample_aspect_ratio)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetFieldOrder gets `AVCodecParameters.field_order` value.
|
|
||||||
func (par *AVCodecParameters) GetFieldOrder() AVFieldOrder {
|
|
||||||
return (AVFieldOrder)(par.field_order)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetFieldOrder sets `AVCodecParameters.field_order` value.
|
|
||||||
func (par *AVCodecParameters) SetFieldOrder(v AVFieldOrder) {
|
|
||||||
par.field_order = (C.enum_AVFieldOrder)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetFieldOrderAddr gets `AVCodecParameters.field_order` address.
|
|
||||||
func (par *AVCodecParameters) GetFieldOrderAddr() *AVFieldOrder {
|
|
||||||
return (*AVFieldOrder)(unsafe.Pointer(&par.field_order))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetColorRange gets `AVCodecParameters.colorrange` value.
|
|
||||||
func (par *AVCodecParameters) GetColorRange() AVColorRange {
|
|
||||||
return (AVColorRange)(par.color_range)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetColorRange sets `AVCodecParameters.colorrange` value.
|
|
||||||
func (par *AVCodecParameters) SetColorRange(v AVColorRange) {
|
|
||||||
par.color_range = (C.enum_AVColorRange)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetColorRangeAddr gets `AVCodecParameters.colorrange` address.
|
|
||||||
func (par *AVCodecParameters) GetColorRangeAddr() *AVColorRange {
|
|
||||||
return (*AVColorRange)(unsafe.Pointer(&par.color_range))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetColorPrimaries gets `AVCodecParameters.color_primaries` value.
|
|
||||||
func (par *AVCodecParameters) GetColorPrimaries() AVColorPrimaries {
|
|
||||||
return (AVColorPrimaries)(par.color_primaries)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetColorPrimaries sets `AVCodecParameters.color_primaries` value.
|
|
||||||
func (par *AVCodecParameters) SetColorPrimaries(v AVColorPrimaries) {
|
|
||||||
par.color_primaries = (C.enum_AVColorPrimaries)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetColorPrimariesAddr gets `AVCodecParameters.color_primaries` address.
|
|
||||||
func (par *AVCodecParameters) GetColorPrimariesAddr() *AVColorPrimaries {
|
|
||||||
return (*AVColorPrimaries)(unsafe.Pointer(&par.color_primaries))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetColorTrc gets `AVCodecParameters.color_trc` value.
|
|
||||||
func (par *AVCodecParameters) GetColorTrc() AVColorTransferCharacteristic {
|
|
||||||
return (AVColorTransferCharacteristic)(par.color_trc)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetColorTrc sets `AVCodecParameters.color_trc` value.
|
|
||||||
func (par *AVCodecParameters) SetColorTrc(v AVColorTransferCharacteristic) {
|
|
||||||
par.color_trc = (C.enum_AVColorTransferCharacteristic)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetColorTrcAddr gets `AVCodecParameters.color_trc` address.
|
|
||||||
func (par *AVCodecParameters) GetColorTrcAddr() *AVColorTransferCharacteristic {
|
|
||||||
return (*AVColorTransferCharacteristic)(unsafe.Pointer(&par.color_trc))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetColorSpace gets `AVCodecParameters.color_space` value.
|
|
||||||
func (par *AVCodecParameters) GetColorSpace() AVColorSpace {
|
|
||||||
return (AVColorSpace)(par.color_space)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetColorSpace sets `AVCodecParameters.color_space` value.
|
|
||||||
func (par *AVCodecParameters) SetColorSpace(v AVColorSpace) {
|
|
||||||
par.color_space = (C.enum_AVColorSpace)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetColorSpaceAddr gets `AVCodecParameters.color_space` address.
|
|
||||||
func (par *AVCodecParameters) GetColorSpaceAddr() *AVColorSpace {
|
|
||||||
return (*AVColorSpace)(unsafe.Pointer(&par.color_space))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetChromaLocation gets `AVCodecParameters.chroma_location` value.
|
|
||||||
func (par *AVCodecParameters) GetChromaLocation() AVChromaLocation {
|
|
||||||
return (AVChromaLocation)(par.chroma_location)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetChromaLocation sets `AVCodecParameters.chroma_location` value.
|
|
||||||
func (par *AVCodecParameters) SetChromaLocation(v AVChromaLocation) {
|
|
||||||
par.chroma_location = (C.enum_AVChromaLocation)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetChromaLocationAddr gets `AVCodecParameters.chroma_location` address.
|
|
||||||
func (par *AVCodecParameters) GetChromaLocationAddr() *AVChromaLocation {
|
|
||||||
return (*AVChromaLocation)(unsafe.Pointer(&par.chroma_location))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetVideoDelay gets `AVCodecParameters.video_delay` value.
|
|
||||||
func (par *AVCodecParameters) GetVideoDelay() int32 {
|
|
||||||
return (int32)(par.video_delay)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetVideoDelay sets `AVCodecParameters.video_delay` value.
|
|
||||||
func (par *AVCodecParameters) SetVideoDelay(v int32) {
|
|
||||||
par.video_delay = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetVideoDelayAddr gets `AVCodecParameters.video_delay` address.
|
|
||||||
func (par *AVCodecParameters) GetVideoDelayAddr() *int32 {
|
|
||||||
return (*int32)(&par.video_delay)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetChannelLayout gets `AVCodecParameters.channel_layout` value.
|
|
||||||
func (par *AVCodecParameters) GetChannelLayout() uint64 {
|
|
||||||
return (uint64)(par.channel_layout)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetChannelLayout sets `AVCodecParameters.channel_layout` value.
|
|
||||||
func (par *AVCodecParameters) SetChannelLayout(v uint64) {
|
|
||||||
par.channel_layout = (C.uint64_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetChannelLayoutAddr gets `AVCodecParameters.channel_layout` address.
|
|
||||||
func (par *AVCodecParameters) GetChannelLayoutAddr() *uint64 {
|
|
||||||
return (*uint64)(&par.channel_layout)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetChannels gets `AVCodecParameters.channels` value.
|
|
||||||
func (par *AVCodecParameters) GetChannels() int32 {
|
|
||||||
return (int32)(par.channels)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetChannels sets `AVCodecParameters.channels` value.
|
|
||||||
func (par *AVCodecParameters) SetChannels(v int32) {
|
|
||||||
par.channels = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetChannelsAddr gets `AVCodecParameters.channels` address.
|
|
||||||
func (par *AVCodecParameters) GetChannelsAddr() *int32 {
|
|
||||||
return (*int32)(&par.channels)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSampleRate gets `AVCodecParameters.sample_rate` value.
|
|
||||||
func (par *AVCodecParameters) GetSampleRate() int32 {
|
|
||||||
return (int32)(par.sample_rate)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetSampleRate sets `AVCodecParameters.sample_rate` value.
|
|
||||||
func (par *AVCodecParameters) SetSampleRate(v int32) {
|
|
||||||
par.sample_rate = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSampleRateAddr gets `AVCodecParameters.sample_rate` address.
|
|
||||||
func (par *AVCodecParameters) GetSampleRateAddr() *int32 {
|
|
||||||
return (*int32)(&par.sample_rate)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetBlockAlign gets `AVCodecParameters.block_align` value.
|
|
||||||
func (par *AVCodecParameters) GetBlockAlign() int32 {
|
|
||||||
return (int32)(par.block_align)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetBlockAlign sets `AVCodecParameters.block_align` value.
|
|
||||||
func (par *AVCodecParameters) SetBlockAlign(v int32) {
|
|
||||||
par.block_align = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetBlockAlignAddr gets `AVCodecParameters.block_align` address.
|
|
||||||
func (par *AVCodecParameters) GetBlockAlignAddr() *int32 {
|
|
||||||
return (*int32)(&par.block_align)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetFrameSize gets `AVCodecParameters.frame_size` value.
|
|
||||||
func (par *AVCodecParameters) GetFrameSize() int32 {
|
|
||||||
return (int32)(par.frame_size)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetFrameSize sets `AVCodecParameters.frame_size` value.
|
|
||||||
func (par *AVCodecParameters) SetFrameSize(v int32) {
|
|
||||||
par.frame_size = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetFrameSizeAddr gets `AVCodecParameters.frame_size` address.
|
|
||||||
func (par *AVCodecParameters) GetFrameSizeAddr() *int32 {
|
|
||||||
return (*int32)(&par.frame_size)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetInitialPadding gets `AVCodecParameters.initial_padding` value.
|
|
||||||
func (par *AVCodecParameters) GetInitialPadding() int32 {
|
|
||||||
return (int32)(par.initial_padding)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetInitialPadding sets `AVCodecParameters.initial_padding` value.
|
|
||||||
func (par *AVCodecParameters) SetInitialPadding(v int32) {
|
|
||||||
par.initial_padding = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetInitialPaddingAddr gets `AVCodecParameters.initial_padding` address.
|
|
||||||
func (par *AVCodecParameters) GetInitialPaddingAddr() *int32 {
|
|
||||||
return (*int32)(&par.initial_padding)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetTrailingPadding gets `AVCodecParameters.trailing_padding` value.
|
|
||||||
func (par *AVCodecParameters) GetTrailingPadding() int32 {
|
|
||||||
return (int32)(par.trailing_padding)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetTrailingPadding sets `AVCodecParameters.trailing_padding` value.
|
|
||||||
func (par *AVCodecParameters) SetTrailingPadding(v int32) {
|
|
||||||
par.trailing_padding = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetTrailingPaddingAddr gets `AVCodecParameters.trailing_padding` address.
|
|
||||||
func (par *AVCodecParameters) GetTrailingPaddingAddr() *int32 {
|
|
||||||
return (*int32)(&par.trailing_padding)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSeekPreroll gets `AVCodecParameters.seek_preroll` value.
|
|
||||||
func (par *AVCodecParameters) GetSeekPreroll() int32 {
|
|
||||||
return (int32)(par.seek_preroll)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetSeekPreroll sets `AVCodecParameters.seek_preroll` value.
|
|
||||||
func (par *AVCodecParameters) SetSeekPreroll(v int32) {
|
|
||||||
par.seek_preroll = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSeekPrerollAddr gets `AVCodecParameters.seek_preroll` address.
|
|
||||||
func (par *AVCodecParameters) GetSeekPrerollAddr() *int32 {
|
|
||||||
return (*int32)(&par.seek_preroll)
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvCodecParametersAlloc allocates a new AVCodecParameters and set its fields to default values
|
|
||||||
// (unknown/invalid/0). The returned struct must be freed with AVCodecParametersFree().
|
|
||||||
func AvCodecParametersAlloc() *AVCodecParameters {
|
|
||||||
return (*AVCodecParameters)(C.avcodec_parameters_alloc())
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvCodecParametersFree frees an AVCodecParameters instance and everything associated with it and
|
|
||||||
// write NULL to the supplied pointer.
|
|
||||||
func AvCodecParametersFree(par **AVCodecParameters) {
|
|
||||||
C.avcodec_parameters_free((**C.struct_AVCodecParameters)(unsafe.Pointer(par)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvCodecParametersCopy copies the contents of src to dst.
|
|
||||||
func AvCodecParametersCopy(dst, src *AVCodecParameters) int32 {
|
|
||||||
return (int32)(C.avcodec_parameters_copy((*C.struct_AVCodecParameters)(dst),
|
|
||||||
(*C.struct_AVCodecParameters)(src)))
|
|
||||||
}
|
|
@@ -25,7 +25,7 @@ func AvMediacodecDefaultInit(avctx *AVCodecContext, ctx *AVMediaCodecContext, su
|
|||||||
(*C.struct_AVMediaCodecContext)(ctx), VoidPointer(surface)))
|
(*C.struct_AVMediaCodecContext)(ctx), VoidPointer(surface)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvMediacodecDefaultFree frees the MediaCodec context
|
// AvMediacodecDefaultFree frees the MediaCodec context.
|
||||||
func AvMediacodecDefaultFree(avctx *AVCodecContext) {
|
func AvMediacodecDefaultFree(avctx *AVCodecContext) {
|
||||||
C.av_mediacodec_default_free((*C.struct_AVCodecContext)(avctx))
|
C.av_mediacodec_default_free((*C.struct_AVCodecContext)(avctx))
|
||||||
}
|
}
|
||||||
|
@@ -1,497 +0,0 @@
|
|||||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
|
||||||
// Use of this source code is governed by a MIT
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package ffmpeg
|
|
||||||
|
|
||||||
/*
|
|
||||||
#include <libavcodec/packet.h>
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
import "unsafe"
|
|
||||||
|
|
||||||
// AVPacketSideDataType
|
|
||||||
type AVPacketSideDataType = C.enum_AVPacketSideDataType
|
|
||||||
|
|
||||||
const (
|
|
||||||
AV_PKT_DATA_PALETTE = AVPacketSideDataType(C.AV_PKT_DATA_PALETTE)
|
|
||||||
AV_PKT_DATA_NEW_EXTRADATA = AVPacketSideDataType(C.AV_PKT_DATA_NEW_EXTRADATA)
|
|
||||||
AV_PKT_DATA_PARAM_CHANGE = AVPacketSideDataType(C.AV_PKT_DATA_PARAM_CHANGE)
|
|
||||||
AV_PKT_DATA_H263_MB_INFO = AVPacketSideDataType(C.AV_PKT_DATA_H263_MB_INFO)
|
|
||||||
AV_PKT_DATA_REPLAYGAIN = AVPacketSideDataType(C.AV_PKT_DATA_REPLAYGAIN)
|
|
||||||
AV_PKT_DATA_DISPLAYMATRIX = AVPacketSideDataType(C.AV_PKT_DATA_DISPLAYMATRIX)
|
|
||||||
AV_PKT_DATA_STEREO3D = AVPacketSideDataType(C.AV_PKT_DATA_STEREO3D)
|
|
||||||
AV_PKT_DATA_AUDIO_SERVICE_TYPE = AVPacketSideDataType(C.AV_PKT_DATA_AUDIO_SERVICE_TYPE)
|
|
||||||
AV_PKT_DATA_QUALITY_STATS = AVPacketSideDataType(C.AV_PKT_DATA_QUALITY_STATS)
|
|
||||||
AV_PKT_DATA_FALLBACK_TRACK = AVPacketSideDataType(C.AV_PKT_DATA_FALLBACK_TRACK)
|
|
||||||
AV_PKT_DATA_CPB_PROPERTIES = AVPacketSideDataType(C.AV_PKT_DATA_CPB_PROPERTIES)
|
|
||||||
AV_PKT_DATA_SKIP_SAMPLES = AVPacketSideDataType(C.AV_PKT_DATA_SKIP_SAMPLES)
|
|
||||||
AV_PKT_DATA_JP_DUALMONO = AVPacketSideDataType(C.AV_PKT_DATA_JP_DUALMONO)
|
|
||||||
AV_PKT_DATA_STRINGS_METADATA = AVPacketSideDataType(C.AV_PKT_DATA_STRINGS_METADATA)
|
|
||||||
AV_PKT_DATA_SUBTITLE_POSITION = AVPacketSideDataType(C.AV_PKT_DATA_SUBTITLE_POSITION)
|
|
||||||
AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL = AVPacketSideDataType(C.AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL)
|
|
||||||
AV_PKT_DATA_WEBVTT_IDENTIFIER = AVPacketSideDataType(C.AV_PKT_DATA_WEBVTT_IDENTIFIER)
|
|
||||||
AV_PKT_DATA_WEBVTT_SETTINGS = AVPacketSideDataType(C.AV_PKT_DATA_WEBVTT_SETTINGS)
|
|
||||||
AV_PKT_DATA_METADATA_UPDATE = AVPacketSideDataType(C.AV_PKT_DATA_METADATA_UPDATE)
|
|
||||||
AV_PKT_DATA_MPEGTS_STREAM_ID = AVPacketSideDataType(C.AV_PKT_DATA_MPEGTS_STREAM_ID)
|
|
||||||
AV_PKT_DATA_MASTERING_DISPLAY_METADATA = AVPacketSideDataType(C.AV_PKT_DATA_MASTERING_DISPLAY_METADATA)
|
|
||||||
AV_PKT_DATA_SPHERICAL = AVPacketSideDataType(C.AV_PKT_DATA_SPHERICAL)
|
|
||||||
AV_PKT_DATA_CONTENT_LIGHT_LEVEL = AVPacketSideDataType(C.AV_PKT_DATA_CONTENT_LIGHT_LEVEL)
|
|
||||||
AV_PKT_DATA_A53_CC = AVPacketSideDataType(C.AV_PKT_DATA_A53_CC)
|
|
||||||
AV_PKT_DATA_ENCRYPTION_INIT_INFO = AVPacketSideDataType(C.AV_PKT_DATA_ENCRYPTION_INIT_INFO)
|
|
||||||
AV_PKT_DATA_ENCRYPTION_INFO = AVPacketSideDataType(C.AV_PKT_DATA_ENCRYPTION_INFO)
|
|
||||||
AV_PKT_DATA_AFD = AVPacketSideDataType(C.AV_PKT_DATA_AFD)
|
|
||||||
AV_PKT_DATA_PRFT = AVPacketSideDataType(C.AV_PKT_DATA_PRFT)
|
|
||||||
AV_PKT_DATA_ICC_PROFILE = AVPacketSideDataType(C.AV_PKT_DATA_ICC_PROFILE)
|
|
||||||
AV_PKT_DATA_DOVI_CONF = AVPacketSideDataType(C.AV_PKT_DATA_DOVI_CONF)
|
|
||||||
AV_PKT_DATA_S12M_TIMECODE = AVPacketSideDataType(C.AV_PKT_DATA_S12M_TIMECODE)
|
|
||||||
AV_PKT_DATA_NB = AVPacketSideDataType(C.AV_PKT_DATA_NB)
|
|
||||||
)
|
|
||||||
|
|
||||||
const (
|
|
||||||
// Deprecated: No use.
|
|
||||||
AV_PKT_DATA_QUALITY_FACTOR = AVPacketSideDataType(C.AV_PKT_DATA_QUALITY_FACTOR)
|
|
||||||
)
|
|
||||||
|
|
||||||
// AVPacketSideData
|
|
||||||
type AVPacketSideData C.struct_AVPacketSideData
|
|
||||||
|
|
||||||
// GetData gets `AVPacketSideData.data` value.
|
|
||||||
func (psd *AVPacketSideData) GetData() *uint8 {
|
|
||||||
return (*uint8)(psd.data)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetData sets `AVPacketSideData.data` value.
|
|
||||||
func (psd *AVPacketSideData) SetData(v *uint8) {
|
|
||||||
psd.data = (*C.uint8_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDataAddr gets `AVPacketSideData.data` address.
|
|
||||||
func (psd *AVPacketSideData) GetDataAddr() **uint8 {
|
|
||||||
return (**uint8)(unsafe.Pointer(&psd.data))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSize gets `AVPacketSideData.size` value.
|
|
||||||
func (psd *AVPacketSideData) GetSize() int32 {
|
|
||||||
return (int32)(psd.size)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetSize sets `AVPacketSideData.size` value.
|
|
||||||
func (psd *AVPacketSideData) SetSize(v int32) {
|
|
||||||
psd.size = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSizeAddr gets `AVPacketSideData.size` address.
|
|
||||||
func (psd *AVPacketSideData) GetSizeAddr() *int32 {
|
|
||||||
return (*int32)(&psd.size)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetType gets `AVPacketSideData.type` value.
|
|
||||||
func (psd *AVPacketSideData) GetType() AVPacketSideDataType {
|
|
||||||
return (AVPacketSideDataType)(psd._type)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetType sets `AVPacketSideData.type` value.
|
|
||||||
func (psd *AVPacketSideData) SetType(v AVPacketSideDataType) {
|
|
||||||
psd._type = (C.enum_AVPacketSideDataType)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetTypeAddr gets `AVPacketSideData.type` address.
|
|
||||||
func (psd *AVPacketSideData) GetTypeAddr() *AVPacketSideDataType {
|
|
||||||
return (*AVPacketSideDataType)(&psd._type)
|
|
||||||
}
|
|
||||||
|
|
||||||
// AVPacket
|
|
||||||
type AVPacket C.struct_AVPacket
|
|
||||||
|
|
||||||
// GetBuf gets `AVPacket.buf` value.
|
|
||||||
func (pkt *AVPacket) GetBuf() *AVBufferRef {
|
|
||||||
return (*AVBufferRef)(pkt.buf)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetBuf sets `AVPacket.buf` value.
|
|
||||||
func (pkt *AVPacket) SetBuf(v *AVBufferRef) {
|
|
||||||
pkt.buf = (*C.struct_AVBufferRef)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetBufAddr gets `AVPacket.buf` address.
|
|
||||||
func (pkt *AVPacket) GetBufAddr() **AVBufferRef {
|
|
||||||
return (**AVBufferRef)(unsafe.Pointer(&pkt.buf))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetPts gets `AVPacket.pts` value.
|
|
||||||
func (pkt *AVPacket) GetPts() int64 {
|
|
||||||
return (int64)(pkt.pts)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetPts sets `AVPacket.pts` value.
|
|
||||||
func (pkt *AVPacket) SetPts(v int64) {
|
|
||||||
pkt.pts = (C.int64_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetPtsAddr gets `AVPacket.pts` address.
|
|
||||||
func (pkt *AVPacket) GetPtsAddr() *int64 {
|
|
||||||
return (*int64)(&pkt.pts)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDts gets `AVPacket.dts` value.
|
|
||||||
func (pkt *AVPacket) GetDts() int64 {
|
|
||||||
return (int64)(pkt.dts)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetDts sets `AVPacket.dts` value.
|
|
||||||
func (pkt *AVPacket) SetDts(v int64) {
|
|
||||||
pkt.dts = (C.int64_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDtsAddr gets `AVPacket.dts` address.
|
|
||||||
func (pkt *AVPacket) GetDtsAddr() *int64 {
|
|
||||||
return (*int64)(&pkt.dts)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetData gets `AVPacket.data` value.
|
|
||||||
func (pkt *AVPacket) GetData() *uint8 {
|
|
||||||
return (*uint8)(pkt.data)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetData sets `AVPacket.data` value.
|
|
||||||
func (pkt *AVPacket) SetData(v *uint8) {
|
|
||||||
pkt.data = (*C.uint8_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDataAddr gets `AVPacket.data` address.
|
|
||||||
func (pkt *AVPacket) GetDataAddr() **uint8 {
|
|
||||||
return (**uint8)(unsafe.Pointer(&pkt.data))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSize gets `AVPacket.size` value.
|
|
||||||
func (pkt *AVPacket) GetSize() int32 {
|
|
||||||
return (int32)(pkt.size)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetSize sets `AVPacket.size` value.
|
|
||||||
func (pkt *AVPacket) SetSize(v int32) {
|
|
||||||
pkt.size = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSizeAddr gets `AVPacket.size` address.
|
|
||||||
func (pkt *AVPacket) GetSizeAddr() *int32 {
|
|
||||||
return (*int32)(&pkt.size)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetStreamIndex gets `AVPacket.stream_index` value.
|
|
||||||
func (pkt *AVPacket) GetStreamIndex() int32 {
|
|
||||||
return (int32)(pkt.stream_index)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetStreamIndex sets `AVPacket.stream_index` value.
|
|
||||||
func (pkt *AVPacket) SetStreamIndex(v int32) {
|
|
||||||
pkt.stream_index = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetStreamIndexAddr gets `AVPacket.stream_index` address.
|
|
||||||
func (pkt *AVPacket) GetStreamIndexAddr() *int32 {
|
|
||||||
return (*int32)(&pkt.stream_index)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetFlags gets `AVPacket.flags` value.
|
|
||||||
func (pkt *AVPacket) GetFlags() int32 {
|
|
||||||
return (int32)(pkt.flags)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetFlags sets `AVPacket.flags` value.
|
|
||||||
func (pkt *AVPacket) SetFlags(v int32) {
|
|
||||||
pkt.flags = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetFlagsAddr gets `AVPacket.flags` address.
|
|
||||||
func (pkt *AVPacket) GetFlagsAddr() *int32 {
|
|
||||||
return (*int32)(&pkt.flags)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSideData gets `AVPacket.side_data` value.
|
|
||||||
func (pkt *AVPacket) GetSideData() *AVPacketSideData {
|
|
||||||
return (*AVPacketSideData)(pkt.side_data)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetSideData sets `AVPacket.side_data` value.
|
|
||||||
func (pkt *AVPacket) SetSideData(v *AVPacketSideData) {
|
|
||||||
pkt.side_data = (*C.struct_AVPacketSideData)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSideDataAddr gets `AVPacket.side_data` address.
|
|
||||||
func (pkt *AVPacket) GetSideDataAddr() **AVPacketSideData {
|
|
||||||
return (**AVPacketSideData)(unsafe.Pointer(&pkt.side_data))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSideDataElems gets `AVPacket.side_data_elems` value.
|
|
||||||
func (pkt *AVPacket) GetSideDataElems() int32 {
|
|
||||||
return (int32)(pkt.side_data_elems)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetSideDataElems sets `AVPacket.side_data_elems` value.
|
|
||||||
func (pkt *AVPacket) SetSideDataElems(v int32) {
|
|
||||||
pkt.side_data_elems = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSideDataElemsAddr gets `AVPacket.side_data_elems` address.
|
|
||||||
func (pkt *AVPacket) GetSideDataElemsAddr() *int32 {
|
|
||||||
return (*int32)(&pkt.side_data_elems)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDuration gets `AVPacket.duration` value.
|
|
||||||
func (pkt *AVPacket) GetDuration() int64 {
|
|
||||||
return (int64)(pkt.duration)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetDuration sets `AVPacket.duration` value.
|
|
||||||
func (pkt *AVPacket) SetDuration(v int64) {
|
|
||||||
pkt.duration = (C.int64_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDurationAddr gets `AVPacket.duration` address.
|
|
||||||
func (pkt *AVPacket) GetDurationAddr() *int64 {
|
|
||||||
return (*int64)(&pkt.duration)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetPos gets `AVPacket.pos` value.
|
|
||||||
func (pkt *AVPacket) GetPos() int64 {
|
|
||||||
return (int64)(pkt.pos)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetPos sets `AVPacket.pos` value.
|
|
||||||
func (pkt *AVPacket) SetPos(v int64) {
|
|
||||||
pkt.pos = (C.int64_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetPosAddr gets `AVPacket.pos` address.
|
|
||||||
func (pkt *AVPacket) GetPosAddr() *int64 {
|
|
||||||
return (*int64)(&pkt.pos)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: No use.
|
|
||||||
//
|
|
||||||
// GetConvergenceDuration gets `AVPacket.convergence_duration` value.
|
|
||||||
func (pkt *AVPacket) GetConvergenceDuration() int64 {
|
|
||||||
return (int64)(pkt.convergence_duration)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: No use.
|
|
||||||
//
|
|
||||||
// SetConvergenceDuration sets `AVPacket.convergence_duration` value.
|
|
||||||
func (pkt *AVPacket) SetConvergenceDuration(v int64) {
|
|
||||||
pkt.convergence_duration = (C.int64_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: No use.
|
|
||||||
//
|
|
||||||
// GetConvergenceDurationAddr gets `AVPacket.convergence_duration` address.
|
|
||||||
func (pkt *AVPacket) GetConvergenceDurationAddr() *int64 {
|
|
||||||
return (*int64)(&pkt.convergence_duration)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: No use.
|
|
||||||
//
|
|
||||||
// AVPacketList
|
|
||||||
type AVPacketList C.struct_AVPacketList
|
|
||||||
|
|
||||||
// Getgets `AVPacketList.next` value.
|
|
||||||
func (pl *AVPacketList) Get() *AVPacketList {
|
|
||||||
return (*AVPacketList)(pl.next)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set sets `AVPacketList.next` value.
|
|
||||||
func (pl *AVPacketList) Set(v *AVPacketList) {
|
|
||||||
pl.next = (*C.struct_AVPacketList)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetAddr gets `AVPacketList.next` address.
|
|
||||||
func (pl *AVPacketList) GetAddr() **AVPacketList {
|
|
||||||
return (**AVPacketList)(unsafe.Pointer(&pl.next))
|
|
||||||
}
|
|
||||||
|
|
||||||
const (
|
|
||||||
AV_PKT_FLAG_KEY = C.AV_PKT_FLAG_KEY
|
|
||||||
AV_PKT_FLAG_CORRUPT = C.AV_PKT_FLAG_CORRUPT
|
|
||||||
AV_PKT_FLAG_DISCARD = C.AV_PKT_FLAG_DISCARD
|
|
||||||
AV_PKT_FLAG_TRUSTED = C.AV_PKT_FLAG_TRUSTED
|
|
||||||
AV_PKT_FLAG_DISPOSABLE = C.AV_PKT_FLAG_DISPOSABLE
|
|
||||||
)
|
|
||||||
|
|
||||||
// AVSideDataParamChangeFlags
|
|
||||||
type AVSideDataParamChangeFlags = C.enum_AVSideDataParamChangeFlags
|
|
||||||
|
|
||||||
const (
|
|
||||||
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT = AVSideDataParamChangeFlags(C.AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT)
|
|
||||||
AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = AVSideDataParamChangeFlags(C.AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)
|
|
||||||
AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE = AVSideDataParamChangeFlags(C.AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE)
|
|
||||||
AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS = AVSideDataParamChangeFlags(C.AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS)
|
|
||||||
)
|
|
||||||
|
|
||||||
// AvPacketAlloc allocates an AVPacket and set its fields to default values. The resulting
|
|
||||||
// struct must be freed using AVPacketFree().
|
|
||||||
func AvPacketAlloc() *AVPacket {
|
|
||||||
return (*AVPacket)(C.av_packet_alloc())
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvPacketClone creates a new packet that references the same data as src.
|
|
||||||
func AvPacketClone(pkt *AVPacket) *AVPacket {
|
|
||||||
return (*AVPacket)(C.av_packet_clone((*C.struct_AVPacket)(pkt)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvPacketFree frees the packet, if the packet is reference counted, it will be
|
|
||||||
// unreferenced first.
|
|
||||||
func AvPacketFree(pkt **AVPacket) {
|
|
||||||
C.av_packet_free((**C.struct_AVPacket)(unsafe.Pointer(pkt)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: No use.
|
|
||||||
//
|
|
||||||
// AvInitPacket initializes optional fields of a packet with default values.
|
|
||||||
func AvInitPacket(pkt *AVPacket) {
|
|
||||||
C.av_init_packet((*C.struct_AVPacket)(pkt))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvNewPacket allocates the payload of a packet and initialize its fields with
|
|
||||||
// default values.
|
|
||||||
func AvNewPacket(pkt *AVPacket, size int32) int32 {
|
|
||||||
return (int32)(C.av_new_packet((*C.struct_AVPacket)(pkt), (C.int)(size)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvShrinkPacket reduces packet size, correctly zeroing padding
|
|
||||||
func AvShrinkPacket(pkt *AVPacket, size int32) {
|
|
||||||
C.av_shrink_packet((*C.struct_AVPacket)(pkt), (C.int)(size))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvGrowPacket increases packet size, correctly zeroing padding
|
|
||||||
func AvGrowPacket(pkt *AVPacket, growBy int32) int32 {
|
|
||||||
return (int32)(C.av_grow_packet((*C.struct_AVPacket)(pkt), (C.int)(growBy)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvPacketFromData initializes a reference-counted packet from AvMalloc()ed data.
|
|
||||||
func AvPacketFromData(pkt *AVPacket, data *uint8, size int32) int32 {
|
|
||||||
return (int32)(C.av_packet_from_data((*C.struct_AVPacket)(pkt),
|
|
||||||
(*C.uint8_t)(data), (C.int)(size)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use AVPacketRef() or AVPacketMakeRefcounted() instead.
|
|
||||||
//
|
|
||||||
// AvDupPacket
|
|
||||||
func AvDupPacket(pkt *AVPacket) {
|
|
||||||
C.av_dup_packet((*C.struct_AVPacket)(pkt))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use AVPacketRef instead.
|
|
||||||
//
|
|
||||||
// AvCopyPacket copies packet, including contents
|
|
||||||
func AvCopyPacket(dst, src *AVPacket) int32 {
|
|
||||||
return (int32)(C.av_copy_packet((*C.struct_AVPacket)(dst), (*C.struct_AVPacket)(src)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use AVPacketCopyProps instead.
|
|
||||||
//
|
|
||||||
// AvCopyPacketSideData copies packet side data
|
|
||||||
func AvCopyPacketSideData(dst, src *AVPacket) int32 {
|
|
||||||
return (int32)(C.av_copy_packet_side_data((*C.struct_AVPacket)(dst), (*C.struct_AVPacket)(src)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use AVPacketUnref() instead.
|
|
||||||
//
|
|
||||||
// AvFreePacket frees a packet.
|
|
||||||
func AvFreePacket(pkt *AVPacket) {
|
|
||||||
C.av_free_packet((*C.struct_AVPacket)(pkt))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvPacketNewSideData allocates new information of a packet.
|
|
||||||
func AvPacketNewSideData(pkt *AVPacket, _type AVPacketSideDataType, size int32) *uint8 {
|
|
||||||
return (*uint8)(C.av_packet_new_side_data((*C.struct_AVPacket)(pkt),
|
|
||||||
(C.enum_AVPacketSideDataType)(_type), (C.int)(size)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvPacketAddSideData wraps an existing array as a packet side data.
|
|
||||||
func AvPacketAddSideData(pkt *AVPacket, _type AVPacketSideDataType, data *uint8, size uintptr) int32 {
|
|
||||||
return (int32)(C.av_packet_add_side_data((*C.struct_AVPacket)(pkt),
|
|
||||||
(C.enum_AVPacketSideDataType)(_type), (*C.uint8_t)(data), (C.size_t)(size)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvPacketShrinkSideData shrinks the already allocated side data buffer.
|
|
||||||
func AvPacketShrinkSideData(pkt *AVPacket, _type AVPacketSideDataType, size int32) int32 {
|
|
||||||
return (int32)(C.av_packet_shrink_side_data((*C.struct_AVPacket)(pkt),
|
|
||||||
(C.enum_AVPacketSideDataType)(_type), (C.int)(size)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvPacketGetSideData gets side information from packet.
|
|
||||||
func AvPacketGetSideData(pkt *AVPacket, _type AVPacketSideDataType, size *int32) *uint8 {
|
|
||||||
return (*uint8)(C.av_packet_get_side_data((*C.struct_AVPacket)(pkt),
|
|
||||||
(C.enum_AVPacketSideDataType)(_type), (*C.int)(size)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: No use.
|
|
||||||
//
|
|
||||||
// AvPacketMergeSideData
|
|
||||||
func AvPacketMergeSideData(pkt *AVPacket) int32 {
|
|
||||||
return (int32)(C.av_packet_merge_side_data((*C.struct_AVPacket)(pkt)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: No use.
|
|
||||||
//
|
|
||||||
// AvPacketSplitSideData
|
|
||||||
func AvPacketSplitSideData(pkt *AVPacket) int32 {
|
|
||||||
return (int32)(C.av_packet_split_side_data((*C.struct_AVPacket)(pkt)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvPacketPackDictionary packs a dictionary for use in side_data.
|
|
||||||
func AvPacketPackDictionary(dict *AVDictionary, size *int32) *uint8 {
|
|
||||||
return (*uint8)(C.av_packet_pack_dictionary((*C.struct_AVDictionary)(dict),
|
|
||||||
(*C.int)(size)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvPacketUnpackDictionary unpacks a dictionary from side_data.
|
|
||||||
func AvPacketUnpackDictionary(data *uint8, size int32, dict **AVDictionary) int32 {
|
|
||||||
return (int32)(C.av_packet_unpack_dictionary((*C.uint8_t)(data), (C.int)(size),
|
|
||||||
(**C.struct_AVDictionary)(unsafe.Pointer(dict))))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvPacketFreeSideData is a convenience function to free all the side data stored.
|
|
||||||
func AvPacketFreeSideData(pkt *AVPacket) {
|
|
||||||
C.av_packet_free_side_data((*C.struct_AVPacket)(pkt))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvPacketRef setups a new reference to the data described by a given packet
|
|
||||||
func AvPacketRef(dst, src *AVPacket) int32 {
|
|
||||||
return (int32)(C.av_packet_ref((*C.struct_AVPacket)(dst), (*C.struct_AVPacket)(src)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvPacketUnref unreferences the buffer referenced by the packet and reset the
|
|
||||||
// remaining packet fields to their default values.
|
|
||||||
func AvPacketUnref(pkt *AVPacket) {
|
|
||||||
C.av_packet_unref((*C.struct_AVPacket)(pkt))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvPacketMoveRef moves every field in src to dst and reset src.
|
|
||||||
func AvPacketMoveRef(dst, src *AVPacket) {
|
|
||||||
C.av_packet_move_ref((*C.struct_AVPacket)(dst), (*C.struct_AVPacket)(src))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvPacketCopyProps copies only "properties" fields from src to dst.
|
|
||||||
func AvPacketCopyProps(dst, src *AVPacket) int32 {
|
|
||||||
return (int32)(C.av_packet_copy_props((*C.struct_AVPacket)(dst), (*C.struct_AVPacket)(src)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvPacketMakeRefcounted ensures the data described by a given packet is reference counted.
|
|
||||||
func AvPacketMakeRefcounted(pkt *AVPacket) {
|
|
||||||
C.av_packet_make_refcounted((*C.struct_AVPacket)(pkt))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvPacketMakeWritable creates a writable reference for the data described by a given packet,
|
|
||||||
// avoiding data copy if possible.
|
|
||||||
func AvPacketMakeWritable(pkt *AVPacket) {
|
|
||||||
C.av_packet_make_writable((*C.struct_AVPacket)(pkt))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvPacketRescaleTs converts valid timing fields (timestamps / durations) in a packet from one
|
|
||||||
// timebase to another. Timestamps with unknown values (AV_NOPTS_VALUE) will be ignored.
|
|
||||||
func AvPacketRescaleTs(pkt *AVPacket, tbSrc, tbDst AVRational) {
|
|
||||||
C.av_packet_rescale_ts((*C.struct_AVPacket)(pkt),
|
|
||||||
(C.struct_AVRational)(tbSrc), (C.struct_AVRational)(tbDst))
|
|
||||||
}
|
|
@@ -11,6 +11,7 @@ package ffmpeg
|
|||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
|
// AVVideotoolboxContext
|
||||||
type AVVideotoolboxContext C.struct_AVVideotoolboxContext
|
type AVVideotoolboxContext C.struct_AVVideotoolboxContext
|
||||||
|
|
||||||
// AvVideotoolboxAllocContext allocates and initializes a Videotoolbox context.
|
// AvVideotoolboxAllocContext allocates and initializes a Videotoolbox context.
|
||||||
|
@@ -362,8 +362,6 @@ func (dc *AVDeviceCapabilitiesQuery) GetFpsAddr() *AVRational {
|
|||||||
|
|
||||||
// NONEED: av_device_capabilities
|
// NONEED: av_device_capabilities
|
||||||
|
|
||||||
// Deprecated: No use.
|
|
||||||
//
|
|
||||||
// AvDeviceCapabilitiesCreate initializes capabilities probing API based on AVOption API.
|
// AvDeviceCapabilitiesCreate initializes capabilities probing API based on AVOption API.
|
||||||
func AvDeviceCapabilitiesCreate(caps **AVDeviceCapabilitiesQuery,
|
func AvDeviceCapabilitiesCreate(caps **AVDeviceCapabilitiesQuery,
|
||||||
s *AVFormatContext, deviceOptions **AVDictionary) int32 {
|
s *AVFormatContext, deviceOptions **AVDictionary) int32 {
|
||||||
@@ -371,8 +369,6 @@ func AvDeviceCapabilitiesCreate(caps **AVDeviceCapabilitiesQuery,
|
|||||||
(*C.struct_AVFormatContext)(s), (**C.struct_AVDictionary)(unsafe.Pointer(deviceOptions))))
|
(*C.struct_AVFormatContext)(s), (**C.struct_AVDictionary)(unsafe.Pointer(deviceOptions))))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: No use.
|
|
||||||
//
|
|
||||||
// AvDeviceCapabilitiesFree frees resources created by AvDeviceCapabilitiesCreate()
|
// AvDeviceCapabilitiesFree frees resources created by AvDeviceCapabilitiesCreate()
|
||||||
func AvDeviceCapabilitiesFree(caps **AVDeviceCapabilitiesQuery, s *AVFormatContext) {
|
func AvDeviceCapabilitiesFree(caps **AVDeviceCapabilitiesQuery, s *AVFormatContext) {
|
||||||
C.avdevice_capabilities_free((**C.struct_AVDeviceCapabilitiesQuery)(unsafe.Pointer(caps)),
|
C.avdevice_capabilities_free((**C.struct_AVDeviceCapabilitiesQuery)(unsafe.Pointer(caps)),
|
||||||
|
51
avfilter.go
51
avfilter.go
@@ -180,7 +180,7 @@ func (fltc *AVFilterContext) GetName() string {
|
|||||||
|
|
||||||
// SetName sets `AVFilterContext.name` value.
|
// SetName sets `AVFilterContext.name` value.
|
||||||
func (fltc *AVFilterContext) SetName(v string) {
|
func (fltc *AVFilterContext) SetName(v string) {
|
||||||
C.free(unsafe.Pointer(fltc.name))
|
FreePointer(fltc.name)
|
||||||
fltc.name, _ = StringCasting(v)
|
fltc.name, _ = StringCasting(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -471,51 +471,6 @@ func (fltc *AVFilterContext) GetExtraHwFramesAddr() *int32 {
|
|||||||
// AVFilterFormatsConfig
|
// AVFilterFormatsConfig
|
||||||
type AVFilterFormatsConfig C.struct_AVFilterFormatsConfig
|
type AVFilterFormatsConfig C.struct_AVFilterFormatsConfig
|
||||||
|
|
||||||
// GetFormats gets `AVFilterFormatsConfig.formats` value.
|
|
||||||
func (fltf *AVFilterFormatsConfig) GetFormats() *AVFilterFormats {
|
|
||||||
return (*AVFilterFormats)(fltf.formats)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetFormats sets `AVFilterFormatsConfig.formats` value.
|
|
||||||
func (fltf *AVFilterFormatsConfig) SetFormats(v *AVFilterFormats) {
|
|
||||||
fltf.formats = (*C.struct_AVFilterFormats)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetFormatsAddr gets `AVFilterFormatsConfig.formats` address.
|
|
||||||
func (fltf *AVFilterFormatsConfig) GetFormatsAddr() **AVFilterFormats {
|
|
||||||
return (**AVFilterFormats)(unsafe.Pointer(&fltf.formats))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSamplerates gets `AVFilterFormatsConfig.samplerates` value.
|
|
||||||
func (fltf *AVFilterFormatsConfig) GetSamplerates() *AVFilterFormats {
|
|
||||||
return (*AVFilterFormats)(fltf.samplerates)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetSamplerates sets `AVFilterFormatsConfig.samplerates` value.
|
|
||||||
func (fltf *AVFilterFormatsConfig) SetSamplerates(v *AVFilterFormats) {
|
|
||||||
fltf.samplerates = (*C.struct_AVFilterFormats)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSampleratesAddr gets `AVFilterFormatsConfig.samplerates` address.
|
|
||||||
func (fltf *AVFilterFormatsConfig) GetSampleratesAddr() **AVFilterFormats {
|
|
||||||
return (**AVFilterFormats)(unsafe.Pointer(&fltf.samplerates))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetChannelLayouts gets `AVFilterFormatsConfig.channel_layouts` value.
|
|
||||||
func (fltf *AVFilterFormatsConfig) GetChannelLayouts() *AVFilterChannelLayouts {
|
|
||||||
return (*AVFilterChannelLayouts)(fltf.channel_layouts)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetChannelLayouts sets `AVFilterFormatsConfig.channel_layouts` value.
|
|
||||||
func (fltf *AVFilterFormatsConfig) SetChannelLayouts(v *AVFilterChannelLayouts) {
|
|
||||||
fltf.channel_layouts = (*C.struct_AVFilterChannelLayouts)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetChannelLayoutsAddr gets `AVFilterFormatsConfig.channel_layouts` address.
|
|
||||||
func (fltf *AVFilterFormatsConfig) GetChannelLayoutsAddr() **AVFilterChannelLayouts {
|
|
||||||
return (**AVFilterChannelLayouts)(unsafe.Pointer(&fltf.channel_layouts))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AVFilterLink
|
// AVFilterLink
|
||||||
type AVFilterLink C.struct_AVFilterLink
|
type AVFilterLink C.struct_AVFilterLink
|
||||||
|
|
||||||
@@ -735,7 +690,7 @@ const (
|
|||||||
AVFILTER_CMD_FLAG_FAST = C.AVFILTER_CMD_FLAG_FAST
|
AVFILTER_CMD_FLAG_FAST = C.AVFILTER_CMD_FLAG_FAST
|
||||||
)
|
)
|
||||||
|
|
||||||
// AvFilterProcessCommand makes the filter instance process a command.
|
// AvFilterProcessCommand makes the filter instance process a command.
|
||||||
// It is recommended to use AVFilterGraphSendCommand().
|
// It is recommended to use AVFilterGraphSendCommand().
|
||||||
func AvFilterProcessCommand(filter *AVFilterContext, cmd, arg string, resLen, flags int32) (res string, ret int32) {
|
func AvFilterProcessCommand(filter *AVFilterContext, cmd, arg string, resLen, flags int32) (res string, ret int32) {
|
||||||
cmdPtr, cmdFunc := StringCasting(cmd)
|
cmdPtr, cmdFunc := StringCasting(cmd)
|
||||||
@@ -1032,7 +987,7 @@ func (fltio *AVFilterInOut) GetName() string {
|
|||||||
|
|
||||||
// SetName sets `AVFilterInOut.name` value.
|
// SetName sets `AVFilterInOut.name` value.
|
||||||
func (fltio *AVFilterInOut) SetName(v string) {
|
func (fltio *AVFilterInOut) SetName(v string) {
|
||||||
C.free(unsafe.Pointer(fltio.name))
|
FreePointer(fltio.name)
|
||||||
fltio.name, _ = StringCasting(v)
|
fltio.name, _ = StringCasting(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
45
avformat.go
45
avformat.go
@@ -658,7 +658,6 @@ func (stm *AVStream) GetEventFlagsAddr() *int32 {
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
AVSTREAM_EVENT_FLAG_METADATA_UPDATED = int32(C.AVSTREAM_EVENT_FLAG_METADATA_UPDATED)
|
AVSTREAM_EVENT_FLAG_METADATA_UPDATED = int32(C.AVSTREAM_EVENT_FLAG_METADATA_UPDATED)
|
||||||
AVSTREAM_EVENT_FLAG_NEW_PACKETS = int32(C.AVSTREAM_EVENT_FLAG_NEW_PACKETS)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetRFrameRate gets `AVStream.r_frame_rate` value.
|
// GetRFrameRate gets `AVStream.r_frame_rate` value.
|
||||||
@@ -982,8 +981,13 @@ func (cpt *AVChapter) GetMetadataAddr() **AVDictionary {
|
|||||||
return (**AVDictionary)(unsafe.Pointer(&cpt.metadata))
|
return (**AVDictionary)(unsafe.Pointer(&cpt.metadata))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// typedef int (*av_format_control_message)(struct AVFormatContext *s, int type,
|
||||||
|
// void *data, size_t data_size);
|
||||||
type AVFormatControlMessageFunc C.av_format_control_message
|
type AVFormatControlMessageFunc C.av_format_control_message
|
||||||
|
|
||||||
|
// typedef int (*AVOpenCallback)(struct AVFormatContext *s,
|
||||||
|
// AVIOContext **pb, const char *url, int flags,
|
||||||
|
// const AVIOInterruptCB *int_cb, AVDictionary **options);
|
||||||
type AVOpenCallbackFunc C.AVOpenCallback
|
type AVOpenCallbackFunc C.AVOpenCallback
|
||||||
|
|
||||||
// AVDurationEstimationMethod
|
// AVDurationEstimationMethod
|
||||||
@@ -1140,7 +1144,7 @@ func (s *AVFormatContext) GetUrl() string {
|
|||||||
func (s *AVFormatContext) SetUrl(v string) {
|
func (s *AVFormatContext) SetUrl(v string) {
|
||||||
vPtr, _ := StringCasting(v)
|
vPtr, _ := StringCasting(v)
|
||||||
if s.url != nil {
|
if s.url != nil {
|
||||||
C.free(unsafe.Pointer(s.url))
|
FreePointer(s.url)
|
||||||
}
|
}
|
||||||
s.url = (*C.char)(vPtr)
|
s.url = (*C.char)(vPtr)
|
||||||
}
|
}
|
||||||
@@ -2073,21 +2077,6 @@ func (s *AVFormatContext) GetSkipEstimateDurationFromPtsAddr() *int32 {
|
|||||||
return (*int32)(&s.skip_estimate_duration_from_pts)
|
return (*int32)(&s.skip_estimate_duration_from_pts)
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetMaxProbePackets gets `AVFormatContext.max_probe_packets` value.
|
|
||||||
func (s *AVFormatContext) GetMaxProbePackets() int32 {
|
|
||||||
return (int32)(s.max_probe_packets)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetMaxProbePackets sets `AVFormatContext.max_probe_packets` value.
|
|
||||||
func (s *AVFormatContext) SetMaxProbePackets(v int32) {
|
|
||||||
s.max_probe_packets = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetMaxProbePacketsAddr gets `AVFormatContext.max_probe_packets` address.
|
|
||||||
func (s *AVFormatContext) GetMaxProbePacketsAddr() *int32 {
|
|
||||||
return (*int32)(&s.max_probe_packets)
|
|
||||||
}
|
|
||||||
|
|
||||||
const (
|
const (
|
||||||
AVFMT_FLAG_GENPTS = C.AVFMT_FLAG_GENPTS
|
AVFMT_FLAG_GENPTS = C.AVFMT_FLAG_GENPTS
|
||||||
AVFMT_FLAG_IGNIDX = C.AVFMT_FLAG_IGNIDX
|
AVFMT_FLAG_IGNIDX = C.AVFMT_FLAG_IGNIDX
|
||||||
@@ -2229,6 +2218,24 @@ func AvFmtCtxGetDurationEstimationMethod(s *AVFormatContext) AVDurationEstimatio
|
|||||||
return (AVDurationEstimationMethod)(C.av_fmt_ctx_get_duration_estimation_method((*C.struct_AVFormatContext)(s)))
|
return (AVDurationEstimationMethod)(C.av_fmt_ctx_get_duration_estimation_method((*C.struct_AVFormatContext)(s)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AVPacketList
|
||||||
|
type AVPacketList C.struct_AVPacketList
|
||||||
|
|
||||||
|
// Getgets `AVPacketList.next` value.
|
||||||
|
func (pl *AVPacketList) Get() *AVPacketList {
|
||||||
|
return (*AVPacketList)(pl.next)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set sets `AVPacketList.next` value.
|
||||||
|
func (pl *AVPacketList) Set(v *AVPacketList) {
|
||||||
|
pl.next = (*C.struct_AVPacketList)(v)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetAddr gets `AVPacketList.next` address.
|
||||||
|
func (pl *AVPacketList) GetAddr() **AVPacketList {
|
||||||
|
return (**AVPacketList)(unsafe.Pointer(&pl.next))
|
||||||
|
}
|
||||||
|
|
||||||
// AvFormatVersion returns the LIBAVFORMAT_VERSION_INT constant.
|
// AvFormatVersion returns the LIBAVFORMAT_VERSION_INT constant.
|
||||||
func AvFormatVersion() uint32 {
|
func AvFormatVersion() uint32 {
|
||||||
return (uint32)(C.avformat_version())
|
return (uint32)(C.avformat_version())
|
||||||
@@ -2396,7 +2403,7 @@ func AvProbeInputBuffer2(pb *AVIOContext, fmt **AVInputFormat,
|
|||||||
(*C.char)(urlPtr), VoidPointer(logctx), (C.uint)(offset), (C.uint)(maxProbeSize)))
|
(*C.char)(urlPtr), VoidPointer(logctx), (C.uint)(offset), (C.uint)(maxProbeSize)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvProbeInputBuffer likes AvProbeInputBuffer2() but returns 0 on success
|
// AvProbeInputBuffer likes AvProbeInputBuffer2() but returns 0 on success.
|
||||||
func AvProbeInputBuffer(pb *AVIOContext, fmt **AVInputFormat,
|
func AvProbeInputBuffer(pb *AVIOContext, fmt **AVInputFormat,
|
||||||
url string, logctx CVoidPointer, offset, maxProbeSize uint32) int32 {
|
url string, logctx CVoidPointer, offset, maxProbeSize uint32) int32 {
|
||||||
urlPtr, urlFunc := StringCasting(url)
|
urlPtr, urlFunc := StringCasting(url)
|
||||||
@@ -2414,8 +2421,6 @@ func AvFormatOpenInput(ps **AVFormatContext, url string, fmt *AVInputFormat, opt
|
|||||||
(*C.char)(urlPtr), (*C.struct_AVInputFormat)(fmt), (**C.struct_AVDictionary)(unsafe.Pointer(options))))
|
(*C.char)(urlPtr), (*C.struct_AVInputFormat)(fmt), (**C.struct_AVDictionary)(unsafe.Pointer(options))))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: Use an AVDictionary to pass options to a demuxer.
|
|
||||||
//
|
|
||||||
// AvDemuxerOpen
|
// AvDemuxerOpen
|
||||||
func AvDemuxerOpen(ic *AVFormatContext) int32 {
|
func AvDemuxerOpen(ic *AVFormatContext) int32 {
|
||||||
return (int32)(C.av_demuxer_open((*C.struct_AVFormatContext)(ic)))
|
return (int32)(C.av_demuxer_open((*C.struct_AVFormatContext)(ic)))
|
||||||
|
@@ -874,14 +874,6 @@ func AvIOPrintf(s *AVIOContext, _fmt string, va ...any) int32 {
|
|||||||
|
|
||||||
// NONEED: avio_print_string_array
|
// NONEED: avio_print_string_array
|
||||||
|
|
||||||
// AvIOPrint
|
|
||||||
func AvIOPrint(s *AVIOContext, va ...any) {
|
|
||||||
fmtPtr, fmtFunc := StringCasting(fmt.Sprint(va...))
|
|
||||||
defer fmtFunc()
|
|
||||||
fmtArray := []*C.char{(*C.char)(fmtPtr), nil}
|
|
||||||
C.avio_print_string_array((*C.struct_AVIOContext)(s), &fmtArray[0])
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvIOFlush forces flushing of buffered data.
|
// AvIOFlush forces flushing of buffered data.
|
||||||
func AvIOFlush(s *AVIOContext) {
|
func AvIOFlush(s *AVIOContext) {
|
||||||
C.avio_flush((*C.struct_AVIOContext)(s))
|
C.avio_flush((*C.struct_AVIOContext)(s))
|
||||||
@@ -1025,13 +1017,6 @@ func AvIOEnumProtocols(opaque CVoidPointerPointer, output int32) string {
|
|||||||
return C.GoString(C.avio_enum_protocols(VoidPointerPointer(opaque), (C.int)(output)))
|
return C.GoString(C.avio_enum_protocols(VoidPointerPointer(opaque), (C.int)(output)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvIOProtocolGetClass gets AVClass by names of available protocols.
|
|
||||||
func AvIOProtocolGetClass(name string) *AVClass {
|
|
||||||
namePtr, nameFunc := StringCasting(name)
|
|
||||||
defer nameFunc()
|
|
||||||
return (*AVClass)(C.avio_protocol_get_class((*C.char)(namePtr)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvIOPause pauses and resumes playing - only meaningful if using a network streaming
|
// AvIOPause pauses and resumes playing - only meaningful if using a network streaming
|
||||||
// protocol (e.g. MMS).
|
// protocol (e.g. MMS).
|
||||||
func AvIOPause(s *AVIOContext, pause int32) int32 {
|
func AvIOPause(s *AVIOContext, pause int32) int32 {
|
||||||
|
@@ -34,7 +34,7 @@ func AvutilLicense() string {
|
|||||||
return C.GoString(C.avutil_license())
|
return C.GoString(C.avutil_license())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Media Type
|
// Media Type.
|
||||||
type AVMediaType = C.enum_AVMediaType
|
type AVMediaType = C.enum_AVMediaType
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -99,6 +99,7 @@ func AvXIfNull[T any](p, x *T) *T {
|
|||||||
return x
|
return x
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AvStringIfNull
|
||||||
func AvStringIfNull(p, x string) string {
|
func AvStringIfNull(p, x string) string {
|
||||||
if len(p) != 0 {
|
if len(p) != 0 {
|
||||||
return p
|
return p
|
||||||
|
@@ -9,9 +9,7 @@ package ffmpeg
|
|||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
type AVAdler = C.AVAdler
|
|
||||||
|
|
||||||
// AvAdler32Update calculates the Adler32 checksum of a buffer.
|
// AvAdler32Update calculates the Adler32 checksum of a buffer.
|
||||||
func AvAdler32Update(adler AVAdler, buf *uint8, len uint32) AVAdler {
|
func AvAdler32Update(adler uint32, buf *uint8, len uint32) uint32 {
|
||||||
return (AVAdler)(C.av_adler32_update((C.AVAdler)(adler), (*C.uint8_t)(buf), (C.uint)(len)))
|
return (uint32)(C.av_adler32_update((C.ulong)(adler), (*C.uint8_t)(buf), (C.uint)(len)))
|
||||||
}
|
}
|
||||||
|
@@ -9,6 +9,7 @@ package ffmpeg
|
|||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
|
// AVAudioFifo
|
||||||
type AVAudioFifo C.struct_AVAudioFifo
|
type AVAudioFifo C.struct_AVAudioFifo
|
||||||
|
|
||||||
// AvAudioFifoFree frees an AVAudioFifo.
|
// AvAudioFifoFree frees an AVAudioFifo.
|
||||||
|
@@ -57,20 +57,18 @@ import "C"
|
|||||||
|
|
||||||
// NONEED: av_append_path_component
|
// NONEED: av_append_path_component
|
||||||
|
|
||||||
|
// AVEscapeMode
|
||||||
type AVEscapeMode = C.enum_AVEscapeMode
|
type AVEscapeMode = C.enum_AVEscapeMode
|
||||||
|
|
||||||
const (
|
const (
|
||||||
AV_ESCAPE_MODE_AUTO = C.AV_ESCAPE_MODE_AUTO
|
AV_ESCAPE_MODE_AUTO = C.AV_ESCAPE_MODE_AUTO
|
||||||
AV_ESCAPE_MODE_BACKSLASH = C.AV_ESCAPE_MODE_BACKSLASH
|
AV_ESCAPE_MODE_BACKSLASH = C.AV_ESCAPE_MODE_BACKSLASH
|
||||||
AV_ESCAPE_MODE_QUOTE = C.AV_ESCAPE_MODE_QUOTE
|
AV_ESCAPE_MODE_QUOTE = C.AV_ESCAPE_MODE_QUOTE
|
||||||
AV_ESCAPE_MODE_XML = C.AV_ESCAPE_MODE_XML
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
AV_ESCAPE_FLAG_WHITESPACE = C.AV_ESCAPE_FLAG_WHITESPACE
|
AV_ESCAPE_FLAG_WHITESPACE = C.AV_ESCAPE_FLAG_WHITESPACE
|
||||||
AV_ESCAPE_FLAG_STRICT = C.AV_ESCAPE_FLAG_STRICT
|
AV_ESCAPE_FLAG_STRICT = C.AV_ESCAPE_FLAG_STRICT
|
||||||
AV_ESCAPE_FLAG_XML_SINGLE_QUOTES = C.AV_ESCAPE_FLAG_XML_SINGLE_QUOTES
|
|
||||||
AV_ESCAPE_FLAG_XML_DOUBLE_QUOTES = C.AV_ESCAPE_FLAG_XML_DOUBLE_QUOTES
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// NONEED: av_escape
|
// NONEED: av_escape
|
||||||
|
@@ -14,6 +14,7 @@ const (
|
|||||||
AV_BF_ROUNDS = C.AV_BF_ROUNDS
|
AV_BF_ROUNDS = C.AV_BF_ROUNDS
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// AVBlowfish
|
||||||
type AVBlowfish C.struct_AVBlowfish
|
type AVBlowfish C.struct_AVBlowfish
|
||||||
|
|
||||||
// GetP gets `AVBlowfish.p` value.
|
// GetP gets `AVBlowfish.p` value.
|
||||||
|
@@ -17,6 +17,7 @@ import (
|
|||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// AVBPrint
|
||||||
type AVBPrint C.struct_AVBPrint
|
type AVBPrint C.struct_AVBPrint
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@@ -47,9 +47,11 @@ func AvBufferAllocz(size int32) *AVBufferRef {
|
|||||||
return (*AVBufferRef)(C.av_buffer_allocz((C.int)(size)))
|
return (*AVBufferRef)(C.av_buffer_allocz((C.int)(size)))
|
||||||
}
|
}
|
||||||
|
|
||||||
const AV_BUFFER_FLAG_READONLY = C.AV_BUFFER_FLAG_READONLY
|
const (
|
||||||
|
AV_BUFFER_FLAG_READONLY = C.AV_BUFFER_FLAG_READONLY
|
||||||
|
)
|
||||||
|
|
||||||
// typedef void (*av_buffer_free_func)(void *opaque, uint8_t *data)
|
// typedef void (*av_buffer_free_func)(void *opaque, uint8_t *data);
|
||||||
type AVBufferFreeFunc = C.av_buffer_free_func
|
type AVBufferFreeFunc = C.av_buffer_free_func
|
||||||
|
|
||||||
// AvBufferCreate Create an AVBuffer from an existing array.
|
// AvBufferCreate Create an AVBuffer from an existing array.
|
||||||
@@ -102,21 +104,16 @@ func AvBufferRealloc(buf **AVBufferRef, size int32) int32 {
|
|||||||
return (int32)(C.av_buffer_realloc((**C.struct_AVBufferRef)(unsafe.Pointer(buf)), (C.int)(size)))
|
return (int32)(C.av_buffer_realloc((**C.struct_AVBufferRef)(unsafe.Pointer(buf)), (C.int)(size)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvBufferReplace ensures dst refers to the same data as src.
|
// AVBufferPool
|
||||||
func AvBufferReplace(dst **AVBufferRef, src *AVBufferRef) int32 {
|
|
||||||
return (int32)(C.av_buffer_replace((**C.struct_AVBufferRef)(unsafe.Pointer(dst)),
|
|
||||||
(*C.struct_AVBufferRef)(src)))
|
|
||||||
}
|
|
||||||
|
|
||||||
type AVBufferPool C.struct_AVBufferPool
|
type AVBufferPool C.struct_AVBufferPool
|
||||||
|
|
||||||
// typedef AVBufferRef* (*av_buffer_pool_alloc_func)(int size)
|
// typedef AVBufferRef* (*av_buffer_pool_alloc_func)(int size);
|
||||||
type AVBufferPoolAllocFunc = C.av_buffer_pool_alloc_func
|
type AVBufferPoolAllocFunc = C.av_buffer_pool_alloc_func
|
||||||
|
|
||||||
// typedef AVBufferRef* (*av_buffer_pool_alloc2_func)(void* opaque, int size)
|
// typedef AVBufferRef* (*av_buffer_pool_alloc2_func)(void* opaque, int size)
|
||||||
type AVBufferPoolAlloc2Func = C.av_buffer_pool_alloc2_func
|
type AVBufferPoolAlloc2Func = C.av_buffer_pool_alloc2_func
|
||||||
|
|
||||||
// typedef void (*av_buffer_pool_free_func)(void* opaque)
|
// typedef void (*av_buffer_pool_free_func)(void* opaque);
|
||||||
type AVBufferPoolFreeFunc = C.av_buffer_pool_free_func
|
type AVBufferPoolFreeFunc = C.av_buffer_pool_free_func
|
||||||
|
|
||||||
// AvBufferPoolInit allocates and initializes a buffer pool.
|
// AvBufferPoolInit allocates and initializes a buffer pool.
|
||||||
@@ -141,8 +138,3 @@ func AvBufferPoolUninit(pool **AVBufferPool) {
|
|||||||
func AvBufferPoolGet(pool *AVBufferPool) *AVBufferRef {
|
func AvBufferPoolGet(pool *AVBufferPool) *AVBufferRef {
|
||||||
return (*AVBufferRef)(C.av_buffer_pool_get((*C.struct_AVBufferPool)(pool)))
|
return (*AVBufferRef)(C.av_buffer_pool_get((*C.struct_AVBufferPool)(pool)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvBufferPoolBufferGetOpaque queries the original opaque parameter of an allocated buffer in the pool.
|
|
||||||
func AvBufferPoolBufferGetOpaque(buf *AVBufferRef) unsafe.Pointer {
|
|
||||||
return C.av_buffer_pool_buffer_get_opaque((*C.struct_AVBufferRef)(buf))
|
|
||||||
}
|
|
||||||
|
@@ -9,6 +9,7 @@ package ffmpeg
|
|||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
|
// AVCAMELLIA
|
||||||
type AVCAMELLIA C.struct_AVCAMELLIA
|
type AVCAMELLIA C.struct_AVCAMELLIA
|
||||||
|
|
||||||
// AvCamelliaAlloc allocates an AVCAMELLIA context.
|
// AvCamelliaAlloc allocates an AVCAMELLIA context.
|
||||||
|
@@ -9,6 +9,7 @@ package ffmpeg
|
|||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
|
// AVCAST5
|
||||||
type AVCAST5 C.struct_AVCAST5
|
type AVCAST5 C.struct_AVCAST5
|
||||||
|
|
||||||
// AvCast5Alloc allocates an AVCAST5 context.
|
// AvCast5Alloc allocates an AVCAST5 context.
|
||||||
|
@@ -36,11 +36,6 @@ const (
|
|||||||
AV_CH_SURROUND_DIRECT_LEFT = uint64(C.AV_CH_SURROUND_DIRECT_LEFT)
|
AV_CH_SURROUND_DIRECT_LEFT = uint64(C.AV_CH_SURROUND_DIRECT_LEFT)
|
||||||
AV_CH_SURROUND_DIRECT_RIGHT = uint64(C.AV_CH_SURROUND_DIRECT_RIGHT)
|
AV_CH_SURROUND_DIRECT_RIGHT = uint64(C.AV_CH_SURROUND_DIRECT_RIGHT)
|
||||||
AV_CH_LOW_FREQUENCY_2 = uint64(C.AV_CH_LOW_FREQUENCY_2)
|
AV_CH_LOW_FREQUENCY_2 = uint64(C.AV_CH_LOW_FREQUENCY_2)
|
||||||
AV_CH_TOP_SIDE_LEFT = uint64(C.AV_CH_TOP_SIDE_LEFT)
|
|
||||||
AV_CH_TOP_SIDE_RIGHT = uint64(C.AV_CH_TOP_SIDE_RIGHT)
|
|
||||||
AV_CH_BOTTOM_FRONT_CENTER = uint64(C.AV_CH_BOTTOM_FRONT_CENTER)
|
|
||||||
AV_CH_BOTTOM_FRONT_LEFT = uint64(C.AV_CH_BOTTOM_FRONT_LEFT)
|
|
||||||
AV_CH_BOTTOM_FRONT_RIGHT = uint64(C.AV_CH_BOTTOM_FRONT_RIGHT)
|
|
||||||
|
|
||||||
AV_CH_LAYOUT_NATIVE = uint64(C.AV_CH_LAYOUT_NATIVE)
|
AV_CH_LAYOUT_NATIVE = uint64(C.AV_CH_LAYOUT_NATIVE)
|
||||||
)
|
)
|
||||||
@@ -74,9 +69,9 @@ const (
|
|||||||
AV_CH_LAYOUT_OCTAGONAL = uint64(C.AV_CH_LAYOUT_OCTAGONAL)
|
AV_CH_LAYOUT_OCTAGONAL = uint64(C.AV_CH_LAYOUT_OCTAGONAL)
|
||||||
AV_CH_LAYOUT_HEXADECAGONAL = uint64(C.AV_CH_LAYOUT_HEXADECAGONAL)
|
AV_CH_LAYOUT_HEXADECAGONAL = uint64(C.AV_CH_LAYOUT_HEXADECAGONAL)
|
||||||
AV_CH_LAYOUT_STEREO_DOWNMIX = uint64(C.AV_CH_LAYOUT_STEREO_DOWNMIX)
|
AV_CH_LAYOUT_STEREO_DOWNMIX = uint64(C.AV_CH_LAYOUT_STEREO_DOWNMIX)
|
||||||
AV_CH_LAYOUT_22POINT2 = uint64(C.AV_CH_LAYOUT_22POINT2)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// AVMatrixEncoding
|
||||||
type AVMatrixEncoding = C.enum_AVMatrixEncoding
|
type AVMatrixEncoding = C.enum_AVMatrixEncoding
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -105,7 +100,9 @@ func AvGetExtendedChannelLayout(name string, channelLayout *uint64, nbChannels *
|
|||||||
(*C.uint64_t)(channelLayout), (*C.int32_t)(nbChannels)))
|
(*C.uint64_t)(channelLayout), (*C.int32_t)(nbChannels)))
|
||||||
}
|
}
|
||||||
|
|
||||||
const AV_CH_LAYOUT_MAX_STRING_SIZE = 256
|
const (
|
||||||
|
AV_CH_LAYOUT_MAX_STRING_SIZE = 256
|
||||||
|
)
|
||||||
|
|
||||||
// AvGetChannelLayoutString returns a description of a channel layout.
|
// AvGetChannelLayoutString returns a description of a channel layout.
|
||||||
func AvGetChannelLayoutString(nbChannels int32, channelLayout uint64) string {
|
func AvGetChannelLayoutString(nbChannels int32, channelLayout uint64) string {
|
||||||
|
@@ -56,6 +56,7 @@ func FFUMOD[T Integer](a, b T) T {
|
|||||||
return a - b*FFUDIV(a, b)
|
return a - b*FFUDIV(a, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FFABS
|
||||||
func FFABS[T SingedInteger](a T) T {
|
func FFABS[T SingedInteger](a T) T {
|
||||||
if a >= 0 {
|
if a >= 0 {
|
||||||
return a
|
return a
|
||||||
@@ -63,6 +64,7 @@ func FFABS[T SingedInteger](a T) T {
|
|||||||
return -a
|
return -a
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FFSIGNT
|
||||||
func FFSIGNT[T SingedInteger](a T) T {
|
func FFSIGNT[T SingedInteger](a T) T {
|
||||||
if a > 0 {
|
if a > 0 {
|
||||||
return 1
|
return 1
|
||||||
@@ -105,6 +107,7 @@ func FFDIFFSIGN[T Integer](x, y T) int {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FFMAX
|
||||||
func FFMAX[T Integer](a, b T) T {
|
func FFMAX[T Integer](a, b T) T {
|
||||||
if a > b {
|
if a > b {
|
||||||
return a
|
return a
|
||||||
@@ -112,10 +115,12 @@ func FFMAX[T Integer](a, b T) T {
|
|||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FFMAX3
|
||||||
func FFMAX3[T Integer](a, b, c T) T {
|
func FFMAX3[T Integer](a, b, c T) T {
|
||||||
return FFMAX(FFMAX(a, b), c)
|
return FFMAX(FFMAX(a, b), c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FFMIN
|
||||||
func FFMIN[T Integer](a, b T) T {
|
func FFMIN[T Integer](a, b T) T {
|
||||||
if a > b {
|
if a > b {
|
||||||
return b
|
return b
|
||||||
@@ -123,6 +128,7 @@ func FFMIN[T Integer](a, b T) T {
|
|||||||
return a
|
return a
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FFMIN3
|
||||||
func FFMIN3[T Integer](a, b, c T) T {
|
func FFMIN3[T Integer](a, b, c T) T {
|
||||||
return FFMIN(FFMIN(a, b), c)
|
return FFMIN(FFMIN(a, b), c)
|
||||||
}
|
}
|
||||||
@@ -216,16 +222,6 @@ func AvSatDsub32C(a, b int32) int32 {
|
|||||||
return (int32)(C.av_sat_dsub32_c((C.int)(a), (C.int)(b)))
|
return (int32)(C.av_sat_dsub32_c((C.int)(a), (C.int)(b)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvSatAdd64C adds two signed 64-bit values with saturation.
|
|
||||||
func AvSatAdd64C(a, b int64) int64 {
|
|
||||||
return (int64)(C.av_sat_add64_c((C.int64_t)(a), (C.int64_t)(b)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvSatSub64C subtracts two signed 64-bit values with saturation.
|
|
||||||
func AvSatSub64C(a, b int64) int64 {
|
|
||||||
return (int64)(C.av_sat_sub64_c((C.int64_t)(a), (C.int64_t)(b)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvClipfC clip a float value into the amin-amax range.
|
// AvClipfC clip a float value into the amin-amax range.
|
||||||
func AvClipfC(a, amin, amax float32) float32 {
|
func AvClipfC(a, amin, amax float32) float32 {
|
||||||
return (float32)(C.av_clipf_c((C.float)(a), (C.float)(amin), (C.float)(amax)))
|
return (float32)(C.av_clipf_c((C.float)(a), (C.float)(amin), (C.float)(amax)))
|
||||||
@@ -241,12 +237,12 @@ func AvCeilLog2C(x int32) int32 {
|
|||||||
return (int32)(C.av_ceil_log2_c((C.int)(x)))
|
return (int32)(C.av_ceil_log2_c((C.int)(x)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvPopcountC counts number of bits set to one in x
|
// AvPopcountC counts number of bits set to one in x.
|
||||||
func AvPopcountC(x uint32) int32 {
|
func AvPopcountC(x uint32) int32 {
|
||||||
return (int32)(C.av_popcount_c((C.uint)(x)))
|
return (int32)(C.av_popcount_c((C.uint)(x)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvPopcount64C counts number of bits set to one in x
|
// AvPopcount64C counts number of bits set to one in x.
|
||||||
func AvPopcount64C(x uint64) int32 {
|
func AvPopcount64C(x uint64) int32 {
|
||||||
return (int32)(C.av_popcount64_c((C.uint64_t)(x)))
|
return (int32)(C.av_popcount64_c((C.uint64_t)(x)))
|
||||||
}
|
}
|
||||||
|
@@ -53,9 +53,6 @@ const (
|
|||||||
AV_CPU_FLAG_ARMV8 = C.AV_CPU_FLAG_ARMV8
|
AV_CPU_FLAG_ARMV8 = C.AV_CPU_FLAG_ARMV8
|
||||||
AV_CPU_FLAG_VFP_VM = C.AV_CPU_FLAG_VFP_VM
|
AV_CPU_FLAG_VFP_VM = C.AV_CPU_FLAG_VFP_VM
|
||||||
AV_CPU_FLAG_SETEND = C.AV_CPU_FLAG_SETEND
|
AV_CPU_FLAG_SETEND = C.AV_CPU_FLAG_SETEND
|
||||||
|
|
||||||
AV_CPU_FLAG_MMI = C.AV_CPU_FLAG_MMI
|
|
||||||
AV_CPU_FLAG_MSA = C.AV_CPU_FLAG_MSA
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// AvGetCpuFlags returns the flags which specify extensions supported by the CPU.
|
// AvGetCpuFlags returns the flags which specify extensions supported by the CPU.
|
||||||
|
@@ -20,6 +20,7 @@ const (
|
|||||||
AV_DICT_MULTIKEY = C.AV_DICT_MULTIKEY
|
AV_DICT_MULTIKEY = C.AV_DICT_MULTIKEY
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// AVDictionaryEntry
|
||||||
type AVDictionaryEntry C.struct_AVDictionaryEntry
|
type AVDictionaryEntry C.struct_AVDictionaryEntry
|
||||||
|
|
||||||
// GetKey gets `AVDictionaryEntry.key` value.
|
// GetKey gets `AVDictionaryEntry.key` value.
|
||||||
|
@@ -20,10 +20,16 @@ func AvDisplayRotationGet(matrix []int32) float64 {
|
|||||||
// AvDisplayRotationSet initializes a transformation matrix describing a pure counterclockwise
|
// AvDisplayRotationSet initializes a transformation matrix describing a pure counterclockwise
|
||||||
// rotation by the specified angle (in degrees).
|
// rotation by the specified angle (in degrees).
|
||||||
func AvDisplayRotationSet(matrix []int32, angle float64) {
|
func AvDisplayRotationSet(matrix []int32, angle float64) {
|
||||||
|
if len(matrix) < 9 {
|
||||||
|
panic("matrix len < 9")
|
||||||
|
}
|
||||||
C.av_display_rotation_set((*C.int32_t)(&matrix[0]), (C.double)(angle))
|
C.av_display_rotation_set((*C.int32_t)(&matrix[0]), (C.double)(angle))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvDisplayMatrixFlip flips the input matrix horizontally and/or vertically.
|
// AvDisplayMatrixFlip flips the input matrix horizontally and/or vertically.
|
||||||
func AvDisplayMatrixFlip(matrix []int32, hflip, vflip int32) {
|
func AvDisplayMatrixFlip(matrix []int32, hflip, vflip int32) {
|
||||||
|
if len(matrix) < 9 {
|
||||||
|
panic("matrix len < 9")
|
||||||
|
}
|
||||||
C.av_display_matrix_flip((*C.int32_t)(&matrix[0]), (C.int)(hflip), (C.int)(vflip))
|
C.av_display_matrix_flip((*C.int32_t)(&matrix[0]), (C.int)(hflip), (C.int)(vflip))
|
||||||
}
|
}
|
||||||
|
@@ -1,143 +0,0 @@
|
|||||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
|
||||||
// Use of this source code is governed by a MIT
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package ffmpeg
|
|
||||||
|
|
||||||
/*
|
|
||||||
#include <libavutil/dovi_meta.h>
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
import "unsafe"
|
|
||||||
|
|
||||||
// AVDOVIDecoderConfigurationRecord
|
|
||||||
type AVDOVIDecoderConfigurationRecord C.struct_AVDOVIDecoderConfigurationRecord
|
|
||||||
|
|
||||||
// GetDvVersionMajor gets `AVDOVIDecoderConfigurationRecord.dv_version_major` value.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) GetDvVersionMajor() uint8 {
|
|
||||||
return (uint8)(dcr.dv_version_major)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetDvVersionMajor sets `AVDOVIDecoderConfigurationRecord.dv_version_major` value.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) SetDvVersionMajor(v uint8) {
|
|
||||||
dcr.dv_version_major = (C.uint8_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDvVersionMajorAddr gets `AVDOVIDecoderConfigurationRecord.dv_version_major` address.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) GetDvVersionMajorAddr() *uint8 {
|
|
||||||
return (*uint8)(&dcr.dv_version_major)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDvVersionMinor gets `AVDOVIDecoderConfigurationRecord.dv_version_minor` value.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) GetDvVersionMinor() uint8 {
|
|
||||||
return (uint8)(dcr.dv_version_minor)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetDvVersionMinor sets `AVDOVIDecoderConfigurationRecord.dv_version_minor` value.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) SetDvVersionMinor(v uint8) {
|
|
||||||
dcr.dv_version_minor = (C.uint8_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDvVersionMinorAddr gets `AVDOVIDecoderConfigurationRecord.dv_version_minor` address.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) GetDvVersionMinorAddr() *uint8 {
|
|
||||||
return (*uint8)(&dcr.dv_version_minor)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDvProfile gets `AVDOVIDecoderConfigurationRecord.dv_profile` value.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) GetDvProfile() uint8 {
|
|
||||||
return (uint8)(dcr.dv_profile)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetDvProfile sets `AVDOVIDecoderConfigurationRecord.dv_profile` value.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) SetDvProfile(v uint8) {
|
|
||||||
dcr.dv_profile = (C.uint8_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDvProfileAddr gets `AVDOVIDecoderConfigurationRecord.dv_profile` address.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) GetDvProfileAddr() *uint8 {
|
|
||||||
return (*uint8)(&dcr.dv_profile)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDvLevel gets `AVDOVIDecoderConfigurationRecord.dv_level` value.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) GetDvLevel() uint8 {
|
|
||||||
return (uint8)(dcr.dv_level)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetDvLevel sets `AVDOVIDecoderConfigurationRecord.dv_level` value.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) SetDvLevel(v uint8) {
|
|
||||||
dcr.dv_level = (C.uint8_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDvLevelAddr gets `AVDOVIDecoderConfigurationRecord.dv_level` address.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) GetDvLevelAddr() *uint8 {
|
|
||||||
return (*uint8)(&dcr.dv_level)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetRpuPresentFlag gets `AVDOVIDecoderConfigurationRecord.rpu_present_flag` value.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) GetRpuPresentFlag() uint8 {
|
|
||||||
return (uint8)(dcr.rpu_present_flag)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetRpuPresentFlag sets `AVDOVIDecoderConfigurationRecord.rpu_present_flag` value.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) SetRpuPresentFlag(v uint8) {
|
|
||||||
dcr.rpu_present_flag = (C.uint8_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetRpuPresentFlagAddr gets `AVDOVIDecoderConfigurationRecord.rpu_present_flag` address.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) GetRpuPresentFlagAddr() *uint8 {
|
|
||||||
return (*uint8)(&dcr.rpu_present_flag)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetElPresentFlag gets `AVDOVIDecoderConfigurationRecord.el_present_flag` value.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) GetElPresentFlag() uint8 {
|
|
||||||
return (uint8)(dcr.el_present_flag)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetElPresentFlag sets `AVDOVIDecoderConfigurationRecord.el_present_flag` value.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) SetElPresentFlag(v uint8) {
|
|
||||||
dcr.el_present_flag = (C.uint8_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetElPresentFlagAddr gets `AVDOVIDecoderConfigurationRecord.el_present_flag` address.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) GetElPresentFlagAddr() *uint8 {
|
|
||||||
return (*uint8)(&dcr.el_present_flag)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetBlPresentFlag gets `AVDOVIDecoderConfigurationRecord.bl_present_flag` value.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) GetBlPresentFlag() uint8 {
|
|
||||||
return (uint8)(dcr.bl_present_flag)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetBlPresentFlag sets `AVDOVIDecoderConfigurationRecord.bl_present_flag` value.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) SetBlPresentFlag(v uint8) {
|
|
||||||
dcr.bl_present_flag = (C.uint8_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetBlPresentFlagAddr gets `AVDOVIDecoderConfigurationRecord.bl_present_flag` address.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) GetBlPresentFlagAddr() *uint8 {
|
|
||||||
return (*uint8)(&dcr.bl_present_flag)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDvBlSignalCompatibilityId
|
|
||||||
// gets `AVDOVIDecoderConfigurationRecord.dv_bl_signal_compatibility_id` value.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) GetDvBlSignalCompatibilityId() uint8 {
|
|
||||||
return (uint8)(dcr.dv_bl_signal_compatibility_id)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetDvBlSignalCompatibilityId
|
|
||||||
// sets `AVDOVIDecoderConfigurationRecord.dv_bl_signal_compatibility_id` value.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) SetDvBlSignalCompatibilityId(v uint8) {
|
|
||||||
dcr.dv_bl_signal_compatibility_id = (C.uint8_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDvBlSignalCompatibilityIdAddr
|
|
||||||
// gets `AVDOVIDecoderConfigurationRecord.dv_bl_signal_compatibility_id` address.
|
|
||||||
func (dcr *AVDOVIDecoderConfigurationRecord) GetDvBlSignalCompatibilityIdAddr() *uint8 {
|
|
||||||
return (*uint8)(&dcr.dv_bl_signal_compatibility_id)
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvDoviAlloc allocates a AVDOVIDecoderConfigurationRecord structure and initialize its
|
|
||||||
// fields to default values.
|
|
||||||
func AvDoviAlloc(size *uintptr) *AVDOVIDecoderConfigurationRecord {
|
|
||||||
return (*AVDOVIDecoderConfigurationRecord)(C.av_dovi_alloc((*C.size_t)(unsafe.Pointer(size))))
|
|
||||||
}
|
|
@@ -27,7 +27,7 @@ func AVUNERROR(e int32) int32 {
|
|||||||
return e
|
return e
|
||||||
}
|
}
|
||||||
|
|
||||||
// Error handling
|
// Error handling.
|
||||||
const (
|
const (
|
||||||
AVERROR_BSF_NOT_FOUND = int32(C.AVERROR_BSF_NOT_FOUND)
|
AVERROR_BSF_NOT_FOUND = int32(C.AVERROR_BSF_NOT_FOUND)
|
||||||
AVERROR_BUG = int32(C.AVERROR_BUG)
|
AVERROR_BUG = int32(C.AVERROR_BUG)
|
||||||
|
@@ -29,7 +29,7 @@ func AvTempfile(prefix string, logOffset int32, logCtx CVoidPointer) (filename s
|
|||||||
prefixPtr, prefixFunc := StringCasting(prefix)
|
prefixPtr, prefixFunc := StringCasting(prefix)
|
||||||
defer prefixFunc()
|
defer prefixFunc()
|
||||||
var filenamePtr *C.char
|
var filenamePtr *C.char
|
||||||
defer C.free(unsafe.Pointer(filenamePtr))
|
defer FreePointer(filenamePtr)
|
||||||
ret = (int32)(C.av_tempfile((*C.char)(prefixPtr),
|
ret = (int32)(C.av_tempfile((*C.char)(prefixPtr),
|
||||||
(**C.char)(unsafe.Pointer(&filenamePtr)),
|
(**C.char)(unsafe.Pointer(&filenamePtr)),
|
||||||
(C.int)(logOffset),
|
(C.int)(logOffset),
|
||||||
|
@@ -1,373 +0,0 @@
|
|||||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
|
||||||
// Use of this source code is governed by a MIT
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package ffmpeg
|
|
||||||
|
|
||||||
/*
|
|
||||||
#include <libavutil/film_grain_params.h>
|
|
||||||
|
|
||||||
AVFilmGrainAOMParams get_av_film_grain_params_codec_aom(AVFilmGrainParams *v) {
|
|
||||||
return v->codec.aom;
|
|
||||||
}
|
|
||||||
|
|
||||||
void set_av_film_grain_params_codec_aom(AVFilmGrainParams *v, AVFilmGrainAOMParams p) {
|
|
||||||
v->codec.aom = p;
|
|
||||||
}
|
|
||||||
|
|
||||||
AVFilmGrainAOMParams* get_av_film_grain_params_codec_aom_addr(AVFilmGrainParams *v) {
|
|
||||||
return &v->codec.aom;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
import "unsafe"
|
|
||||||
|
|
||||||
// AVFilmGrainParamsType
|
|
||||||
type AVFilmGrainParamsType = C.enum_AVFilmGrainParamsType
|
|
||||||
|
|
||||||
const (
|
|
||||||
AV_FILM_GRAIN_PARAMS_NONE = AVFilmGrainParamsType(C.AV_FILM_GRAIN_PARAMS_NONE)
|
|
||||||
AV_FILM_GRAIN_PARAMS_AV1 = AVFilmGrainParamsType(C.AV_FILM_GRAIN_PARAMS_AV1)
|
|
||||||
)
|
|
||||||
|
|
||||||
// AVFilmGrainAOMParams
|
|
||||||
type AVFilmGrainAOMParams C.struct_AVFilmGrainAOMParams
|
|
||||||
|
|
||||||
// GetNumYPoints gets `AVFilmGrainAOMParams.num_y_points` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetNumYPoints() int32 {
|
|
||||||
return (int32)(aomp.num_y_points)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetNumYPoints sets `AVFilmGrainAOMParams.num_y_points` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) SetNumYPoints(v int32) {
|
|
||||||
aomp.num_y_points = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetNumYPointsAddr gets `AVFilmGrainAOMParams.num_y_points` address.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetNumYPointsAddr() *int32 {
|
|
||||||
return (*int32)(&aomp.num_y_points)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetYPoints gets `AVFilmGrainAOMParams.y_points` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetYPoints() (v [][]uint8) {
|
|
||||||
for i := 0; i < 14; i++ {
|
|
||||||
v = append(v, unsafe.Slice((*uint8)(&aomp.y_points[i][0]), 2))
|
|
||||||
}
|
|
||||||
return v
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetYPoints sets `AVFilmGrainAOMParams.y_points` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) SetYPoints(v [][]uint8) {
|
|
||||||
for i := 0; i < FFMIN(len(v), 14); i++ {
|
|
||||||
for j := 0; j < FFMIN(len(v[i]), 2); j++ {
|
|
||||||
aomp.y_points[i][j] = (C.uint8_t)(v[i][j])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetYPointsAddr gets `AVFilmGrainAOMParams.y_points` address.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetYPointsAddr() **uint8 {
|
|
||||||
return (**uint8)(unsafe.Pointer(&aomp.y_points))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetChromaScalingFromLuma gets `AVFilmGrainAOMParams.chroma_scaling_from_luma` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetChromaScalingFromLuma() int32 {
|
|
||||||
return (int32)(aomp.chroma_scaling_from_luma)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetChromaScalingFromLuma sets `AVFilmGrainAOMParams.chroma_scaling_from_luma` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) SetChromaScalingFromLuma(v int32) {
|
|
||||||
aomp.chroma_scaling_from_luma = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetChromaScalingFromLumaAddr gets `AVFilmGrainAOMParams.chroma_scaling_from_luma` address.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetChromaScalingFromLumaAddr() *int32 {
|
|
||||||
return (*int32)(&aomp.chroma_scaling_from_luma)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetNumUvPoints gets `AVFilmGrainAOMParams.num_uv_points` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetNumUvPoints() []int32 {
|
|
||||||
return unsafe.Slice((*int32)(&aomp.num_uv_points[0]), 2)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetNumUvPoints sets `AVFilmGrainAOMParams.num_uv_points` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) SetNumUvPoints(v []int32) {
|
|
||||||
for i := 0; i < FFMIN(len(v), 2); i++ {
|
|
||||||
aomp.num_uv_points[i] = (C.int)(v[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetNumUvPointsAddr gets `AVFilmGrainAOMParams.num_uv_points` address.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetNumUvPointsAddr() **int32 {
|
|
||||||
return (**int32)(unsafe.Pointer(&aomp.num_uv_points))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUvPoints gets `AVFilmGrainAOMParams.uv_points` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetUvPoints() (v [][][]uint8) {
|
|
||||||
for i := 0; i < 2; i++ {
|
|
||||||
tmp := [][]uint8{}
|
|
||||||
for j := 0; j < 10; j++ {
|
|
||||||
tmp = append(tmp, unsafe.Slice((*uint8)(&aomp.uv_points[i][j][0]), 2))
|
|
||||||
}
|
|
||||||
v = append(v, tmp)
|
|
||||||
}
|
|
||||||
return v
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetUvPoints sets `AVFilmGrainAOMParams.uv_points` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) SetUvPoints(v [][][]uint8) {
|
|
||||||
for i := 0; i < FFMIN(len(v), 2); i++ {
|
|
||||||
for j := 0; j < FFMIN(len(v[i]), 10); j++ {
|
|
||||||
for k := 0; k < FFMIN(len(v[i][j]), 2); k++ {
|
|
||||||
aomp.uv_points[i][j][k] = (C.uint8_t)(v[i][j][k])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUvPointsAddr gets `AVFilmGrainAOMParams.uv_points` address.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetUvPointsAddr() **uint8 {
|
|
||||||
return (**uint8)(unsafe.Pointer(&aomp.uv_points))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetScalingShift gets `AVFilmGrainAOMParams.scaling_shift` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetScalingShift() int32 {
|
|
||||||
return (int32)(aomp.scaling_shift)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetScalingShift sets `AVFilmGrainAOMParams.scaling_shift` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) SetScalingShift(v int32) {
|
|
||||||
aomp.scaling_shift = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetScalingShiftAddr gets `AVFilmGrainAOMParams.scaling_shift` address.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetScalingShiftAddr() *int32 {
|
|
||||||
return (*int32)(&aomp.scaling_shift)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetArCoeffLag gets `AVFilmGrainAOMParams.ar_coeff_lag` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetArCoeffLag() int32 {
|
|
||||||
return (int32)(aomp.ar_coeff_lag)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetArCoeffLag sets `AVFilmGrainAOMParams.ar_coeff_lag` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) SetArCoeffLag(v int32) {
|
|
||||||
aomp.ar_coeff_lag = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetArCoeffLagAddr gets `AVFilmGrainAOMParams.ar_coeff_lag` address.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetArCoeffLagAddr() *int32 {
|
|
||||||
return (*int32)(&aomp.ar_coeff_lag)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetArCoeffsY gets `AVFilmGrainAOMParams.ar_coeffs_y` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetArCoeffsY() []int8 {
|
|
||||||
return unsafe.Slice((*int8)(&aomp.ar_coeffs_y[0]), 24)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetArCoeffsY sets `AVFilmGrainAOMParams.ar_coeffs_y` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) SetArCoeffsY(v []int8) {
|
|
||||||
for i := 0; i < FFMIN(len(v), 24); i++ {
|
|
||||||
aomp.ar_coeffs_y[i] = (C.int8_t)(v[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetArCoeffsYAddr gets `AVFilmGrainAOMParams.ar_coeffs_y` address.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetArCoeffsYAddr() **int8 {
|
|
||||||
return (**int8)(unsafe.Pointer(&aomp.ar_coeffs_y))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetArCoeffsUv gets `AVFilmGrainAOMParams.ar_coeffs_uv` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetArCoeffsUv() (v [][]int8) {
|
|
||||||
for i := 0; i < 2; i++ {
|
|
||||||
v = append(v, unsafe.Slice((*int8)(&aomp.ar_coeffs_uv[i][0]), 25))
|
|
||||||
}
|
|
||||||
return v
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetArCoeffsUv sets `AVFilmGrainAOMParams.ar_coeffs_uv` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) SetArCoeffsUv(v [][]int8) {
|
|
||||||
for i := 0; i < FFMIN(len(v), 2); i++ {
|
|
||||||
for j := 0; j < FFMIN(len(v[i]), 25); j++ {
|
|
||||||
aomp.ar_coeffs_uv[i][j] = (C.int8_t)(v[i][j])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetArCoeffsUvAddr gets `AVFilmGrainAOMParams.ar_coeffs_uv` address.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetArCoeffsUvAddr() **int8 {
|
|
||||||
return (**int8)(unsafe.Pointer(&aomp.ar_coeffs_uv))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetArCoeffShift gets `AVFilmGrainAOMParams.ar_coeff_shift` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetArCoeffShift() int32 {
|
|
||||||
return (int32)(aomp.ar_coeff_shift)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetArCoeffShift sets `AVFilmGrainAOMParams.ar_coeff_shift` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) SetArCoeffShift(v int32) {
|
|
||||||
aomp.ar_coeff_shift = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetArCoeffShiftAddr gets `AVFilmGrainAOMParams.ar_coeff_shift` address.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetArCoeffShiftAddr() *int32 {
|
|
||||||
return (*int32)(&aomp.ar_coeff_shift)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetGrainScaleShift gets `AVFilmGrainAOMParams.grain_scale_shift` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetGrainScaleShift() int32 {
|
|
||||||
return (int32)(aomp.grain_scale_shift)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetGrainScaleShift sets `AVFilmGrainAOMParams.grain_scale_shift` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) SetGrainScaleShift(v int32) {
|
|
||||||
aomp.grain_scale_shift = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetGrainScaleShiftAddr gets `AVFilmGrainAOMParams.grain_scale_shift` address.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetGrainScaleShiftAddr() *int32 {
|
|
||||||
return (*int32)(&aomp.grain_scale_shift)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUvMult gets `AVFilmGrainAOMParams.uv_mult` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetUvMult() []int32 {
|
|
||||||
return unsafe.Slice((*int32)(&aomp.uv_mult[0]), 2)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetUvMult sets `AVFilmGrainAOMParams.uv_mult` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) SetUvMult(v []int32) {
|
|
||||||
for i := 0; i < FFMIN(len(v), 2); i++ {
|
|
||||||
aomp.uv_mult[i] = (C.int)(v[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUvMultAddr gets `AVFilmGrainAOMParams.uv_mult` address.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetUvMultAddr() **int32 {
|
|
||||||
return (**int32)(unsafe.Pointer(&aomp.uv_mult))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUvMultLuma gets `AVFilmGrainAOMParams.uv_mult_luma` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetUvMultLuma() []int32 {
|
|
||||||
return unsafe.Slice((*int32)(&aomp.uv_mult_luma[0]), 2)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetUvMultLuma sets `AVFilmGrainAOMParams.uv_mult_luma` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) SetUvMultLuma(v []int32) {
|
|
||||||
for i := 0; i < FFMIN(len(v), 2); i++ {
|
|
||||||
aomp.uv_mult_luma[i] = (C.int)(v[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUvMultLumaAddr gets `AVFilmGrainAOMParams.uv_mult_luma` address.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetUvMultLumaAddr() **int32 {
|
|
||||||
return (**int32)(unsafe.Pointer(&aomp.uv_mult_luma))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUvOffset gets `AVFilmGrainAOMParams.uv_offset` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetUvOffset() []int32 {
|
|
||||||
return unsafe.Slice((*int32)(&aomp.uv_offset[0]), 2)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetUvOffset sets `AVFilmGrainAOMParams.uv_offset` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) SetUvOffset(v []int32) {
|
|
||||||
for i := 0; i < FFMIN(len(v), 2); i++ {
|
|
||||||
aomp.uv_offset[i] = (C.int)(v[i])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetUvOffsetAddr gets `AVFilmGrainAOMParams.uv_offset` address.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetUvOffsetAddr() **int32 {
|
|
||||||
return (**int32)(unsafe.Pointer(&aomp.uv_offset))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetOverlapFlag gets `AVFilmGrainAOMParams.overlap_flag` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetOverlapFlag() int32 {
|
|
||||||
return (int32)(aomp.overlap_flag)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetOverlapFlag sets `AVFilmGrainAOMParams.overlap_flag` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) SetOverlapFlag(v int32) {
|
|
||||||
aomp.overlap_flag = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetOverlapFlagAddr gets `AVFilmGrainAOMParams.overlap_flag` address.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetOverlapFlagAddr() *int32 {
|
|
||||||
return (*int32)(&aomp.overlap_flag)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetLimitOutputRange gets `AVFilmGrainAOMParams.limit_outputrange` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetLimitOutputRange() int32 {
|
|
||||||
return (int32)(aomp.limit_output_range)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetLimitOutputRange sets `AVFilmGrainAOMParams.limit_outputrange` value.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) SetLimitOutputRange(v int32) {
|
|
||||||
aomp.limit_output_range = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetLimitOutputRangeAddr gets `AVFilmGrainAOMParams.limit_outputrange` address.
|
|
||||||
func (aomp *AVFilmGrainAOMParams) GetLimitOutputRangeAddr() *int32 {
|
|
||||||
return (*int32)(&aomp.limit_output_range)
|
|
||||||
}
|
|
||||||
|
|
||||||
// AVFilmGrainParams
|
|
||||||
type AVFilmGrainParams C.struct_AVFilmGrainParams
|
|
||||||
|
|
||||||
// GetType gets `AVFilmGrainParams.type` value.
|
|
||||||
func (fgp *AVFilmGrainParams) GetType() AVFilmGrainParamsType {
|
|
||||||
return (AVFilmGrainParamsType)(fgp._type)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetType sets `AVFilmGrainParams.type` value.
|
|
||||||
func (fgp *AVFilmGrainParams) SetType(v AVFilmGrainParamsType) {
|
|
||||||
fgp._type = (C.enum_AVFilmGrainParamsType)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetTypeAddr gets `AVFilmGrainParams.type` address.
|
|
||||||
func (fgp *AVFilmGrainParams) GetTypeAddr() *AVFilmGrainParamsType {
|
|
||||||
return (*AVFilmGrainParamsType)(&fgp._type)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSeed gets `AVFilmGrainParams.seed` value.
|
|
||||||
func (fgp *AVFilmGrainParams) GetSeed() uint64 {
|
|
||||||
return (uint64)(fgp.seed)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetSeed sets `AVFilmGrainParams.seed` value.
|
|
||||||
func (fgp *AVFilmGrainParams) SetSeed(v uint64) {
|
|
||||||
fgp.seed = (C.uint64_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSeedAddr gets `AVFilmGrainParams.seed` address.
|
|
||||||
func (fgp *AVFilmGrainParams) GetSeedAddr() *uint64 {
|
|
||||||
return (*uint64)(&fgp.seed)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCodecAom gets `AVFilmGrainParams.codec_aom` value.
|
|
||||||
func (fgp *AVFilmGrainParams) GetCodecAom() AVFilmGrainAOMParams {
|
|
||||||
return (AVFilmGrainAOMParams)(
|
|
||||||
C.get_av_film_grain_params_codec_aom((*C.struct_AVFilmGrainParams)(fgp)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetCodecAom sets `AVFilmGrainParams.codec_aom` value.
|
|
||||||
func (fgp *AVFilmGrainParams) SetCodecAom(v AVFilmGrainAOMParams) {
|
|
||||||
C.set_av_film_grain_params_codec_aom((*C.struct_AVFilmGrainParams)(fgp),
|
|
||||||
(C.struct_AVFilmGrainAOMParams)(v))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetCodecAomAddr gets `AVFilmGrainParams.codec_aom` address.
|
|
||||||
func (fgp *AVFilmGrainParams) GetCodecAomAddr() *AVFilmGrainAOMParams {
|
|
||||||
return (*AVFilmGrainAOMParams)(C.get_av_film_grain_params_codec_aom_addr(
|
|
||||||
(*C.struct_AVFilmGrainParams)(fgp)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvFilmGrainParamsAlloc allocates an AVFilmGrainParams structure and set its fields to
|
|
||||||
// default values.
|
|
||||||
func AvFilmGrainParamsAlloc(size *uintptr) *AVFilmGrainParams {
|
|
||||||
return (*AVFilmGrainParams)(C.av_film_grain_params_alloc((*C.size_t)(unsafe.Pointer(size))))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvFilmGrainParamsCreateSideData allocates a complete AVFilmGrainParams and add it to the frame.
|
|
||||||
func AvFilmGrainParamsCreateSideData(frame *AVFrame) *AVFilmGrainParams {
|
|
||||||
return (*AVFilmGrainParams)(C.av_film_grain_params_create_side_data((*C.struct_AVFrame)(frame)))
|
|
||||||
}
|
|
@@ -35,9 +35,6 @@ const (
|
|||||||
AV_FRAME_DATA_S12M_TIMECODE = AVFrameSideDataType(C.AV_FRAME_DATA_S12M_TIMECODE)
|
AV_FRAME_DATA_S12M_TIMECODE = AVFrameSideDataType(C.AV_FRAME_DATA_S12M_TIMECODE)
|
||||||
AV_FRAME_DATA_DYNAMIC_HDR_PLUS = AVFrameSideDataType(C.AV_FRAME_DATA_DYNAMIC_HDR_PLUS)
|
AV_FRAME_DATA_DYNAMIC_HDR_PLUS = AVFrameSideDataType(C.AV_FRAME_DATA_DYNAMIC_HDR_PLUS)
|
||||||
AV_FRAME_DATA_REGIONS_OF_INTEREST = AVFrameSideDataType(C.AV_FRAME_DATA_REGIONS_OF_INTEREST)
|
AV_FRAME_DATA_REGIONS_OF_INTEREST = AVFrameSideDataType(C.AV_FRAME_DATA_REGIONS_OF_INTEREST)
|
||||||
AV_FRAME_DATA_VIDEO_ENC_PARAMS = AVFrameSideDataType(C.AV_FRAME_DATA_VIDEO_ENC_PARAMS)
|
|
||||||
AV_FRAME_DATA_SEI_UNREGISTERED = AVFrameSideDataType(C.AV_FRAME_DATA_SEI_UNREGISTERED)
|
|
||||||
AV_FRAME_DATA_FILM_GRAIN_PARAMS = AVFrameSideDataType(C.AV_FRAME_DATA_FILM_GRAIN_PARAMS)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// AVActiveFormatDescription
|
// AVActiveFormatDescription
|
||||||
@@ -1363,7 +1360,7 @@ func AvFrameApplyCropping(frame *AVFrame, flags int32) int32 {
|
|||||||
return (int32)(C.av_frame_apply_cropping((*C.struct_AVFrame)(frame), (C.int)(flags)))
|
return (int32)(C.av_frame_apply_cropping((*C.struct_AVFrame)(frame), (C.int)(flags)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvFrameSideDataName returns a string identifying the side data type
|
// AvFrameSideDataName returns a string identifying the side data type.
|
||||||
func AvFrameSideDataName(_type AVFrameSideDataType) string {
|
func AvFrameSideDataName(_type AVFrameSideDataType) string {
|
||||||
return C.GoString(C.av_frame_side_data_name((C.enum_AVFrameSideDataType)(_type)))
|
return C.GoString(C.av_frame_side_data_name((C.enum_AVFrameSideDataType)(_type)))
|
||||||
}
|
}
|
||||||
|
@@ -28,13 +28,15 @@ const (
|
|||||||
AV_HWDEVICE_TYPE_DRM = AVHWDeviceType(C.AV_HWDEVICE_TYPE_DRM)
|
AV_HWDEVICE_TYPE_DRM = AVHWDeviceType(C.AV_HWDEVICE_TYPE_DRM)
|
||||||
AV_HWDEVICE_TYPE_OPENCL = AVHWDeviceType(C.AV_HWDEVICE_TYPE_OPENCL)
|
AV_HWDEVICE_TYPE_OPENCL = AVHWDeviceType(C.AV_HWDEVICE_TYPE_OPENCL)
|
||||||
AV_HWDEVICE_TYPE_MEDIACODEC = AVHWDeviceType(C.AV_HWDEVICE_TYPE_MEDIACODEC)
|
AV_HWDEVICE_TYPE_MEDIACODEC = AVHWDeviceType(C.AV_HWDEVICE_TYPE_MEDIACODEC)
|
||||||
AV_HWDEVICE_TYPE_VULKAN = AVHWDeviceType(C.AV_HWDEVICE_TYPE_VULKAN)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// AVHWDeviceInternal
|
||||||
type AVHWDeviceInternal C.struct_AVHWDeviceInternal
|
type AVHWDeviceInternal C.struct_AVHWDeviceInternal
|
||||||
|
|
||||||
|
// AVHWDeviceContext
|
||||||
type AVHWDeviceContext C.struct_AVHWDeviceContext
|
type AVHWDeviceContext C.struct_AVHWDeviceContext
|
||||||
|
|
||||||
|
// typedef void (*av_hw_device_context_free_func)(struct AVHWDeviceContext *ctx);
|
||||||
type AVHWDeviceContextFreeFunc = C.av_hw_device_context_free_func
|
type AVHWDeviceContextFreeFunc = C.av_hw_device_context_free_func
|
||||||
|
|
||||||
// GetAvClass gets `AVHWDeviceContext.av_class` value.
|
// GetAvClass gets `AVHWDeviceContext.av_class` value.
|
||||||
@@ -117,10 +119,13 @@ func (dc *AVHWDeviceContext) GetUserOpaqueAddr() *unsafe.Pointer {
|
|||||||
return &dc.user_opaque
|
return &dc.user_opaque
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AVHWFramesInternal
|
||||||
type AVHWFramesInternal C.struct_AVHWFramesInternal
|
type AVHWFramesInternal C.struct_AVHWFramesInternal
|
||||||
|
|
||||||
|
// AVHWFramesContext
|
||||||
type AVHWFramesContext C.struct_AVHWFramesContext
|
type AVHWFramesContext C.struct_AVHWFramesContext
|
||||||
|
|
||||||
|
// typedef void (*av_hw_frames_context_free_func)(struct AVHWFramesContext *ctx);
|
||||||
type AVHWFramesContextFreeFunc = C.av_hw_frames_context_free_func
|
type AVHWFramesContextFreeFunc = C.av_hw_frames_context_free_func
|
||||||
|
|
||||||
// GetAvClass gets `AVHWFramesContext.av_class` value.
|
// GetAvClass gets `AVHWFramesContext.av_class` value.
|
||||||
@@ -358,17 +363,6 @@ func AvHWDeviceCtxCreateDerived(dstCtx **AVBufferRef, _type AVHWDeviceType,
|
|||||||
(C.int)(flags)))
|
(C.int)(flags)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvHWDeviceCtxCreateDerivedOpts creates a new device of the specified type from an existing device.
|
|
||||||
func AvHWDeviceCtxCreateDerivedOpts(dstCtx **AVBufferRef, _type AVHWDeviceType,
|
|
||||||
srcCtx *AVBufferRef, options *AVDictionary, flags int32) int32 {
|
|
||||||
return (int32)(C.av_hwdevice_ctx_create_derived_opts(
|
|
||||||
(**C.struct_AVBufferRef)(unsafe.Pointer(dstCtx)),
|
|
||||||
(C.enum_AVHWDeviceType)(_type),
|
|
||||||
(*C.struct_AVBufferRef)(srcCtx),
|
|
||||||
(*C.struct_AVDictionary)(options),
|
|
||||||
(C.int)(flags)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvHWFrameCtxAlloc allocates an AVHWFramesContext tied to a given device context.
|
// AvHWFrameCtxAlloc allocates an AVHWFramesContext tied to a given device context.
|
||||||
func AvHWFrameCtxAlloc(deviceCtx *AVBufferRef) *AVBufferRef {
|
func AvHWFrameCtxAlloc(deviceCtx *AVBufferRef) *AVBufferRef {
|
||||||
return (*AVBufferRef)(C.av_hwframe_ctx_alloc((*C.struct_AVBufferRef)(deviceCtx)))
|
return (*AVBufferRef)(C.av_hwframe_ctx_alloc((*C.struct_AVBufferRef)(deviceCtx)))
|
||||||
@@ -393,6 +387,7 @@ func AvHWFrameTransferData(dst, src *AVFrame, flags int32) int32 {
|
|||||||
(C.int)(flags)))
|
(C.int)(flags)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AVHWFrameTransferDirection
|
||||||
type AVHWFrameTransferDirection = C.enum_AVHWFrameTransferDirection
|
type AVHWFrameTransferDirection = C.enum_AVHWFrameTransferDirection
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -410,6 +405,7 @@ func AvHWFrameTransferGetFormats(hwframeCtx *AVBufferRef, dir AVHWFrameTransferD
|
|||||||
(C.int)(flags)))
|
(C.int)(flags)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AVHWFramesConstraints
|
||||||
type AVHWFramesConstraints C.struct_AVHWFramesConstraints
|
type AVHWFramesConstraints C.struct_AVHWFramesConstraints
|
||||||
|
|
||||||
// GetValidHwFormats gets `AVHWFramesConstraints.valid_hw_formats` value.
|
// GetValidHwFormats gets `AVHWFramesConstraints.valid_hw_formats` value.
|
||||||
|
@@ -16,3 +16,18 @@ type AVQSVDeviceContext C.struct_AVQSVDeviceContext
|
|||||||
|
|
||||||
// AVQSVFramesContext
|
// AVQSVFramesContext
|
||||||
type AVQSVFramesContext C.struct_AVQSVFramesContext
|
type AVQSVFramesContext C.struct_AVQSVFramesContext
|
||||||
|
|
||||||
|
// GetFrameType gets `AVQSVFramesContext.frame_type` value.
|
||||||
|
func (ctx *AVQSVFramesContext) GetFrameType() int32 {
|
||||||
|
return (int32)(ctx.frame_type)
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetFrameType sets `AVQSVFramesContext.frame_type` value.
|
||||||
|
func (ctx *AVQSVFramesContext) SetFrameType(v int32) {
|
||||||
|
ctx.frame_type = (C.int)(v)
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetFrameTypeAddr gets `AVQSVFramesContext.frame_type` address.
|
||||||
|
func (ctx *AVQSVFramesContext) GetFrameTypeAddr() *int32 {
|
||||||
|
return (*int32)(&ctx.frame_type)
|
||||||
|
}
|
||||||
|
@@ -41,18 +41,6 @@ func AvImageFillLinesizes(linesizes []int32, pixFmt AVPixelFormat, width int32)
|
|||||||
(C.enum_AVPixelFormat)(pixFmt), (C.int)(width)))
|
(C.enum_AVPixelFormat)(pixFmt), (C.int)(width)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvImageFillPlaneSizes fills plane sizes for an image with pixel format pix_fmt and height height.
|
|
||||||
func AvImageFillPlaneSizes(size []uintptr, pixFmt AVPixelFormat, height int32, linesizes []int) int32 {
|
|
||||||
if len(size) < 4 {
|
|
||||||
panic("size len < 4")
|
|
||||||
}
|
|
||||||
if len(linesizes) < 4 {
|
|
||||||
panic("linesizes len < 4")
|
|
||||||
}
|
|
||||||
return (int32)(C.av_image_fill_plane_sizes((*C.size_t)(unsafe.Pointer(&size[0])),
|
|
||||||
(C.enum_AVPixelFormat)(pixFmt), (C.int)(height), (*C.ptrdiff_t)(unsafe.Pointer(&linesizes[0]))))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvImageFillPointers fills plane data pointers for an image with pixel format pix_fmt and height height.
|
// AvImageFillPointers fills plane data pointers for an image with pixel format pix_fmt and height height.
|
||||||
func AvImageFillPointers(data []*uint8, pixFmt AVPixelFormat,
|
func AvImageFillPointers(data []*uint8, pixFmt AVPixelFormat,
|
||||||
height int32, ptr *uint8, linesizes []int32) int32 {
|
height int32, ptr *uint8, linesizes []int32) int32 {
|
||||||
|
@@ -17,10 +17,6 @@ void av_log_wrap(void *avcl, int level, char *fmt) {
|
|||||||
av_log(avcl, level, fmt, NULL);
|
av_log(avcl, level, fmt, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void av_log_once_wrap(void* avcl, int initial_level, int subsequent_level, int *state, char *fmt) {
|
|
||||||
av_log_once(avcl, initial_level, subsequent_level, state, fmt, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef void (*av_log_callback_func)(void*, int, const char*, va_list);
|
typedef void (*av_log_callback_func)(void*, int, const char*, va_list);
|
||||||
|
|
||||||
*/
|
*/
|
||||||
@@ -132,22 +128,16 @@ func (cls *AVClass) GetChildNextAddr() *AvClassChildNextFunc {
|
|||||||
return (*AvClassChildNextFunc)(&cls.child_next)
|
return (*AvClassChildNextFunc)(&cls.child_next)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: No use.
|
|
||||||
//
|
|
||||||
// GetChildClassNext gets `AVClass.child_class_next` value.
|
// GetChildClassNext gets `AVClass.child_class_next` value.
|
||||||
func (cls *AVClass) GetChildClassNext() AvClassChildClassNextFunc {
|
func (cls *AVClass) GetChildClassNext() AvClassChildClassNextFunc {
|
||||||
return (AvClassChildClassNextFunc)(cls.child_class_next)
|
return (AvClassChildClassNextFunc)(cls.child_class_next)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: No use.
|
|
||||||
//
|
|
||||||
// SetChildClassNext sets `AVClass.child_class_next` value.
|
// SetChildClassNext sets `AVClass.child_class_next` value.
|
||||||
func (cls *AVClass) SetChildClassNext(v AvClassChildClassNextFunc) {
|
func (cls *AVClass) SetChildClassNext(v AvClassChildClassNextFunc) {
|
||||||
cls.child_class_next = (C.av_class_child_class_next_func)(v)
|
cls.child_class_next = (C.av_class_child_class_next_func)(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: No use.
|
|
||||||
//
|
|
||||||
// GetChildClassNextAddr gets `AVClass.child_class_next` address.
|
// GetChildClassNextAddr gets `AVClass.child_class_next` address.
|
||||||
func (cls *AVClass) GetChildClassNextAddr() *AvClassChildClassNextFunc {
|
func (cls *AVClass) GetChildClassNextAddr() *AvClassChildClassNextFunc {
|
||||||
return (*AvClassChildClassNextFunc)(&cls.child_class_next)
|
return (*AvClassChildClassNextFunc)(&cls.child_class_next)
|
||||||
@@ -188,38 +178,29 @@ func AvLog(avcl CVoidPointer, level int32, _fmt string, va ...any) {
|
|||||||
C.av_log_wrap(VoidPointer(avcl), (C.int)(level), (*C.char)(strPtr))
|
C.av_log_wrap(VoidPointer(avcl), (C.int)(level), (*C.char)(strPtr))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvLogOnce sends the specified message to the log once with the initial_level and then with
|
|
||||||
// the subsequent_level. By default, all logging messages are sent to stderr.
|
|
||||||
// This behavior can be altered by setting a different logging callback function.
|
|
||||||
func AvLogOnce(avcl CVoidPointer, initialLevel, subsequentLevel int32, state *int32, _fmt string, va ...any) {
|
|
||||||
fmtPtr, fmtFunc := StringCasting(fmt.Sprintf(_fmt, va...))
|
|
||||||
defer fmtFunc()
|
|
||||||
C.av_log_once_wrap(VoidPointer(avcl), (C.int)(initialLevel), (C.int)(subsequentLevel), (*C.int)(state), (*C.char)(fmtPtr))
|
|
||||||
}
|
|
||||||
|
|
||||||
// NONEED: av_vlog
|
// NONEED: av_vlog
|
||||||
|
|
||||||
// AvLogGetLevel gets the current log level
|
// AvLogGetLevel gets the current log level.
|
||||||
func AvLogGetLevel() int32 {
|
func AvLogGetLevel() int32 {
|
||||||
return (int32)(C.av_log_get_level())
|
return (int32)(C.av_log_get_level())
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvLogSetLevel sets the log level
|
// AvLogSetLevel sets the log level.
|
||||||
func AvLogSetLevel(level int32) {
|
func AvLogSetLevel(level int32) {
|
||||||
C.av_log_set_level(C.int(level))
|
C.av_log_set_level((C.int)(level))
|
||||||
}
|
}
|
||||||
|
|
||||||
// typedef void (*av_log_callback_func)(void*, int, const char*, va_list);
|
// typedef void (*av_log_callback_func)(void*, int, const char*, va_list);
|
||||||
type AVLogCallbackFunc = C.av_log_callback_func
|
type AVLogCallbackFunc = C.av_log_callback_func
|
||||||
|
|
||||||
// AvLogSetCallback sets the logging callback
|
// AvLogSetCallback sets the logging callback.
|
||||||
func AvLogSetCallback(f AVLogCallbackFunc) {
|
func AvLogSetCallback(f AVLogCallbackFunc) {
|
||||||
C.av_log_set_callback(f)
|
C.av_log_set_callback(f)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NONEED: av_log_default_callback
|
// NONEED: av_log_default_callback
|
||||||
|
|
||||||
// AvDefaultItemName returns the context name
|
// AvDefaultItemName returns the context name.
|
||||||
func AvDefaultItemName(ctx CVoidPointer) string {
|
func AvDefaultItemName(ctx CVoidPointer) string {
|
||||||
return C.GoString(C.av_default_item_name(VoidPointer(ctx)))
|
return C.GoString(C.av_default_item_name(VoidPointer(ctx)))
|
||||||
}
|
}
|
||||||
|
@@ -9,6 +9,7 @@ package ffmpeg
|
|||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
|
// FFALIGN
|
||||||
func FFALIGN[T Integer](x, a T) T {
|
func FFALIGN[T Integer](x, a T) T {
|
||||||
return ((x) + (a) - 1) & ^((a) - 1)
|
return ((x) + (a) - 1) & ^((a) - 1)
|
||||||
}
|
}
|
||||||
|
@@ -9,6 +9,7 @@ package ffmpeg
|
|||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
|
// AVRounding
|
||||||
type AVRounding = C.enum_AVRounding
|
type AVRounding = C.enum_AVRounding
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@@ -9,6 +9,7 @@ package ffmpeg
|
|||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
|
// AVMotionVector
|
||||||
type AVMotionVector C.struct_AVMotionVector
|
type AVMotionVector C.struct_AVMotionVector
|
||||||
|
|
||||||
// GetSource gets `AVMotionVector.source` value.
|
// GetSource gets `AVMotionVector.source` value.
|
||||||
|
@@ -9,6 +9,7 @@ package ffmpeg
|
|||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
|
// AVMurMur3
|
||||||
type AVMurMur3 C.struct_AVMurMur3
|
type AVMurMur3 C.struct_AVMurMur3
|
||||||
|
|
||||||
// AvMurmur3Alloc allocates an AVMurMur3 hash context.
|
// AvMurmur3Alloc allocates an AVMurMur3 hash context.
|
||||||
|
@@ -247,10 +247,8 @@ const (
|
|||||||
|
|
||||||
AV_OPT_FLAG_READONLY = int32(C.AV_OPT_FLAG_READONLY)
|
AV_OPT_FLAG_READONLY = int32(C.AV_OPT_FLAG_READONLY)
|
||||||
AV_OPT_FLAG_BSF_PARAM = int32(C.AV_OPT_FLAG_BSF_PARAM)
|
AV_OPT_FLAG_BSF_PARAM = int32(C.AV_OPT_FLAG_BSF_PARAM)
|
||||||
AV_OPT_FLAG_RUNTIME_PARAM = int32(C.AV_OPT_FLAG_RUNTIME_PARAM)
|
|
||||||
AV_OPT_FLAG_FILTERING_PARAM = int32(C.AV_OPT_FLAG_FILTERING_PARAM)
|
AV_OPT_FLAG_FILTERING_PARAM = int32(C.AV_OPT_FLAG_FILTERING_PARAM)
|
||||||
AV_OPT_FLAG_DEPRECATED = int32(C.AV_OPT_FLAG_DEPRECATED)
|
AV_OPT_FLAG_DEPRECATED = int32(C.AV_OPT_FLAG_DEPRECATED)
|
||||||
AV_OPT_FLAG_CHILD_CONSTS = int32(C.AV_OPT_FLAG_CHILD_CONSTS)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetUnit gets `AVOption.unit` value.
|
// GetUnit gets `AVOption.unit` value.
|
||||||
@@ -507,19 +505,12 @@ func AvOptChildNext(obj, prev CVoidPointer) unsafe.Pointer {
|
|||||||
return C.av_opt_child_next(VoidPointer(obj), VoidPointer(prev))
|
return C.av_opt_child_next(VoidPointer(obj), VoidPointer(prev))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated: Use AvOptChildClassIterate instead.
|
|
||||||
//
|
|
||||||
// AvOptChildClassNext
|
// AvOptChildClassNext
|
||||||
func AvOptChildClassNext(parent, prev *AVClass) *AVClass {
|
func AvOptChildClassNext(parent, prev *AVClass) *AVClass {
|
||||||
return (*AVClass)(C.av_opt_child_class_next((*C.struct_AVClass)(parent),
|
return (*AVClass)(C.av_opt_child_class_next((*C.struct_AVClass)(parent),
|
||||||
(*C.struct_AVClass)(prev)))
|
(*C.struct_AVClass)(prev)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvOptChildClassIterate iterates over potential AVOptions-enabled children of parent.
|
|
||||||
func AvOptChildClassIterate(parent *AVClass, iter CVoidPointerPointer) *AVClass {
|
|
||||||
return (*AVClass)(C.av_opt_child_class_iterate((*C.struct_AVClass)(parent), VoidPointerPointer(iter)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvOptSet
|
// AvOptSet
|
||||||
func AvOptSet(obj CVoidPointer, name string, val string, searchFlags int32) int32 {
|
func AvOptSet(obj CVoidPointer, name string, val string, searchFlags int32) int32 {
|
||||||
namePtr, nameFunc := StringCasting(name)
|
namePtr, nameFunc := StringCasting(name)
|
||||||
|
@@ -10,6 +10,7 @@ package ffmpeg
|
|||||||
import "C"
|
import "C"
|
||||||
import "unsafe"
|
import "unsafe"
|
||||||
|
|
||||||
|
// AVComponentDescriptor
|
||||||
type AVComponentDescriptor C.struct_AVComponentDescriptor
|
type AVComponentDescriptor C.struct_AVComponentDescriptor
|
||||||
|
|
||||||
// GetPlane gets `AVComponentDescriptor.plane` value.
|
// GetPlane gets `AVComponentDescriptor.plane` value.
|
||||||
|
@@ -10,6 +10,7 @@ package ffmpeg
|
|||||||
*/
|
*/
|
||||||
import "C"
|
import "C"
|
||||||
|
|
||||||
|
// AVPixelutilsSadFn
|
||||||
type AVPixelutilsSadFn C.av_pixelutils_sad_fn
|
type AVPixelutilsSadFn C.av_pixelutils_sad_fn
|
||||||
|
|
||||||
// AvPixelutilsGetSadFn gets a potentially optimized pointer to a Sum-of-absolute-differences
|
// AvPixelutilsGetSadFn gets a potentially optimized pointer to a Sum-of-absolute-differences
|
||||||
|
@@ -252,14 +252,7 @@ const (
|
|||||||
AV_PIX_FMT_NV24 = AVPixelFormat(C.AV_PIX_FMT_NV24)
|
AV_PIX_FMT_NV24 = AVPixelFormat(C.AV_PIX_FMT_NV24)
|
||||||
AV_PIX_FMT_NV42 = AVPixelFormat(C.AV_PIX_FMT_NV42)
|
AV_PIX_FMT_NV42 = AVPixelFormat(C.AV_PIX_FMT_NV42)
|
||||||
|
|
||||||
AV_PIX_FMT_VULKAN = AVPixelFormat(C.AV_PIX_FMT_VULKAN)
|
AV_PIX_FMT_NB = AVPixelFormat(C.AV_PIX_FMT_NB)
|
||||||
|
|
||||||
AV_PIX_FMT_Y210BE = AVPixelFormat(C.AV_PIX_FMT_Y210BE)
|
|
||||||
AV_PIX_FMT_Y210LE = AVPixelFormat(C.AV_PIX_FMT_Y210LE)
|
|
||||||
|
|
||||||
AV_PIX_FMT_X2RGB10LE = AVPixelFormat(C.AV_PIX_FMT_X2RGB10LE)
|
|
||||||
AV_PIX_FMT_X2RGB10BE = AVPixelFormat(C.AV_PIX_FMT_X2RGB10BE)
|
|
||||||
AV_PIX_FMT_NB = AVPixelFormat(C.AV_PIX_FMT_NB)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -341,9 +334,6 @@ const (
|
|||||||
AV_PIX_FMT_AYUV64 = AVPixelFormat(C.AV_PIX_FMT_AYUV64)
|
AV_PIX_FMT_AYUV64 = AVPixelFormat(C.AV_PIX_FMT_AYUV64)
|
||||||
AV_PIX_FMT_P010 = AVPixelFormat(C.AV_PIX_FMT_P010)
|
AV_PIX_FMT_P010 = AVPixelFormat(C.AV_PIX_FMT_P010)
|
||||||
AV_PIX_FMT_P016 = AVPixelFormat(C.AV_PIX_FMT_P016)
|
AV_PIX_FMT_P016 = AVPixelFormat(C.AV_PIX_FMT_P016)
|
||||||
|
|
||||||
AV_PIX_FMT_Y210 = AVPixelFormat(C.AV_PIX_FMT_Y210)
|
|
||||||
AV_PIX_FMT_X2RGB10 = AVPixelFormat(C.AV_PIX_FMT_X2RGB10)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Chromaticity coordinates of the source primaries.
|
// Chromaticity coordinates of the source primaries.
|
||||||
@@ -365,7 +355,6 @@ const (
|
|||||||
AVCOL_PRI_SMPTEST428_1 = AVColorPrimaries(C.AVCOL_PRI_SMPTEST428_1)
|
AVCOL_PRI_SMPTEST428_1 = AVColorPrimaries(C.AVCOL_PRI_SMPTEST428_1)
|
||||||
AVCOL_PRI_SMPTE431 = AVColorPrimaries(C.AVCOL_PRI_SMPTE431)
|
AVCOL_PRI_SMPTE431 = AVColorPrimaries(C.AVCOL_PRI_SMPTE431)
|
||||||
AVCOL_PRI_SMPTE432 = AVColorPrimaries(C.AVCOL_PRI_SMPTE432)
|
AVCOL_PRI_SMPTE432 = AVColorPrimaries(C.AVCOL_PRI_SMPTE432)
|
||||||
AVCOL_PRI_EBU3213 = AVColorPrimaries(C.AVCOL_PRI_EBU3213)
|
|
||||||
AVCOL_PRI_JEDEC_P22 = AVColorPrimaries(C.AVCOL_PRI_JEDEC_P22)
|
AVCOL_PRI_JEDEC_P22 = AVColorPrimaries(C.AVCOL_PRI_JEDEC_P22)
|
||||||
AVCOL_PRI_NB = AVColorPrimaries(C.AVCOL_PRI_NB)
|
AVCOL_PRI_NB = AVColorPrimaries(C.AVCOL_PRI_NB)
|
||||||
)
|
)
|
||||||
|
@@ -87,7 +87,7 @@ func AvD2Q(d float64, max int32) AVRational {
|
|||||||
// return One of the following values:
|
// return One of the following values:
|
||||||
// 1 if `q1` is nearer to `q` than `q2`
|
// 1 if `q1` is nearer to `q` than `q2`
|
||||||
// -1 if `q2` is nearer to `q` than `q1`
|
// -1 if `q2` is nearer to `q` than `q1`
|
||||||
// 0 if they have the same distance
|
// 0 if they have the same distance.
|
||||||
func AvNearerQ(q, q1, q2 AVRational) int32 {
|
func AvNearerQ(q, q1, q2 AVRational) int32 {
|
||||||
return (int32)(C.av_nearer_q((C.struct_AVRational)(q),
|
return (int32)(C.av_nearer_q((C.struct_AVRational)(q),
|
||||||
(C.struct_AVRational)(q1), (C.struct_AVRational)(q2)))
|
(C.struct_AVRational)(q1), (C.struct_AVRational)(q2)))
|
||||||
@@ -102,10 +102,3 @@ func AvFindNearestQIdx(q AVRational, qList *AVRational) int32 {
|
|||||||
func AvQ2intfloat(q AVRational) uint32 {
|
func AvQ2intfloat(q AVRational) uint32 {
|
||||||
return (uint32)(C.av_q2intfloat((C.struct_AVRational)(q)))
|
return (uint32)(C.av_q2intfloat((C.struct_AVRational)(q)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvGcdQ returns the best rational so that a and b are multiple of it.
|
|
||||||
// If the resulting denominator is larger than max_den, return def.
|
|
||||||
func AvGcdQ(a, b AVRational, maxDen int32, def AVRational) AVRational {
|
|
||||||
return (AVRational)(C.av_gcd_q((C.struct_AVRational)(a), (C.struct_AVRational)(b),
|
|
||||||
(C.int)(maxDen), (C.struct_AVRational)(def)))
|
|
||||||
}
|
|
||||||
|
@@ -49,7 +49,7 @@ func AvGetSampleFmt(name string) AVSampleFormat {
|
|||||||
// requested planar/packed format, the format returned is the same as the
|
// requested planar/packed format, the format returned is the same as the
|
||||||
// input.
|
// input.
|
||||||
func AvGetAltSampleFmt(sampleFmt AVSampleFormat, planar int32) AVSampleFormat {
|
func AvGetAltSampleFmt(sampleFmt AVSampleFormat, planar int32) AVSampleFormat {
|
||||||
return (AVSampleFormat)(C.av_get_alt_sample_fmt((C.enum_AVSampleFormat)(sampleFmt), C.int(planar)))
|
return (AVSampleFormat)(C.av_get_alt_sample_fmt((C.enum_AVSampleFormat)(sampleFmt), (C.int)(planar)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvGetPackedSampleFmt gets the packed alternative form of the given sample format.
|
// AvGetPackedSampleFmt gets the packed alternative form of the given sample format.
|
||||||
|
@@ -10,6 +10,7 @@ package ffmpeg
|
|||||||
import "C"
|
import "C"
|
||||||
import "unsafe"
|
import "unsafe"
|
||||||
|
|
||||||
|
// AVSphericalProjection
|
||||||
type AVSphericalProjection = C.enum_AVSphericalProjection
|
type AVSphericalProjection = C.enum_AVSphericalProjection
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -18,6 +19,7 @@ const (
|
|||||||
AV_SPHERICAL_EQUIRECTANGULAR_TILE = AVSphericalProjection(C.AV_SPHERICAL_EQUIRECTANGULAR_TILE)
|
AV_SPHERICAL_EQUIRECTANGULAR_TILE = AVSphericalProjection(C.AV_SPHERICAL_EQUIRECTANGULAR_TILE)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// AVSphericalMapping
|
||||||
type AVSphericalMapping C.struct_AVSphericalMapping
|
type AVSphericalMapping C.struct_AVSphericalMapping
|
||||||
|
|
||||||
// GetProjection gets `AVSphericalMapping.projection` value.
|
// GetProjection gets `AVSphericalMapping.projection` value.
|
||||||
|
@@ -36,6 +36,7 @@ const (
|
|||||||
AV_STEREO3D_FLAG_INVERT = C.AV_STEREO3D_FLAG_INVERT
|
AV_STEREO3D_FLAG_INVERT = C.AV_STEREO3D_FLAG_INVERT
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// AVStereo3D
|
||||||
type AVStereo3D C.struct_AVStereo3D
|
type AVStereo3D C.struct_AVStereo3D
|
||||||
|
|
||||||
// GetType gets `AVStereo3D.type` value.
|
// GetType gets `AVStereo3D.type` value.
|
||||||
|
@@ -12,6 +12,7 @@ typedef void (*av_thread_message_free_func)(void *msg);
|
|||||||
import "C"
|
import "C"
|
||||||
import "unsafe"
|
import "unsafe"
|
||||||
|
|
||||||
|
// AVThreadMessageQueue
|
||||||
type AVThreadMessageQueue C.struct_AVThreadMessageQueue
|
type AVThreadMessageQueue C.struct_AVThreadMessageQueue
|
||||||
|
|
||||||
// AVThreadMessageFlags
|
// AVThreadMessageFlags
|
||||||
|
@@ -13,6 +13,7 @@ const (
|
|||||||
AV_TIMECODE_STR_SIZE = C.AV_TIMECODE_STR_SIZE
|
AV_TIMECODE_STR_SIZE = C.AV_TIMECODE_STR_SIZE
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// AVTimecodeFlag
|
||||||
type AVTimecodeFlag = C.enum_AVTimecodeFlag
|
type AVTimecodeFlag = C.enum_AVTimecodeFlag
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -21,6 +22,7 @@ const (
|
|||||||
AV_TIMECODE_FLAG_ALLOWNEGATIVE = AVTimecodeFlag(C.AV_TIMECODE_FLAG_ALLOWNEGATIVE)
|
AV_TIMECODE_FLAG_ALLOWNEGATIVE = AVTimecodeFlag(C.AV_TIMECODE_FLAG_ALLOWNEGATIVE)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// AVTimecode
|
||||||
type AVTimecode C.AVTimecode
|
type AVTimecode C.AVTimecode
|
||||||
|
|
||||||
// GetStart gets `AVTimecode.start` value.
|
// GetStart gets `AVTimecode.start` value.
|
||||||
@@ -93,12 +95,6 @@ func AvTimecodeGetSmpteFromFramenum(tc *AVTimecode, framenum int32) uint32 {
|
|||||||
return (uint32)(C.av_timecode_get_smpte_from_framenum((*C.AVTimecode)(tc), (C.int)(framenum)))
|
return (uint32)(C.av_timecode_get_smpte_from_framenum((*C.AVTimecode)(tc), (C.int)(framenum)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvTimecodeGetSmpte converts sei info to SMPTE 12M binary representation.
|
|
||||||
func AvTimecodeGetSmpte(rate AVRational, drop, hh, mm, ss, ff int32) int32 {
|
|
||||||
return (int32)(C.av_timecode_get_smpte((C.struct_AVRational)(rate),
|
|
||||||
(C.int)(drop), (C.int)(hh), (C.int)(mm), (C.int)(ss), (C.int)(ff)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvTimecodeMakeString loads timecode string in buf.
|
// AvTimecodeMakeString loads timecode string in buf.
|
||||||
func AvTimecodeMakeString(tc *AVTimecode, framenum int32) (buf, bufPar string) {
|
func AvTimecodeMakeString(tc *AVTimecode, framenum int32) (buf, bufPar string) {
|
||||||
b := make([]C.char, AV_TIMECODE_STR_SIZE+1)
|
b := make([]C.char, AV_TIMECODE_STR_SIZE+1)
|
||||||
@@ -106,14 +102,6 @@ func AvTimecodeMakeString(tc *AVTimecode, framenum int32) (buf, bufPar string) {
|
|||||||
return C.GoString(&b[0]), C.GoString(ret)
|
return C.GoString(&b[0]), C.GoString(ret)
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvTimecodeMakeSmpteTcString2 gets the timecode string from the SMPTE timecode format.
|
|
||||||
func AvTimecodeMakeSmpteTcString2(rate AVRational, tcsmpte uint32, preventDf, skipField int32) (buf, bufPar string) {
|
|
||||||
b := make([]C.char, AV_TIMECODE_STR_SIZE+1)
|
|
||||||
ret := C.av_timecode_make_smpte_tc_string2((*C.char)(&b[0]),
|
|
||||||
(C.AVRational)(rate), (C.uint32_t)(tcsmpte), (C.int)(preventDf), (C.int)(skipField))
|
|
||||||
return C.GoString(&b[0]), C.GoString(ret)
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvTimecodeMakeSmpteTcString gets the timecode string from the SMPTE timecode format.
|
// AvTimecodeMakeSmpteTcString gets the timecode string from the SMPTE timecode format.
|
||||||
func AvTimecodeMakeSmpteTcString(tcsmpte uint32, preventDf int32) (buf, bufPar string) {
|
func AvTimecodeMakeSmpteTcString(tcsmpte uint32, preventDf int32) (buf, bufPar string) {
|
||||||
b := make([]C.char, AV_TIMECODE_STR_SIZE+1)
|
b := make([]C.char, AV_TIMECODE_STR_SIZE+1)
|
||||||
@@ -134,15 +122,6 @@ func AvTimecodeInit(tc *AVTimecode, rate AVRational, flags, frameStart int32, lo
|
|||||||
(C.int)(flags), (C.int)(frameStart), VoidPointer(logCtx)))
|
(C.int)(flags), (C.int)(frameStart), VoidPointer(logCtx)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvTimecodeInitFromComponents initializes a timecode struct from the passed timecode components.
|
|
||||||
func AvTimecodeInitFromComponents(tc *AVTimecode, rate AVRational,
|
|
||||||
flags, hh, mm, ss, ff int32, logCtx CVoidPointer) int32 {
|
|
||||||
return (int32)(C.av_timecode_init_from_components((*C.AVTimecode)(tc),
|
|
||||||
(C.struct_AVRational)(rate), (C.int)(flags),
|
|
||||||
(C.int)(hh), (C.int)(mm), (C.int)(ss), (C.int)(ff),
|
|
||||||
VoidPointer(logCtx)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvTimecodeInitFromString parses timecode representation (hh:mm:ss[:;.]ff).
|
// AvTimecodeInitFromString parses timecode representation (hh:mm:ss[:;.]ff).
|
||||||
func AvTimecodeInitFromString(tc *AVTimecode, rate AVRational, str string, logCtx CVoidPointer) int32 {
|
func AvTimecodeInitFromString(tc *AVTimecode, rate AVRational, str string, logCtx CVoidPointer) int32 {
|
||||||
strPtr, strFunc := StringCasting(str)
|
strPtr, strFunc := StringCasting(str)
|
||||||
@@ -151,7 +130,7 @@ func AvTimecodeInitFromString(tc *AVTimecode, rate AVRational, str string, logCt
|
|||||||
(*C.char)(strPtr), VoidPointer(logCtx)))
|
(*C.char)(strPtr), VoidPointer(logCtx)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvTimecodeCheckFrameRate checks if the timecode feature is available for the given frame rate
|
// AvTimecodeCheckFrameRate checks if the timecode feature is available for the given frame rate.
|
||||||
func AvTimecodeCheckFrameRate(rate AVRational) int32 {
|
func AvTimecodeCheckFrameRate(rate AVRational) int32 {
|
||||||
return (int32)(C.av_timecode_check_frame_rate((C.struct_AVRational)(rate)))
|
return (int32)(C.av_timecode_check_frame_rate((C.struct_AVRational)(rate)))
|
||||||
}
|
}
|
||||||
|
@@ -14,6 +14,7 @@ typedef int (*av_tree_enu_func)(void *opaque, void *elem);
|
|||||||
import "C"
|
import "C"
|
||||||
import "unsafe"
|
import "unsafe"
|
||||||
|
|
||||||
|
// AVTreeNode
|
||||||
type AVTreeNode C.struct_AVTreeNode
|
type AVTreeNode C.struct_AVTreeNode
|
||||||
|
|
||||||
// typedef int (*av_tree_cmp_func)(void *opaque, void *elem);
|
// typedef int (*av_tree_cmp_func)(void *opaque, void *elem);
|
||||||
|
@@ -23,7 +23,7 @@ func AvTwofishInit(d *AVTWOFISH, key *uint8, keyBits int32) int32 {
|
|||||||
(*C.uint8_t)(key), (C.int)(keyBits)))
|
(*C.uint8_t)(key), (C.int)(keyBits)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// AvTwofishCrypt encrypts or decrypts a buffer using a previously initialized context
|
// AvTwofishCrypt encrypts or decrypts a buffer using a previously initialized context.
|
||||||
func AvTwofishCrypt(d *AVTWOFISH, dst, src *uint8, count int32, iv *uint8, decrypt int32) {
|
func AvTwofishCrypt(d *AVTWOFISH, dst, src *uint8, count int32, iv *uint8, decrypt int32) {
|
||||||
C.av_twofish_crypt((*C.struct_AVTWOFISH)(d),
|
C.av_twofish_crypt((*C.struct_AVTWOFISH)(d),
|
||||||
(*C.uint8_t)(dst), (*C.uint8_t)(src),
|
(*C.uint8_t)(dst), (*C.uint8_t)(src),
|
||||||
|
89
avutil_tx.go
89
avutil_tx.go
@@ -56,105 +56,20 @@ func (cf *AVComplexFloat) GetImAddr() *float32 {
|
|||||||
// AVComplexDouble
|
// AVComplexDouble
|
||||||
type AVComplexDouble C.struct_AVComplexDouble
|
type AVComplexDouble C.struct_AVComplexDouble
|
||||||
|
|
||||||
// Make new AVComplexDouble.
|
|
||||||
func AvMakeComxDouble(re, im float64) AVComplexDouble {
|
|
||||||
return (AVComplexDouble)(C.struct_AVComplexDouble{
|
|
||||||
re: (C.double)(re),
|
|
||||||
im: (C.double)(im)})
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetRe gets `AVComplexDouble.re` value.
|
|
||||||
func (cd *AVComplexDouble) GetRe() float64 {
|
|
||||||
return (float64)(cd.re)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetRe sets `AVComplexDouble.re` value.
|
|
||||||
func (cd *AVComplexDouble) SetRe(v float64) {
|
|
||||||
cd.re = (C.double)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetReAddr gets `AVComplexDouble.re` address.
|
|
||||||
func (cd *AVComplexDouble) GetReAddr() *float64 {
|
|
||||||
return (*float64)(&cd.re)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetIm gets `AVComplexDouble.im` value.
|
|
||||||
func (cd *AVComplexDouble) GetIm() float64 {
|
|
||||||
return (float64)(cd.im)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetIm sets `AVComplexDouble.im` value.
|
|
||||||
func (cd *AVComplexDouble) SetIm(v float64) {
|
|
||||||
cd.im = (C.double)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetImAddr gets `AVComplexDouble.im` address.
|
|
||||||
func (cd *AVComplexDouble) GetImAddr() *float64 {
|
|
||||||
return (*float64)(&cd.im)
|
|
||||||
}
|
|
||||||
|
|
||||||
// AVComplexInt32
|
// AVComplexInt32
|
||||||
type AVComplexInt32 C.struct_AVComplexInt32
|
type AVComplexInt32 C.struct_AVComplexInt32
|
||||||
|
|
||||||
// Make new AVComplexFloat.
|
|
||||||
func AvMakeComxInt32(re, im int32) AVComplexInt32 {
|
|
||||||
return (AVComplexInt32)(C.struct_AVComplexInt32{
|
|
||||||
re: (C.int32_t)(re),
|
|
||||||
im: (C.int32_t)(im)})
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetRe gets `AVComplexInt32.re` value.
|
|
||||||
func (ci *AVComplexInt32) GetRe() int32 {
|
|
||||||
return (int32)(ci.re)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetRe sets `AVComplexInt32.re` value.
|
|
||||||
func (ci *AVComplexInt32) SetRe(v int32) {
|
|
||||||
ci.re = (C.int32_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetReAddr gets `AVComplexInt32.re` address.
|
|
||||||
func (ci *AVComplexInt32) GetReAddr() *int32 {
|
|
||||||
return (*int32)(&ci.re)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetIm gets `AVComplexInt32.im` value.
|
|
||||||
func (ci *AVComplexInt32) GetIm() int32 {
|
|
||||||
return (int32)(ci.im)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetIm sets `AVComplexInt32.im` value.
|
|
||||||
func (ci *AVComplexInt32) SetIm(v int32) {
|
|
||||||
ci.im = (C.int32_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetImAddr gets `AVComplexInt32.im` address.
|
|
||||||
func (ci *AVComplexInt32) GetImAddr() *int32 {
|
|
||||||
return (*int32)(&ci.im)
|
|
||||||
}
|
|
||||||
|
|
||||||
// AVTXType
|
// AVTXType
|
||||||
type AVTXType = C.enum_AVTXType
|
type AVTXType = C.enum_AVTXType
|
||||||
|
|
||||||
const (
|
const (
|
||||||
AV_TX_FLOAT_FFT = AVTXType(C.AV_TX_FLOAT_FFT)
|
AV_TX_FLOAT_FFT = AVTXType(C.AV_TX_FLOAT_FFT)
|
||||||
AV_TX_FLOAT_MDCT = AVTXType(C.AV_TX_FLOAT_MDCT)
|
AV_TX_FLOAT_MDCT = AVTXType(C.AV_TX_FLOAT_MDCT)
|
||||||
AV_TX_DOUBLE_FFT = AVTXType(C.AV_TX_DOUBLE_FFT)
|
|
||||||
AV_TX_DOUBLE_MDCT = AVTXType(C.AV_TX_DOUBLE_MDCT)
|
|
||||||
AV_TX_INT32_FFT = AVTXType(C.AV_TX_INT32_FFT)
|
|
||||||
AV_TX_INT32_MDCT = AVTXType(C.AV_TX_INT32_MDCT)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// typedef void (*av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride);
|
// typedef void (*av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride);
|
||||||
type AvTxFn = C.av_tx_fn
|
type AvTxFn = C.av_tx_fn
|
||||||
|
|
||||||
// AVTXFlags
|
|
||||||
type AVTXFlags = C.enum_AVTXFlags
|
|
||||||
|
|
||||||
const (
|
|
||||||
AV_TX_INPLACE = AVTXFlags(C.AV_TX_INPLACE)
|
|
||||||
)
|
|
||||||
|
|
||||||
// AvTxInit initializes a transform context with the given configuration
|
// AvTxInit initializes a transform context with the given configuration
|
||||||
// (i)MDCTs with an odd length are currently not supported.
|
// (i)MDCTs with an odd length are currently not supported.
|
||||||
func AvTxInit(ctx **AVTXContext, tx *AvTxFn, _type AVTXType,
|
func AvTxInit(ctx **AVTXContext, tx *AvTxFn, _type AVTXType,
|
||||||
|
@@ -1,220 +0,0 @@
|
|||||||
// Copyright (c) 2023 QRTC. All rights reserved.
|
|
||||||
// Use of this source code is governed by a MIT
|
|
||||||
// license that can be found in the LICENSE file.
|
|
||||||
|
|
||||||
package ffmpeg
|
|
||||||
|
|
||||||
/*
|
|
||||||
#include <libavutil/video_enc_params.h>
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
import "unsafe"
|
|
||||||
|
|
||||||
// AVVideoEncParamsType
|
|
||||||
type AVVideoEncParamsType = C.enum_AVVideoEncParamsType
|
|
||||||
|
|
||||||
const (
|
|
||||||
AV_VIDEO_ENC_PARAMS_NONE = AVVideoEncParamsType(C.AV_VIDEO_ENC_PARAMS_NONE)
|
|
||||||
AV_VIDEO_ENC_PARAMS_VP9 = AVVideoEncParamsType(C.AV_VIDEO_ENC_PARAMS_VP9)
|
|
||||||
AV_VIDEO_ENC_PARAMS_H264 = AVVideoEncParamsType(C.AV_VIDEO_ENC_PARAMS_H264)
|
|
||||||
AV_VIDEO_ENC_PARAMS_MPEG2 = AVVideoEncParamsType(C.AV_VIDEO_ENC_PARAMS_MPEG2)
|
|
||||||
)
|
|
||||||
|
|
||||||
// AVVideoEncParams
|
|
||||||
type AVVideoEncParams C.struct_AVVideoEncParams
|
|
||||||
|
|
||||||
// GetNbBlocks gets `AVVideoEncParams.nb_blocks` value.
|
|
||||||
func (vep *AVVideoEncParams) GetNbBlocks() uint32 {
|
|
||||||
return (uint32)(vep.nb_blocks)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetNbBlocks sets `AVVideoEncParams.nb_blocks` value.
|
|
||||||
func (vep *AVVideoEncParams) SetNbBlocks(v uint32) {
|
|
||||||
vep.nb_blocks = (C.uint)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetNbBlocksAddr gets `AVVideoEncParams.nb_blocks` address.
|
|
||||||
func (vep *AVVideoEncParams) GetNbBlocksAddr() *uint32 {
|
|
||||||
return (*uint32)(&vep.nb_blocks)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetBlocksOffset gets `AVVideoEncParams.blocks_offset` value.
|
|
||||||
func (vep *AVVideoEncParams) GetBlocksOffset() uintptr {
|
|
||||||
return (uintptr)(vep.blocks_offset)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetBlocksOffset sets `AVVideoEncParams.blocks_offset` value.
|
|
||||||
func (vep *AVVideoEncParams) SetBlocksOffset(v uintptr) {
|
|
||||||
vep.blocks_offset = (C.size_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetBlocksOffsetAddr gets `AVVideoEncParams.blocks_offset` address.
|
|
||||||
func (vep *AVVideoEncParams) GetBlocksOffsetAddr() *uintptr {
|
|
||||||
return (*uintptr)(unsafe.Pointer(&vep.blocks_offset))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetBlockSize gets `AVVideoEncParams.block_size` value.
|
|
||||||
func (vep *AVVideoEncParams) GetBlockSize() uintptr {
|
|
||||||
return (uintptr)(vep.block_size)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetBlockSize sets `AVVideoEncParams.block_size` value.
|
|
||||||
func (vep *AVVideoEncParams) SetBlockSize(v uintptr) {
|
|
||||||
vep.block_size = (C.size_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetBlockSizeAddr gets `AVVideoEncParams.block_size` address.
|
|
||||||
func (vep *AVVideoEncParams) GetBlockSizeAddr() *uintptr {
|
|
||||||
return (*uintptr)(unsafe.Pointer(&vep.block_size))
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetType gets `AVVideoEncParams.type` value.
|
|
||||||
func (vep *AVVideoEncParams) GetType() AVVideoEncParamsType {
|
|
||||||
return (AVVideoEncParamsType)(vep._type)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetType sets `AVVideoEncParams.type` value.
|
|
||||||
func (vep *AVVideoEncParams) SetType(v AVVideoEncParamsType) {
|
|
||||||
vep._type = (C.enum_AVVideoEncParamsType)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetTypeAddr gets `AVVideoEncParams.type` address.
|
|
||||||
func (vep *AVVideoEncParams) GetTypeAddr() *AVVideoEncParamsType {
|
|
||||||
return (*AVVideoEncParamsType)(&vep._type)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetQp gets `AVVideoEncParams.qp` value.
|
|
||||||
func (vep *AVVideoEncParams) GetQp() int32 {
|
|
||||||
return (int32)(vep.qp)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetQp sets `AVVideoEncParams.qp` value.
|
|
||||||
func (vep *AVVideoEncParams) SetQp(v int32) {
|
|
||||||
vep.qp = (C.int32_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetQpAddr gets `AVVideoEncParams.qp` address.
|
|
||||||
func (vep *AVVideoEncParams) GetQpAddr() *int32 {
|
|
||||||
return (*int32)(&vep.qp)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDeltaQp gets `AVVideoEncParams.delta_qp` value.
|
|
||||||
func (vep *AVVideoEncParams) GetDeltaQp() (v [][]int32) {
|
|
||||||
for i := 0; i < 4; i++ {
|
|
||||||
v = append(v, unsafe.Slice((*int32)(&vep.delta_qp[i][0]), 2))
|
|
||||||
}
|
|
||||||
return v
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetDeltaQp sets `AVVideoEncParams.delta_qp` value.
|
|
||||||
func (vep *AVVideoEncParams) SetDeltaQp(v [][]int32) {
|
|
||||||
for i := 0; i < FFMIN(len(v), 4); i++ {
|
|
||||||
for j := 0; j < FFMIN(len(v[i]), 2); j++ {
|
|
||||||
vep.delta_qp[i][j] = (C.int)(v[i][j])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDeltaQpAddr gets `AVVideoEncParams.delta_qp` address.
|
|
||||||
func (vep *AVVideoEncParams) GetDeltaQpAddr() **int32 {
|
|
||||||
return (**int32)(unsafe.Pointer(&vep.delta_qp))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AVVideoBlockParams
|
|
||||||
type AVVideoBlockParams C.struct_AVVideoBlockParams
|
|
||||||
|
|
||||||
// GetSrcX gets `AVVideoBlockParams.src_x` value.
|
|
||||||
func (vbp *AVVideoBlockParams) GetSrcX() int32 {
|
|
||||||
return (int32)(vbp.src_x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetSrcX sets `AVVideoBlockParams.src_x` value.
|
|
||||||
func (vbp *AVVideoBlockParams) SetSrcX(v int32) {
|
|
||||||
vbp.src_x = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSrcXAddr gets `AVVideoBlockParams.src_x` address.
|
|
||||||
func (vbp *AVVideoBlockParams) GetSrcXAddr() *int32 {
|
|
||||||
return (*int32)(&vbp.src_x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSrcY gets `AVVideoBlockParams.src_y` value.
|
|
||||||
func (vbp *AVVideoBlockParams) GetSrcY() int32 {
|
|
||||||
return (int32)(vbp.src_y)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetSrcY sets `AVVideoBlockParams.src_y` value.
|
|
||||||
func (vbp *AVVideoBlockParams) SetSrcY(v int32) {
|
|
||||||
vbp.src_y = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetSrcYAddr gets `AVVideoBlockParams.src_y` address.
|
|
||||||
func (vbp *AVVideoBlockParams) GetSrcYAddr() *int32 {
|
|
||||||
return (*int32)(&vbp.src_y)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetW gets `AVVideoBlockParams.w` value.
|
|
||||||
func (vbp *AVVideoBlockParams) GetW() int32 {
|
|
||||||
return (int32)(vbp.w)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetW sets `AVVideoBlockParams.w` value.
|
|
||||||
func (vbp *AVVideoBlockParams) SetW(v int32) {
|
|
||||||
vbp.w = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetWAddr gets `AVVideoBlockParams.w` address.
|
|
||||||
func (vbp *AVVideoBlockParams) GetWAddr() *int32 {
|
|
||||||
return (*int32)(&vbp.w)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetH gets `AVVideoBlockParams.h` value.
|
|
||||||
func (vbp *AVVideoBlockParams) GetH() int32 {
|
|
||||||
return (int32)(vbp.h)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetH sets `AVVideoBlockParams.h` value.
|
|
||||||
func (vbp *AVVideoBlockParams) SetH(v int32) {
|
|
||||||
vbp.h = (C.int)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetHAddr gets `AVVideoBlockParams.h` address.
|
|
||||||
func (vbp *AVVideoBlockParams) GetHAddr() *int32 {
|
|
||||||
return (*int32)(&vbp.h)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDeltaQp gets `AVVideoBlockParams.delta_qp` value.
|
|
||||||
func (vbp *AVVideoBlockParams) GetDeltaQp() int32 {
|
|
||||||
return (int32)(vbp.delta_qp)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetDeltaQp sets `AVVideoBlockParams.delta_qp` value.
|
|
||||||
func (vbp *AVVideoBlockParams) SetDeltaQp(v int32) {
|
|
||||||
vbp.delta_qp = (C.int32_t)(v)
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetDeltaQpAddr gets `AVVideoBlockParams.delta_qp` address.
|
|
||||||
func (vbp *AVVideoBlockParams) GetDeltaQpAddr() *int32 {
|
|
||||||
return (*int32)(&vbp.delta_qp)
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvVideoEncParamsBlock gets the block at the specified idx.
|
|
||||||
func AvVideoEncParamsBlock(par *AVVideoEncParams, idx uint32) *AVVideoBlockParams {
|
|
||||||
return (*AVVideoBlockParams)(C.av_video_enc_params_block((*C.struct_AVVideoEncParams)(par), (C.uint)(idx)))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvVideoEncParamsAlloc allocates memory for AVVideoEncParams of the given type, plus an array of
|
|
||||||
// nbBlocks AVVideoBlockParams and initializes the variables.
|
|
||||||
func AvVideoEncParamsAlloc(_type AVVideoEncParamsType, nbBlocks uint32, outSize *uintptr) *AVVideoEncParams {
|
|
||||||
return (*AVVideoEncParams)(C.av_video_enc_params_alloc((C.enum_AVVideoEncParamsType)(_type),
|
|
||||||
(C.uint)(nbBlocks), (*C.size_t)(unsafe.Pointer(outSize))))
|
|
||||||
}
|
|
||||||
|
|
||||||
// AvVideoEncParamsCreateSideData sllocates memory for AVEncodeInfoFrame plus an array of
|
|
||||||
// nbBlocks AVEncodeInfoBlock in the given AVFrame frame
|
|
||||||
// as AVFrameSideData of type AV_FRAME_DATA_VIDEO_ENC_PARAMS
|
|
||||||
// and initializes the variables.
|
|
||||||
func AvVideoEncParamsCreateSideData(frame *AVFrame, _type AVVideoEncParamsType, nbBlocks uint32) *AVVideoEncParams {
|
|
||||||
return (*AVVideoEncParams)(C.av_video_enc_params_create_side_data((*C.struct_AVFrame)(frame),
|
|
||||||
(C.enum_AVVideoEncParamsType)(_type), (C.uint)(nbBlocks)))
|
|
||||||
}
|
|
@@ -10,6 +10,7 @@ package ffmpeg
|
|||||||
import "C"
|
import "C"
|
||||||
import "unsafe"
|
import "unsafe"
|
||||||
|
|
||||||
|
// AVXTEA
|
||||||
type AVXTEA C.struct_AVXTEA
|
type AVXTEA C.struct_AVXTEA
|
||||||
|
|
||||||
// GetKey gets `AVXTEA.key` value.
|
// GetKey gets `AVXTEA.key` value.
|
||||||
|
@@ -302,7 +302,7 @@ func main() {
|
|||||||
|
|
||||||
if videoStream != nil {
|
if videoStream != nil {
|
||||||
fmt.Fprintf(os.Stdout, "Play the output video file with the command:\n"+
|
fmt.Fprintf(os.Stdout, "Play the output video file with the command:\n"+
|
||||||
"ffplay -f rawvideo -pix_fmt %s -video_size %dx%d %s\n",
|
"ffplay -f rawvideo -pixel_format %s -video_size %dx%d %s\n",
|
||||||
ffmpeg.AvGetPixFmtName(videoDecCtx.GetPixFmt()),
|
ffmpeg.AvGetPixFmtName(videoDecCtx.GetPixFmt()),
|
||||||
videoDecCtx.GetWidth(), videoDecCtx.GetHeight(), videoDstFilename)
|
videoDecCtx.GetWidth(), videoDecCtx.GetHeight(), videoDstFilename)
|
||||||
}
|
}
|
||||||
|
@@ -401,7 +401,7 @@ func getVideoFrame(ost *outputStream) *ffmpeg.AVFrame {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// when we pass a frame to the encoder, it may keep a reference to it
|
// when we pass a frame to the encoder, it may keep a reference to it
|
||||||
// internally; make sure we do not overwrite it here
|
// internally; make sure we do not overwrite it here
|
||||||
if ffmpeg.AvFrameMakeWritable(ost.frame) < 0 {
|
if ffmpeg.AvFrameMakeWritable(ost.frame) < 0 {
|
||||||
panic("Make video frame writable failed")
|
panic("Make video frame writable failed")
|
||||||
|
@@ -1,5 +1,192 @@
|
|||||||
|
//go:build ffmpeg_hw_qsv
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
func main() {
|
/*
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
struct AVCodecContext;
|
||||||
|
|
||||||
|
int get_format(struct AVCodecContext *avctx, int *pix_fmts) {
|
||||||
|
// TODO.
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
import "C"
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"syscall"
|
||||||
|
"unsafe"
|
||||||
|
|
||||||
|
ffmpeg "github.com/qrtc/ffmpeg-dev-go"
|
||||||
|
)
|
||||||
|
|
||||||
|
type decodeContext struct {
|
||||||
|
hwDeviceRef *ffmpeg.AVBufferRef
|
||||||
|
}
|
||||||
|
|
||||||
|
func decodePacket(decode *decodeContext, decoderCtx *ffmpeg.AVCodecContext,
|
||||||
|
frame *ffmpeg.AVFrame, swFrame *ffmpeg.AVFrame,
|
||||||
|
pkt *ffmpeg.AVPacket, outputCtx *ffmpeg.AVIOContext) (ret int32) {
|
||||||
|
var (
|
||||||
|
data [][]uint8
|
||||||
|
)
|
||||||
|
if ret = ffmpeg.AvCodecSendPacket(decoderCtx, pkt); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Error during decoding\n")
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
for ret >= 0 {
|
||||||
|
ret = ffmpeg.AvCodecReceiveFrame(decoderCtx, frame)
|
||||||
|
if ret == ffmpeg.AVERROR(syscall.EAGAIN) || ret == ffmpeg.AVERROR_EOF {
|
||||||
|
break
|
||||||
|
} else if ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Error while decoding.\n")
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
// A real program would do something useful with the decoded frame here.
|
||||||
|
// We just retrieve the raw data and write it to a file, which is rather
|
||||||
|
// useless but pedagogic.
|
||||||
|
if ret = ffmpeg.AvHWFrameTransferData(swFrame, frame, 0); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Error transferring the data to system memory\n")
|
||||||
|
goto fail
|
||||||
|
}
|
||||||
|
|
||||||
|
data = ffmpeg.SliceSlice(&swFrame.GetData()[0], len(swFrame.GetData()),
|
||||||
|
swFrame.GetWidth()*swFrame.GetHeight())
|
||||||
|
for i := 0; i < len(swFrame.GetData()) && data[i] != nil; i++ {
|
||||||
|
for j := 0; j < int(swFrame.GetHeight()>>ffmpeg.CondExpr(i > 0, 1, 0)); j++ {
|
||||||
|
ffmpeg.AvIOWrite(outputCtx, &data[i][j*int(swFrame.GetLinesize()[i])], swFrame.GetWidth())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fail:
|
||||||
|
ffmpeg.AvFrameUnref(swFrame)
|
||||||
|
ffmpeg.AvFrameUnref(frame)
|
||||||
|
|
||||||
|
if ret < 0 {
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
var (
|
||||||
|
intputCtx *ffmpeg.AVFormatContext
|
||||||
|
videoSt *ffmpeg.AVStream
|
||||||
|
decoderCtx *ffmpeg.AVCodecContext
|
||||||
|
decoder *ffmpeg.AVCodec
|
||||||
|
pkt ffmpeg.AVPacket
|
||||||
|
frame, swFrame *ffmpeg.AVFrame
|
||||||
|
decode = &decodeContext{}
|
||||||
|
outputCtx *ffmpeg.AVIOContext
|
||||||
|
ret int32
|
||||||
|
)
|
||||||
|
|
||||||
|
if len(os.Args) < 3 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Usage: %s <input file> <output file>\n", os.Args[0])
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
// open the input file
|
||||||
|
if ret = ffmpeg.AvFormatOpenInput(&intputCtx, os.Args[1], nil, nil); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Cannot open input file '%s': ", os.Args[1])
|
||||||
|
goto finish
|
||||||
|
}
|
||||||
|
|
||||||
|
// find the first H.264 video stream
|
||||||
|
for i := 0; i < int(intputCtx.GetNbStreams()); i++ {
|
||||||
|
st := intputCtx.GetStreams()[i]
|
||||||
|
if st.GetCodecpar().GetCodecId() == ffmpeg.AV_CODEC_ID_H264 && videoSt == nil {
|
||||||
|
videoSt = st
|
||||||
|
} else {
|
||||||
|
st.SetDiscard(ffmpeg.AVDISCARD_ALL)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if videoSt == nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "No H.264 video stream in the input file\n")
|
||||||
|
goto finish
|
||||||
|
}
|
||||||
|
|
||||||
|
// open the hardware device
|
||||||
|
if ret = ffmpeg.AvHWDeviceCtxCreate(&decode.hwDeviceRef, ffmpeg.AV_HWDEVICE_TYPE_QSV,
|
||||||
|
"auto", nil, 0); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Cannot open the hardware device\n")
|
||||||
|
goto finish
|
||||||
|
}
|
||||||
|
|
||||||
|
// initialize the decoder
|
||||||
|
if decoder = ffmpeg.AvCodecFindDecoderByName("h264_qsv"); decoder == nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "The QSV decoder is not present in libavcodec\n")
|
||||||
|
goto finish
|
||||||
|
}
|
||||||
|
|
||||||
|
decoderCtx.SetCodecId(ffmpeg.AV_CODEC_ID_H264)
|
||||||
|
if videoSt.GetCodecpar().GetExtradataSize() != 0 {
|
||||||
|
decoderCtx.SetExtradata((*uint8)(ffmpeg.AvMallocz(videoSt.GetCodecpar().GetExtradataSize() +
|
||||||
|
ffmpeg.AV_INPUT_BUFFER_PADDING_SIZE)))
|
||||||
|
if decoderCtx.GetExtradata() == nil {
|
||||||
|
ret = ffmpeg.AVERROR(syscall.ENOMEM)
|
||||||
|
goto finish
|
||||||
|
}
|
||||||
|
copy(unsafe.Slice(decoderCtx.GetExtradata(), videoSt.GetCodecpar().GetExtradataSize()),
|
||||||
|
unsafe.Slice(videoSt.GetCodecpar().GetExtradata(), videoSt.GetCodecpar().GetExtradataSize()))
|
||||||
|
}
|
||||||
|
|
||||||
|
decoderCtx.SetOpaque(decode.hwDeviceRef)
|
||||||
|
decoderCtx.SetGetFormat((ffmpeg.AVCodecContextGetFormatFunc)(C.get_format))
|
||||||
|
|
||||||
|
if ret = ffmpeg.AvCodecOpen2(decoderCtx, nil, nil); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Error opening the decoder: ")
|
||||||
|
goto finish
|
||||||
|
}
|
||||||
|
|
||||||
|
// open the output stream
|
||||||
|
if ret = ffmpeg.AvIOOpen(&outputCtx, os.Args[2], ffmpeg.AVIO_FLAG_WRITE); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Error opening the output context: ")
|
||||||
|
goto finish
|
||||||
|
}
|
||||||
|
|
||||||
|
frame = ffmpeg.AvFrameAlloc()
|
||||||
|
swFrame = ffmpeg.AvFrameAlloc()
|
||||||
|
if frame == nil || swFrame == nil {
|
||||||
|
ret = ffmpeg.AVERROR(syscall.ENOMEM)
|
||||||
|
goto finish
|
||||||
|
}
|
||||||
|
|
||||||
|
// actual decoding
|
||||||
|
for ret >= 0 {
|
||||||
|
if ret = ffmpeg.AvReadFrame(intputCtx, &pkt); ret < 0 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
if pkt.GetStreamIndex() == videoSt.GetIndex() {
|
||||||
|
ret = decodePacket(decode, decoderCtx, frame, swFrame, &pkt, outputCtx)
|
||||||
|
}
|
||||||
|
|
||||||
|
ffmpeg.AvPacketUnref(&pkt)
|
||||||
|
}
|
||||||
|
|
||||||
|
finish:
|
||||||
|
if ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "%s\n", ffmpeg.AvErr2str(ret))
|
||||||
|
}
|
||||||
|
|
||||||
|
ffmpeg.AvFormatCloseInput(&intputCtx)
|
||||||
|
|
||||||
|
ffmpeg.AvFrameFree(&frame)
|
||||||
|
ffmpeg.AvFrameFree(&swFrame)
|
||||||
|
|
||||||
|
ffmpeg.AvCodecFreeContext(&decoderCtx)
|
||||||
|
|
||||||
|
ffmpeg.AvBufferUnref(&decode.hwDeviceRef)
|
||||||
|
|
||||||
|
ffmpeg.AvIOClose(outputCtx)
|
||||||
|
|
||||||
|
os.Exit(int(ret))
|
||||||
}
|
}
|
||||||
|
@@ -101,7 +101,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fmt.Fprintf(os.Stderr, "Scaling succeeded. Play the output file with the command:\n"+
|
fmt.Fprintf(os.Stderr, "Scaling succeeded. Play the output file with the command:\n"+
|
||||||
"ffplay -f rawvideo -pix_fmt %s -video_size %dx%d %s\n",
|
"ffplay -f rawvideo -pixel_format %s -video_size %dx%d %s\n",
|
||||||
ffmpeg.AvGetPixFmtName(dstPixFmt), dstW, dstH, dstFilename)
|
ffmpeg.AvGetPixFmtName(dstPixFmt), dstW, dstH, dstFilename)
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
@@ -349,7 +349,7 @@ func convertSamples(inputData, convertedData **uint8,
|
|||||||
|
|
||||||
// Add converted input audio samples to the FIFO buffer for later processing.
|
// Add converted input audio samples to the FIFO buffer for later processing.
|
||||||
func addSamplesToFifo(fifo *ffmpeg.AVAudioFifo, convertedInputSamples **uint8, frameSize int32) int32 {
|
func addSamplesToFifo(fifo *ffmpeg.AVAudioFifo, convertedInputSamples **uint8, frameSize int32) int32 {
|
||||||
// Make the FIFO as large as it needs to be to hold both,
|
// Make the FIFO as large as it needs to be to hold both,
|
||||||
// the old and the new samples.
|
// the old and the new samples.
|
||||||
if ret := ffmpeg.AvAudioFifoRealloc(fifo, ffmpeg.AvAudioFifoSize(fifo)+frameSize); ret < 0 {
|
if ret := ffmpeg.AvAudioFifoRealloc(fifo, ffmpeg.AvAudioFifoSize(fifo)+frameSize); ret < 0 {
|
||||||
fmt.Fprintf(os.Stderr, "Could not reallocate FIFO\n")
|
fmt.Fprintf(os.Stderr, "Could not reallocate FIFO\n")
|
||||||
|
@@ -395,7 +395,7 @@ func filterEncodeWriteFrame(ofmtCtx *ffmpeg.AVFormatContext, streamCtx []streamC
|
|||||||
)
|
)
|
||||||
|
|
||||||
ffmpeg.AvLog(nil, ffmpeg.AV_LOG_INFO, "Pushing decoded frame to filters\n")
|
ffmpeg.AvLog(nil, ffmpeg.AV_LOG_INFO, "Pushing decoded frame to filters\n")
|
||||||
// push the decoded frame into the filtergraph
|
// push the decoded frame into the filtergraph
|
||||||
if ret = ffmpeg.AvBuffersrcAddFrameFlags(filter.buffersrcCtx, frame, 0); ret < 0 {
|
if ret = ffmpeg.AvBuffersrcAddFrameFlags(filter.buffersrcCtx, frame, 0); ret < 0 {
|
||||||
ffmpeg.AvLog(nil, ffmpeg.AV_LOG_ERROR, "Error while feeding the filtergraph\n")
|
ffmpeg.AvLog(nil, ffmpeg.AV_LOG_ERROR, "Error while feeding the filtergraph\n")
|
||||||
return ret
|
return ret
|
||||||
|
@@ -1,5 +1,302 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
func main() {
|
/*
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
struct AVCodecContext;
|
||||||
|
|
||||||
|
static int av_pix_fmt_none;
|
||||||
|
static int av_pix_fmt_vaapi;
|
||||||
|
|
||||||
|
static inline void initial_pix_fmt(int x, int y)
|
||||||
|
{
|
||||||
|
av_pix_fmt_none = x;
|
||||||
|
av_pix_fmt_vaapi = y;
|
||||||
|
}
|
||||||
|
|
||||||
|
int get_vaapi_format(struct AVCodecContext *ctx, int *pix_fmts)
|
||||||
|
{
|
||||||
|
const int *p;
|
||||||
|
|
||||||
|
for (p = pix_fmts; *p != av_pix_fmt_none; p++) {
|
||||||
|
if (*p == av_pix_fmt_vaapi)
|
||||||
|
return *p;
|
||||||
|
}
|
||||||
|
|
||||||
|
fprintf(stderr, "Unable to decode this file using VA-API.\n");
|
||||||
|
return av_pix_fmt_none;
|
||||||
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
import "C"
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
|
ffmpeg "github.com/qrtc/ffmpeg-dev-go"
|
||||||
|
)
|
||||||
|
|
||||||
|
type streamContext struct {
|
||||||
|
ifmtCtx *ffmpeg.AVFormatContext
|
||||||
|
ofmtCtx *ffmpeg.AVFormatContext
|
||||||
|
|
||||||
|
hwDeviceCtx *ffmpeg.AVBufferRef
|
||||||
|
|
||||||
|
decoderCtx *ffmpeg.AVCodecContext
|
||||||
|
encoderCtx *ffmpeg.AVCodecContext
|
||||||
|
|
||||||
|
videoStream int32
|
||||||
|
ost *ffmpeg.AVStream
|
||||||
|
initialized bool
|
||||||
|
}
|
||||||
|
|
||||||
|
func openInputFile(filename string, sc *streamContext) (ret int32) {
|
||||||
|
var (
|
||||||
|
decoder *ffmpeg.AVCodec
|
||||||
|
video *ffmpeg.AVStream
|
||||||
|
)
|
||||||
|
|
||||||
|
if ret = ffmpeg.AvFormatOpenInput(&sc.ifmtCtx, filename, nil, nil); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Cannot open input file '%s', Error code: %s\n",
|
||||||
|
filename, ffmpeg.AvErr2str(ret))
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
if ret = ffmpeg.AvFormatFindStreamInfo(sc.ifmtCtx, nil); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Cannot find input stream information. Error code: %s\n",
|
||||||
|
ffmpeg.AvErr2str(ret))
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
if ret = ffmpeg.AvFindBestStream(sc.ifmtCtx, ffmpeg.AVMEDIA_TYPE_VIDEO, -1, -1, &decoder, 0); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Cannot find a video stream in the input file."+
|
||||||
|
" Error code: %s\n", ffmpeg.AvErr2str(ret))
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
sc.videoStream = ret
|
||||||
|
|
||||||
|
if sc.decoderCtx = ffmpeg.AvCodecAllocContext3(decoder); sc.decoderCtx == nil {
|
||||||
|
return ffmpeg.AVERROR(syscall.ENOMEM)
|
||||||
|
}
|
||||||
|
|
||||||
|
video = sc.ifmtCtx.GetStreams()[sc.videoStream]
|
||||||
|
if ret = ffmpeg.AvCodecParametersToContext(sc.decoderCtx, video.GetCodecpar()); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "avcodec_parameters_to_context error. Error code: %s\n",
|
||||||
|
ffmpeg.AvErr2str(ret))
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
sc.decoderCtx.SetHwDeviceCtx(ffmpeg.AvBufferRef(sc.hwDeviceCtx))
|
||||||
|
if sc.decoderCtx.GetHwDeviceCtx() == nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "A hardware device reference create failed.\n")
|
||||||
|
return ffmpeg.AVERROR(syscall.ENOMEM)
|
||||||
|
}
|
||||||
|
C.initial_pix_fmt((C.int)(ffmpeg.AV_PIX_FMT_NONE), (C.int)(ffmpeg.AV_PIX_FMT_VAAPI))
|
||||||
|
sc.decoderCtx.SetGetFormat((ffmpeg.AVCodecContextGetFormatFunc)(C.get_vaapi_format))
|
||||||
|
|
||||||
|
if ret = ffmpeg.AvCodecOpen2(sc.decoderCtx, decoder, nil); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Failed to open codec for decoding. Error code: %s\n",
|
||||||
|
ffmpeg.AvErr2str(ret))
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func encodeWrite(encPkt *ffmpeg.AVPacket, frame *ffmpeg.AVFrame, sc *streamContext) (ret int32) {
|
||||||
|
|
||||||
|
ffmpeg.AvPacketUnref(encPkt)
|
||||||
|
|
||||||
|
if ret = ffmpeg.AvCodecSendFrame(sc.encoderCtx, frame); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Error during encoding. Error code: %s\n", ffmpeg.AvErr2str(ret))
|
||||||
|
goto end
|
||||||
|
}
|
||||||
|
for {
|
||||||
|
if ret = ffmpeg.AvCodecReceivePacket(sc.encoderCtx, encPkt); ret != 0 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
encPkt.SetStreamIndex(0)
|
||||||
|
ffmpeg.AvPacketRescaleTs(encPkt, sc.ifmtCtx.GetStreams()[sc.videoStream].GetTimeBase(),
|
||||||
|
sc.ofmtCtx.GetStreams()[0].GetTimeBase())
|
||||||
|
if ret = ffmpeg.AvInterleavedWriteFrame(sc.ofmtCtx, encPkt); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Error during writing data to output file. "+
|
||||||
|
"Error code: %s\n", ffmpeg.AvErr2str(ret))
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end:
|
||||||
|
if ret == ffmpeg.AVERROR_EOF {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return ffmpeg.CondExpr(ret == ffmpeg.AVERROR(syscall.EAGAIN), 0, int32(-1))
|
||||||
|
}
|
||||||
|
|
||||||
|
func initialEncCodecCtx(encCodec *ffmpeg.AVCodec, sc *streamContext) (ret int32) {
|
||||||
|
|
||||||
|
// we need to ref hw_frames_ctx of decoder to initialize encoder's codec.
|
||||||
|
// Only after we get a decoded frame, can we obtain its hw_frames_ctx
|
||||||
|
sc.encoderCtx.SetHwFramesCtx(ffmpeg.AvBufferRef(sc.decoderCtx.GetHwFramesCtx()))
|
||||||
|
if sc.encoderCtx.GetHwFramesCtx() == nil {
|
||||||
|
return ffmpeg.AVERROR(syscall.ENOMEM)
|
||||||
|
}
|
||||||
|
// set AVCodecContext Parameters for encoder, here we keep them stay
|
||||||
|
// the same as decoder.
|
||||||
|
// xxx: now the sample can't handle resolution change case.
|
||||||
|
sc.encoderCtx.SetTimeBase(ffmpeg.AvInvQ(sc.decoderCtx.GetFramerate()))
|
||||||
|
sc.encoderCtx.SetPixFmt(ffmpeg.AV_PIX_FMT_VAAPI)
|
||||||
|
sc.encoderCtx.SetWidth(sc.decoderCtx.GetWidth())
|
||||||
|
sc.encoderCtx.SetHeight(sc.decoderCtx.GetHeight())
|
||||||
|
|
||||||
|
if ret = ffmpeg.AvCodecOpen2(sc.encoderCtx, encCodec, nil); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Failed to open encode codec. Error code: %s\n",
|
||||||
|
ffmpeg.AvErr2str(ret))
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
sc.ost.SetTimeBase(sc.encoderCtx.GetTimeBase())
|
||||||
|
if ret = ffmpeg.AvCodecParametersFromContext(sc.ost.GetCodecpar(), sc.encoderCtx); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Failed to copy the stream parameters. "+
|
||||||
|
"Error code: %s\n", ffmpeg.AvErr2str(ret))
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
// write the stream header
|
||||||
|
if ret = ffmpeg.AvFormatWriteHeader(sc.ofmtCtx, nil); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Error while writing stream header. "+
|
||||||
|
"Error code: %s\n", ffmpeg.AvErr2str(ret))
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func decEnc(pkt *ffmpeg.AVPacket, encCodec *ffmpeg.AVCodec, sc *streamContext) (ret int32) {
|
||||||
|
var (
|
||||||
|
frame *ffmpeg.AVFrame
|
||||||
|
)
|
||||||
|
|
||||||
|
if ret = ffmpeg.AvCodecSendPacket(sc.decoderCtx, pkt); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Error during decoding. Error code: %s\n", ffmpeg.AvErr2str(ret))
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
|
||||||
|
for ret >= 0 {
|
||||||
|
if frame = ffmpeg.AvFrameAlloc(); frame == nil {
|
||||||
|
return ffmpeg.AVERROR(syscall.ENOMEM)
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = ffmpeg.AvCodecReceiveFrame(sc.decoderCtx, frame)
|
||||||
|
if ret == ffmpeg.AVERROR(syscall.EAGAIN) || ret == ffmpeg.AVERROR_EOF {
|
||||||
|
ffmpeg.AvFrameFree(&frame)
|
||||||
|
} else if ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Error while decoding. Error code: %s\n", ffmpeg.AvErr2str(ret))
|
||||||
|
goto fail
|
||||||
|
}
|
||||||
|
|
||||||
|
if !sc.initialized {
|
||||||
|
if ret = initialEncCodecCtx(encCodec, sc); ret != 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Initial EncodeCtx failed.\n")
|
||||||
|
goto fail
|
||||||
|
}
|
||||||
|
sc.initialized = true
|
||||||
|
}
|
||||||
|
|
||||||
|
if ret = encodeWrite(pkt, frame, sc); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Error during encoding and writing.\n")
|
||||||
|
}
|
||||||
|
fail:
|
||||||
|
ffmpeg.AvFrameFree(&frame)
|
||||||
|
if ret < 0 {
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
var (
|
||||||
|
ret int32
|
||||||
|
decPkt *ffmpeg.AVPacket
|
||||||
|
encCodec *ffmpeg.AVCodec
|
||||||
|
sc = &streamContext{}
|
||||||
|
)
|
||||||
|
|
||||||
|
if len(os.Args) != 4 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Usage: %s <input file> <encode codec> <output file>\n"+
|
||||||
|
"The output format is guessed according to the file extension.\n"+
|
||||||
|
"\n", os.Args[0])
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
if ret = ffmpeg.AvHWDeviceCtxCreate(&sc.hwDeviceCtx, ffmpeg.AV_HWDEVICE_TYPE_VAAPI,
|
||||||
|
ffmpeg.NIL, nil, 0); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Failed to create a VAAPI device. Error code: %s\n", ffmpeg.AvErr2str(ret))
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
if decPkt = ffmpeg.AvPacketAlloc(); decPkt == nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "Failed to allocate decode packet\n")
|
||||||
|
goto end
|
||||||
|
}
|
||||||
|
|
||||||
|
if ret = openInputFile(os.Args[1], sc); ret < 0 {
|
||||||
|
goto end
|
||||||
|
}
|
||||||
|
|
||||||
|
if encCodec = ffmpeg.AvCodecFindEncoderByName(os.Args[2]); encCodec == nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "Could not find encoder '%s'\n", os.Args[2])
|
||||||
|
ret = -1
|
||||||
|
goto end
|
||||||
|
}
|
||||||
|
|
||||||
|
if ret = ffmpeg.AvFormatAllocOutputContext2(&sc.ofmtCtx, nil, ffmpeg.NIL, os.Args[3]); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Failed to deduce output format from file extension. Error code: "+
|
||||||
|
"%s\n", ffmpeg.AvErr2str(ret))
|
||||||
|
goto end
|
||||||
|
}
|
||||||
|
|
||||||
|
if sc.encoderCtx = ffmpeg.AvCodecAllocContext3(encCodec); sc.encoderCtx == nil {
|
||||||
|
ret = ffmpeg.AVERROR(syscall.ENOMEM)
|
||||||
|
goto end
|
||||||
|
}
|
||||||
|
|
||||||
|
if ret = ffmpeg.AvIOOpen(sc.ofmtCtx.GetPbAddr(), os.Args[3], ffmpeg.AVIO_FLAG_WRITE); ret < 0 {
|
||||||
|
fmt.Fprintf(os.Stderr, "Cannot open output file. "+
|
||||||
|
"Error code: %s\n", ffmpeg.AvErr2str(ret))
|
||||||
|
goto end
|
||||||
|
}
|
||||||
|
|
||||||
|
// read all packets and only transcoding video
|
||||||
|
for ret >= 0 {
|
||||||
|
if ret = ffmpeg.AvReadFrame(sc.ifmtCtx, decPkt); ret < 0 {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
|
||||||
|
if sc.videoStream == decPkt.GetStreamIndex() {
|
||||||
|
ret = decEnc(decPkt, encCodec, sc)
|
||||||
|
}
|
||||||
|
|
||||||
|
ffmpeg.AvPacketUnref(decPkt)
|
||||||
|
}
|
||||||
|
|
||||||
|
// flush decoder
|
||||||
|
ffmpeg.AvPacketUnref(decPkt)
|
||||||
|
decEnc(decPkt, encCodec, sc)
|
||||||
|
|
||||||
|
// flush encoder
|
||||||
|
encodeWrite(decPkt, nil, sc)
|
||||||
|
|
||||||
|
// write the trailer for output stream
|
||||||
|
ffmpeg.AvWriteTrailer(sc.ofmtCtx)
|
||||||
|
|
||||||
|
end:
|
||||||
|
ffmpeg.AvFormatCloseInput(&sc.ifmtCtx)
|
||||||
|
ffmpeg.AvFormatCloseInput(&sc.ofmtCtx)
|
||||||
|
ffmpeg.AvCodecFreeContext(&sc.decoderCtx)
|
||||||
|
ffmpeg.AvCodecFreeContext(&sc.encoderCtx)
|
||||||
|
ffmpeg.AvBufferUnref(&sc.hwDeviceCtx)
|
||||||
|
ffmpeg.AvPacketFree(&decPkt)
|
||||||
|
os.Exit(int(ret))
|
||||||
}
|
}
|
||||||
|
@@ -25,6 +25,33 @@ type UnsingedInteger interface {
|
|||||||
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
|
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CVoidPointer represents a (void*) type pointer in the C world.
|
||||||
|
type CVoidPointer any
|
||||||
|
|
||||||
|
// VoidPointer returns a unsafe.Pointer from CVoidPointer.
|
||||||
|
func VoidPointer(a CVoidPointer) unsafe.Pointer {
|
||||||
|
if a == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return unsafe.Pointer(reflect.ValueOf(a).Pointer())
|
||||||
|
}
|
||||||
|
|
||||||
|
// CVoidPointer represents a (void**) type pointer in the C world.
|
||||||
|
type CVoidPointerPointer any
|
||||||
|
|
||||||
|
// VoidPointerPointer returns a *unsafe.Pointer from CVoidPointerPointer.
|
||||||
|
func VoidPointerPointer(a CVoidPointerPointer) *unsafe.Pointer {
|
||||||
|
if a == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return (*unsafe.Pointer)(unsafe.Pointer(reflect.ValueOf(a).Pointer()))
|
||||||
|
}
|
||||||
|
|
||||||
|
// FreePointer frees memory allocated in the C world.
|
||||||
|
func FreePointer(ptr CVoidPointer) {
|
||||||
|
C.free(VoidPointer(ptr))
|
||||||
|
}
|
||||||
|
|
||||||
const NIL = "\\'<nil>'\\"
|
const NIL = "\\'<nil>'\\"
|
||||||
|
|
||||||
// StringCasting casts go string to c world char* with free function.
|
// StringCasting casts go string to c world char* with free function.
|
||||||
@@ -34,7 +61,7 @@ func StringCasting(s string) (allocPtr *C.char, freeFunc func()) {
|
|||||||
return nil, func() {}
|
return nil, func() {}
|
||||||
}
|
}
|
||||||
allocPtr = C.CString(s)
|
allocPtr = C.CString(s)
|
||||||
freeFunc = func() { C.free(unsafe.Pointer(allocPtr)) }
|
freeFunc = func() { FreePointer(allocPtr) }
|
||||||
return allocPtr, freeFunc
|
return allocPtr, freeFunc
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,28 +123,6 @@ func PointerOffset[U any, V Integer](ptr *U, offset V) *U {
|
|||||||
uintptr(unsafe.Sizeof(*ptr))*(uintptr(offset))))
|
uintptr(unsafe.Sizeof(*ptr))*(uintptr(offset))))
|
||||||
}
|
}
|
||||||
|
|
||||||
// CVoidPointer represents a (void*) type pointer in the C world.
|
|
||||||
type CVoidPointer any
|
|
||||||
|
|
||||||
// VoidPointer returns a unsafe.Pointer from CVoidPointer.
|
|
||||||
func VoidPointer(a CVoidPointer) unsafe.Pointer {
|
|
||||||
if a == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return unsafe.Pointer(reflect.ValueOf(a).Pointer())
|
|
||||||
}
|
|
||||||
|
|
||||||
// CVoidPointer represents a (void**) type pointer in the C world.
|
|
||||||
type CVoidPointerPointer any
|
|
||||||
|
|
||||||
// VoidPointerPointer returns a *unsafe.Pointer from CVoidPointerPointer.
|
|
||||||
func VoidPointerPointer(a CVoidPointerPointer) *unsafe.Pointer {
|
|
||||||
if a == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return (*unsafe.Pointer)(unsafe.Pointer(reflect.ValueOf(a).Pointer()))
|
|
||||||
}
|
|
||||||
|
|
||||||
// CondExpr is Conditional Operator like Ternary Operator in the C world.
|
// CondExpr is Conditional Operator like Ternary Operator in the C world.
|
||||||
func CondExpr[T any](cond bool, x, y T) T {
|
func CondExpr[T any](cond bool, x, y T) T {
|
||||||
if cond {
|
if cond {
|
||||||
@@ -126,6 +131,7 @@ func CondExpr[T any](cond bool, x, y T) T {
|
|||||||
return y
|
return y
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PlusPlus is ++ like operator.
|
||||||
func PlusPlus[T Integer](x *T) T {
|
func PlusPlus[T Integer](x *T) T {
|
||||||
defer func() { *x++ }()
|
defer func() { *x++ }()
|
||||||
return *x
|
return *x
|
||||||
|
@@ -14,7 +14,7 @@ const (
|
|||||||
SWR_FLAG_RESAMPLE = C.SWR_FLAG_RESAMPLE
|
SWR_FLAG_RESAMPLE = C.SWR_FLAG_RESAMPLE
|
||||||
)
|
)
|
||||||
|
|
||||||
// Dithering algorithms
|
// Dithering algorithms.
|
||||||
type SwrDitherType = C.enum_SwrDitherType
|
type SwrDitherType = C.enum_SwrDitherType
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -33,7 +33,7 @@ const (
|
|||||||
SWR_DITHER_NB = SwrDitherType(C.SWR_DITHER_NB)
|
SWR_DITHER_NB = SwrDitherType(C.SWR_DITHER_NB)
|
||||||
)
|
)
|
||||||
|
|
||||||
// Resampling Engines
|
// Resampling Engines.
|
||||||
type SwrEngine = C.enum_SwrEngine
|
type SwrEngine = C.enum_SwrEngine
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -42,7 +42,7 @@ const (
|
|||||||
SWR_ENGINE_NB = SwrEngine(C.SWR_ENGINE_NB)
|
SWR_ENGINE_NB = SwrEngine(C.SWR_ENGINE_NB)
|
||||||
)
|
)
|
||||||
|
|
||||||
// Resampling Filter Types
|
// Resampling Filter Types.
|
||||||
type SwrFilterType = C.enum_SwrFilterType
|
type SwrFilterType = C.enum_SwrFilterType
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@@ -109,7 +109,7 @@ func SwrNextPts(s *SwrContext, pts int64) int64 {
|
|||||||
return (int64)(C.swr_next_pts((*C.struct_SwrContext)(s), (C.int64_t)(pts)))
|
return (int64)(C.swr_next_pts((*C.struct_SwrContext)(s), (C.int64_t)(pts)))
|
||||||
}
|
}
|
||||||
|
|
||||||
// SwrSetCompensation activates resampling compensation ("soft" compensation).
|
// SwrSetCompensation activates resampling compensation ("soft" compensation).
|
||||||
// This function is internally called when needed in SwrNextPts().
|
// This function is internally called when needed in SwrNextPts().
|
||||||
func SwrSetCompensation(s *SwrContext, sampleDelta, compensationDistance int32) int32 {
|
func SwrSetCompensation(s *SwrContext, sampleDelta, compensationDistance int32) int32 {
|
||||||
return (int32)(C.swr_set_compensation((*C.struct_SwrContext)(s),
|
return (int32)(C.swr_set_compensation((*C.struct_SwrContext)(s),
|
||||||
|
Reference in New Issue
Block a user