mirror of
https://github.com/asticode/go-astiav.git
synced 2025-10-05 16:16:50 +08:00
Added codec context qmin
This commit is contained in:
@@ -149,6 +149,14 @@ func (cc *CodecContext) Profile() Profile {
|
|||||||
return Profile(cc.c.profile)
|
return Profile(cc.c.profile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (cc *CodecContext) Qmin() int {
|
||||||
|
return int(cc.c.qmin)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cc *CodecContext) SetQmin(qmin int) {
|
||||||
|
cc.c.qmin = C.int(qmin)
|
||||||
|
}
|
||||||
|
|
||||||
func (cc *CodecContext) SampleAspectRatio() Rational {
|
func (cc *CodecContext) SampleAspectRatio() Rational {
|
||||||
return newRationalFromC(cc.c.sample_aspect_ratio)
|
return newRationalFromC(cc.c.sample_aspect_ratio)
|
||||||
}
|
}
|
||||||
|
@@ -82,6 +82,7 @@ func TestCodecContext(t *testing.T) {
|
|||||||
cc4.SetGopSize(7)
|
cc4.SetGopSize(7)
|
||||||
cc4.SetHeight(8)
|
cc4.SetHeight(8)
|
||||||
cc4.SetPixelFormat(astiav.PixelFormat0Bgr)
|
cc4.SetPixelFormat(astiav.PixelFormat0Bgr)
|
||||||
|
cc4.SetQmin(5)
|
||||||
cc4.SetSampleAspectRatio(astiav.NewRational(10, 1))
|
cc4.SetSampleAspectRatio(astiav.NewRational(10, 1))
|
||||||
cc4.SetSampleFormat(astiav.SampleFormatDbl)
|
cc4.SetSampleFormat(astiav.SampleFormatDbl)
|
||||||
cc4.SetSampleRate(12)
|
cc4.SetSampleRate(12)
|
||||||
@@ -99,6 +100,7 @@ func TestCodecContext(t *testing.T) {
|
|||||||
require.Equal(t, 7, cc4.GopSize())
|
require.Equal(t, 7, cc4.GopSize())
|
||||||
require.Equal(t, 8, cc4.Height())
|
require.Equal(t, 8, cc4.Height())
|
||||||
require.Equal(t, astiav.PixelFormat0Bgr, cc4.PixelFormat())
|
require.Equal(t, astiav.PixelFormat0Bgr, cc4.PixelFormat())
|
||||||
|
require.Equal(t, 5, cc4.Qmin())
|
||||||
require.Equal(t, astiav.NewRational(10, 1), cc4.SampleAspectRatio())
|
require.Equal(t, astiav.NewRational(10, 1), cc4.SampleAspectRatio())
|
||||||
require.Equal(t, astiav.SampleFormatDbl, cc4.SampleFormat())
|
require.Equal(t, astiav.SampleFormatDbl, cc4.SampleFormat())
|
||||||
require.Equal(t, 12, cc4.SampleRate())
|
require.Equal(t, 12, cc4.SampleRate())
|
||||||
|
Reference in New Issue
Block a user