mirror of
https://github.com/asticode/go-astiav.git
synced 2025-09-26 20:21:15 +08:00
Added stream discard
This commit is contained in:
@@ -63,7 +63,7 @@ func (p *Program) Discard() Discard {
|
||||
|
||||
// https://ffmpeg.org/doxygen/7.0/structAVProgram.html#a9c7a07c08a1f960aaa49f3f47633af5c
|
||||
func (p *Program) SetDiscard(d Discard) {
|
||||
p.c.discard = int32(d)
|
||||
p.c.discard = C.enum_AVDiscard(d)
|
||||
}
|
||||
|
||||
// https://ffmpeg.org/doxygen/7.0/structAVProgram.html#ae9dab38d4694e3da9cba0f882f4e43d3
|
||||
|
10
stream.go
10
stream.go
@@ -36,6 +36,16 @@ func (s *Stream) CodecParameters() *CodecParameters {
|
||||
return newCodecParametersFromC(s.c.codecpar)
|
||||
}
|
||||
|
||||
// https://ffmpeg.org/doxygen/7.0/structAVStream.html#a492fcecc45dbbd8da51edd0124e9dd30
|
||||
func (s *Stream) Discard() Discard {
|
||||
return Discard(s.c.discard)
|
||||
}
|
||||
|
||||
// https://ffmpeg.org/doxygen/7.0/structAVStream.html#a492fcecc45dbbd8da51edd0124e9dd30
|
||||
func (s *Stream) SetDiscard(d Discard) {
|
||||
s.c.discard = C.enum_AVDiscard(d)
|
||||
}
|
||||
|
||||
// https://ffmpeg.org/doxygen/7.0/structAVStream.html#a4e04af7a5a4d8298649850df798dd0bc
|
||||
func (s *Stream) Duration() int64 {
|
||||
return int64(s.c.duration)
|
||||
|
@@ -38,6 +38,8 @@ func TestStream(t *testing.T) {
|
||||
|
||||
s1.SetAvgFrameRate(NewRational(2, 1))
|
||||
require.Equal(t, NewRational(2, 1), s1.AvgFrameRate())
|
||||
s1.SetDiscard(DiscardAll)
|
||||
require.Equal(t, DiscardAll, s1.Discard())
|
||||
s1.SetID(2)
|
||||
require.Equal(t, 2, s1.ID())
|
||||
s1.SetIndex(1)
|
||||
|
Reference in New Issue
Block a user