mirror of
https://github.com/asticode/go-astiav.git
synced 2025-09-26 20:21:15 +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.
17 lines
322 B
Go
17 lines
322 B
Go
package astiav
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestPixelFormat(t *testing.T) {
|
|
p := FindPixelFormatByName("yuv420p")
|
|
require.Equal(t, PixelFormatYuv420P, p)
|
|
require.Equal(t, "yuv420p", p.String())
|
|
d := p.Descriptor()
|
|
require.NotNil(t, d)
|
|
require.Equal(t, d.Name(), p.String())
|
|
}
|