Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions codec_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,3 +528,8 @@ func (cc *CodecContext) RateControlBufferSize() int {
func (cc *CodecContext) SetRateControlBufferSize(n int) {
cc.c.rc_buffer_size = C.int(n)
}

// https://ffmpeg.org/doxygen/7.0/group__lavc__misc.html#gaf60b0e076f822abcb2700eb601d352a6
func (cc *CodecContext) FlushBuffers() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some test?

Just calling this new method here without checking anything should validate it doesn't crash 👍

C.avcodec_flush_buffers(cc.c)
}
5 changes: 5 additions & 0 deletions format_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,11 @@ func (fc *FormatContext) SeekFrame(streamIndex int, timestamp int64, f SeekFlags
return newError(C.av_seek_frame(fc.c, C.int(streamIndex), C.int64_t(timestamp), C.int(f)))
}

// https://ffmpeg.org/doxygen/7.0/group__lavf__decoding.html#ga3b40fc8d2fda6992ae6ea2567d71ba30
func (fc *FormatContext) SeekFile(streamIndex int, mints, timestamp, maxts int64, f SeekFlags) error {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some tests below this?

return newError(C.avformat_seek_file(fc.c, C.int(streamIndex), C.int64_t(mints), C.int64_t(timestamp), C.int64_t(maxts), C.int(f)))
}

// https://ffmpeg.org/doxygen/7.0/group__lavf__decoding.html#gaa03a82c5fd4fe3af312d229ca94cd6f3
func (fc *FormatContext) Flush() error {
return newError(C.avformat_flush(fc.c))
Expand Down
5 changes: 5 additions & 0 deletions mathematics.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ package astiav
//#include <libavutil/mathematics.h>
import "C"

// https://ffmpeg.org/doxygen/7.0/group__lavu__math.html#ga3daf97178dd1b08b5e916be381cd33e4
func Rescale(a, b, c int64) int64 {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add some tests above this?

return int64(C.av_rescale(C.int64_t(a), C.int64_t(b), C.int64_t(c)))
}

// https://ffmpeg.org/doxygen/7.0/group__lavu__math.html#gaf02994a8bbeaa91d4757df179cbe567f
func RescaleQ(a int64, b Rational, c Rational) int64 {
return int64(C.av_rescale_q(C.int64_t(a), b.c, c.c))
Expand Down