mirror of
https://github.com/asticode/go-astiav.git
synced 2026-04-23 00:07:04 +08:00
b09923632f
* OpenIOContextWithDictionary * OpenIOContext * OpenIOContext * IOInterrupterCB * OpenIOContext(filename string, flags IOContextFlags, ii *IOInterrupter, d *Dictionary) * Program and Discard * Program and Discard * Program and Discard * Program and Discard * Program and Discard * Program and Discard * CodecContext MaxBFrames() SetMaxBFrames(n int) * another pr * delete Flags() * delete Flags() * delete Flags() * delete PmtVersion() * SetStreamIndex * SetStreamIndex * MaxBFrames() SetMaxBFrames(n int) RcMaxRate() SetRcMaxRate(n int64) RcMinRate() SetRcMinRate(n int64) RcBufferSize() SetRcBufferSize(n int) * rename rate control methods * test passed * bufferSrcCtx initialize with dictionary * bufferSrcCtx initialize with dictionary * SetHardwareDeviceContext * SetHardwareDeviceContext
40 lines
1.1 KiB
Go
40 lines
1.1 KiB
Go
package astiav
|
|
|
|
//#include <libavfilter/buffersrc.h>
|
|
import "C"
|
|
|
|
type BuffersrcFilterContext struct {
|
|
fc *FilterContext
|
|
}
|
|
|
|
func newBuffersrcFilterContext(fc *FilterContext) *BuffersrcFilterContext {
|
|
return &BuffersrcFilterContext{fc: fc}
|
|
}
|
|
|
|
// https://ffmpeg.org/doxygen/7.0/group__lavfi__buffersrc.html#ga73ed90c3c3407f36e54d65f91faaaed9
|
|
func (bfc *BuffersrcFilterContext) AddFrame(f *Frame, fs BuffersrcFlags) error {
|
|
var cf *C.AVFrame
|
|
if f != nil {
|
|
cf = f.c
|
|
}
|
|
return newError(C.av_buffersrc_add_frame_flags(bfc.fc.c, cf, C.int(fs)))
|
|
}
|
|
|
|
func (bfc *BuffersrcFilterContext) FilterContext() *FilterContext {
|
|
return bfc.fc
|
|
}
|
|
|
|
// https://ffmpeg.org/doxygen/7.0/group__lavfi.html#ga8c15af28902395399fe455f6f8236848
|
|
func (bfc *BuffersrcFilterContext) Initialize(d *Dictionary) error {
|
|
var dc **C.AVDictionary
|
|
if d != nil {
|
|
dc = &d.c
|
|
}
|
|
return newError(C.avfilter_init_dict(bfc.fc.c, dc))
|
|
}
|
|
|
|
// https://ffmpeg.org/doxygen/7.0/group__lavfi__buffersrc.html#ga398cd2a84f8b4a588197ab9d90135048
|
|
func (bfc *BuffersrcFilterContext) SetParameters(bfcp *BuffersrcFilterContextParameters) error {
|
|
return newError(C.av_buffersrc_parameters_set(bfc.fc.c, bfcp.c))
|
|
}
|