Expose pointer to underlying AVCodecContext (#95)

* feat: expose pointer to underlying C object

* feat: add ut
This commit is contained in:
l0rem1psum
2024-11-05 15:58:34 +08:00
committed by GitHub
parent bc148523bc
commit 0d3622405a
2 changed files with 6 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ package astiav
import (
"testing"
"unsafe"
"github.com/stretchr/testify/require"
)
@@ -40,6 +41,7 @@ func TestCodecContext(t *testing.T) {
require.Equal(t, 1, cc1.ThreadCount())
require.Equal(t, ThreadType(3), cc1.ThreadType())
require.Equal(t, 320, cc1.Width())
require.Equal(t, unsafe.Pointer(cc1.c), cc1.UnsafePointer())
cl := cc1.Class()
require.NotNil(t, cl)
require.Equal(t, "AVCodecContext", cl.Name())