Documentation ¶
Overview ¶
Package avfoundation provides AVFoundation binding for Go
Index ¶
Constants ¶
const ( Video = MediaType(C.AVBindMediaTypeVideo) Audio = MediaType(C.AVBindMediaTypeAudio) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct { // UID is a unique identifier for a device UID string // contains filtered or unexported fields }
Device represents a metadata that later can be used to retrieve back the underlying device given by AVFoundation
type MediaType ¶
type MediaType C.AVBindMediaType
type ReadCloser ¶
type ReadCloser struct {
// contains filtered or unexported fields
}
ReadCloser is a wrapper around the data callback from AVFoundation. The data received from the the underlying callback can be retrieved by calling Read.
func (*ReadCloser) Close ¶
func (rc *ReadCloser) Close()
Close closes the capturing session, and no data will flow anymore
func (*ReadCloser) Read ¶
func (rc *ReadCloser) Read() ([]byte, func(), error)
Read reads raw data, the format is determined by the media type and property:
- For video, each call will return a frame.
- For audio, each call will return a chunk which its size configured by Latency
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents a capturing session.
func NewSession ¶
NewSession creates a new capturing session
func (*Session) Open ¶
func (session *Session) Open(property prop.Media) (*ReadCloser, error)
Open start capturing session. As soon as it returns successfully, the data will start flowing. The raw data can be retrieved by using ReadCloser's Read method.
func (*Session) Properties ¶
Properties queries a list of properties that device supports