mirror of
https://github.com/qrtc/ffmpeg-dev-go.git
synced 2025-10-25 08:20:21 +08:00
2023-10-22 11:46:19 CST W43D0
This commit is contained in:
24
avutil_hwcontext_videotoolbox.go
Normal file
24
avutil_hwcontext_videotoolbox.go
Normal file
@@ -0,0 +1,24 @@
|
||||
//go:build ffmpeg_hw_videotoolbox
|
||||
|
||||
package ffmpeg
|
||||
|
||||
/*
|
||||
#include <libavutil/hwcontext_videotoolbox.h>
|
||||
*/
|
||||
import "C"
|
||||
|
||||
// AvMapVideotoolboxFormatToPixfmt converts a VideoToolbox (actually CoreVideo) format to AVPixelFormat.
|
||||
func AvMapVideotoolboxFormatToPixfmt(cvFmt uint32) AVPixelFormat {
|
||||
return (AVPixelFormat)(C.av_map_videotoolbox_format_to_pixfmt((C.uint32_t)(cvFmt)))
|
||||
}
|
||||
|
||||
// AvMapVideotoolboxFormatFromPixfmt converts an AVPixelFormat to a VideoToolbox (actually CoreVideo) format.
|
||||
func AvMapVideotoolboxFormatFromPixfmt(pixFmt AVPixelFormat) uint32 {
|
||||
return (uint32)(C.av_map_videotoolbox_format_from_pixfmt((C.enum_AVPixelFormat)(pixFmt)))
|
||||
}
|
||||
|
||||
// AvMapVideotoolboxFormatFromPixfmt2 same as av_map_videotoolbox_format_from_pixfmt function, but can map and
|
||||
// return full range pixel formats via a flag.
|
||||
func AvMapVideotoolboxFormatFromPixfmt2(pixFmt AVPixelFormat, fullRange bool) uint32 {
|
||||
return (uint32)(C.av_map_videotoolbox_format_from_pixfmt2((C.enum_AVPixelFormat)(pixFmt), C.bool(fullRange)))
|
||||
}
|
||||
Reference in New Issue
Block a user