mirror of
https://github.com/asticode/go-astiav.git
synced 2025-10-05 16:16:50 +08:00
Add AVPixFmtDescriptor to retrieve flags for AVPixelFormat (#154)
* 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.
This commit is contained in:
@@ -141,6 +141,15 @@ func TestPacketFlags(t *testing.T) {
|
||||
require.False(t, fs.Has(PacketFlag(2)))
|
||||
}
|
||||
|
||||
func TestPixelFormatDescriptorFlags(t *testing.T) {
|
||||
fs := NewPixelFormatDescriptorFlags(PixelFormatDescriptorFlag(1))
|
||||
require.True(t, fs.Has(PixelFormatDescriptorFlag(1)))
|
||||
fs = fs.Add(PixelFormatDescriptorFlag(2))
|
||||
require.True(t, fs.Has(PixelFormatDescriptorFlag(2)))
|
||||
fs = fs.Del(PixelFormatDescriptorFlag(2))
|
||||
require.False(t, fs.Has(PixelFormatDescriptorFlag(2)))
|
||||
}
|
||||
|
||||
func TestSeekFlags(t *testing.T) {
|
||||
fs := NewSeekFlags(SeekFlag(1))
|
||||
require.True(t, fs.Has(SeekFlag(1)))
|
||||
|
Reference in New Issue
Block a user