From 1afa99ec8e3a304352c18c0ca568107992ccf225 Mon Sep 17 00:00:00 2001 From: Quentin Renard Date: Fri, 20 Dec 2024 09:34:13 +0100 Subject: [PATCH] Added bit stream filter context output codec parameters --- bit_stream_filter_context.go | 5 +++++ bit_stream_filter_context_test.go | 2 ++ 2 files changed, 7 insertions(+) diff --git a/bit_stream_filter_context.go b/bit_stream_filter_context.go index 05ed993..fc19273 100644 --- a/bit_stream_filter_context.go +++ b/bit_stream_filter_context.go @@ -93,3 +93,8 @@ func (bsfc *BitStreamFilterContext) SetInputTimeBase(r Rational) { func (bsfc *BitStreamFilterContext) InputCodecParameters() *CodecParameters { return newCodecParametersFromC(bsfc.c.par_in) } + +// https://ffmpeg.org/doxygen/7.0/structAVBSFContext.html#ab58f8c37eec197e0f30d17d60959a60d +func (bsfc *BitStreamFilterContext) OutputCodecParameters() *CodecParameters { + return newCodecParametersFromC(bsfc.c.par_out) +} diff --git a/bit_stream_filter_context_test.go b/bit_stream_filter_context_test.go index 2913841..da58bd2 100644 --- a/bit_stream_filter_context_test.go +++ b/bit_stream_filter_context_test.go @@ -29,7 +29,9 @@ func TestBitStreamFilterContext(t *testing.T) { require.NoError(t, cp1.Copy(bsfc.InputCodecParameters())) require.Equal(t, CodecIDH264, bsfc.InputCodecParameters().CodecID()) + require.Equal(t, CodecIDNone, bsfc.OutputCodecParameters().CodecID()) require.NoError(t, bsfc.Initialize()) + require.Equal(t, CodecIDH264, bsfc.OutputCodecParameters().CodecID()) // TODO Test SendPacket // TODO Test ReceivePacket