forked from asticode/go-astiav
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilter_link.go
65 lines (50 loc) · 1.28 KB
/
filter_link.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package astiav
//#include <libavfilter/avfilter.h>
import "C"
// https://github.com/FFmpeg/FFmpeg/blob/n5.0/libavfilter/avfilter.h#L471
type FilterLink struct {
c *C.AVFilterLink
}
func newFilterLinkFromC(c *C.AVFilterLink) *FilterLink {
if c == nil {
return nil
}
return &FilterLink{c: c}
}
func (l *FilterLink) ChannelLayout() ChannelLayout {
v, _ := newChannelLayoutFromC(&l.c.ch_layout).clone()
return v
}
func (l *FilterLink) ColorRange() ColorRange {
return ColorRange(l.c.color_range)
}
func (l *FilterLink) ColorSpace() ColorSpace {
return ColorSpace(l.c.colorspace)
}
func (l *FilterLink) FrameRate() Rational {
return newRationalFromC(l.c.frame_rate)
}
func (l *FilterLink) Height() int {
return int(l.c.h)
}
func (l *FilterLink) MediaType() MediaType {
return MediaType(l.c._type)
}
func (l *FilterLink) PixelFormat() PixelFormat {
return PixelFormat(l.c.format)
}
func (l *FilterLink) SampleAspectRatio() Rational {
return newRationalFromC(l.c.sample_aspect_ratio)
}
func (l *FilterLink) SampleFormat() SampleFormat {
return SampleFormat(l.c.format)
}
func (l *FilterLink) SampleRate() int {
return int(l.c.sample_rate)
}
func (l *FilterLink) TimeBase() Rational {
return newRationalFromC(l.c.time_base)
}
func (l *FilterLink) Width() int {
return int(l.c.w)
}