asticode / go-astiav

Golang ffmpeg and libav C bindings
MIT License
393 stars 45 forks source link

Provide a way to expose underlying C struct #43

Closed l0rem1psum closed 9 months ago

l0rem1psum commented 9 months ago

Sometimes I need to access the underlying C struct for some operations currently not implemented or is used by another C library. Hence, it would be convenient to provide a way to access the underlying struct for more flexibility.

As an example, for astiav.Frame, we could add the following method:

func (f *Frame) Inner() unsafe.Pointer { // TODO: discuss method name
    return unsafe.Pointer(f.c)
}
l0rem1psum commented 9 months ago

Just realized that this was proposed in #2 as well.