mirror of
https://github.com/asticode/go-astiav.git
synced 2026-04-22 15:57:03 +08:00
a541263dfd
* n7.1: Migrate deprecated methods, fields, and definitions * n7.1: Add new definitions * n7.1: Add new field * n7.1: Update doxygen url * n8.0: Clean up remaining n7.x deprecations * n8.0: Add new CodecIDs and fields * n8.0: Migration to n8.0 * n8.0: Refactor swscale with Publicly expose struct SwsContext, enum SwsDither, and enum SwsAlphaBlend n8.0: Stash commit * n8.0: Update doxygen url * n8.0: Fix windows.patch to apply new library.mak in n8.0 * n8.0: Clean up and organize the APIs, remove redundant implementations, and reorder the enum fields * n8.0: Refactor SoftwareScaleContext to simplify and optimize update logic and remove redundant code * Add tests for supported sample rates and frame rates in codec encoders * Revert changes in `Free` and `Class`, other minor improvements * Adapt the examples to the current library * Update breaking changes
27 lines
746 B
Go
27 lines
746 B
Go
package astiav
|
|
|
|
//#include <libavutil/pixdesc.h>
|
|
import "C"
|
|
|
|
// https://ffmpeg.org/doxygen/8.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/8.0/structAVPixFmtDescriptor.html#a10736c3f1288eb87b23ede3ffdefb435
|
|
func (pfd *PixelFormatDescriptor) Name() string {
|
|
return C.GoString(pfd.c.name)
|
|
}
|
|
|
|
// https://ffmpeg.org/doxygen/8.0/structAVPixFmtDescriptor.html#a5047d1e6b045f637345dbc305bf4357d
|
|
func (pfd *PixelFormatDescriptor) Flags() PixelFormatDescriptorFlags {
|
|
return PixelFormatDescriptorFlags(pfd.c.flags)
|
|
}
|