forked from asticode/go-astiav
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buffersrc_filter_context.go
39 lines (32 loc) · 1.14 KB
/
buffersrc_filter_context.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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))
}