Added links to C doc

This commit is contained in:
Quentin Renard
2024-11-13 18:12:00 +01:00
parent 1841ad55fe
commit b15d5d0e04
80 changed files with 539 additions and 115 deletions

View File

@@ -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) {