mirror of
https://github.com/asticode/go-astiav.git
synced 2025-10-05 00:02:45 +08:00
merge master and add SetHardwareDeviceContext (#126)
This commit is contained in:
@@ -4,6 +4,7 @@ package astiav
|
||||
import "C"
|
||||
import (
|
||||
"errors"
|
||||
"math"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
@@ -154,3 +155,17 @@ func (g *FilterGraph) SendCommand(target, cmd, args string, f FilterCommandFlags
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// https://ffmpeg.org/doxygen/7.0/structAVFilterGraph.html#a0ba5c820c760788ea5f8e40c476f9704
|
||||
func (g *FilterGraph) NbFilters() int {
|
||||
return int(g.c.nb_filters)
|
||||
}
|
||||
|
||||
// https://ffmpeg.org/doxygen/7.0/structAVFilterGraph.html#a1dafd3d239f7c2f5e3ac109578ef926d
|
||||
func (g *FilterGraph) Filters() (fs []*FilterContext) {
|
||||
fcs := (*[(math.MaxInt32 - 1) / unsafe.Sizeof((*C.AVFilterContext)(nil))](*C.AVFilterContext))(unsafe.Pointer(g.c.filters))
|
||||
for i := 0; i < g.NbFilters(); i++ {
|
||||
fs = append(fs, newFilterContext(fcs[i]))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user