mirror of
https://github.com/asticode/go-astiav.git
synced 2025-09-27 04:26:30 +08:00

* 1. Adds hardware_frames_constraints to retrieve valid HWPixelFormats and SWPixelFormats for specific hardware frame configurations. 2. Implements a HardwareFramesConstraints method in hardware_device_context to obtain these constraints for a given hardware frames context. * Add AVPixFmtDescriptor to retrieve flags for AVPixelFormat feat(PixelFormat): Expose `AVPixFmtDescriptor` via `Descriptor()` method This commit introduces support for `AVPixFmtDescriptor`, which provides detailed information about an `AVPixelFormat`, including its flags. A new `Descriptor()` method has been added to the `PixelFormat` type (or class) to retrieve its corresponding `AVPixFmtDescriptor`. This allows for easier access to extended properties of pixel formats.
27 lines
746 B
Go
27 lines
746 B
Go
package astiav
|
|
|
|
//#include <libavutil/pixdesc.h>
|
|
import "C"
|
|
|
|
// https://ffmpeg.org/doxygen/7.0/structAVPixFmtDescriptor.html
|
|
type PixelFormatDescriptor struct {
|
|
c *C.AVPixFmtDescriptor
|
|
}
|
|
|
|
func newPixelFormatDescriptorFromC(c *C.AVPixFmtDescriptor) *PixelFormatDescriptor {
|
|
if c == nil {
|
|
return nil
|
|
}
|
|
return &PixelFormatDescriptor{c: c}
|
|
}
|
|
|
|
// https://ffmpeg.org/doxygen/7.0/structAVPixFmtDescriptor.html#a10736c3f1288eb87b23ede3ffdefb435
|
|
func (pfd *PixelFormatDescriptor) Name() string {
|
|
return C.GoString(pfd.c.name)
|
|
}
|
|
|
|
// https://ffmpeg.org/doxygen/7.0/structAVPixFmtDescriptor.html#a5047d1e6b045f637345dbc305bf4357d
|
|
func (pfd *PixelFormatDescriptor) Flags() PixelFormatDescriptorFlags {
|
|
return PixelFormatDescriptorFlags(pfd.c.flags)
|
|
}
|