mirror of
https://github.com/asticode/go-astiav.git
synced 2025-11-03 10:40:51 +08:00
Added links to C doc
This commit is contained in:
15
program.go
15
program.go
@@ -6,7 +6,7 @@ import (
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// https://github.com/FFmpeg/FFmpeg/blob/n7.0/libavformat/avformat.h#L1181
|
||||
// https://ffmpeg.org/doxygen/7.0/structAVProgram.html
|
||||
type Program struct {
|
||||
c *C.AVProgram
|
||||
fc *FormatContext
|
||||
@@ -22,22 +22,27 @@ func newProgramFromC(c *C.AVProgram, fc *FormatContext) *Program {
|
||||
}
|
||||
}
|
||||
|
||||
// https://ffmpeg.org/doxygen/7.0/avformat_8c.html#ae1eb83cf16060217c805e61f0f62fa4e
|
||||
func (p *Program) AddStream(s *Stream) {
|
||||
C.av_program_add_stream_index(p.fc.c, p.c.id, C.uint(s.c.index))
|
||||
}
|
||||
|
||||
// https://ffmpeg.org/doxygen/7.0/structAVProgram.html#a10cc799a98b37335e820b0bdb386eb95
|
||||
func (p *Program) ID() int {
|
||||
return int(p.c.id)
|
||||
}
|
||||
|
||||
func (p *Program) NbStreams() int {
|
||||
return int(p.c.nb_stream_indexes)
|
||||
}
|
||||
|
||||
// https://ffmpeg.org/doxygen/7.0/structAVProgram.html#a10cc799a98b37335e820b0bdb386eb95
|
||||
func (p *Program) SetID(i int) {
|
||||
p.c.id = C.int(i)
|
||||
}
|
||||
|
||||
// https://ffmpeg.org/doxygen/7.0/structAVProgram.html#a136cf29d2aa5b0e4c6d743406c5e39d1
|
||||
func (p *Program) NbStreams() int {
|
||||
return int(p.c.nb_stream_indexes)
|
||||
}
|
||||
|
||||
// https://ffmpeg.org/doxygen/7.0/structAVProgram.html#a7967d41af4812ed61a28762e988c7a02
|
||||
func (p *Program) Streams() (ss []*Stream) {
|
||||
is := make(map[int]bool)
|
||||
for _, idx := range unsafe.Slice(p.c.stream_index, p.c.nb_stream_indexes) {
|
||||
|
||||
Reference in New Issue
Block a user