Documentation
¶
Index ¶
Constants ¶
View Source
const ( CompressionUndefined = Compression("") CompressionAuto = Compression("*") CompressionMJPEG = Compression("MJPG") CompressionHEIC = Compression("HEIC") )
View Source
const ( PixelFormatUndefined = PixelFormat("") PixelFormatAuto = PixelFormat("*") // Raw formats: PixelFormatNV12 = PixelFormat("NV12") // https://www.kernel.org/doc/html/v4.10/media/uapi/v4l/pixfmt-nv12.html PixelFormatYU12 = PixelFormat("YU12") // https://www.kernel.org/doc/html/v4.10/media/uapi/v4l/pixfmt-yuv420.html PixelFormatYUYV = PixelFormat("YUYV") // https://www.kernel.org/doc/html/v4.10/media/uapi/v4l/pixfmt-yuyv.html )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CameraCommon ¶
type CameraCompressed ¶
type CameraCompressed interface {
CameraCommon
GetCompressedFrames(context.Context) (FramesCompressed, error)
ReleaseFrames(FramesCompressed) error
}
type Compression ¶
type Compression string
type CompressionQuality ¶
type CompressionQuality int64
type DevicePath ¶
type DevicePath = string
type DevicePathAndPlatform ¶
type DevicePathAndPlatform struct {
DevicePath DevicePath
Platform Platform
}
func ListCameras ¶
func ListCameras() ([]DevicePathAndPlatform, error)
func (DevicePathAndPlatform) ListFormats ¶
func (d DevicePathAndPlatform) ListFormats() (Formats, error)
func (DevicePathAndPlatform) OpenCamera ¶
func (d DevicePathAndPlatform) OpenCamera(format Format) (Camera, error)
type Format ¶
type Format struct {
Width uint64
Height uint64
PixelFormat PixelFormat
FPS Fraction
}
type Formats ¶
type Formats []Format
func (Formats) BestResolution ¶
func (Formats) FilterByFPS ¶
func (Formats) FilterByPixelFormat ¶
func (s Formats) FilterByPixelFormat(pixFmt PixelFormat) Formats
func (Formats) FilterByWidth ¶
type FrameDecompressor ¶
type FrameDecompressor interface {
io.Closer
WriteCompressed(FramesCompressed) error
DecompressNext() (Frame, error)
ReleaseFrame(Frame)
}
func NewFrameDecompressor ¶
func NewFrameDecompressor( compression Compression, ) (FrameDecompressor, error)
type FramesCompressed ¶
type FramesCompressed interface {
Bytes() []byte
}
type PixelFormat ¶
type PixelFormat string
func PixelFormatByName ¶
func PixelFormatByName(pixFmtName string) PixelFormat
func PixelFormatFromUint32 ¶
func PixelFormatFromUint32(v uint32) PixelFormat
func (PixelFormat) Uint32 ¶
func (pixFmt PixelFormat) Uint32() uint32
type Platform ¶
type Platform interface {
ListCameras() ([]DevicePath, error)
OpenCamera(
devicePath DevicePath,
format Format,
) (Camera, error)
OpenCameraCompressed(
devicePath DevicePath,
format Format,
compression Compression,
compressionQuality CompressionQuality,
) (CameraCompressed, error)
ListFormats(
devicePath string,
) (Formats, error)
}
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func DefaultRegistry ¶
func DefaultRegistry() *Registry
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) ListCameras ¶
func (r *Registry) ListCameras() ([]DevicePathAndPlatform, error)
func (*Registry) RegisterPlatform ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.