diff --git a/stream.go b/stream.go index 9102b1e..0c314c3 100644 --- a/stream.go +++ b/stream.go @@ -56,6 +56,11 @@ func (s *Stream) EventFlags() StreamEventFlags { return StreamEventFlags(s.c.event_flags) } +// https://ffmpeg.org/doxygen/7.0/structAVStream.html#ab76e176c2a1d1ff09ec9c0bb88dc25e9 +func (s *Stream) SetEventFlags(eventFlags StreamEventFlags) { + s.c.event_flags = C.int(eventFlags) +} + // https://ffmpeg.org/doxygen/7.0/structAVStream.html#a6873ed62f196c24e8bf282609231786f func (s *Stream) ID() int { return int(s.c.id) @@ -86,6 +91,16 @@ func (s *Stream) NbFrames() int64 { return int64(s.c.nb_frames) } +// https://ffmpeg.org/doxygen/7.0/structAVStream.html#a6cdb0c90a69899f4e1e54704bb654936 +func (s *Stream) PTSWrapBits() int { + return int(s.c.pts_wrap_bits) +} + +// https://ffmpeg.org/doxygen/7.0/structAVStream.html#a6cdb0c90a69899f4e1e54704bb654936 +func (s *Stream) SetPTSWrapBits(bits int) { + s.c.pts_wrap_bits = C.int(bits) +} + // https://ffmpeg.org/doxygen/7.0/structAVStream.html#ad63fb11cc1415e278e09ddc676e8a1ad func (s *Stream) RFrameRate() Rational { return newRationalFromC(s.c.r_frame_rate) @@ -111,6 +126,11 @@ func (s *Stream) StartTime() int64 { return int64(s.c.start_time) } +// https://ffmpeg.org/doxygen/7.0/structAVStream.html#a7c67ae70632c91df8b0f721658ec5377 +func (s *Stream) SetStartTime(startTime int64) { + s.c.start_time = C.int64_t(startTime) +} + // https://ffmpeg.org/doxygen/7.0/structAVStream.html#a9db755451f14e2bf590d4b85d82b32e6 func (s *Stream) TimeBase() Rational { return newRationalFromC(s.c.time_base) diff --git a/stream_test.go b/stream_test.go index 3f7ed15..0a47b4c 100644 --- a/stream_test.go +++ b/stream_test.go @@ -40,14 +40,20 @@ func TestStream(t *testing.T) { require.Equal(t, NewRational(2, 1), s1.AvgFrameRate()) s1.SetDiscard(DiscardAll) require.Equal(t, DiscardAll, s1.Discard()) + s1.SetEventFlags(1) + require.Equal(t, StreamEventFlags(1), s1.EventFlags()) s1.SetID(2) require.Equal(t, 2, s1.ID()) s1.SetIndex(1) require.Equal(t, 1, s1.Index()) + s1.SetPTSWrapBits(2) + require.Equal(t, 2, s1.PTSWrapBits()) s1.SetRFrameRate(NewRational(2, 1)) require.Equal(t, NewRational(2, 1), s1.RFrameRate()) s1.SetSampleAspectRatio(NewRational(2, 1)) require.Equal(t, NewRational(2, 1), s1.SampleAspectRatio()) + s1.SetStartTime(1) + require.Equal(t, int64(1), s1.StartTime()) s1.SetTimeBase(NewRational(1, 1)) require.Equal(t, NewRational(1, 1), s1.TimeBase()) }