2024-04-07 12:40:09 CST W14D0

This commit is contained in:
aggresss
2024-04-07 12:40:09 +08:00
parent 3bf72b60e0
commit 4d6f80cb09
33 changed files with 2133 additions and 893 deletions

View File

@@ -49,6 +49,8 @@ import (
)
const (
// Deprecated: No use.
//
// Minimum encoding buffer size.
AV_INPUT_BUFFER_MIN_SIZE = C.AV_INPUT_BUFFER_MIN_SIZE
)
@@ -706,36 +708,6 @@ func (avctx *AVCodecContext) GetDarkMaskingAddr() *float32 {
return (*float32)(&avctx.dark_masking)
}
// GetSliceCount gets `AVCodecContext.slice_count` value.
func (avctx *AVCodecContext) GetSliceCount() int32 {
return (int32)(avctx.slice_count)
}
// SetSliceCount sets `AVCodecContext.slice_count` value.
func (avctx *AVCodecContext) SetSliceCount(v int32) {
avctx.slice_count = (C.int)(v)
}
// GetSliceCountAddr gets `AVCodecContext.slice_count` address.
func (avctx *AVCodecContext) GetSliceCountAddr() *int32 {
return (*int32)(&avctx.slice_count)
}
// GetSliceOffset gets `AVCodecContext.slice_offset` value.
func (avctx *AVCodecContext) GetSliceOffset() *int32 {
return (*int32)(avctx.slice_offset)
}
// SetSliceOffset sets `AVCodecContext.slice_offset` value.
func (avctx *AVCodecContext) SetSliceOffset(v *int32) {
avctx.slice_offset = (*C.int)(v)
}
// GetSliceOffsetAddr gets `AVCodecContext.slice_offset` address.
func (avctx *AVCodecContext) GetSliceOffsetAddr() **int32 {
return (**int32)(unsafe.Pointer(&avctx.slice_offset))
}
// GetSampleAspectRatio gets `AVCodecContext.sample_aspect_ratio` value.
func (avctx *AVCodecContext) GetSampleAspectRatio() AVRational {
return (AVRational)(avctx.sample_aspect_ratio)
@@ -1233,21 +1205,6 @@ func (avctx *AVCodecContext) GetSampleRateAddr() *int32 {
return (*int32)(&avctx.sample_rate)
}
// GetChannels gets `AVCodecContext.channels` value.
func (avctx *AVCodecContext) GetChannels() int32 {
return (int32)(avctx.channels)
}
// SetChannels sets `AVCodecContext.channels` value.
func (avctx *AVCodecContext) SetChannels(v int32) {
avctx.channels = (C.int)(v)
}
// GetChannelsAddr gets `AVCodecContext.channels` address.
func (avctx *AVCodecContext) GetChannelsAddr() *int32 {
return (*int32)(&avctx.channels)
}
// GetSampleFmt gets `AVCodecContext.sample_fmt` value.
func (avctx *AVCodecContext) GetSampleFmt() AVSampleFormat {
return (AVSampleFormat)(avctx.sample_fmt)
@@ -1278,27 +1235,6 @@ func (avctx *AVCodecContext) GetFrameSizeAddr() *int32 {
return (*int32)(&avctx.frame_size)
}
// Deprecated: use frame_num instead.
//
// GetFrameNumber gets `AVCodecContext.frame_number` value.
func (avctx *AVCodecContext) GetFrameNumber() int32 {
return (int32)(avctx.frame_number)
}
// Deprecated: use frame_num instead.
//
// SetFrameNumber sets `AVCodecContext.frame_number` value.
func (avctx *AVCodecContext) SetFrameNumber(v int32) {
avctx.frame_number = (C.int)(v)
}
// Deprecated: use frame_num instead.
//
// GetFrameNumberAddr gets `AVCodecContext.frame_number` address.
func (avctx *AVCodecContext) GetFrameNumberAddr() *int32 {
return (*int32)(&avctx.frame_number)
}
// GetBlockAlign gets `AVCodecContext.block_align` value.
func (avctx *AVCodecContext) GetBlockAlign() int32 {
return (int32)(avctx.block_align)
@@ -1329,42 +1265,6 @@ func (avctx *AVCodecContext) GetCutoffAddr() *int32 {
return (*int32)(&avctx.cutoff)
}
// Deprecated: No use.
//
// GetChannelLayout gets `AVCodecContext.channel_layout` value.
func (avctx *AVCodecContext) GetChannelLayout() uint64 {
return (uint64)(avctx.channel_layout)
}
// Deprecated: No use.
//
// SetChannelLayout sets `AVCodecContext.channel_layout` value.
func (avctx *AVCodecContext) SetChannelLayout(v uint64) {
avctx.channel_layout = (C.uint64_t)(v)
}
// Deprecated: No use.
//
// GetChannelLayoutAddr gets `AVCodecContext.channel_layout` address.
func (avctx *AVCodecContext) GetChannelLayoutAddr() *uint64 {
return (*uint64)(&avctx.channel_layout)
}
// GetRequestChannelLayout gets `AVCodecContext.request_channel_layout` value.
func (avctx *AVCodecContext) GetRequestChannelLayout() uint64 {
return (uint64)(avctx.request_channel_layout)
}
// SetRequestChannelLayout sets `AVCodecContext.request_channel_layout` value.
func (avctx *AVCodecContext) SetRequestChannelLayout(v uint64) {
avctx.request_channel_layout = (C.uint64_t)(v)
}
// GetRequestChannelLayoutAddr gets `AVCodecContext.request_channel_layout` address.
func (avctx *AVCodecContext) GetRequestChannelLayoutAddr() *uint64 {
return (*uint64)(&avctx.request_channel_layout)
}
// GetAudioServiceType gets `AVCodecContext.audio_servicetype` value.
func (avctx *AVCodecContext) GetAudioServiceType() AVAudioServiceType {
return (AVAudioServiceType)(avctx.audio_service_type)
@@ -1678,6 +1578,66 @@ func (avctx *AVCodecContext) GetFrameNumAddr() *int64 {
return (*int64)(&avctx.frame_num)
}
// GetSideDataPreferPacket gets `AVCodecContext.side_data_prefer_packet` value.
func (avctx *AVCodecContext) GetSideDataPreferPacket() []int32 {
return unsafe.Slice((*int32)(avctx.side_data_prefer_packet), avctx.nb_side_data_prefer_packet)
}
// SetSideDataPreferPacket sets `AVCodecContext.side_data_prefer_packet` value.
func (avctx *AVCodecContext) SetSideDataPreferPacket(v *int32) {
avctx.side_data_prefer_packet = (*C.int)(v)
}
// GetSideDataPreferPacketAddr gets `AVCodecContext.side_data_prefer_packet` address.
func (avctx *AVCodecContext) GetSideDataPreferPacketAddr() **int32 {
return (**int32)(unsafe.Pointer(&avctx.side_data_prefer_packet))
}
// GetNbSideDataPreferPacket gets `AVCodecContext.nb_side_data_prefer_packet` value.
func (avctx *AVCodecContext) GetNbSideDataPreferPacket() uint32 {
return (uint32)(avctx.nb_side_data_prefer_packet)
}
// SetNbSideDataPreferPacket sets `AVCodecContext.nb_side_data_prefer_packet` value.
func (avctx *AVCodecContext) SetNbSideDataPreferPacket(v uint32) {
avctx.nb_side_data_prefer_packet = (C.uint)(v)
}
// GetNbSideDataPreferPacketAddr gets `AVCodecContext.nb_side_data_prefer_packet` address.
func (avctx *AVCodecContext) GetNbSideDataPreferPacketAddr() *uint32 {
return (*uint32)(&avctx.nb_side_data_prefer_packet)
}
// GetDecodedSideData gets `AVCodecContext.decoded_side_data` value.
func (avctx *AVCodecContext) GetDecodedSideData() []*AVFrameSideData {
return unsafe.Slice((**AVFrameSideData)(unsafe.Pointer(avctx.decoded_side_data)), avctx.nb_decoded_side_data)
}
// SetDecodedSideData sets `AVCodecContext.decoded_side_data` value.
func (avctx *AVCodecContext) SetDecodedSideData(v **AVFrameSideData) {
avctx.decoded_side_data = (**C.struct_AVFrameSideData)(unsafe.Pointer(v))
}
// GetDecodedSideDataAddr gets `AVCodecContext.decoded_side_data` address.
func (avctx *AVCodecContext) GetDecodedSideDataAddr() ***AVFrameSideData {
return (***AVFrameSideData)(unsafe.Pointer(&avctx.decoded_side_data))
}
// GetNbDecodedSideData gets `AVCodecContext.nb_decoded_side_data` value.
func (avctx *AVCodecContext) GetNbDecodedSideData() int32 {
return (int32)(avctx.nb_decoded_side_data)
}
// SetNbDecodedSideData sets `AVCodecContext.nb_decoded_side_data` value.
func (avctx *AVCodecContext) SetNbDecodedSideData(v int32) {
avctx.nb_decoded_side_data = (C.int)(v)
}
// GetNbDecodedSideDataAddr gets `AVCodecContext.nb_decoded_side_data` address.
func (avctx *AVCodecContext) GetNbDecodedSideDataAddr() *int32 {
return (*int32)(&avctx.nb_decoded_side_data)
}
const (
FF_BUG_AUTODETECT = int32(C.FF_BUG_AUTODETECT)
FF_BUG_XVID_ILACE = int32(C.FF_BUG_XVID_ILACE)
@@ -1780,21 +1740,6 @@ func (avctx *AVCodecContext) GetErrRecognitionAddr() *int32 {
return (*int32)(&avctx.err_recognition)
}
// GetReorderedOpaque gets `AVCodecContext.reordered_opaque` value.
func (avctx *AVCodecContext) GetReorderedOpaque() int64 {
return (int64)(avctx.reordered_opaque)
}
// SetReorderedOpaque sets `AVCodecContext.reordered_opaque` value.
func (avctx *AVCodecContext) SetReorderedOpaque(v int64) {
avctx.reordered_opaque = (C.int64_t)(v)
}
// GetReorderedOpaqueAddr gets `AVCodecContext.reordered_opaque` address.
func (avctx *AVCodecContext) GetReorderedOpaqueAddr() *int64 {
return (*int64)(&avctx.reordered_opaque)
}
// GetHwaccel gets `AVCodecContext.hwaccel` value.
func (avctx *AVCodecContext) GetHwaccel() *AVHWAccel {
return (*AVHWAccel)(avctx.hwaccel)
@@ -1894,7 +1839,6 @@ const (
FF_IDCT_SIMPLEARMV6 = int32(C.FF_IDCT_SIMPLEARMV6)
FF_IDCT_FAAN = int32(C.FF_IDCT_FAAN)
FF_IDCT_SIMPLENEON = int32(C.FF_IDCT_SIMPLENEON)
FF_IDCT_NONE = int32(C.FF_IDCT_NONE)
FF_IDCT_SIMPLEAUTO = int32(C.FF_IDCT_SIMPLEAUTO)
)
@@ -2364,66 +2308,6 @@ func (avctx *AVCodecContext) GetCodecDescriptorAddr() **AVCodecDescriptor {
return (**AVCodecDescriptor)(unsafe.Pointer(&avctx.codec_descriptor))
}
// GetPtsCorrectionNumFaultyPts gets `AVCodecContext.pts_correction_num_faulty_pts` value.
func (avctx *AVCodecContext) GetPtsCorrectionNumFaultyPts() int64 {
return (int64)(avctx.pts_correction_num_faulty_pts)
}
// SetPtsCorrectionNumFaultyPts sets `AVCodecContext.pts_correction_num_faulty_pts` value.
func (avctx *AVCodecContext) SetPtsCorrectionNumFaultyPts(v int64) {
avctx.pts_correction_num_faulty_pts = (C.int64_t)(v)
}
// GetPtsCorrectionNumFaultyPtsAddr gets `AVCodecContext.pts_correction_num_faulty_pts` address.
func (avctx *AVCodecContext) GetPtsCorrectionNumFaultyPtsAddr() *int64 {
return (*int64)(&avctx.pts_correction_num_faulty_pts)
}
// GetPtsCorrectionNumFaultyDts gets `AVCodecContext.pts_correction_num_faulty_dts` value.
func (avctx *AVCodecContext) GetPtsCorrectionNumFaultyDts() int64 {
return (int64)(avctx.pts_correction_num_faulty_dts)
}
// SetPtsCorrectionNumFaultyDts sets `AVCodecContext.pts_correction_num_faulty_dts` value.
func (avctx *AVCodecContext) SetPtsCorrectionNumFaultyDts(v int64) {
avctx.pts_correction_num_faulty_dts = (C.int64_t)(v)
}
// GetPtsCorrectionNumFaultyDtsAddr gets `AVCodecContext.pts_correction_num_faulty_dts` address.
func (avctx *AVCodecContext) GetPtsCorrectionNumFaultyDtsAddr() *int64 {
return (*int64)(&avctx.pts_correction_num_faulty_dts)
}
// GetPtsCorrectionLastPts gets `AVCodecContext.pts_correction_last_pts` value.
func (avctx *AVCodecContext) GetPtsCorrectionLastPts() int64 {
return (int64)(avctx.pts_correction_last_pts)
}
// SetPtsCorrectionLastPts sets `AVCodecContext.pts_correction_last_pts` value.
func (avctx *AVCodecContext) SetPtsCorrectionLastPts(v int64) {
avctx.pts_correction_last_pts = (C.int64_t)(v)
}
// GetPtsCorrectionLastPtsAddr gets `AVCodecContext.pts_correction_last_pts` address.
func (avctx *AVCodecContext) GetPtsCorrectionLastPtsAddr() *int64 {
return (*int64)(&avctx.pts_correction_last_pts)
}
// GetPtsCorrectionLastDts gets `AVCodecContext.pts_correction_last_dts` value.
func (avctx *AVCodecContext) GetPtsCorrectionLastDts() int64 {
return (int64)(avctx.pts_correction_last_dts)
}
// SetPtsCorrectionLastDts sets `AVCodecContext.pts_correction_last_dts` value.
func (avctx *AVCodecContext) SetPtsCorrectionLastDts(v int64) {
avctx.pts_correction_last_dts = (C.int64_t)(v)
}
// GetPtsCorrectionLastDtsAddr gets `AVCodecContext.pts_correction_last_dts` address.
func (avctx *AVCodecContext) GetPtsCorrectionLastDtsAddr() *int64 {
return (*int64)(&avctx.pts_correction_last_dts)
}
// GetSubCharenc gets `AVCodecContext.sub_charenc` value.
func (avctx *AVCodecContext) GetSubCharenc() string {
return C.GoString(avctx.sub_charenc)
@@ -3169,20 +3053,6 @@ func AvCodecAlignDimensions2(avctx *AVCodecContext, width, height *int32,
(*C.int)(width), (*C.int)(height), (*C.int)(unsafe.Pointer(&linesizeAlign[0])))
}
// Deprecated: Use AvChromaLocationEnumToPos() instead.
//
// AvCodecEnumToChromaPos converts AVChromaLocation to swscale x/y chroma position.
func AvCodecEnumToChromaPos(xpos, ypos *int32, pos AVChromaLocation) int32 {
return (int32)(C.avcodec_enum_to_chroma_pos((*C.int)(xpos), (*C.int)(ypos), (C.enum_AVChromaLocation)(pos)))
}
// Deprecated: Use AvChromaLocationPosToEnum() instead.
//
// AvCodecChromaPosToEnum converts swscale x/y chroma position to AVChromaLocation.
func AvCodecChromaPosToEnum(xpos, ypos int32) AVChromaLocation {
return (AVChromaLocation)(C.avcodec_chroma_pos_to_enum((C.int)(xpos), (C.int)(ypos)))
}
// AvCodecDecodeSubtitle2 decodes a subtitle message.
func AvCodecDecodeSubtitle2(avctx *AVCodecContext, sub *AVSubtitle, gotSubPtr *int32, avpkt *AVPacket) int32 {
return (int32)(C.avcodec_decode_subtitle2((*C.struct_AVCodecContext)(avctx),

View File

@@ -106,15 +106,6 @@ func (codec *AVCodec) GetSampleFmts() []AVSampleFormat {
})
}
// Deprecated: Use ChLayouts instead.
//
// 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)

View File

@@ -219,7 +219,6 @@ const (
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)

View File

@@ -328,36 +328,6 @@ 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)

View File

@@ -2,12 +2,15 @@
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
//go:build ffmpeg_jni
package ffmpeg
/*
#include <libavcodec/jni.h>
*/
import "C"
import "unsafe"
// AvJniSetJavaVm sets a Java virtual machine which will be used to retrieve the JNI environment.
func AvJniSetJavaVm(vm, logCtx CVoidPointer) int32 {
@@ -18,3 +21,14 @@ func AvJniSetJavaVm(vm, logCtx CVoidPointer) int32 {
func AvJniGetJavaVm(logCtx CVoidPointer) {
C.av_jni_get_java_vm(VoidPointer(logCtx))
}
// AvJniSetAndroidAppCtx sets the Android application context which will be used to retrieve the Android
// content resolver to handle content uris.
func AvJniSetAndroidAppCtx(app_ctx, log_ctx CVoidPointer) int32 {
return (int32)(C.av_jni_set_android_app_ctx(VoidPointer(app_ctx), VoidPointer(log_ctx)))
}
// AvJniGetAndroidAppCtx gets the Android application context that has been set with AvJniGetAndroidAppCtx.
func AvJniGetAndroidAppCtx() unsafe.Pointer {
return unsafe.Pointer(C.av_jni_get_android_app_ctx())
}

View File

@@ -14,39 +14,44 @@ import "unsafe"
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_DYNAMIC_HDR10_PLUS = AVPacketSideDataType(C.AV_PKT_DATA_DYNAMIC_HDR10_PLUS)
AV_PKT_DATA_NB = AVPacketSideDataType(C.AV_PKT_DATA_NB)
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_DYNAMIC_HDR10_PLUS = AVPacketSideDataType(C.AV_PKT_DATA_DYNAMIC_HDR10_PLUS)
AV_PKT_DATA_IAMF_MIX_GAIN_PARAM = AVPacketSideDataType(C.AV_PKT_DATA_IAMF_MIX_GAIN_PARAM)
AV_PKT_DATA_IAMF_DEMIXING_INFO_PARAM = AVPacketSideDataType(C.AV_PKT_DATA_IAMF_DEMIXING_INFO_PARAM)
AV_PKT_DATA_IAMF_RECON_GAIN_INFO_PARAM = AVPacketSideDataType(C.AV_PKT_DATA_IAMF_RECON_GAIN_INFO_PARAM)
AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT = AVPacketSideDataType(C.AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT)
AV_PKT_DATA_NB = AVPacketSideDataType(C.AV_PKT_DATA_NB)
)
const (
@@ -386,10 +391,8 @@ const (
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)
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

View File

@@ -19,16 +19,22 @@ type AVVDPAURenderFunc2 = C.AVVDPAU_Render2
// AVVDPAUContext
type AVVDPAUContext C.struct_AVVDPAUContext
// Deprecated: No use.
//
// AvAllocVdpaucontext allocates AVVDPAUContext.
func AvAllocVdpaucontext() *AVVDPAUContext {
return (*AVVDPAUContext)(C.av_alloc_vdpaucontext())
}
// Deprecated: No use.
//
// AvVdpauHwaccelGetRender2
func AvVdpauHwaccelGetRender2(ctx *AVVDPAUContext) AVVDPAURenderFunc2 {
return (AVVDPAURenderFunc2)(C.av_vdpau_hwaccel_get_render2((*C.struct_AVVDPAUContext)(ctx)))
}
// Deprecated: No use.
//
// AvVdpauHwaccelSetRender2
func AvVdpauHwaccelSetRender2(ctx *AVVDPAUContext, f AVVDPAURenderFunc2) {
C.av_vdpau_hwaccel_set_render2((*C.struct_AVVDPAUContext)(ctx), (C.AVVDPAU_Render2)(f))
@@ -38,6 +44,10 @@ func AvVdpauHwaccelSetRender2(ctx *AVVDPAUContext, f AVVDPAURenderFunc2) {
// NONEED: av_vdpau_get_surface_parameters
// NONEED: av_vdpau_bind_context
// Deprecated: No use.
//
// AvVdpauAllocContext
func AvVdpauAllocContext() *AVVDPAUContext {
return (*AVVDPAUContext)(C.av_vdpau_alloc_context())

View File

@@ -320,21 +320,6 @@ func (fltc *AVFilterContext) GetThreadTypeAddr() *int32 {
return (*int32)(&fltc.thread_type)
}
// GetInternal gets `AVFilterContext.internal` value.
func (fltc *AVFilterContext) GetInternal() *AVFilterInternal {
return (*AVFilterInternal)(fltc.internal)
}
// SetInternal sets `AVFilterContext.internal` value.
func (fltc *AVFilterContext) SetInternal(v *AVFilterInternal) {
fltc.internal = (*C.struct_AVFilterInternal)(v)
}
// GetInternalAddr gets `AVFilterContext.internal` address.
func (fltc *AVFilterContext) GetInternalAddr() **AVFilterInternal {
return (**AVFilterInternal)(unsafe.Pointer(&fltc.internal))
}
// AVFilterCommand
type AVFilterCommand C.struct_AVFilterCommand
@@ -634,25 +619,34 @@ func (fltl *AVFilterLink) GetSampleAspectRatioAddr() *AVRational {
return (*AVRational)(&fltl.sample_aspect_ratio)
}
// Deprecated: Use ChLayout instead.
//
// GetChannelLayout gets `AVFilterLink.channel_layout` value.
func (fltl *AVFilterLink) GetChannelLayout() uint64 {
return (uint64)(fltl.channel_layout)
// GetColorspace gets `AVFilterLink.colorspace` value.
func (fltl *AVFilterLink) GetColorspace() AVColorSpace {
return (AVColorSpace)(fltl.colorspace)
}
// Deprecated: Use ChLayout instead.
//
// SetChannelLayout sets `AVFilterLink.channel_layout` value.
func (fltl *AVFilterLink) SetChannelLayout(v uint64) {
fltl.channel_layout = (C.uint64_t)(v)
// SetColorspace sets `AVFilterLink.colorspace` value.
func (fltl *AVFilterLink) SetColorspace(v AVColorSpace) {
fltl.colorspace = (C.enum_AVColorSpace)(v)
}
// Deprecated: Use ChLayout instead.
//
// GetChannelLayoutAddr gets `AVFilterLink.channel_layout` address.
func (fltl *AVFilterLink) GetChannelLayoutAddr() *uint64 {
return (*uint64)(&fltl.channel_layout)
// GetColorspaceAddr gets `AVFilterLink.colorspace` address.
func (fltl *AVFilterLink) GetColorspaceAddr() *AVColorSpace {
return (*AVColorSpace)(&fltl.colorspace)
}
// GetColorRange gets `AVFilterLink.color_range` value.
func (fltl *AVFilterLink) GetColorRange() AVColorRange {
return (AVColorRange)(fltl.color_range)
}
// SetColorRange sets `AVFilterLink.color_range` value.
func (fltl *AVFilterLink) SetColorRange(v AVColorRange) {
fltl.color_range = (C.enum_AVColorRange)(v)
}
// GetColorRangeAddr gets `AVFilterLink.color_range` address.
func (fltl *AVFilterLink) GetColorRangeAddr() *AVColorRange {
return (*AVColorRange)(&fltl.color_range)
}
// GetSampleRate gets `AVFilterLink.sample_rate` value.
@@ -889,21 +883,6 @@ func (fltg *AVFilterGraph) GetNbThreadsAddr() *int32 {
return (*int32)(&fltg.nb_threads)
}
// GetInternal gets `AVFilterGraph.internal` value.
func (fltg *AVFilterGraph) GetInternal() *AVFilterGraphInternal {
return (*AVFilterGraphInternal)(fltg.internal)
}
// SetInternal sets `AVFilterGraph.internal` value.
func (fltg *AVFilterGraph) SetInternal(v *AVFilterGraphInternal) {
fltg.internal = (*C.struct_AVFilterGraphInternal)(v)
}
// GetInternalAddr gets `AVFilterGraph.internal` address.
func (fltg *AVFilterGraph) GetInternalAddr() **AVFilterGraphInternal {
return (**AVFilterGraphInternal)(unsafe.Pointer(&fltg.internal))
}
// GetOpaque gets `AVFilterGraph.opaque` value.
func (fltg *AVFilterGraph) GetOpaque() unsafe.Pointer {
return fltg.opaque

View File

@@ -66,18 +66,21 @@ func AvBuffersinkGetSampleAspectRatio(ctx *AVFilterContext) AVRational {
return (AVRational)(C.av_buffersink_get_sample_aspect_ratio((*C.struct_AVFilterContext)(ctx)))
}
// AvBuffersinkGetColorspace
func AvBuffersinkGetColorspace(ctx *AVFilterContext) AVColorSpace {
return (AVColorSpace)(C.av_buffersink_get_colorspace((*C.struct_AVFilterContext)(ctx)))
}
// AvBuffersinkGetColorRange
func AvBuffersinkGetColorRange(ctx *AVFilterContext) AVColorRange {
return (AVColorRange)(C.av_buffersink_get_color_range((*C.struct_AVFilterContext)(ctx)))
}
// AvBuffersinkGetChannels
func AvBuffersinkGetChannels(ctx *AVFilterContext) int32 {
return (int32)(C.av_buffersink_get_channels((*C.struct_AVFilterContext)(ctx)))
}
// Deprecated: No use.
//
// AvBuffersinkGetChannelLayout
func AvBuffersinkGetChannelLayout(ctx *AVFilterContext) uint64 {
return (uint64)(C.av_buffersink_get_channel_layout((*C.struct_AVFilterContext)(ctx)))
}
// AvBuffersinkGetChLayout
func AvBuffersinkGetChLayout(ctx *AVFilterContext, chLayout *AVChannelLayout) int32 {
return (int32)(C.av_buffersink_get_ch_layout((*C.struct_AVFilterContext)(ctx),

View File

@@ -144,27 +144,6 @@ func (bsrc *AVBufferSrcParameters) GetSampleRateAddr() *int32 {
return (*int32)(&bsrc.sample_rate)
}
// Deprecated: use ChLayout instead.
//
// GetChannelLayout gets `AVBufferSrcParameters.channel_layout` value.
func (bsrc *AVBufferSrcParameters) GetChannelLayout() uint64 {
return (uint64)(bsrc.channel_layout)
}
// Deprecated: use ChLayout instead.
//
// SetChannelLayout sets `AVBufferSrcParameters.channel_layout` value.
func (bsrc *AVBufferSrcParameters) SetChannelLayout(v uint64) {
bsrc.channel_layout = (C.uint64_t)(v)
}
// Deprecated: use ChLayout instead.
//
// GetChannelLayoutAddr gets `AVBufferSrcParameters.channel_layout` address.
func (bsrc *AVBufferSrcParameters) GetChannelLayoutAddr() *uint64 {
return (*uint64)(&bsrc.channel_layout)
}
// GetChLayout gets `AVBufferSrcParameters.ch_layout` value.
func (bsrc *AVBufferSrcParameters) GetChLayout() AVChannelLayout {
return (AVChannelLayout)(bsrc.ch_layout)
@@ -180,6 +159,36 @@ func (bsrc *AVBufferSrcParameters) GetChLayoutAddr() *AVChannelLayout {
return (*AVChannelLayout)(&bsrc.ch_layout)
}
// GetColorSpace gets `AVBufferSrcParameters.color_space` value.
func (bsrc *AVBufferSrcParameters) GetColorSpace() AVColorSpace {
return (AVColorSpace)(bsrc.color_space)
}
// SetColorSpace sets `AVBufferSrcParameters.color_space` value.
func (bsrc *AVBufferSrcParameters) SetColorSpace(v AVColorSpace) {
bsrc.color_space = (C.enum_AVColorSpace)(v)
}
// GetColorSpaceAddr gets `AVBufferSrcParameters.color_space` address.
func (bsrc *AVBufferSrcParameters) GetColorSpaceAddr() *AVColorSpace {
return (*AVColorSpace)(&bsrc.color_space)
}
// GetColorRange gets `AVBufferSrcParameters.color_range` value.
func (bsrc *AVBufferSrcParameters) GetColorRange() AVColorRange {
return (AVColorRange)(bsrc.color_range)
}
// SetColorRange sets `AVBufferSrcParameters.color_range` value.
func (bsrc *AVBufferSrcParameters) SetColorRange(v AVColorRange) {
bsrc.color_range = (C.enum_AVColorRange)(v)
}
// GetColorRangeAddr gets `AVBufferSrcParameters.color_range` address.
func (bsrc *AVBufferSrcParameters) GetColorRangeAddr() *AVColorRange {
return (*AVColorRange)(&bsrc.color_range)
}
// AvBuffersrcParametersAlloc allocates a new AVBufferSrcParameters instance. It should be freed by the
// caller with AvFree().
func AvBuffersrcParametersAlloc() *AVBufferSrcParameters {

View File

@@ -29,6 +29,47 @@ int get_av_index_entry_size(AVIndexEntry *ie) {
void set_av_index_entry_size(AVIndexEntry *ie, int v) {
ie->size = v;
}
struct AVIAMFAudioElement * get_av_stream_group_params_iamf_audio_element(AVStreamGroup *sg) {
return sg->params.iamf_audio_element;
}
void set_av_stream_group_params_iamf_audio_element(AVStreamGroup *sg, struct AVIAMFAudioElement *v) {
sg->params.iamf_audio_element = v;
}
struct AVIAMFAudioElement ** get_av_stream_group_params_iamf_audio_element_addr(AVStreamGroup *sg) {
return &sg->params.iamf_audio_element;
}
struct AVIAMFMixPresentation * get_av_stream_group_params_iamf_mix_presentation(AVStreamGroup *sg) {
return sg->params.iamf_mix_presentation;
}
void set_av_stream_group_params_iamf_mix_presentation(AVStreamGroup *sg, struct AVIAMFMixPresentation *v) {
sg->params.iamf_mix_presentation = v;
}
struct AVIAMFMixPresentation ** get_av_stream_group_params_iamf_mix_presentation_addr(AVStreamGroup *sg) {
return &sg->params.iamf_mix_presentation;
}
struct AVStreamGroupTileGrid * get_av_stream_group_params_tile_grid(AVStreamGroup *sg) {
return sg->params.tile_grid;
}
void set_av_stream_group_params_tile_grid(AVStreamGroup *sg, struct AVStreamGroupTileGrid *v) {
sg->params.tile_grid = v;
}
struct AVStreamGroupTileGrid ** get_av_stream_group_params_tile_grid_addr(AVStreamGroup *sg) {
return &sg->params.tile_grid;
}
void av_stream_group_tile_grid_set_offsets(AVStreamGroupTileGrid *sgtg, void *v) {
sgtg->offsets = v;
}
*/
import "C"
import (
@@ -708,19 +749,370 @@ func (stm *AVStream) GetPtsWrapBitsAddr() *int32 {
return (*int32)(&stm.pts_wrap_bits)
}
// AVStreamGroupTileGrid
type AVStreamGroupTileGrid C.struct_AVStreamGroupTileGrid
// GetAvClass gets `AVStreamGroupTileGrid.av_class` value.
func (sgtg *AVStreamGroupTileGrid) GetAvClass() *AVClass {
return (*AVClass)(sgtg.av_class)
}
// SetAvClass sets `AVStreamGroupTileGrid.av_class` value.
func (sgtg *AVStreamGroupTileGrid) SetAvClass(v *AVClass) {
sgtg.av_class = (*C.struct_AVClass)(v)
}
// GetAvClassAddr gets `AVStreamGroupTileGrid.av_class` address.
func (sgtg *AVStreamGroupTileGrid) GetAvClassAddr() **AVClass {
return (**AVClass)(unsafe.Pointer(&sgtg.av_class))
}
// GetNbTiles gets `AVStreamGroupTileGrid.nb_tiles` value.
func (sgtg *AVStreamGroupTileGrid) GetNbTiles() uint32 {
return (uint32)(sgtg.nb_tiles)
}
// SetNbTiles sets `AVStreamGroupTileGrid.nb_tiles` value.
func (sgtg *AVStreamGroupTileGrid) SetNbTiles(v uint32) {
sgtg.nb_tiles = (C.uint)(v)
}
// GetNbTilesAddr gets `AVStreamGroupTileGrid.nb_tiles` address.
func (sgtg *AVStreamGroupTileGrid) GetNbTilesAddr() *uint32 {
return (*uint32)(&sgtg.nb_tiles)
}
// GetCodedWidth gets `AVStreamGroupTileGrid.coded_width` value.
func (sgtg *AVStreamGroupTileGrid) GetCodedWidth() int32 {
return (int32)(sgtg.coded_width)
}
// SetCodedWidth sets `AVStreamGroupTileGrid.coded_width` value.
func (sgtg *AVStreamGroupTileGrid) SetCodedWidth(v int32) {
sgtg.coded_width = (C.int)(v)
}
// GetCodedWidthAddr gets `AVStreamGroupTileGrid.coded_width` address.
func (sgtg *AVStreamGroupTileGrid) GetCodedWidthAddr() *int32 {
return (*int32)(&sgtg.coded_width)
}
// GetCodedHeight gets `AVStreamGroupTileGrid.coded_height` value.
func (sgtg *AVStreamGroupTileGrid) GetCodedHeight() int32 {
return (int32)(sgtg.coded_height)
}
// SetCodedHeight sets `AVStreamGroupTileGrid.coded_height` value.
func (sgtg *AVStreamGroupTileGrid) SetCodedHeight(v int32) {
sgtg.coded_height = (C.int)(v)
}
// GetCodedHeightAddr gets `AVStreamGroupTileGrid.coded_height` address.
func (sgtg *AVStreamGroupTileGrid) GetCodedHeightAddr() *int32 {
return (*int32)(&sgtg.coded_height)
}
// GetOffsets gets `AVStreamGroupTileGrid.offsets` value.
func (sgtg *AVStreamGroupTileGrid) GetOffset() (v []struct {
Idx uint32
Horizontal int32
Vertical int32
}) {
for i := 0; i < int(sgtg.nb_tiles); i++ {
o := PointerOffset(sgtg.offsets, i)
v = append(v, struct {
Idx uint32
Horizontal int32
Vertical int32
}{
uint32(o.idx),
int32(o.horizontal),
int32(o.vertical),
})
}
return v
}
// SetOffsets sets `AVStreamGroupTileGrid.offsets` value.
func (sgtg *AVStreamGroupTileGrid) SetOffsets(v unsafe.Pointer) {
C.av_stream_group_tile_grid_set_offsets((*C.struct_AVStreamGroupTileGrid)(sgtg), v)
}
// GetBackground gets `AVStreamGroupTileGrid.background` value.
func (sgtg *AVStreamGroupTileGrid) GetBackground() []uint8 {
return unsafe.Slice((*uint8)(&sgtg.background[0]), 4)
}
// SetBackground sets `AVStreamGroupTileGrid.background` value.
func (sgtg *AVStreamGroupTileGrid) SetBackground(v []uint8) {
for i := 0; i < FFMIN(len(v), 4); i++ {
sgtg.background[i] = (C.uint8_t)(v[i])
}
}
// GetBackgroundAddr gets `AVStreamGroupTileGrid.background` address.
func (sgtg *AVStreamGroupTileGrid) GetBackgroundAddr() **uint8 {
return (**uint8)(unsafe.Pointer(&sgtg.background))
}
// GetHorizontalOffset gets `AVStreamGroupTileGrid.horizontal_offset` value.
func (sgtg *AVStreamGroupTileGrid) GetHorizontalOffset() int32 {
return (int32)(sgtg.horizontal_offset)
}
// SetHorizontalOffset sets `AVStreamGroupTileGrid.horizontal_offset` value.
func (sgtg *AVStreamGroupTileGrid) SetHorizontalOffset(v int32) {
sgtg.horizontal_offset = (C.int)(v)
}
// GetHorizontalOffsetAddr gets `AVStreamGroupTileGrid.horizontal_offset` address.
func (sgtg *AVStreamGroupTileGrid) GetHorizontalOffsetAddr() *int32 {
return (*int32)(&sgtg.horizontal_offset)
}
// GetVerticalOffset gets `AVStreamGroupTileGrid.vertical_offset` value.
func (sgtg *AVStreamGroupTileGrid) GetVerticalOffset() int32 {
return (int32)(sgtg.vertical_offset)
}
// SetVerticalOffset sets `AVStreamGroupTileGrid.vertical_offset` value.
func (sgtg *AVStreamGroupTileGrid) SetVerticalOffset(v int32) {
sgtg.vertical_offset = (C.int)(v)
}
// GetVerticalOffsetAddr gets `AVStreamGroupTileGrid.vertical_offset` address.
func (sgtg *AVStreamGroupTileGrid) GetVerticalOffsetAddr() *int32 {
return (*int32)(&sgtg.vertical_offset)
}
// GetWidth gets `AVStreamGroupTileGrid.width` value.
func (sgtg *AVStreamGroupTileGrid) GetWidth() int32 {
return (int32)(sgtg.width)
}
// SetWidth sets `AVStreamGroupTileGrid.width` value.
func (sgtg *AVStreamGroupTileGrid) SetWidth(v int32) {
sgtg.width = (C.int)(v)
}
// GetWidthAddr gets `AVStreamGroupTileGrid.width` address.
func (sgtg *AVStreamGroupTileGrid) GetWidthAddr() *int32 {
return (*int32)(&sgtg.width)
}
// GetHeight gets `AVStreamGroupTileGrid.height` value.
func (sgtg *AVStreamGroupTileGrid) GetHeight() int32 {
return (int32)(sgtg.height)
}
// SetHeight sets `AVStreamGroupTileGrid.height` value.
func (sgtg *AVStreamGroupTileGrid) SetHeight(v int32) {
sgtg.height = (C.int)(v)
}
// GetHeightAddr gets `AVStreamGroupTileGrid.height` address.
func (sgtg *AVStreamGroupTileGrid) GetHeightAddr() *int32 {
return (*int32)(&sgtg.height)
}
// AVStreamGroupParamsType
type AVStreamGroupParamsType = C.enum_AVStreamGroupParamsType
const (
AV_STREAM_GROUP_PARAMS_NONE = AVStreamGroupParamsType(C.AV_STREAM_GROUP_PARAMS_NONE)
AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT = AVStreamGroupParamsType(C.AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT)
AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION = AVStreamGroupParamsType(C.AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION)
AV_STREAM_GROUP_PARAMS_TILE_GRID = AVStreamGroupParamsType(C.AV_STREAM_GROUP_PARAMS_TILE_GRID)
)
// AVStreamGroup
type AVStreamGroup C.struct_AVStreamGroup
// GetAvClass gets `AVStreamGroup.av_class` value.
func (sg *AVStreamGroup) GetAvClass() *AVClass {
return (*AVClass)(sg.av_class)
}
// SetAvClass sets `AVStreamGroup.av_class` value.
func (sg *AVStreamGroup) SetAvClass(v *AVClass) {
sg.av_class = (*C.struct_AVClass)(v)
}
// GetAvClassAddr gets `AVStreamGroup.av_class` address.
func (sg *AVStreamGroup) GetAvClassAddr() **AVClass {
return (**AVClass)(unsafe.Pointer(&sg.av_class))
}
// GetPrivData gets `AVStreamGroup.priv_data` value.
func (sg *AVStreamGroup) GetPrivData() unsafe.Pointer {
return unsafe.Pointer(sg.priv_data)
}
// SetPrivData sets `AVStreamGroup.priv_data` value.
func (sg *AVStreamGroup) SetPrivData(v unsafe.Pointer) {
sg.priv_data = VoidPointer(v)
}
// GetPrivDataAddr gets `AVStreamGroup.priv_data` address.
func (sg *AVStreamGroup) GetPrivDataAddr() *unsafe.Pointer {
return (*unsafe.Pointer)(&sg.priv_data)
}
// GetIndex gets `AVStreamGroup.index` value.
func (sg *AVStreamGroup) GetIndex() uint32 {
return (uint32)(sg.index)
}
// SetIndex sets `AVStreamGroup.index` value.
func (sg *AVStreamGroup) SetIndex(v uint32) {
sg.index = (C.uint)(v)
}
// GetIndexAddr gets `AVStreamGroup.index` address.
func (sg *AVStreamGroup) GetIndexAddr() *uint32 {
return (*uint32)(&sg.index)
}
// GetId gets `AVStreamGroup.id` value.
func (sg *AVStreamGroup) GetId() int64 {
return (int64)(sg.id)
}
// SetId sets `AVStreamGroup.id` value.
func (sg *AVStreamGroup) SetId(v int64) {
sg.id = (C.int64_t)(v)
}
// GetIdAddr gets `AVStreamGroup.id` address.
func (sg *AVStreamGroup) GetIdAddr() *int64 {
return (*int64)(&sg.id)
}
// GetType gets `AVStreamGroup._type` value.
func (sg *AVStreamGroup) GetType() AVStreamGroupParamsType {
return (AVStreamGroupParamsType)(sg._type)
}
// SetType sets `AVStreamGroup._type` value.
func (sg *AVStreamGroup) SetType(v AVStreamGroupParamsType) {
sg._type = (C.enum_AVStreamGroupParamsType)(v)
}
// GetTypeAddr gets `AVStreamGroup._type` address.
func (sg *AVStreamGroup) GetTypeAddr() *AVStreamGroupParamsType {
return (*AVStreamGroupParamsType)(&sg._type)
}
// GetParamsIamfAudioElement gets `AVStreamGroup.params.iamf_audio_element` value.
func (sg *AVStreamGroup) GetParamsIamfAudioElement() *AVIAMFAudioElement {
return (*AVIAMFAudioElement)(C.get_av_stream_group_params_iamf_audio_element((*C.struct_AVStreamGroup)(sg)))
}
// SetParamsIamfAudioElement sets `AVStreamGroup.params.iamf_audio_element` value.
func (sg *AVStreamGroup) SetParamsIamfAudioElement(v *AVIAMFAudioElement) {
C.set_av_stream_group_params_iamf_audio_element((*C.struct_AVStreamGroup)(sg), (*C.struct_AVIAMFAudioElement)(v))
}
// GetParamsIamfAudioElementAddr gets `AVStreamGroup.params.iamf_audio_element` address.
func (sg *AVStreamGroup) GetParamsIamfAudioElementAddr() **AVIAMFAudioElement {
return (**AVIAMFAudioElement)(unsafe.Pointer(C.get_av_stream_group_params_iamf_audio_element_addr((*C.struct_AVStreamGroup)(sg))))
}
// GetParamsIamfMixPresentation gets `AVStreamGroup.params.iamf_mix_presentation` value.
func (sg *AVStreamGroup) GetParamsIamfMixPresentation() *AVIAMFMixPresentation {
return (*AVIAMFMixPresentation)(C.get_av_stream_group_params_iamf_mix_presentation((*C.struct_AVStreamGroup)(sg)))
}
// SetParamsIamfMixPresentation sets `AVStreamGroup.params.iamf_mix_presentation` value.
func (sg *AVStreamGroup) SetParamsIamfMixPresentation(v *AVIAMFMixPresentation) {
C.set_av_stream_group_params_iamf_mix_presentation((*C.struct_AVStreamGroup)(sg), (*C.struct_AVIAMFMixPresentation)(v))
}
// GetParamsIamfMixPresentationAddr gets `AVStreamGroup.params.iamf_mix_presentation` address.
func (sg *AVStreamGroup) GetParamsIamfMixPresentationAddr() **AVIAMFMixPresentation {
return (**AVIAMFMixPresentation)(unsafe.Pointer(C.get_av_stream_group_params_iamf_mix_presentation_addr((*C.struct_AVStreamGroup)(sg))))
}
// GetParamsTileGrid gets `AVStreamGroup.params.tile_grid` value.
func (sg *AVStreamGroup) GetParamsTileGrid() *AVStreamGroupTileGrid {
return (*AVStreamGroupTileGrid)(C.get_av_stream_group_params_tile_grid((*C.struct_AVStreamGroup)(sg)))
}
// SetParamsTileGrid sets `AVStreamGroup.params.tile_grid` value.
func (sg *AVStreamGroup) SetParamsTileGrid(v *AVStreamGroupTileGrid) {
C.set_av_stream_group_params_tile_grid((*C.struct_AVStreamGroup)(sg), (*C.struct_AVStreamGroupTileGrid)(v))
}
// GetParamsTileGridAddr gets `AVStreamGroup.params.tile_grid` address.
func (sg *AVStreamGroup) GetParamsTileGridAddr() **AVStreamGroupTileGrid {
return (**AVStreamGroupTileGrid)(unsafe.Pointer(C.get_av_stream_group_params_tile_grid_addr((*C.struct_AVStreamGroup)(sg))))
}
// GetMetadata gets `AVStreamGroup.metadata` value.
func (sg *AVStreamGroup) GetMetadata() *AVDictionary {
return (*AVDictionary)(sg.metadata)
}
// SetMetadata sets `AVStreamGroup.metadata` value.
func (sg *AVStreamGroup) SetMetadata(v *AVDictionary) {
sg.metadata = (*C.struct_AVDictionary)(v)
}
// GetMetadataAddr gets `AVStreamGroup.metadata` address.
func (sg *AVStreamGroup) GetMetadataAddr() **AVDictionary {
return (**AVDictionary)(unsafe.Pointer(&sg.metadata))
}
// GetNbStreams gets `AVStreamGroup.nb_streams` value.
func (sg *AVStreamGroup) GetNbStreams() uint32 {
return (uint32)(sg.nb_streams)
}
// SetNbStreams sets `AVStreamGroup.nb_streams` value.
func (sg *AVStreamGroup) SetNbStreams(v uint32) {
sg.nb_streams = (C.uint)(v)
}
// GetNbStreamsAddr gets `AVStreamGroup.nb_streams` address.
func (sg *AVStreamGroup) GetNbStreamsAddr() *uint32 {
return (*uint32)(&sg.nb_streams)
}
// GetStreams gets `AVStreamGroup.streams` value.
func (sg *AVStreamGroup) GetStreams() []*AVStream {
return unsafe.Slice((**AVStream)(unsafe.Pointer(sg.streams)), sg.nb_streams)
}
// SetStreams sets `AVStreamGroup.streams` value.
func (sg *AVStreamGroup) SetStreams(v **AVStream) {
sg.streams = (**C.struct_AVStream)(unsafe.Pointer(v))
}
// GetStreamsAddr gets `AVStreamGroup.streams` address.
func (sg *AVStreamGroup) GetStreamsAddr() ***AVStream {
return (***AVStream)(unsafe.Pointer(&sg.streams))
}
// GetDisposition gets `AVStreamGroup.disposition` value.
func (sg *AVStreamGroup) GetDisposition() int32 {
return (int32)(sg.disposition)
}
// SetDisposition sets `AVStreamGroup.disposition` value.
func (sg *AVStreamGroup) SetDisposition(v int32) {
sg.disposition = (C.int)(v)
}
// GetDispositionAddr gets `AVStreamGroup.disposition` address.
func (sg *AVStreamGroup) GetDispositionAddr() *int32 {
return (*int32)(&sg.disposition)
}
// AvStreamGetParser
func AvStreamGetParser(s *AVStream) *AVCodecParserContext {
return (*AVCodecParserContext)(C.av_stream_get_parser((*C.struct_AVStream)(s)))
}
// Deprecated: No use.
//
// AvStreamGetEndPts returns the pts of the last muxed packet + its duration.
// the retuned value is undefined when used with a demuxer.
func AvStreamGetEndPts(s *AVStream) int64 {
return (int64)(C.av_stream_get_end_pts((*C.struct_AVStream)(s)))
}
const (
AV_PROGRAM_RUNNING = C.AV_PROGRAM_RUNNING
)
@@ -1105,6 +1497,36 @@ func (s *AVFormatContext) GetStreamsAddr() ***AVStream {
return (***AVStream)(unsafe.Pointer(&s.streams))
}
// GetStreamGroups gets `AVFormatContext.stream_groups` value.
func (s *AVFormatContext) GetStreamGroups() (v []*AVStreamGroup) {
return unsafe.Slice((**AVStreamGroup)(unsafe.Pointer(s.stream_groups)), s.nb_stream_groups)
}
// SetStreamGroups sets `AVFormatContext.streams` value.
func (s *AVFormatContext) SetStreamGroups(v **AVStreamGroup) {
s.stream_groups = (**C.struct_AVStreamGroup)(unsafe.Pointer(v))
}
// GetStreamGroupsAddr gets `AVFormatContext.streams` address.
func (s *AVFormatContext) GetStreamGroupsAddr() ***AVStreamGroup {
return (***AVStreamGroup)(unsafe.Pointer(&s.stream_groups))
}
// GetNbStreamGroups gets `AVFormatContext.nb_stream_groups` value.
func (s *AVFormatContext) GetNbStreamGroups() uint32 {
return (uint32)(s.nb_stream_groups)
}
// SetNbStreamGroups sets `AVFormatContext.nb_stream_groups` value.
func (s *AVFormatContext) SetNbStreamGroups(v uint32) {
s.nb_stream_groups = (C.uint)(v)
}
// GetNbStreamGroupsAddr gets `AVFormatContext.nb_stream_groups` address.
func (s *AVFormatContext) GetNbStreamGroupsAddr() *uint32 {
return (*uint32)(&s.nb_stream_groups)
}
// GetUrl gets `AVFormatContext.url` value.
func (s *AVFormatContext) GetUrl() string {
return C.GoString(s.url)
@@ -1569,21 +1991,6 @@ func (s *AVFormatContext) GetAvoidNegativeTsAddr() *int32 {
return (*int32)(&s.avoid_negative_ts)
}
// GetTsId gets `AVFormatContext.ts_id` value.
func (s *AVFormatContext) GetTsId() int32 {
return (int32)(s.ts_id)
}
// SetTsId sets `AVFormatContext.ts_id` value.
func (s *AVFormatContext) SetTsId(v int32) {
s.ts_id = (C.int)(v)
}
// GetTsIdAddr gets `AVFormatContext.ts_id` address.
func (s *AVFormatContext) GetTsIdAddr() *int32 {
return (*int32)(&s.ts_id)
}
// GetAudioPreload gets `AVFormatContext.audio_preload` value.
func (s *AVFormatContext) GetAudioPreload() int32 {
return (int32)(s.audio_preload)
@@ -1951,27 +2358,6 @@ func (s *AVFormatContext) GetIoOpenAddr() *AvFormatContextIoOpenFunc {
return (*AvFormatContextIoOpenFunc)(&s.io_open)
}
// Deprecated: use io_close2 intead.
//
// GetIoClose gets `AVFormatContext.io_close` value.
func (s *AVFormatContext) GetIoClose() AvFormatContextIoCloseFunc {
return (AvFormatContextIoCloseFunc)(s.io_close)
}
// Deprecated: use io_close2 intead.
//
// SetIoClose sets `AVFormatContext.io_close` value.
func (s *AVFormatContext) SetIoClose(v AvFormatContextIoCloseFunc) {
s.io_close = (C.av_format_context_io_close_func)(v)
}
// Deprecated: use io_close2 intead.
//
// GetIoCloseAddr gets `AVFormatContext.io_close` address.
func (s *AVFormatContext) GetIoCloseAddr() *AvFormatContextIoCloseFunc {
return (*AvFormatContextIoCloseFunc)(&s.io_close)
}
// GetProtocolBlacklist gets `AVFormatContext.protocol_blacklist` value.
func (s *AVFormatContext) GetProtocolBlacklist() string {
return C.GoString(s.protocol_blacklist)
@@ -2071,6 +2457,8 @@ func AvFormatInjectGlobalSideData(s *AVFormatContext) {
C.av_format_inject_global_side_data((*C.struct_AVFormatContext)(s))
}
// Deprecated: No use.
//
// AvFmtCtxGetDurationEstimationMethod returns the method used to set ctx->duration.
func AvFmtCtxGetDurationEstimationMethod(s *AVFormatContext) AVDurationEstimationMethod {
return (AVDurationEstimationMethod)(C.av_fmt_ctx_get_duration_estimation_method((*C.struct_AVFormatContext)(s)))
@@ -2134,11 +2522,35 @@ func AvStreamGetClass() *AVClass {
return (*AVClass)(C.av_stream_get_class())
}
// AvStreamGroupGetClass
func AvStreamGroupGetClass() *AVClass {
return (*AVClass)(C.av_stream_group_get_class())
}
// AvformatStreamGroupName
func AvformatStreamGroupName(_type AVStreamGroupParamsType) string {
return C.GoString(C.avformat_stream_group_name((C.enum_AVStreamGroupParamsType)(_type)))
}
// AvformatStreamGroupCreate
func AvformatStreamGroupCreate(s *AVFormatContext, _type AVStreamGroupParamsType, options **AVDictionary) *AVStreamGroup {
return (*AVStreamGroup)(C.avformat_stream_group_create(
(*C.struct_AVFormatContext)(s),
(C.enum_AVStreamGroupParamsType)(_type),
(**C.struct_AVDictionary)(unsafe.Pointer(options))))
}
// AvFormatNewStream adds a new stream to a media file.
func AvFormatNewStream(s *AVFormatContext, c *AVCodec) *AVStream {
return (*AVStream)(C.avformat_new_stream((*C.struct_AVFormatContext)(s), (*C.struct_AVCodec)(c)))
}
// AvformatStreamGroupAddStream
func AvformatStreamGroupAddStream(stg *AVStreamGroup, st *AVStream) int32 {
return (int32)(C.avformat_stream_group_add_stream((*C.struct_AVStreamGroup)(stg),
(*C.struct_AVStream)(st)))
}
// Deprecated: No use.
//
// AvStreamAddSideData wraps an existing array as stream side data.

View File

@@ -237,27 +237,6 @@ type AVIODirContext C.struct_AVIODirContext
// URLContext
type URLContext C.struct_URLContext
// Deprecated: No use.
//
// GetURLContext gets `AVIODirContext.url_context` value.
func (dc *AVIODirContext) GetURLContext() *URLContext {
return (*URLContext)(dc.url_context)
}
// Deprecated: No use.
//
// SetURLContext sets `AVIODirContext.url_context` value.
func (dc *AVIODirContext) SetURLContext(v *URLContext) {
dc.url_context = (*C.struct_URLContext)(v)
}
// Deprecated: No use.
//
// GetURLContextAddr gets `AVIODirContext.url_context` address.
func (dc *AVIODirContext) GetURLContextAddr() **URLContext {
return (**URLContext)(unsafe.Pointer(&dc.url_context))
}
// AVIODataMarkerType
type AVIODataMarkerType = C.enum_AVIODataMarkerType

View File

@@ -118,17 +118,6 @@ func AvIntListLength[U, V Integer](list *U, term V) uint32 {
return (uint32)(C.av_int_list_length_for_size((C.uint)(elsize), (unsafe.Pointer)(list), (C.uint64_t)(term)))
}
// Deprecated: No use.
//
// AvFopenUtf8
func AvFopenUtf8(path, mode string) *FILE {
pathPtr, pathFunc := StringCasting(path)
defer pathFunc()
modePtr, modeFunc := StringCasting(mode)
defer modeFunc()
return (*FILE)(C.av_fopen_utf8((*C.char)(pathPtr), (*C.char)(modePtr)))
}
// AvGetTimeBaseQ returns the fractional representation of the internal time base.
func AvGetTimeBaseQ() AVRational {
return (AVRational)(C.av_get_time_base_q())

View File

@@ -63,6 +63,8 @@ const struct AVChannelLayout av_channel_layout_cube = AV_CHANNE
const struct AVChannelLayout av_channel_layout_5point1point4_back = AV_CHANNEL_LAYOUT_5POINT1POINT4_BACK;
const struct AVChannelLayout av_channel_layout_7point1point2 = AV_CHANNEL_LAYOUT_7POINT1POINT2;
const struct AVChannelLayout av_channel_layout_7point1point4_back = AV_CHANNEL_LAYOUT_7POINT1POINT4_BACK;
const struct AVChannelLayout av_channel_layout_7point2point3 = AV_CHANNEL_LAYOUT_7POINT2POINT3;
const struct AVChannelLayout av_channel_layout_9point1point4_back = AV_CHANNEL_LAYOUT_9POINT1POINT4_BACK;
const struct AVChannelLayout av_channel_layout_hexadecagonal = AV_CHANNEL_LAYOUT_HEXADECAGONAL;
const struct AVChannelLayout av_channel_layout_stereo_downmix = AV_CHANNEL_LAYOUT_STEREO_DOWNMIX;
const struct AVChannelLayout av_channel_layout_22point2 = AV_CHANNEL_LAYOUT_22POINT2;
@@ -160,8 +162,6 @@ const (
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)
)
const (
@@ -197,6 +197,8 @@ const (
AV_CH_LAYOUT_5POINT1POINT4_BACK = uint64(C.AV_CH_LAYOUT_5POINT1POINT4_BACK)
AV_CH_LAYOUT_7POINT1POINT2 = uint64(C.AV_CH_LAYOUT_7POINT1POINT2)
AV_CH_LAYOUT_7POINT1POINT4_BACK = uint64(C.AV_CH_LAYOUT_7POINT1POINT4_BACK)
AV_CH_LAYOUT_7POINT2POINT3 = uint64(C.AV_CH_LAYOUT_7POINT2POINT3)
AV_CH_LAYOUT_9POINT1POINT4_BACK = uint64(C.AV_CH_LAYOUT_9POINT1POINT4_BACK)
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_22POINT2 = uint64(C.AV_CH_LAYOUT_22POINT2)
@@ -433,6 +435,12 @@ func AV_CHANNEL_LAYOUT_7POINT1POINT2() *AVChannelLayout {
func AV_CHANNEL_LAYOUT_7POINT1POINT4_BACK() *AVChannelLayout {
return (*AVChannelLayout)(&C.av_channel_layout_7point1point4_back)
}
func AV_CHANNEL_LAYOUT_7POINT2POINT3() *AVChannelLayout {
return (*AVChannelLayout)(&C.av_channel_layout_7point2point3)
}
func AV_CHANNEL_LAYOUT_9POINT1POINT4_BACK() *AVChannelLayout {
return (*AVChannelLayout)(&C.av_channel_layout_9point1point4_back)
}
func AV_CHANNEL_LAYOUT_HEXADECAGONAL() *AVChannelLayout {
return (*AVChannelLayout)(&C.av_channel_layout_hexadecagonal)
}
@@ -445,100 +453,10 @@ func AV_CHANNEL_LAYOUT_22POINT2() *AVChannelLayout {
func AV_CHANNEL_LAYOUT_AMBISONIC_FIRST_ORDER() *AVChannelLayout {
return (*AVChannelLayout)(&C.av_channel_layout_ambisonic_first_order)
}
func AV_CHANNEL_LAYOUT_7POINT1_TOP_BACK() *AVChannelLayout {
return (*AVChannelLayout)(&C.av_channel_layout_7point1_top_back)
}
// Deprecated: Use AvChannelLayoutFromString() instead.
//
// AvGetChannelLayout returns a channel layout id that matches name, or 0 if no match is found.
func AvGetChannelLayout(name string) uint64 {
namePtr, nameFunc := StringCasting(name)
defer nameFunc()
return (uint64)(C.av_get_channel_layout((*C.char)(namePtr)))
}
// Deprecated: Use AvChannelLayoutFromString() instead.
//
// AvGetExtendedChannelLayout returns a channel layout and the number of channels based on the specified name.
func AvGetExtendedChannelLayout(name string, channelLayout *uint64, nbChannels *int32) int32 {
namePtr, nameFunc := StringCasting(name)
defer nameFunc()
return (int32)(C.av_get_extended_channel_layout((*C.char)(namePtr),
(*C.uint64_t)(channelLayout), (*C.int32_t)(nbChannels)))
}
// Deprecated: Use AvChannelLayoutDescribe() instead.
//
// AvGetChannelLayoutString returns a description of a channel layout.
func AvGetChannelLayoutString(nbChannels int32, channelLayout uint64) string {
buf := make([]C.char, AV_CH_LAYOUT_MAX_STRING_SIZE)
C.av_get_channel_layout_string((*C.char)(&buf[0]), (C.int)(AV_CH_LAYOUT_MAX_STRING_SIZE),
(C.int)(nbChannels), (C.uint64_t)(channelLayout))
return C.GoString((*C.char)(&buf[0]))
}
// Deprecated: Use AvChannelLayoutDescribe() instead.
//
// AvBPrintChannelLayout appends a description of a channel layout to a bprint buffer.
func AvBPrintChannelLayout(bp *AVBPrint, nbChannels int32, channelLayout uint64) {
C.av_bprint_channel_layout((*C.struct_AVBPrint)(bp),
(C.int)(nbChannels), (C.uint64_t)(channelLayout))
}
// Deprecated: Use AVChannelLayout.GetNbChannels() instead.
//
// AvGetChannelLayoutNbChannels returns the number of channels in the channel layout.
func AvGetChannelLayoutNbChannels(channelLayout uint64) int32 {
return (int32)(C.av_get_channel_layout_nb_channels((C.uint64_t)(channelLayout)))
}
// Deprecated: Use AvChannelLayoutDefault() instead.
//
// AvGetDefaultChannelLayout returns default channel layout for a given number of channels.
func AvGetDefaultChannelLayout(nbChannels int32) int64 {
return (int64)(C.av_get_default_channel_layout((C.int)(nbChannels)))
}
// Deprecated: Use AvChannelLayoutIndexFromChannel() instead.
//
// AvGetChannelLayoutChannelIndex gets the index of a channel in channel_layout.
func AvGetChannelLayoutChannelIndex(channelLayout, channel uint64) int32 {
return (int32)(C.av_get_channel_layout_channel_index((C.uint64_t)(channelLayout),
(C.uint64_t)(channel)))
}
// Deprecated: Use AvChannelLayoutChannelFromIndex() instead.
//
// AvChannelLayoutExtractChannel gets the channel with the given index in channel_layout.
func AvChannelLayoutExtractChannel(channelLayout uint64, index int32) uint64 {
return (uint64)(C.av_channel_layout_extract_channel((C.uint64_t)(channelLayout),
(C.int)(index)))
}
// Deprecated: Use AvChannelName() instead.
//
// AvGetChannelName gets the name of a given channel.
func AvGetChannelName(channel uint64) string {
return C.GoString(C.av_get_channel_name((C.uint64_t)(channel)))
}
// Deprecated: Use AvChannelDescription() instead.
//
// AvGetChannelDescription gets the value and name of a standard channel layout.
func AvGetChannelDescription(channel uint64) string {
return C.GoString(C.av_get_channel_description((C.uint64_t)(channel)))
}
// Deprecated: Use AvChannelLayoutStandard() instead.
//
// AvGetStandardChannelLayout Get the value and name of a standard channel layout.
func AvGetStandardChannelLayout(index uint32, layout *uint64, name **int8) int32 {
return (int32)(C.av_get_standard_channel_layout((C.uint)(index),
(*C.uint64_t)(layout), (**C.char)(unsafe.Pointer(name))))
}
// AvChannelName gets a human readable string in an abbreviated form describing a given channel.
func AvChannelName(channel AVChannel) string {
buf := make([]C.char, AV_CH_LAYOUT_MAX_STRING_SIZE)
@@ -576,6 +494,11 @@ func AvChannelFromString(name string) AVChannel {
return (AVChannel)(C.av_channel_from_string((*C.char)(namePtr)))
}
// AvChannelLayoutCustomInit
func AvChannelLayoutCustomInit(channelLayout *AVChannelLayout, nbChannels int32) int32 {
return (int32)(C.av_channel_layout_custom_init((*C.struct_AVChannelLayout)(channelLayout), (C.int)(nbChannels)))
}
// AvChannelLayoutFromMask initializes a native channel layout from a bitmask indicating which channels
// are present.
func AvChannelLayoutFromMask(channelLayout *AVChannelLayout, mask uint64) int32 {
@@ -678,3 +601,14 @@ func AvChannelLayoutCompare(chl, chl1 *AVChannelLayout) int32 {
return (int32)(C.av_channel_layout_compare((*C.struct_AVChannelLayout)(chl),
(*C.struct_AVChannelLayout)(chl1)))
}
const (
AV_CHANNEL_LAYOUT_RETYPE_FLAG_LOSSLESS = int32(C.AV_CHANNEL_LAYOUT_RETYPE_FLAG_LOSSLESS)
AV_CHANNEL_LAYOUT_RETYPE_FLAG_CANONICAL = int32(C.AV_CHANNEL_LAYOUT_RETYPE_FLAG_CANONICAL)
)
// AvChannelLayoutRetype changes the AVChannelOrder of a channel layout.
func AvChannelLayoutRetype(channelLayout *AVChannelLayout, order AVChannelOrder, flags int32) int32 {
return (int32)(C.av_channel_layout_retype((*C.struct_AVChannelLayout)(channelLayout),
(C.enum_AVChannelOrder)(order), (C.int)(flags)))
}

View File

@@ -106,133 +106,3 @@ func AvFifoReset2(f *AVFifo) {
func AvFifoFreep2(f **AVFifo) {
C.av_fifo_freep2((**C.struct_AVFifo)(unsafe.Pointer(f)))
}
// AVFifoBuffer
type AVFifoBuffer C.struct_AVFifoBuffer
// Deprecated: Use AvFifoAlloc2() instread.
//
// AvFifoAlloc initializes an AVFifoBuffer.
func AvFifoAlloc[T Integer](size T) *AVFifoBuffer {
return (*AVFifoBuffer)(C.av_fifo_alloc((C.uint)(size)))
}
// Deprecated: Use AvFifoAlloc2() instread.
//
// AvFifoAllocArray initializes an AVFifoBuffer.
func AvFifoAllocArray[U, V Integer](nmemb U, size V) *AVFifoBuffer {
return (*AVFifoBuffer)(C.av_fifo_alloc_array((C.size_t)(nmemb), (C.size_t)(size)))
}
// Deprecated: Use AvFifoFreep2() instread.
//
// AvFifoFree frees an AVFifoBuffer.
func AvFifoFree(f *AVFifoBuffer) {
C.av_fifo_free((*C.struct_AVFifoBuffer)(f))
}
// Deprecated: Use AvFifoFreep2() instread.
//
// AvFifoFreep frees an AVFifoBuffer and reset pointer to NULL.
func AvFifoFreep(f **AVFifoBuffer) {
C.av_fifo_freep((**C.struct_AVFifoBuffer)(unsafe.Pointer(f)))
}
// Deprecated: Use AvFifoReset2() instread.
//
// AvFifoReset resets the AVFifoBuffer to the state right after AvFifoAlloc, in particular it is emptied.
func AvFifoReset(f *AVFifoBuffer) {
C.av_fifo_reset((*C.struct_AVFifoBuffer)(f))
}
// Deprecated: Use AvFifoCanRead() instread.
//
// AvFifoSize returns the amount of data in bytes in the AVFifoBuffer, that is the
// amount of data you can read from it.
func AvFifoSize(f *AVFifoBuffer) int32 {
return (int32)(C.av_fifo_size((*C.struct_AVFifoBuffer)(f)))
}
// Deprecated: Use AvFifoCanWrite() instread.
//
// AvFifoSpace returns the amount of space in bytes in the AVFifoBuffer, that is the
// amount of data you can write into it.
func AvFifoSpace(f *AVFifoBuffer) int32 {
return (int32)(C.av_fifo_space((*C.struct_AVFifoBuffer)(f)))
}
// Deprecated: No use.
//
// typedef void (*av_fifo_peek_func)(void*, void*, int);
type AvFifoPeekFunc = C.av_fifo_peek_func
// Deprecated: Use the new AVFifo-API with AvFifoPeek() or AvFifoPeekToCb() instread.
//
// AvFifoGenericPeekAt feeds data at specific position from an AVFifoBuffer to a user-supplied callback.
func AvFifoGenericPeekAt(f *AVFifoBuffer, dest CVoidPointer,
offset, bufSize int32, fn AvFifoPeekFunc) int32 {
return (int32)(C.av_fifo_generic_peek_at((*C.struct_AVFifoBuffer)(f),
VoidPointer(dest), (C.int)(offset), (C.int)(bufSize), (C.av_fifo_peek_func)(fn)))
}
// Deprecated: Use the new AVFifo-API with AvFifoPeek() or AvFifoPeekToCb() instread.
//
// AvFifoGenericPeek feeds data from an AVFifoBuffer to a user-supplied callback.
func AvFifoGenericPeek(f *AVFifoBuffer, dest CVoidPointer,
bufSize int32, fn AvFifoPeekFunc) int32 {
return (int32)(C.av_fifo_generic_peek((*C.struct_AVFifoBuffer)(f),
VoidPointer(dest), (C.int)(bufSize), (C.av_fifo_peek_func)(fn)))
}
// typedef void (*av_fifo_read_func)(void*, void*, int);
type AvFifoReadFunc = C.av_fifo_read_func
// Deprecated: Use the new AVFifo-API with AvFifoRead() or AvFifoReadToCb() instread.
//
// AvFifoGenericRead feeds data from an AVFifoBuffer to a user-supplied callback.
func AvFifoGenericRead(f *AVFifoBuffer, dest CVoidPointer,
bufSize int32, fn AvFifoReadFunc) int32 {
return (int32)(C.av_fifo_generic_read((*C.struct_AVFifoBuffer)(f),
VoidPointer(dest), (C.int)(bufSize), (C.av_fifo_read_func)(fn)))
}
// typedef int (*av_fifo_write_func)(void*, void*, int);
type AvFifoWriteFunc = C.av_fifo_write_func
// Deprecated: Use the new AVFifo-API with AvFifoWrite() or AvFifoWriteFromCb() instread.
//
// AvFifoGenericWrite feeds data from a user-supplied callback to an AVFifoBuffer.
func AvFifoGenericWrite(f *AVFifoBuffer, src CVoidPointer,
size int32, fn AvFifoWriteFunc) int32 {
return (int32)(C.av_fifo_generic_write((*C.struct_AVFifoBuffer)(f),
VoidPointer(src), (C.int)(size), (C.av_fifo_write_func)(fn)))
}
// Deprecated: Use the new AVFifo-API with AvFifoGrow2() instread.
//
// AvFifoRealloc2 resizes an AVFifoBuffer.
func AvFifoRealloc2[T Integer](f *AVFifoBuffer, size T) int32 {
return (int32)(C.av_fifo_realloc2((*C.struct_AVFifoBuffer)(f), (C.uint)(size)))
}
// Deprecated: Use the new AVFifo-API with av_fifo_grow2() instread.
//
// AvFifoGrow enlarges an AVFifoBuffer.
func AvFifoGrow[T Integer](f *AVFifoBuffer, additionalSpace T) int32 {
return (int32)(C.av_fifo_grow((*C.struct_AVFifoBuffer)(f), (C.uint)(additionalSpace)))
}
// Deprecated: Use the new AVFifo-API with AvFifoDrain2() instread.
//
// AvFifoDrain reads and discards the specified amount of data from an AVFifoBuffer.
func AvFifoDrain[T Integer](f *AVFifoBuffer, size T) {
C.av_fifo_drain((*C.struct_AVFifoBuffer)(f), (C.int)(size))
}
// Deprecated: Use the new AVFifo-API with AvFifoPeek() or AvFifoPeekToCb() instread.
//
// AvFifoPeek2 returns a pointer to the data stored in a FIFO buffer at a certain offset.
// The FIFO buffer is not modified.
func AvFifoPeek2[T Integer](f *AVFifoBuffer, offs T) *uint8 {
return (*uint8)(C.av_fifo_peek2((*C.struct_AVFifoBuffer)(f), (C.int)(offs)))
}

View File

@@ -23,18 +23,3 @@ func AvFileMap(filename string, bufptr **uint8, size *uintptr, logOffset int32,
func AvFileUnmap(bufptr *uint8, size uintptr) {
C.av_file_unmap((*C.uint8_t)(bufptr), (C.size_t)(size))
}
// Deprecated: No use.
//
// AvTempfile tries to create file in /tmp first, if possible.
func AvTempfile(prefix string, logOffset int32, logCtx CVoidPointer) (filename string, ret int32) {
prefixPtr, prefixFunc := StringCasting(prefix)
defer prefixFunc()
var filenamePtr *C.char
defer FreePointer(filenamePtr)
ret = (int32)(C.av_tempfile((*C.char)(prefixPtr),
(**C.char)(unsafe.Pointer(&filenamePtr)),
(C.int)(logOffset),
VoidPointer(logCtx)))
return C.GoString(filenamePtr), ret
}

View File

@@ -329,91 +329,127 @@ func (h274p *AVFilmGrainH274Params) GetModelIdAddr() *int32 {
return (*int32)(&h274p.model_id)
}
// Deprecated: No use.
//
// GetBitDepthLuma gets `AVFilmGrainH274Params.bit_depth_luma` value.
func (h274p *AVFilmGrainH274Params) GetBitDepthLuma() int32 {
return (int32)(h274p.bit_depth_luma)
}
// Deprecated: No use.
//
// SetBitDepthLuma sets `AVFilmGrainH274Params.bit_depth_luma` value.
func (h274p *AVFilmGrainH274Params) SetBitDepthLuma(v int32) {
h274p.bit_depth_luma = (C.int)(v)
}
// Deprecated: No use.
//
// GetBitDepthLumaAddr gets `AVFilmGrainH274Params.bit_depth_luma` address.
func (h274p *AVFilmGrainH274Params) GetBitDepthLumaAddr() *int32 {
return (*int32)(&h274p.bit_depth_luma)
}
// Deprecated: No use.
//
// GetBitDepthChroma gets `AVFilmGrainH274Params.bit_depth_chroma` value.
func (h274p *AVFilmGrainH274Params) GetBitDepthChroma() int32 {
return (int32)(h274p.bit_depth_chroma)
}
// Deprecated: No use.
//
// SetBitDepthChroma sets `AVFilmGrainH274Params.bit_depth_chroma` value.
func (h274p *AVFilmGrainH274Params) SetBitDepthChroma(v int32) {
h274p.bit_depth_chroma = (C.int)(v)
}
// Deprecated: No use.
//
// GetBitDepthChromaAddr gets `AVFilmGrainH274Params.bit_depth_chroma` address.
func (h274p *AVFilmGrainH274Params) GetBitDepthChromaAddr() *int32 {
return (*int32)(&h274p.bit_depth_chroma)
}
// Deprecated: No use.
//
// GetColorRange gets `AVFilmGrainH274Params.color_range` value.
func (h274p *AVFilmGrainH274Params) GetColorRange() AVColorRange {
return (AVColorRange)(h274p.color_range)
}
// Deprecated: No use.
//
// SetColorRange sets `AVFilmGrainH274Params.color_range` value.
func (h274p *AVFilmGrainH274Params) SetColorRange(v AVColorRange) {
h274p.color_range = (C.enum_AVColorRange)(v)
}
// Deprecated: No use.
//
// GetColorRangeAddr gets `AVFilmGrainH274Params.color_range` address.
func (h274p *AVFilmGrainH274Params) GetColorRangeAddr() *AVColorRange {
return (*AVColorRange)(&h274p.color_range)
}
// Deprecated: No use.
//
// GetColorPrimaries gets `AVFilmGrainH274Params.color_primaries` value.
func (h274p *AVFilmGrainH274Params) GetColorPrimaries() AVColorPrimaries {
return (AVColorPrimaries)(h274p.color_primaries)
}
// Deprecated: No use.
//
// SetColorPrimaries sets `AVFilmGrainH274Params.color_primaries` value.
func (h274p *AVFilmGrainH274Params) SetColorPrimaries(v AVColorPrimaries) {
h274p.color_primaries = (C.enum_AVColorPrimaries)(v)
}
// Deprecated: No use.
//
// GetColorPrimariesAddr gets `AVFilmGrainH274Params.color_primaries` address.
func (h274p *AVFilmGrainH274Params) GetColorPrimariesAddr() *AVColorPrimaries {
return (*AVColorPrimaries)(&h274p.color_primaries)
}
// Deprecated: No use.
//
// GetColorTrc gets `AVFilmGrainH274Params.color_trc` value.
func (h274p *AVFilmGrainH274Params) GetColorTrc() AVColorTransferCharacteristic {
return (AVColorTransferCharacteristic)(h274p.color_trc)
}
// Deprecated: No use.
//
// SetColorTrc sets `AVFilmGrainH274Params.color_trc` value.
func (h274p *AVFilmGrainH274Params) SetColorTrc(v AVColorTransferCharacteristic) {
h274p.color_trc = (C.enum_AVColorTransferCharacteristic)(v)
}
// Deprecated: No use.
//
// GetColorTrcAddr gets `AVFilmGrainH274Params.color_trc` address.
func (h274p *AVFilmGrainH274Params) GetColorTrcAddr() *AVColorTransferCharacteristic {
return (*AVColorTransferCharacteristic)(&h274p.color_trc)
}
// Deprecated: No use.
//
// GetColorSpace gets `AVFilmGrainH274Params.color_space` value.
func (h274p *AVFilmGrainH274Params) GetColorSpace() AVColorSpace {
return (AVColorSpace)(h274p.color_space)
}
// Deprecated: No use.
//
// SetColorSpace sets `AVFilmGrainH274Params.color_space` value.
func (h274p *AVFilmGrainH274Params) SetColorSpace(v AVColorSpace) {
h274p.color_space = (C.enum_AVColorSpace)(v)
}
// Deprecated: No use.
//
// GetColorSpaceAddr gets `AVFilmGrainH274Params.color_space` address.
func (h274p *AVFilmGrainH274Params) GetColorSpaceAddr() *AVColorSpace {
return (*AVColorSpace)(&h274p.color_space)
@@ -623,6 +659,156 @@ func (fgp *AVFilmGrainParams) GetCodecAomAddr() *AVFilmGrainAOMParams {
(*C.struct_AVFilmGrainParams)(fgp)))
}
// GetWidth gets `AVFilmGrainParams.width` value.
func (fgp *AVFilmGrainParams) GetWidth() int32 {
return (int32)(fgp.width)
}
// SetWidth sets `AVFilmGrainParams.width` value.
func (fgp *AVFilmGrainParams) SetWidth(v int32) {
fgp.width = (C.int)(v)
}
// GetWidthAddr gets `AVFilmGrainParams.width` address.
func (fgp *AVFilmGrainParams) GetWidthAddr() *int32 {
return (*int32)(&fgp.width)
}
// GetHeight gets `AVFilmGrainParams.height` value.
func (fgp *AVFilmGrainParams) GetHeight() int32 {
return (int32)(fgp.height)
}
// SetHeight sets `AVFilmGrainParams.height` value.
func (fgp *AVFilmGrainParams) SetHeight(v int32) {
fgp.height = (C.int)(v)
}
// GetHeightAddr gets `AVFilmGrainParams.height` address.
func (fgp *AVFilmGrainParams) GetHeightAddr() *int32 {
return (*int32)(&fgp.height)
}
// GetSubsamplingX gets `AVFilmGrainParams.subsampling_x` value.
func (fgp *AVFilmGrainParams) GetSubsamplingX() int32 {
return (int32)(fgp.subsampling_x)
}
// SetSubsamplingX sets `AVFilmGrainParams.subsampling_x` value.
func (fgp *AVFilmGrainParams) SetSubsamplingX(v int32) {
fgp.subsampling_x = (C.int)(v)
}
// GetSubsamplingXAddr gets `AVFilmGrainParams.subsampling_x` address.
func (fgp *AVFilmGrainParams) GetSubsamplingXAddr() *int32 {
return (*int32)(&fgp.subsampling_x)
}
// GetSubsamplingY gets `AVFilmGrainParams.subsampling_y` value.
func (fgp *AVFilmGrainParams) GetSubsamplingY() int32 {
return (int32)(fgp.subsampling_y)
}
// SetSubsamplingY sets `AVFilmGrainParams.subsampling_y` value.
func (fgp *AVFilmGrainParams) SetSubsamplingY(v int32) {
fgp.subsampling_y = (C.int)(v)
}
// GetSubsamplingYAddr gets `AVFilmGrainParams.subsampling_y` address.
func (fgp *AVFilmGrainParams) GetSubsamplingYAddr() *int32 {
return (*int32)(&fgp.subsampling_y)
}
// GetColorRange gets `AVFilmGrainParams.color_range` value.
func (fgp *AVFilmGrainParams) GetColorRange() AVColorRange {
return (AVColorRange)(fgp.color_range)
}
// SetColorRange sets `AVFilmGrainParams.color_range` value.
func (fgp *AVFilmGrainParams) SetColorRange(v AVColorRange) {
fgp.color_range = (C.enum_AVColorRange)(v)
}
// GetColorRangeAddr gets `AVFilmGrainParams.color_range` address.
func (fgp *AVFilmGrainParams) GetColorRangeAddr() *AVColorRange {
return (*AVColorRange)(&fgp.color_range)
}
// GetColorPrimaries gets `AVFilmGrainParams.color_primaries` value.
func (fgp *AVFilmGrainParams) GetColorPrimaries() AVColorPrimaries {
return (AVColorPrimaries)(fgp.color_primaries)
}
// SetColorPrimaries sets `AVFilmGrainParams.color_primaries` value.
func (fgp *AVFilmGrainParams) SetColorPrimaries(v AVColorPrimaries) {
fgp.color_primaries = (C.enum_AVColorPrimaries)(v)
}
// GetColorPrimariesAddr gets `AVFilmGrainParams.color_primaries` address.
func (fgp *AVFilmGrainParams) GetColorPrimariesAddr() *AVColorPrimaries {
return (*AVColorPrimaries)(&fgp.color_primaries)
}
// GetColorTrc gets `AVFilmGrainParams.color_trc` value.
func (fgp *AVFilmGrainParams) GetColorTrc() AVColorTransferCharacteristic {
return (AVColorTransferCharacteristic)(fgp.color_trc)
}
// SetColorTrc sets `AVFilmGrainParams.color_trc` value.
func (fgp *AVFilmGrainParams) SetColorTrc(v AVColorTransferCharacteristic) {
fgp.color_trc = (C.enum_AVColorTransferCharacteristic)(v)
}
// GetColorTrcAddr gets `AVFilmGrainParams.color_trc` address.
func (fgp *AVFilmGrainParams) GetColorTrcAddr() *AVColorTransferCharacteristic {
return (*AVColorTransferCharacteristic)(&fgp.color_trc)
}
// GetColorSpace gets `AVFilmGrainParams.color_space` value.
func (fgp *AVFilmGrainParams) GetColorSpace() AVColorSpace {
return (AVColorSpace)(fgp.color_space)
}
// SetColorSpace sets `AVFilmGrainParams.color_space` value.
func (fgp *AVFilmGrainParams) SetColorSpace(v AVColorSpace) {
fgp.color_space = (C.enum_AVColorSpace)(v)
}
// GetColorSpaceAddr gets `AVFilmGrainParams.color_space` address.
func (fgp *AVFilmGrainParams) GetColorSpaceAddr() *AVColorSpace {
return (*AVColorSpace)(&fgp.color_space)
}
// GetBitDepthLuma gets `AVFilmGrainParams.bit_depth_luma` value.
func (fgp *AVFilmGrainParams) GetBitDepthLuma() int32 {
return (int32)(fgp.bit_depth_luma)
}
// SetBitDepthLuma sets `AVFilmGrainParams.bit_depth_luma` value.
func (fgp *AVFilmGrainParams) SetBitDepthLuma(v int32) {
fgp.bit_depth_luma = (C.int)(v)
}
// GetBitDepthLumaAddr gets `AVFilmGrainParams.bit_depth_luma` address.
func (fgp *AVFilmGrainParams) GetBitDepthLumaAddr() *int32 {
return (*int32)(&fgp.bit_depth_luma)
}
// GetBitDepthChroma gets `AVFilmGrainParams.bit_depth_chroma` value.
func (fgp *AVFilmGrainParams) GetBitDepthChroma() int32 {
return (int32)(fgp.bit_depth_chroma)
}
// SetBitDepthChroma sets `AVFilmGrainParams.bit_depth_chroma` value.
func (fgp *AVFilmGrainParams) SetBitDepthChroma(v int32) {
fgp.bit_depth_chroma = (C.int)(v)
}
// GetBitDepthChromaAddr gets `AVFilmGrainParams.bit_depth_chroma` address.
func (fgp *AVFilmGrainParams) GetBitDepthChromaAddr() *int32 {
return (*int32)(&fgp.bit_depth_chroma)
}
// AvFilmGrainParamsAlloc allocates an AVFilmGrainParams structure and set its fields to
// default values.
func AvFilmGrainParamsAlloc(size *uintptr) *AVFilmGrainParams {
@@ -633,3 +819,8 @@ func AvFilmGrainParamsAlloc(size *uintptr) *AVFilmGrainParams {
func AvFilmGrainParamsCreateSideData(frame *AVFrame) *AVFilmGrainParams {
return (*AVFilmGrainParams)(C.av_film_grain_params_create_side_data((*C.struct_AVFrame)(frame)))
}
// AvFilmGrainParamsSelect selects the most appropriate film grain parameters set for the frame.
func AvFilmGrainParamsSelect(frame *AVFrame) *AVFilmGrainParams {
return (*AVFilmGrainParams)(C.av_film_grain_params_select((*C.struct_AVFrame)(frame)))
}

View File

@@ -441,48 +441,6 @@ func (frame *AVFrame) GetTimeBaseAddr() *AVRational {
return (*AVRational)(&frame.time_base)
}
// Deprecated: Unused.
//
// GetCodedPictureNumber gets `AVFrame.coded_picture_number` value.
func (frame *AVFrame) GetCodedPictureNumber() int32 {
return (int32)(frame.coded_picture_number)
}
// Deprecated: Unused.
//
// SetCodedPictureNumber sets `AVFrame.coded_picture_number` value.
func (frame *AVFrame) SetCodedPictureNumber(v int32) {
frame.coded_picture_number = (C.int)(v)
}
// Deprecated: Unused.
//
// GetCodedPictureNumberAddr gets `AVFrame.coded_picture_number` address.
func (frame *AVFrame) GetCodedPictureNumberAddr() *int32 {
return (*int32)(&frame.coded_picture_number)
}
// Deprecated: Unused.
//
// GetDisplayPictureNumber gets `AVFrame.display_picture_number` value.
func (frame *AVFrame) GetDisplayPictureNumber() int32 {
return (int32)(frame.display_picture_number)
}
// Deprecated: Unused.
//
// SetDisplayPictureNumber sets `AVFrame.display_picture_number` value.
func (frame *AVFrame) SetDisplayPictureNumber(v int32) {
frame.display_picture_number = (C.int)(v)
}
// Deprecated: Unused.
//
// GetDisplayPictureNumberAddr gets `AVFrame.display_picture_number` address.
func (frame *AVFrame) GetDisplayPictureNumberAddr() *int32 {
return (*int32)(&frame.display_picture_number)
}
// GetQuality gets `AVFrame.quality` value.
func (frame *AVFrame) GetQuality() int32 {
return (int32)(frame.quality)
@@ -576,27 +534,6 @@ func (frame *AVFrame) GetPaletteHasChangedAddr() *int32 {
return (*int32)(&frame.palette_has_changed)
}
// Deprecated: Use AV_CODEC_FLAG_COPY_OPAQUE instead.
//
// GetReorderedOpaque gets `AVFrame.reordered_opaque` value.
func (frame *AVFrame) GetReorderedOpaque() int64 {
return (int64)(frame.reordered_opaque)
}
// Deprecated: Use AV_CODEC_FLAG_COPY_OPAQUE instead.
//
// SetReorderedOpaque sets `AVFrame.reordered_opaque` value.
func (frame *AVFrame) SetReorderedOpaque(v int64) {
frame.reordered_opaque = (C.int64_t)(v)
}
// Deprecated: Use AV_CODEC_FLAG_COPY_OPAQUE instead.
//
// GetReorderedOpaqueAddr gets `AVFrame.reordered_opaque` address.
func (frame *AVFrame) GetReorderedOpaqueAddr() *int64 {
return (*int64)(&frame.reordered_opaque)
}
// GetSampleRate gets `AVFrame.sample_rate` value.
func (frame *AVFrame) GetSampleRate() int32 {
return (int32)(frame.sample_rate)
@@ -612,27 +549,6 @@ func (frame *AVFrame) GetSampleRateAddr() *int32 {
return (*int32)(&frame.sample_rate)
}
// Deprecated: use ChLayout instead
//
// GetChannelLayout gets `AVFrame.channel_layout` value.
func (frame *AVFrame) GetChannelLayout() uint64 {
return (uint64)(frame.channel_layout)
}
// Deprecated: use ChLayout instead
//
// SetChannelLayout sets `AVFrame.channel_layout` value.
func (frame *AVFrame) SetChannelLayout(v uint64) {
frame.channel_layout = (C.uint64_t)(v)
}
// Deprecated: use ChLayout instead
//
// GetChannelLayoutAddr gets `AVFrame.channel_layout` address.
func (frame *AVFrame) GetChannelLayoutAddr() *uint64 {
return (*uint64)(&frame.channel_layout)
}
// GetBuf gets `AVFrame.buf` value.
func (frame *AVFrame) GetBuf() []*AVBufferRef {
return unsafe.Slice((**AVBufferRef)(unsafe.Pointer(&frame.buf[0])), AV_NUM_DATA_POINTERS)
@@ -839,27 +755,6 @@ func (frame *AVFrame) GetPktPosAddr() *int64 {
return (*int64)(&frame.pkt_pos)
}
// Deprecated: Use duration instead.
//
// GetPktDuration gets `AVFrame.pkt_duration` value.
func (frame *AVFrame) GetPktDuration() int64 {
return (int64)(frame.pkt_duration)
}
// Deprecated: Use duration instead.
//
// SetPktDuration sets `AVFrame.pkt_duration` value.
func (frame *AVFrame) SetPktDuration(v int64) {
frame.pkt_duration = (C.int64_t)(v)
}
// Deprecated: Use duration instead.
//
// GetPktDurationAddr gets `AVFrame.pkt_duration` address.
func (frame *AVFrame) GetPktDurationAddr() *int64 {
return (*int64)(&frame.pkt_duration)
}
// GetMetadata gets `AVFrame.metadata` value.
func (frame *AVFrame) GetMetadata() *AVDictionary {
return (*AVDictionary)(frame.metadata)
@@ -897,27 +792,6 @@ const (
FF_DECODE_ERROR_DECODE_SLICES = int32(C.FF_DECODE_ERROR_DECODE_SLICES)
)
// Deprecated: use ChLayout instead
//
// GetChannels gets `AVFrame.channels` value.
func (frame *AVFrame) GetChannels() int32 {
return (int32)(frame.channels)
}
// Deprecated: use ChLayout instead
//
// SetChannels sets `AVFrame.channels` value.
func (frame *AVFrame) SetChannels(v int32) {
frame.channels = (C.int)(v)
}
// Deprecated: use ChLayout instead
//
// GetChannelsAddr gets `AVFrame.channels` address.
func (frame *AVFrame) GetChannelsAddr() *int32 {
return (*int32)(&frame.channels)
}
// GetPktSize gets `AVFrame.pkt_size` value.
func (frame *AVFrame) GetPktSize() int32 {
return (int32)(frame.pkt_size)
@@ -1176,3 +1050,37 @@ func AvFrameApplyCropping(frame *AVFrame, flags int32) int32 {
func AvFrameSideDataName(_type AVFrameSideDataType) string {
return C.GoString(C.av_frame_side_data_name((C.enum_AVFrameSideDataType)(_type)))
}
// AvFrameSideDataFree frees all side data entries and their contents.
func AvFrameSideDataFree(sd ***AVFrameSideData, nbSd *int32) {
C.av_frame_side_data_free((***C.struct_AVFrameSideData)(unsafe.Pointer(sd)), (*C.int)(nbSd))
}
const (
AV_FRAME_SIDE_DATA_FLAG_UNIQUE = uint32(C.AV_FRAME_SIDE_DATA_FLAG_UNIQUE)
)
// AvFrameSideDataNew adds new side data entry to an array.
func AvFrameSideDataNew(sd ***AVFrameSideData, nbSd *int32, _type AVFrameSideDataType, size uintptr, flags uint32) *AVFrameSideData {
return (*AVFrameSideData)(C.av_frame_side_data_new(
(***C.struct_AVFrameSideData)(unsafe.Pointer(sd)), (*C.int)(nbSd),
(C.enum_AVFrameSideDataType)(_type), (C.size_t)(size), (C.uint)(flags)))
}
// AvFrameSideDataClone
func AvFrameSideDataClone(sd ***AVFrameSideData, nbSd *int32, src *AVFrameSideData, flags uint32) int32 {
return (int32)(C.av_frame_side_data_clone((***C.struct_AVFrameSideData)(unsafe.Pointer(sd)), (*C.int)(nbSd),
(*C.struct_AVFrameSideData)(src), (C.uint)(flags)))
}
// AvFrameSideDataGetC
func AvFrameSideDataGetC(sd **AVFrameSideData, nbSd int32, _type AVFrameSideDataType) *AVFrameSideData {
return (*AVFrameSideData)(C.av_frame_side_data_get_c((**C.struct_AVFrameSideData)(unsafe.Pointer(sd)), (C.int)(nbSd),
(C.enum_AVFrameSideDataType)(_type)))
}
// AvFrameSideDataGet
func AvFrameSideDataGet(sd **AVFrameSideData, nbSd int32, _type AVFrameSideDataType) *AVFrameSideData {
return (*AVFrameSideData)(C.av_frame_side_data_get((**C.struct_AVFrameSideData)(unsafe.Pointer(sd)), (C.int)(nbSd),
(C.enum_AVFrameSideDataType)(_type)))
}

View File

@@ -29,6 +29,7 @@ const (
AV_HWDEVICE_TYPE_OPENCL = AVHWDeviceType(C.AV_HWDEVICE_TYPE_OPENCL)
AV_HWDEVICE_TYPE_MEDIACODEC = AVHWDeviceType(C.AV_HWDEVICE_TYPE_MEDIACODEC)
AV_HWDEVICE_TYPE_VULKAN = AVHWDeviceType(C.AV_HWDEVICE_TYPE_VULKAN)
AV_HWDEVICE_TYPE_D3D12VA = AVHWDeviceType(C.AV_HWDEVICE_TYPE_D3D12VA)
)
// AVHWDeviceInternal
@@ -55,21 +56,6 @@ func (dc *AVHWDeviceContext) GetAvClassAddr() **AVClass {
return (**AVClass)(unsafe.Pointer(&dc.av_class))
}
// GetInternal gets `AVHWDeviceContext.internal` value.
func (dc *AVHWDeviceContext) GetInternal() *AVHWDeviceInternal {
return (*AVHWDeviceInternal)(dc.internal)
}
// SetInternal sets `AVHWDeviceContext.internal` value.
func (dc *AVHWDeviceContext) SetInternal(v *AVHWDeviceInternal) {
dc.internal = (*C.struct_AVHWDeviceInternal)(v)
}
// GetInternalAddr gets `AVHWDeviceContext.internal` address.
func (dc *AVHWDeviceContext) GetInternalAddr() **AVHWDeviceInternal {
return (**AVHWDeviceInternal)(unsafe.Pointer(&dc.internal))
}
// GetType gets `AVHWDeviceContext.type` value.
func (dc *AVHWDeviceContext) GetType() AVHWDeviceType {
return (AVHWDeviceType)(dc._type)
@@ -144,21 +130,6 @@ func (fc *AVHWFramesContext) GetAvClassAddr() **AVClass {
return (**AVClass)(unsafe.Pointer(&fc.av_class))
}
// GetInternal gets `AVHWFramesContext.internal` value.
func (fc *AVHWFramesContext) GetInternal() *AVHWFramesInternal {
return (*AVHWFramesInternal)(fc.internal)
}
// SetInternal sets `AVHWFramesContext.internal` value.
func (fc *AVHWFramesContext) SetInternal(v *AVHWFramesInternal) {
fc.internal = (*C.struct_AVHWFramesInternal)(v)
}
// GetInternalAddr gets `AVHWFramesContext.internal` address.
func (fc *AVHWFramesContext) GetInternalAddr() **AVHWFramesInternal {
return (**AVHWFramesInternal)(unsafe.Pointer(&fc.internal))
}
// GetDeviceRef gets `AVHWFramesContext.device_ref` value.
func (fc *AVHWFramesContext) GetDeviceRef() *AVBufferRef {
return (*AVBufferRef)(fc.device_ref)

View File

@@ -0,0 +1,24 @@
// 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.
//go:build ffmpeg_hw_d3d12va
package ffmpeg
/*
#include <libavutil/hwcontext_d3d12va.h>
*/
import "C"
// AVD3D12VADeviceContext
type AVD3D12VADeviceContext C.struct_AVD3D12VADeviceContext
// AVD3D12VASyncContext
type AVD3D12VASyncContext C.struct_AVD3D12VASyncContext
// AVD3D12VAFrame
type AVD3D12VAFrame C.struct_AVD3D12VAFrame
// AVD3D12VAFramesContext
type AVD3D12VAFramesContext C.struct_AVD3D12VAFramesContext

1088
avutil_iamf.go Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -220,3 +220,22 @@ func AvImageFillBlack(dstData []*uint8, dstLinesize []int,
(C.enum_AVPixelFormat)(pixFmt), (C.enum_AVColorRange)(_range),
(C.int)(width), (C.int)(height)))
}
// AvImageFillColor
func AvImageFillColor(dstData []*uint8, dstLinesize []int,
pixFmt AVPixelFormat, color []uint32, width, height, flags int32) int32 {
if len(dstData) < 4 {
panic("dstData len < 4")
}
if len(dstLinesize) < 4 {
panic("dstLinesize len < 4")
}
if len(color) < 4 {
panic("color len < 4")
}
return (int32)(C.av_image_fill_color((**C.uint8_t)(unsafe.Pointer(&dstData[0])),
(*C.ptrdiff_t)(unsafe.Pointer(&dstLinesize[0])),
(C.enum_AVPixelFormat)(pixFmt),
(*C.uint32_t)(unsafe.Pointer(&color[0])),
(C.int)(width), (C.int)(height), (C.int)(flags)))
}

View File

@@ -67,28 +67,79 @@ import (
type AVOptionType = int32
const (
AV_OPT_TYPE_FLAGS = AVOptionType(C.AV_OPT_TYPE_FLAGS)
AV_OPT_TYPE_INT = AVOptionType(C.AV_OPT_TYPE_INT)
AV_OPT_TYPE_INT64 = AVOptionType(C.AV_OPT_TYPE_INT64)
AV_OPT_TYPE_DOUBLE = AVOptionType(C.AV_OPT_TYPE_DOUBLE)
AV_OPT_TYPE_FLOAT = AVOptionType(C.AV_OPT_TYPE_FLOAT)
AV_OPT_TYPE_STRING = AVOptionType(C.AV_OPT_TYPE_STRING)
AV_OPT_TYPE_RATIONAL = AVOptionType(C.AV_OPT_TYPE_RATIONAL)
AV_OPT_TYPE_BINARY = AVOptionType(C.AV_OPT_TYPE_BINARY)
AV_OPT_TYPE_DICT = AVOptionType(C.AV_OPT_TYPE_DICT)
AV_OPT_TYPE_UINT64 = AVOptionType(C.AV_OPT_TYPE_UINT64)
AV_OPT_TYPE_CONST = AVOptionType(C.AV_OPT_TYPE_CONST)
AV_OPT_TYPE_IMAGE_SIZE = AVOptionType(C.AV_OPT_TYPE_IMAGE_SIZE)
AV_OPT_TYPE_PIXEL_FMT = AVOptionType(C.AV_OPT_TYPE_PIXEL_FMT)
AV_OPT_TYPE_SAMPLE_FMT = AVOptionType(C.AV_OPT_TYPE_SAMPLE_FMT)
AV_OPT_TYPE_VIDEO_RATE = AVOptionType(C.AV_OPT_TYPE_VIDEO_RATE)
AV_OPT_TYPE_DURATION = AVOptionType(C.AV_OPT_TYPE_DURATION)
AV_OPT_TYPE_COLOR = AVOptionType(C.AV_OPT_TYPE_COLOR)
AV_OPT_TYPE_CHANNEL_LAYOUT = AVOptionType(C.AV_OPT_TYPE_CHANNEL_LAYOUT)
AV_OPT_TYPE_BOOL = AVOptionType(C.AV_OPT_TYPE_BOOL)
AV_OPT_TYPE_CHLAYOUT = AVOptionType(C.AV_OPT_TYPE_CHLAYOUT)
AV_OPT_TYPE_FLAGS = AVOptionType(C.AV_OPT_TYPE_FLAGS)
AV_OPT_TYPE_INT = AVOptionType(C.AV_OPT_TYPE_INT)
AV_OPT_TYPE_INT64 = AVOptionType(C.AV_OPT_TYPE_INT64)
AV_OPT_TYPE_DOUBLE = AVOptionType(C.AV_OPT_TYPE_DOUBLE)
AV_OPT_TYPE_FLOAT = AVOptionType(C.AV_OPT_TYPE_FLOAT)
AV_OPT_TYPE_STRING = AVOptionType(C.AV_OPT_TYPE_STRING)
AV_OPT_TYPE_RATIONAL = AVOptionType(C.AV_OPT_TYPE_RATIONAL)
AV_OPT_TYPE_BINARY = AVOptionType(C.AV_OPT_TYPE_BINARY)
AV_OPT_TYPE_DICT = AVOptionType(C.AV_OPT_TYPE_DICT)
AV_OPT_TYPE_UINT64 = AVOptionType(C.AV_OPT_TYPE_UINT64)
AV_OPT_TYPE_CONST = AVOptionType(C.AV_OPT_TYPE_CONST)
AV_OPT_TYPE_IMAGE_SIZE = AVOptionType(C.AV_OPT_TYPE_IMAGE_SIZE)
AV_OPT_TYPE_PIXEL_FMT = AVOptionType(C.AV_OPT_TYPE_PIXEL_FMT)
AV_OPT_TYPE_SAMPLE_FMT = AVOptionType(C.AV_OPT_TYPE_SAMPLE_FMT)
AV_OPT_TYPE_VIDEO_RATE = AVOptionType(C.AV_OPT_TYPE_VIDEO_RATE)
AV_OPT_TYPE_DURATION = AVOptionType(C.AV_OPT_TYPE_DURATION)
AV_OPT_TYPE_COLOR = AVOptionType(C.AV_OPT_TYPE_COLOR)
AV_OPT_TYPE_BOOL = AVOptionType(C.AV_OPT_TYPE_BOOL)
AV_OPT_TYPE_CHLAYOUT = AVOptionType(C.AV_OPT_TYPE_CHLAYOUT)
AV_OPT_TYPE_FLAG_ARRAY = AVOptionType(C.AV_OPT_TYPE_FLAG_ARRAY)
)
// AVOptionArrayDef
type AVOptionArrayDef C.struct_AVOptionArrayDef
// GetDef gets `AVOptionArrayDef.def` value.
func (oadf *AVOptionArrayDef) GetDef() string {
return C.GoString(oadf.def)
}
// GetSizeMin gets `AVOptionArrayDef.siz` value.
func (oadf *AVOptionArrayDef) GetSizeMin() uint32 {
return (uint32)(oadf.size_min)
}
// SetSizeMin sets `AVOptionArrayDef.siz` value.
func (oadf *AVOptionArrayDef) SetSizeMin(v uint32) {
oadf.size_min = (C.uint)(v)
}
// GetSizeMinAddr gets `AVOptionArrayDef.siz` address.
func (oadf *AVOptionArrayDef) GetSizeMinAddr() *uint32 {
return (*uint32)(&oadf.size_min)
}
// GetSizeMax gets `AVOptionArrayDef.siz` value.
func (oadf *AVOptionArrayDef) GetSizeMax() uint32 {
return (uint32)(oadf.size_max)
}
// SetSizeMax sets `AVOptionArrayDef.siz` value.
func (oadf *AVOptionArrayDef) SetSizeMax(v uint32) {
oadf.size_max = (C.uint)(v)
}
// GetSizeMaxAddr gets `AVOptionArrayDef.siz` address.
func (oadf *AVOptionArrayDef) GetSizeMaxAddr() *uint32 {
return (*uint32)(&oadf.size_max)
}
// GetSep gets `AVOptionArrayDef.sep` value.
func (oadf *AVOptionArrayDef) GetSep() string {
return C.GoStringN(&oadf.sep, 1)
}
// SetSep sets `AVOptionArrayDef.sep` value.
func (oadf *AVOptionArrayDef) SetSep(v string) {
SepPtr, SepFunc := StringCasting(v)
defer SepFunc()
oadf.sep = (C.char)(*SepPtr)
}
// AVOption
type AVOption C.struct_AVOption
@@ -584,16 +635,6 @@ func AvOptSetVideoRate(obj CVoidPointer, name string, val AVRational, searchFlag
(C.struct_AVRational)(val), (C.int)(searchFlags)))
}
// Deprecated: No use.
//
// AvOptSetChannelLayout
func AvOptSetChannelLayout(obj CVoidPointer, name string, chLayout int64, searchFlags int32) int32 {
namePtr, nameFunc := StringCasting(name)
defer nameFunc()
return (int32)(C.av_opt_set_channel_layout(VoidPointer(obj), (*C.char)(namePtr),
(C.int64_t)(chLayout), (C.int)(searchFlags)))
}
// AvOptSetChlayout
func AvOptSetChlayout(obj CVoidPointer, name string, layout *AVChannelLayout, searchFlags int32) int32 {
namePtr, nameFunc := StringCasting(name)
@@ -688,16 +729,6 @@ func AvOptGetVideoRate(obj CVoidPointer, name string, searchFlags int32, outVal
(C.int)(searchFlags), (*C.struct_AVRational)(outVal)))
}
// Deprecated: No use.
//
// AvOptGetChannelLayout
func AvOptGetChannelLayout(obj CVoidPointer, name string, searchFlags int32, outVal *int64) int32 {
namePtr, nameFunc := StringCasting(name)
defer nameFunc()
return (int32)(C.av_opt_get_channel_layout(VoidPointer(obj), (*C.char)(namePtr),
(C.int)(searchFlags), (*C.int64_t)(outVal)))
}
// AvOptGetChlayout
func AvOptGetChlayout(obj CVoidPointer, name string, searchFlags int32, layout *AVChannelLayout) int32 {
namePtr, nameFunc := StringCasting(name)

View File

@@ -189,6 +189,7 @@ const (
AV_PIX_FMT_FLAG_ALPHA = C.AV_PIX_FMT_FLAG_ALPHA
AV_PIX_FMT_FLAG_BAYER = C.AV_PIX_FMT_FLAG_BAYER
AV_PIX_FMT_FLAG_FLOAT = C.AV_PIX_FMT_FLAG_FLOAT
AV_PIX_FMT_FLAG_XYZ = C.AV_PIX_FMT_FLAG_XYZ
)
// AvGetBitsPerPixel returns the number of bits per pixel used by the pixel format

View File

@@ -9,6 +9,15 @@ package ffmpeg
*/
import "C"
const (
AVPALETTE_SIZE = int32(C.AVPALETTE_SIZE)
AVPALETTE_COUNT = int32(C.AVPALETTE_COUNT)
)
const (
AV_VIDEO_MAX_PLANES = int32(C.AV_VIDEO_MAX_PLANES)
)
// Pixel format.
type AVPixelFormat = C.enum_AVPixelFormat
@@ -191,8 +200,6 @@ const (
AV_PIX_FMT_BAYER_GRBG16LE = AVPixelFormat(C.AV_PIX_FMT_BAYER_GRBG16LE)
AV_PIX_FMT_BAYER_GRBG16BE = AVPixelFormat(C.AV_PIX_FMT_BAYER_GRBG16BE)
AV_PIX_FMT_XVMC = AVPixelFormat(C.AV_PIX_FMT_XVMC)
AV_PIX_FMT_YUV440P10LE = AVPixelFormat(C.AV_PIX_FMT_YUV440P10LE)
AV_PIX_FMT_YUV440P10BE = AVPixelFormat(C.AV_PIX_FMT_YUV440P10BE)
AV_PIX_FMT_YUV440P12LE = AVPixelFormat(C.AV_PIX_FMT_YUV440P12LE)
@@ -305,6 +312,8 @@ const (
AV_PIX_FMT_GBRAP14BE = AVPixelFormat(C.AV_PIX_FMT_GBRAP14BE)
AV_PIX_FMT_GBRAP14LE = AVPixelFormat(C.AV_PIX_FMT_GBRAP14LE)
AV_PIX_FMT_D3D12 = AVPixelFormat(C.AV_PIX_FMT_D3D12)
AV_PIX_FMT_NB = AVPixelFormat(C.AV_PIX_FMT_NB)
)

View File

@@ -31,6 +31,13 @@ func AvTsMakeTimeString(ts int64, tb *AVRational) string {
(C.int64_t)(ts), (*C.struct_AVRational)(tb)))
}
// AvTsMakeTimeString2 makes a timestamp string.
func AvTsMakeTimeString2(ts int64, tb AVRational) string {
b := make([]C.char, AV_TS_MAX_STRING_SIZE+1)
return C.GoString(C.av_ts_make_time_string2((*C.char)(&b[0]),
(C.int64_t)(ts), (C.struct_AVRational)(tb)))
}
// AvTs2timestr
func AvTs2timestr[T Integer](ts T, tb *AVRational) string {
return AvTsMakeTimeString((int64)(ts), tb)

View File

@@ -60,9 +60,9 @@ func decode(decCtx *ffmpeg.AVCodecContext, pkt *ffmpeg.AVPacket, frame *ffmpeg.A
fmt.Fprintf(os.Stderr, "Failed to calculate data size\n")
os.Exit(1)
}
data := ffmpeg.SliceSlice(&frame.GetData()[0], decCtx.GetChannels(), frame.GetNbSamples()*dataSize)
data := ffmpeg.SliceSlice(&frame.GetData()[0], decCtx.GetChLayoutAddr().GetNbChannels(), frame.GetNbSamples()*dataSize)
for i := int32(0); i < frame.GetNbSamples(); i++ {
for ch := 0; ch < int(decCtx.GetChannels()); ch++ {
for ch := 0; ch < int(decCtx.GetChLayoutAddr().GetNbChannels()); ch++ {
outfile.Write(data[ch][dataSize*i : dataSize*(i+1)])
}
}
@@ -175,7 +175,7 @@ func main() {
sfmt = ffmpeg.AvGetPackedSampleFmt(sfmt)
}
nChannels := avctx.GetChannels()
nChannels := avctx.GetChLayoutAddr().GetNbChannels()
fmtStr, ret := getFormatFromSampleFmt(sfmt)
if ret < 0 {
goto end

View File

@@ -40,10 +40,10 @@ func decode(decCtx *ffmpeg.AVCodecContext, frame *ffmpeg.AVFrame, pkt *ffmpeg.AV
os.Exit(1)
}
fmt.Fprintf(os.Stdout, "saving frame %3d\n", decCtx.GetFrameNumber())
fmt.Fprintf(os.Stdout, "saving frame %3d\n", decCtx.GetFrameNum())
// the picture is allocated by the decoder. no need to free it
fname := fmt.Sprintf("%s-%d", filename, decCtx.GetFrameNumber())
fname := fmt.Sprintf("%s-%d", filename, decCtx.GetFrameNum())
pgmSave(frame.GetData()[0], frame.GetLinesize()[0], frame.GetWidth(), frame.GetHeight(), fname)
}
}

View File

@@ -43,7 +43,7 @@ func outputVideoFrame(videoDecCtx *ffmpeg.AVCodecContext, frame *ffmpeg.AVFrame)
}
videoFrameCount++
fmt.Fprintf(os.Stdout, "video_frame n:%d coded_n:%d\n", videoFrameCount, frame.GetCodedPictureNumber())
fmt.Fprintf(os.Stdout, "video_frame n:%d\n", videoFrameCount)
// copy decoded frame to destination buffer:
// this is required since rawvideo expects non aligned data
@@ -309,7 +309,7 @@ func main() {
if audioStream != nil {
sfmt := audioDecCtx.GetSampleFmt()
nChannels := audioDecCtx.GetChannels()
nChannels := audioDecCtx.GetChLayoutAddr().GetNbChannels()
var _fmt string
if ffmpeg.AvSampleFmtIsPlanar(sfmt) != 0 {

View File

@@ -166,12 +166,12 @@ func main() {
if ret := ffmpeg.AvFrameMakeWritable(frame); ret < 0 {
os.Exit(1)
}
samples := unsafe.Slice((*uint16)(unsafe.Pointer(frame.GetData()[0])), avctx.GetFrameSize()*avctx.GetChannels())
samples := unsafe.Slice((*uint16)(unsafe.Pointer(frame.GetData()[0])), avctx.GetFrameSize()*avctx.GetChLayoutAddr().GetNbChannels())
for j := 0; j < int(avctx.GetFrameSize()); j++ {
samples[2*j] = (uint16)(math.Sin(t) * 10000)
for k := 1; k < int(avctx.GetChannels()); k++ {
for k := 1; k < int(avctx.GetChLayoutAddr().GetNbChannels()); k++ {
samples[2*j+k] = samples[2*j]
}
t += tincr

View File

@@ -240,7 +240,7 @@ func openAudio(oc *ffmpeg.AVFormatContext, codec *ffmpeg.AVCodec, ost *outputStr
func getAudioFrame(ost *outputStream) (frame *ffmpeg.AVFrame) {
frame = ost.tmpFrame
data := unsafe.Slice((*int16)(unsafe.Pointer(frame.GetData()[0])),
frame.GetNbSamples()*ost.enc.GetChannels())
frame.GetNbSamples()*ost.enc.GetChLayoutAddr().GetNbChannels())
if ffmpeg.AvCompareTs(ost.nextPts, ost.enc.GetTimeBase(), STREAM_DURATION, ffmpeg.AvMakeQ(1, 1)) > 0 {
return nil
@@ -248,7 +248,7 @@ func getAudioFrame(ost *outputStream) (frame *ffmpeg.AVFrame) {
idx := 0
for j := 0; j < int(frame.GetNbSamples()); j++ {
v := (int16)(math.Sin(float64(ost.t)) * 10_000)
for i := 0; i < int(ost.enc.GetChannels()); i++ {
for i := 0; i < int(ost.enc.GetChLayoutAddr().GetNbChannels()); i++ {
data[idx] = v
idx++
ost.t += ost.tincr

View File

@@ -235,7 +235,7 @@ func initResampler(inputCodecContext, outputCodecContext *ffmpeg.AVCodecContext)
func initFifo(outputCodecContext *ffmpeg.AVCodecContext) (fifo *ffmpeg.AVAudioFifo, ret int32) {
// Create the FIFO buffer based on the specified output sample format
if fifo = ffmpeg.AvAudioFifoAlloc(outputCodecContext.GetSampleFmt(),
outputCodecContext.GetChannels(), 1); fifo == nil {
outputCodecContext.GetChLayoutAddr().GetNbChannels(), 1); fifo == nil {
fmt.Fprintf(os.Stderr, "Could not allocate FIFO\n")
return nil, ffmpeg.AVERROR(syscall.ENOMEM)
}
@@ -315,7 +315,7 @@ func initConvertedSamples(outputCodecContext *ffmpeg.AVCodecContext,
// Allocate as many pointers as there are audio channels.
// Each pointer will later point to the audio samples of the corresponding
// channels (although it may be NULL for interleaved formats).
if convertedInputSamples = (**uint8)(ffmpeg.AvCalloc(outputCodecContext.GetChannels(),
if convertedInputSamples = (**uint8)(ffmpeg.AvCalloc(outputCodecContext.GetChLayoutAddr().GetNbChannels(),
unsafe.Sizeof(*convertedInputSamples))); convertedInputSamples == nil {
fmt.Fprintf(os.Stderr, "Could not allocate converted input sample pointers\n")
return nil, ffmpeg.AVERROR(syscall.ENOMEM)
@@ -324,7 +324,7 @@ func initConvertedSamples(outputCodecContext *ffmpeg.AVCodecContext,
// Allocate memory for the samples of all channels in one consecutive
// block for convenience.
if ret = ffmpeg.AvSamplesAlloc(convertedInputSamples, nil,
outputCodecContext.GetChannels(),
outputCodecContext.GetChLayoutAddr().GetNbChannels(),
frameSize,
outputCodecContext.GetSampleFmt(), 0); ret < 0 {
fmt.Fprintf(os.Stderr, "Could not allocate converted input samples (error '%s')\n", ffmpeg.AvErr2str(ret))

View File

@@ -75,19 +75,6 @@ func SwrIsInitialized(s *SwrContext) int32 {
return (int32)(C.swr_is_initialized((*C.struct_SwrContext)(s)))
}
// Deprecated: Use SwrAllocSetOpts2() instead.
//
// SwrAllocSetOpts allocates SwrContext if needed and set/reset common parameters.
func SwrAllocSetOpts(s *SwrContext,
outChLayout int64, outSampleFmt AVSampleFormat, outSampleRate int32,
inChLayout int64, inSampleFmt AVSampleFormat, inSampleRate int32,
logOffset int32, logCtx CVoidPointer) *SwrContext {
return (*SwrContext)(C.swr_alloc_set_opts((*C.struct_SwrContext)(s),
(C.int64_t)(outChLayout), (C.enum_AVSampleFormat)(outSampleFmt), (C.int)(outSampleRate),
(C.int64_t)(inChLayout), (C.enum_AVSampleFormat)(inSampleFmt), (C.int)(inSampleRate),
(C.int)(logOffset), VoidPointer(logCtx)))
}
// SwrAllocSetOpts2 allocates SwrContext if needed and set/reset common parameters.
func SwrAllocSetOpts2(s **SwrContext,
outChLayout *AVChannelLayout, outSampleFmt AVSampleFormat, outSampleRate int32,
@@ -134,19 +121,6 @@ func SwrSetChannelMapping(s *SwrContext, channelMap *int32) int32 {
return (int32)(C.swr_set_channel_mapping((*C.struct_SwrContext)(s), (*C.int)(channelMap)))
}
// Deprecated: Use SwrBuildMatrix2() instead.
//
// SwrBuildMatrix generates a channel mixing matrix.
func SwrBuildMatrix(inLayout, outLayout uint64,
centerMixLevel, surroundMixLevel, lfeMixLevel float64,
rematrixMaxval, rematrixVolume float64,
matrix *float64, stride int32, matrixEncoding AVMatrixEncoding, logCtx CVoidPointer) int32 {
return (int32)(C.swr_build_matrix((C.uint64_t)(inLayout), (C.uint64_t)(outLayout),
(C.double)(centerMixLevel), (C.double)(surroundMixLevel), (C.double)(lfeMixLevel),
(C.double)(rematrixMaxval), (C.double)(rematrixVolume),
(*C.double)(matrix), (C.int)(stride), (C.enum_AVMatrixEncoding)(matrixEncoding), VoidPointer(logCtx)))
}
// SwrBuildMatrix2 generates a channel mixing matrix.
func SwrBuildMatrix2(inLayout, outLayout *AVChannelLayout,
centerMixLevel, surroundMixLevel, lfeMixLevel float64,