forked from asticode/go-astiav
-
Notifications
You must be signed in to change notification settings - Fork 0
/
filter_in_out.go
45 lines (36 loc) · 894 Bytes
/
filter_in_out.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
40
41
42
43
44
45
package astiav
//#cgo pkg-config: libavfilter
//#include <libavfilter/avfilter.h>
import "C"
// https://github.com/FFmpeg/FFmpeg/blob/n5.0/libavfilter/avfilter.h#L1021
type FilterInOut struct {
c *C.struct_AVFilterInOut
}
func newFilterInOutFromC(c *C.struct_AVFilterInOut) *FilterInOut {
if c == nil {
return nil
}
return &FilterInOut{c: c}
}
func AllocFilterInOut() *FilterInOut {
return newFilterInOutFromC(C.avfilter_inout_alloc())
}
func (i *FilterInOut) Free() {
C.avfilter_inout_free(&i.c)
}
func (i *FilterInOut) SetName(n string) {
i.c.name = C.CString(n)
}
func (i *FilterInOut) SetFilterContext(c *FilterContext) {
i.c.filter_ctx = (*C.struct_AVFilterContext)(c.c)
}
func (i *FilterInOut) SetPadIdx(idx int) {
i.c.pad_idx = C.int(idx)
}
func (i *FilterInOut) SetNext(n *FilterInOut) {
var nc *C.struct_AVFilterInOut
if n != nil {
nc = n.c
}
i.c.next = nc
}