-
Notifications
You must be signed in to change notification settings - Fork 47
/
filter_graph_segment.go
39 lines (33 loc) · 1.08 KB
/
filter_graph_segment.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/avfilter.h>
import "C"
import (
"math"
"unsafe"
)
// https://ffmpeg.org/doxygen/7.0/structAVFilterGraphSegment.html
type FilterGraphSegment struct {
c *C.AVFilterGraphSegment
}
func newFilterGraphSegmentFromC(c *C.AVFilterGraphSegment) *FilterGraphSegment {
if c == nil {
return nil
}
return &FilterGraphSegment{c: c}
}
// https://ffmpeg.org/doxygen/7.0/group__lavfi.html#ga51283edd8f3685e1f33239f360e14ae8
func (fgs *FilterGraphSegment) Free() {
C.avfilter_graph_segment_free(&fgs.c)
}
// https://ffmpeg.org/doxygen/7.0/structAVFilterGraphSegment.html#ad5a2779af221d1520490fe2719f9e39a
func (fgs *FilterGraphSegment) Chains() (cs []*FilterChain) {
ccs := (*[(math.MaxInt32 - 1) / unsafe.Sizeof((*C.AVFilterChain)(nil))](*C.AVFilterChain))(unsafe.Pointer(fgs.c.chains))
for i := 0; i < fgs.NbChains(); i++ {
cs = append(cs, newFilterChainFromC(ccs[i]))
}
return
}
// https://ffmpeg.org/doxygen/7.0/structAVFilterGraphSegment.html#ab7563eca151d89e693f6258de5ce0214
func (fgs *FilterGraphSegment) NbChains() int {
return int(fgs.c.nb_chains)
}