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.
21 lines
1.1 KiB
Go
21 lines
1.1 KiB
Go
package astiav
|
|
|
|
//#include <libavutil/pixdesc.h>
|
|
import "C"
|
|
|
|
// https://ffmpeg.org/doxygen/7.0/pixdesc_8h.html#ac7c7d0be16fb9b6f05b3e0d463cd037b
|
|
type PixelFormatDescriptorFlag int64
|
|
|
|
const (
|
|
PixelFormatDescriptorFlagBe = PixelFormatDescriptorFlag(C.AV_PIX_FMT_FLAG_BE)
|
|
PixelFormatDescriptorFlagPal = PixelFormatDescriptorFlag(C.AV_PIX_FMT_FLAG_PAL)
|
|
PixelFormatDescriptorFlagBitStream = PixelFormatDescriptorFlag(C.AV_PIX_FMT_FLAG_BITSTREAM)
|
|
PixelFormatDescriptorFlagHwAccel = PixelFormatDescriptorFlag(C.AV_PIX_FMT_FLAG_HWACCEL)
|
|
PixelFormatDescriptorFlagPlanar = PixelFormatDescriptorFlag(C.AV_PIX_FMT_FLAG_PLANAR)
|
|
PixelFormatDescriptorFlagRgb = PixelFormatDescriptorFlag(C.AV_PIX_FMT_FLAG_RGB)
|
|
PixelFormatDescriptorFlagAlpha = PixelFormatDescriptorFlag(C.AV_PIX_FMT_FLAG_ALPHA)
|
|
PixelFormatDescriptorFlagBayer = PixelFormatDescriptorFlag(C.AV_PIX_FMT_FLAG_BAYER)
|
|
PixelFormatDescriptorFlagFloat = PixelFormatDescriptorFlag(C.AV_PIX_FMT_FLAG_FLOAT)
|
|
PixelFormatDescriptorFlagXyz = PixelFormatDescriptorFlag(C.AV_PIX_FMT_FLAG_XYZ)
|
|
)
|