Skip to content

Commit

Permalink
Renamed bit stream filter in parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
asticode committed May 17, 2024
1 parent a83963b commit 1fae94a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions bit_stream_filter_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ func (bsfc *BitStreamFilterContext) Free() {
C.av_bsf_free(&bsfc.c)
}

func (bsfc *BitStreamFilterContext) TimeBaseIn() Rational {
func (bsfc *BitStreamFilterContext) InputTimeBase() Rational {
return newRationalFromC(bsfc.c.time_base_in)
}

func (bsfc *BitStreamFilterContext) SetTimeBaseIn(r Rational) {
func (bsfc *BitStreamFilterContext) SetInputTimeBase(r Rational) {
bsfc.c.time_base_in = r.c
}

func (bsfc *BitStreamFilterContext) CodecParametersIn() *CodecParameters {
func (bsfc *BitStreamFilterContext) InputCodecParameters() *CodecParameters {
return newCodecParametersFromC(bsfc.c.par_in)
}
8 changes: 4 additions & 4 deletions bit_stream_filter_context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ func TestBitStreamFilterContext(t *testing.T) {
require.NotNil(t, cl)
require.Equal(t, "AVBSFContext", cl.Name())

bsfc.SetTimeBaseIn(NewRational(15, 1))
require.Equal(t, NewRational(15, 1), bsfc.TimeBaseIn())
bsfc.SetInputTimeBase(NewRational(15, 1))
require.Equal(t, NewRational(15, 1), bsfc.InputTimeBase())

cp1 := AllocCodecParameters()
require.NotNil(t, cp1)
defer cp1.Free()
cp1.SetCodecID(CodecIDH264)
require.NoError(t, cp1.Copy(bsfc.CodecParametersIn()))
require.Equal(t, CodecIDH264, bsfc.CodecParametersIn().CodecID())
require.NoError(t, cp1.Copy(bsfc.InputCodecParameters()))
require.Equal(t, CodecIDH264, bsfc.InputCodecParameters().CodecID())

require.NoError(t, bsfc.Initialize())

Expand Down
4 changes: 2 additions & 2 deletions examples/bit_stream_filtering/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ func main() {
defer s.bitStreamFilterContext.Free()

// Copy codec parameters
if err := is.CodecParameters().Copy(s.bitStreamFilterContext.CodecParametersIn()); err != nil {
if err := is.CodecParameters().Copy(s.bitStreamFilterContext.InputCodecParameters()); err != nil {
log.Fatal(fmt.Errorf("main: copying codec parameters failed: %w", err))
}

// Update time base
s.bitStreamFilterContext.SetTimeBaseIn(is.TimeBase())
s.bitStreamFilterContext.SetInputTimeBase(is.TimeBase())

// Initialize bit stream filter context
if err := s.bitStreamFilterContext.Initialize(); err != nil {
Expand Down

0 comments on commit 1fae94a

Please sign in to comment.