Documentation ¶
Index ¶
- type Audio
- type AudioConstraints
- type Bool
- type BoolConstraint
- type BoolExact
- type Duration
- type DurationConstraint
- type DurationExact
- type DurationOneOf
- type DurationRanged
- type Float
- type FloatConstraint
- type FloatExact
- type FloatOneOf
- type FloatRanged
- type FrameFormat
- type FrameFormatConstraint
- type FrameFormatExact
- type FrameFormatOneOf
- type Int
- type IntConstraint
- type IntExact
- type IntOneOf
- type IntRanged
- type Media
- type MediaConstraints
- type String
- type StringConstraint
- type StringExact
- type StringOneOf
- type Video
- type VideoConstraints
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Audio ¶
type Audio struct { ChannelCount int Latency time.Duration SampleRate int SampleSize int IsBigEndian bool IsFloat bool IsInterleaved bool }
Audio represents an audio's constraints
type AudioConstraints ¶
type AudioConstraints struct { ChannelCount IntConstraint Latency DurationConstraint SampleRate IntConstraint SampleSize IntConstraint IsBigEndian BoolConstraint IsFloat BoolConstraint IsInterleaved BoolConstraint }
AudioConstraints represents an audio's constraints
type BoolConstraint ¶
BoolConstraint is an interface to represent bool value constraint.
type BoolExact ¶
type BoolExact bool
BoolExact specifies exact bool value.
type Duration ¶
Duration specifies ideal duration value. Any value may be selected, but closest value takes priority.
type DurationConstraint ¶
type DurationConstraint interface { Compare(time.Duration) (float64, bool) Value() (time.Duration, bool) }
DurationConstraint is an interface to represent time.Duration constraint.
type DurationExact ¶
DurationExact specifies exact duration value.
type DurationOneOf ¶
DurationOneOf specifies list of expected duration values.
type DurationRanged ¶
DurationRanged specifies range of expected duration value. If Ideal is non-zero, closest value to Ideal takes priority.
type Float ¶
type Float float32
Float specifies ideal float value. Any value may be selected, but closest value takes priority.
type FloatConstraint ¶
FloatConstraint is an interface to represent float value constraint.
type FloatExact ¶
type FloatExact float32
FloatExact specifies exact float value.
func (FloatExact) Compare ¶
func (f FloatExact) Compare(a float32) (float64, bool)
Compare implements FloatConstraint.
func (FloatExact) Value ¶
func (f FloatExact) Value() (float32, bool)
Value implements FloatConstraint.
type FloatOneOf ¶
type FloatOneOf []float32
FloatOneOf specifies list of expected float values.
func (FloatOneOf) Compare ¶
func (f FloatOneOf) Compare(a float32) (float64, bool)
Compare implements FloatConstraint.
func (FloatOneOf) Value ¶
func (FloatOneOf) Value() (float32, bool)
Value implements FloatConstraint.
type FloatRanged ¶
FloatRanged specifies range of expected float value. If Ideal is non-zero, closest value to Ideal takes priority.
func (FloatRanged) Compare ¶
func (f FloatRanged) Compare(a float32) (float64, bool)
Compare implements FloatConstraint.
func (FloatRanged) Value ¶
func (FloatRanged) Value() (float32, bool)
Value implements FloatConstraint.
type FrameFormat ¶
FrameFormat specifies expected frame format. Any value may be selected, but matched value takes priority.
type FrameFormatConstraint ¶
type FrameFormatConstraint interface { Compare(frame.Format) (float64, bool) Value() (frame.Format, bool) }
FrameFormatConstraint is an interface to represent frame format constraint.
type FrameFormatExact ¶
FrameFormatExact specifies exact frame format.
func (FrameFormatExact) Compare ¶
func (f FrameFormatExact) Compare(a frame.Format) (float64, bool)
Compare implements FrameFormatConstraint.
func (FrameFormatExact) String ¶
func (f FrameFormatExact) String() string
String implements Stringify
type FrameFormatOneOf ¶
FrameFormatOneOf specifies list of expected frame format.
func (FrameFormatOneOf) Compare ¶
func (f FrameFormatOneOf) Compare(a frame.Format) (float64, bool)
Compare implements FrameFormatConstraint.
func (FrameFormatOneOf) String ¶
func (f FrameFormatOneOf) String() string
String implements Stringify
type Int ¶
type Int int
Int specifies ideal int value. Any value may be selected, but closest value takes priority.
type IntConstraint ¶
IntConstraint is an interface to represent integer value constraint.
type IntExact ¶
type IntExact int
IntExact specifies exact int value.
type IntOneOf ¶
type IntOneOf []int
IntOneOf specifies list of expected float values.
type IntRanged ¶
IntRanged specifies range of expected int value. If Ideal is non-zero, closest value to Ideal takes priority.
type Media ¶
Media stores single set of media propaties.
func (*Media) MergeConstraints ¶
func (p *Media) MergeConstraints(o MediaConstraints)
type MediaConstraints ¶
type MediaConstraints struct { DeviceID StringConstraint VideoConstraints AudioConstraints }
MediaConstraints represents set of media property constraints. Each field constrains property by min/ideal/max range, exact match, or oneof match.
func (*MediaConstraints) FitnessDistance ¶
func (p *MediaConstraints) FitnessDistance(o Media) (float64, bool)
FitnessDistance calculates fitness of media property and media constraints. If no media satisfies given constraints, second return value will be false.
func (*MediaConstraints) String ¶
func (m *MediaConstraints) String() string
type String ¶
type String string
String specifies expected string. Any value may be selected, but matched value takes priority.
type StringConstraint ¶
StringConstraint is an interface to represent string constraint.
type StringExact ¶
type StringExact string
StringExact specifies exact string.
func (StringExact) Compare ¶
func (f StringExact) Compare(a string) (float64, bool)
Compare implements StringConstraint.
func (StringExact) Value ¶
func (f StringExact) Value() (string, bool)
Value implements StringConstraint.
type StringOneOf ¶
type StringOneOf []string
StringOneOf specifies list of expected string.
func (StringOneOf) Compare ¶
func (f StringOneOf) Compare(a string) (float64, bool)
Compare implements StringConstraint.
func (StringOneOf) Value ¶
func (StringOneOf) Value() (string, bool)
Value implements StringConstraint.
type Video ¶
type Video struct {
Width, Height int
FrameRate float32
FrameFormat frame.Format
DiscardFramesOlderThan time.Duration
}
Video represents a video's constraints
type VideoConstraints ¶
type VideoConstraints struct {
Width, Height IntConstraint
FrameRate FloatConstraint
FrameFormat FrameFormatConstraint
DiscardFramesOlderThan time.Duration
}
VideoConstraints represents a video's constraints