Documentation ¶
Index ¶
- Constants
- type AllowedFrameTypes
- type Frame
- type FrameStatistics
- type Pool
- type Properties
- type Statistics
- type Stream
- func (s *Stream) Channel() <-chan Frame
- func (s *Stream) Copy(n int) []*Stream
- func (s *Stream) Lock() bool
- func (s *Stream) Monochrome() *Stream
- func (s *Stream) Properties() StreamProperties
- func (s *Stream) Sample(each int) *Stream
- func (s *Stream) Slice(start, end int) *Stream
- func (s *Stream) Split(splits ...int) []*Stream
- func (s *Stream) Unlock() bool
- type StreamProperties
- type TypedFrame
Constants ¶
View Source
const ( StatisticsKeyFramesIn = "frames_in" StatisticsKeyFramesOut = "frames_out" StatisticsKeyLastFrameOut = "last_frame_out" )
View Source
const ( FrameStatisticsKeyNumber = "number" FrameStatisticsKeyPts = "pts" FrameStatisticsKeyQuantizer = "quantizer" FrameStatisticsKeySize = "size" FrameStatisticsKeyIsKeyFrame = "is_key" FrameStatisticsKeyIsIntraFrame = "is_intra" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllowedFrameTypes ¶
type Frame ¶
type Frame interface { Properties() Properties // PTS usually frame number, but can differ on VFR PTS() int64 // NextPTS Next PTS NextPTS() int64 // Get16 get a pixel sample in 16-bit depth Get16(x, y int) (Y uint16, Cb uint16, Cr uint16) // Get8 get a pixel sample in 8-bit depth Get8(x, y int) (Y uint8, Cb uint8, Cr uint8) GetLuma() []byte GetCb() []byte GetCr() []byte // GetJoint Gets Luma+Cb+Cr slice. Do not keep references to this slice, copy instead. // This is unsafe GetJoint() []byte // Return Finishes using this frame and marks it for reuse Return() }
type FrameStatistics ¶
func (FrameStatistics) IsIntraFrame ¶
func (s FrameStatistics) IsIntraFrame() bool
func (FrameStatistics) IsKeyFrame ¶
func (s FrameStatistics) IsKeyFrame() bool
func (FrameStatistics) Number ¶
func (s FrameStatistics) Number() int
func (FrameStatistics) PTS ¶
func (s FrameStatistics) PTS() int64
func (FrameStatistics) Quantizer ¶
func (s FrameStatistics) Quantizer() float64
func (FrameStatistics) Size ¶
func (s FrameStatistics) Size() int
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func NewPool ¶
func NewPool(properties Properties) (*Pool, error)
func (*Pool) Properties ¶
func (p *Pool) Properties() Properties
type Properties ¶
type Statistics ¶
func (Statistics) FramesIn ¶
func (s Statistics) FramesIn() int
func (Statistics) FramesOut ¶
func (s Statistics) FramesOut() int
func (Statistics) LastFrameOut ¶
func (s Statistics) LastFrameOut() *FrameStatistics
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
func NewStream ¶
func NewStream(properties StreamProperties) (*Stream, chan<- Frame)
func (*Stream) Properties ¶
func (s *Stream) Properties() StreamProperties
type StreamProperties ¶
type StreamProperties struct { // Width could be not populated until the first frame is read. Frame can contain different settings. Width int `json:"width" yaml:"width"` // Height could be not populated until the first frame is read. Frame can contain different settings. Height int `json:"height" yaml:"height"` // PixelAspectRatio could be not populated until the first frame is read. Frame can contain different settings. PixelAspectRatio utilities.Ratio `json:"par" yaml:"par"` // ColorSpace could be not populated until the first frame is read. Frame can contain different settings. ColorSpace color.Space `json:"colorspace" yaml:"colorspace"` FrameRate utilities.Ratio `json:"framerate" yaml:"framerate"` FullColorRange bool `json:"fullrange" yaml:"fullrange"` VFR bool `json:"vfr" yaml:"vfr"` }
func (StreamProperties) FrameProperties ¶
func (p StreamProperties) FrameProperties() Properties
func (StreamProperties) TimeBase ¶
func (p StreamProperties) TimeBase() utilities.Ratio
type TypedFrame ¶
type TypedFrame[T AllowedFrameTypes] interface { Frame // GetNative get a pixel sample in native bit depth GetNative(x, y int) (Y T, Cb T, Cr T) // GetNativeLuma also known as Y. Do not keep references to this slice, copy instead. GetNativeLuma() []T // GetNativeCb also known as U. Do not keep references to this slice, copy instead. GetNativeCb() []T // GetNativeCr also known as V. Do not keep references to this slice, copy instead. GetNativeCr() []T // GetNativeJoint Gets Luma+Cb+Cr slice. Do not keep references to this slice, copy instead. GetNativeJoint() []T FillNativeLuma([]T) FillNativeCb([]T) FillNativeCr([]T) }
Click to show internal directories.
Click to hide internal directories.