mirror of
https://github.com/asticode/go-astiav.git
synced 2025-10-05 08:06:59 +08:00
Moved all c code to .h and .c files + removed struc_ prefix when not needed
This commit is contained in:
@@ -12,10 +12,10 @@ import (
|
||||
|
||||
// https://github.com/FFmpeg/FFmpeg/blob/n5.0/libavfilter/avfilter.h#L67
|
||||
type FilterContext struct {
|
||||
c *C.struct_AVFilterContext
|
||||
c *C.AVFilterContext
|
||||
}
|
||||
|
||||
func newFilterContext(c *C.struct_AVFilterContext) *FilterContext {
|
||||
func newFilterContext(c *C.AVFilterContext) *FilterContext {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
@@ -32,7 +32,7 @@ func (fc *FilterContext) Free() {
|
||||
}
|
||||
|
||||
func (fc *FilterContext) BuffersrcAddFrame(f *Frame, fs BuffersrcFlags) error {
|
||||
var cf *C.struct_AVFrame
|
||||
var cf *C.AVFrame
|
||||
if f != nil {
|
||||
cf = f.c
|
||||
}
|
||||
@@ -40,7 +40,7 @@ func (fc *FilterContext) BuffersrcAddFrame(f *Frame, fs BuffersrcFlags) error {
|
||||
}
|
||||
|
||||
func (fc *FilterContext) BuffersinkGetFrame(f *Frame, fs BuffersinkFlags) error {
|
||||
var cf *C.struct_AVFrame
|
||||
var cf *C.AVFrame
|
||||
if f != nil {
|
||||
cf = f.c
|
||||
}
|
||||
@@ -60,7 +60,7 @@ func (fc *FilterContext) NbOutputs() int {
|
||||
}
|
||||
|
||||
func (fc *FilterContext) Inputs() (ls []*FilterLink) {
|
||||
lcs := (*[(math.MaxInt32 - 1) / unsafe.Sizeof((*C.struct_AVFilterLink)(nil))](*C.struct_AVFilterLink))(unsafe.Pointer(fc.c.inputs))
|
||||
lcs := (*[(math.MaxInt32 - 1) / unsafe.Sizeof((*C.AVFilterLink)(nil))](*C.AVFilterLink))(unsafe.Pointer(fc.c.inputs))
|
||||
for i := 0; i < fc.NbInputs(); i++ {
|
||||
ls = append(ls, newFilterLinkFromC(lcs[i]))
|
||||
}
|
||||
@@ -68,7 +68,7 @@ func (fc *FilterContext) Inputs() (ls []*FilterLink) {
|
||||
}
|
||||
|
||||
func (fc *FilterContext) Outputs() (ls []*FilterLink) {
|
||||
lcs := (*[(math.MaxInt32 - 1) / unsafe.Sizeof((*C.struct_AVFilterLink)(nil))](*C.struct_AVFilterLink))(unsafe.Pointer(fc.c.outputs))
|
||||
lcs := (*[(math.MaxInt32 - 1) / unsafe.Sizeof((*C.AVFilterLink)(nil))](*C.AVFilterLink))(unsafe.Pointer(fc.c.outputs))
|
||||
for i := 0; i < fc.NbOutputs(); i++ {
|
||||
ls = append(ls, newFilterLinkFromC(lcs[i]))
|
||||
}
|
||||
|
Reference in New Issue
Block a user