Documentation ¶
Index ¶
- Constants
- func NewAccessory(manuf, model, name, serial, firmware string) *hap.Accessory
- func ServiceCameraRTPStreamManagement() *hap.Service
- func ServiceMicrophone() *hap.Service
- type Addr
- type AudioCodec
- type AudioParams
- type CryptoSuite
- type RTPParams
- type SelectedStreamConfig
- type SessionControl
- type SetupEndpoints
- type Stream
- type StreamingStatus
- type SupportedAudioStreamConfig
- type SupportedRTPConfig
- type SupportedVideoStreamConfig
- type VideoAttrs
- type VideoCodec
- type VideoParams
Constants ¶
View Source
const ( VideoCodecTypeH264 = 0 VideoCodecProfileConstrainedBaseline = 0 VideoCodecProfileMain = 1 VideoCodecProfileHigh = 2 VideoCodecLevel31 = 0 VideoCodecLevel32 = 1 VideoCodecLevel40 = 2 VideoCodecPacketizationModeNonInterleaved = 0 VideoCodecCvoNotSuppported = 0 VideoCodecCvoSuppported = 1 )
View Source
const ( AudioCodecTypePCMU = 0 AudioCodecTypePCMA = 1 AudioCodecTypeAACELD = 2 AudioCodecTypeOpus = 3 AudioCodecTypeMSBC = 4 AudioCodecTypeAMR = 5 AudioCodecTypeARMWB = 6 AudioCodecBitrateVariable = 0 AudioCodecBitrateConstant = 1 AudioCodecSampleRate8Khz = 0 AudioCodecSampleRate16Khz = 1 AudioCodecSampleRate24Khz = 2 RTPTimeAACELD8 = 60 // 8000/1000*60=480 RTPTimeAACELD16 = 30 // 16000/1000*30=480 RTPTimeAACELD24 = 20 // 24000/1000*20=480 RTPTimeAACLD16 = 60 // 16000/1000*60=960 RTPTimeAACLD24 = 40 // 24000/1000*40=960 )
View Source
const ( CryptoAES_CM_128_HMAC_SHA1_80 = 0 CryptoAES_CM_256_HMAC_SHA1_80 = 1 CryptoNone = 2 )
View Source
const ( SessionCommandEnd = 0 SessionCommandStart = 1 SessionCommandSuspend = 2 SessionCommandResume = 3 SessionCommandReconfigure = 4 )
View Source
const ( StreamingStatusAvailable = 0 StreamingStatusBusy = 1 )
View Source
const TypeSelectedStreamConfiguration = "117"
View Source
const TypeSetupEndpoints = "118"
View Source
const TypeStreamingStatus = "120"
View Source
const TypeSupportedAudioStreamConfiguration = "115"
View Source
const TypeSupportedRTPConfiguration = "116"
View Source
const TypeSupportedVideoStreamConfiguration = "114"
Variables ¶
This section is empty.
Functions ¶
func NewAccessory ¶
func ServiceMicrophone ¶
Types ¶
type AudioCodec ¶
type AudioCodec struct { CodecType byte `tlv8:"1"` CodecParams []AudioParams `tlv8:"2"` RTPParams []RTPParams `tlv8:"3"` ComfortNoise []byte `tlv8:"4"` }
type AudioParams ¶
type CryptoSuite ¶
type SelectedStreamConfig ¶
type SelectedStreamConfig struct { Control SessionControl `tlv8:"1"` VideoCodec VideoCodec `tlv8:"2"` AudioCodec AudioCodec `tlv8:"3"` }
type SessionControl ¶
type SetupEndpoints ¶
type SetupEndpoints struct { SessionID string `tlv8:"1"` Status []byte `tlv8:"2"` Address Addr `tlv8:"3"` VideoCrypto CryptoSuite `tlv8:"4"` AudioCrypto CryptoSuite `tlv8:"5"` VideoSSRC []uint32 `tlv8:"6"` AudioSSRC []uint32 `tlv8:"7"` }
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
func NewStream ¶
func NewStream( client *hap.Client, videoCodec *VideoCodec, audioCodec *AudioCodec, videoSession, audioSession *srtp.Session, bitrate int, ) (*Stream, error)
func (*Stream) ExchangeEndpoints ¶
func (*Stream) GetFreeStream ¶
GetFreeStream search free streaming service. Usual every HomeKit camera can stream only to two clients simultaniosly. So it has two similar services for streaming.
func (*Stream) SetStreamConfig ¶
func (s *Stream) SetStreamConfig(config *SelectedStreamConfig) error
type StreamingStatus ¶
type StreamingStatus struct {
Status byte `tlv8:"1"`
}
type SupportedAudioStreamConfig ¶
type SupportedAudioStreamConfig struct { Codecs []AudioCodec `tlv8:"1"` ComfortNoise byte `tlv8:"2"` }
type SupportedRTPConfig ¶
type SupportedRTPConfig struct {
CryptoType []byte `tlv8:"2"`
}
type SupportedVideoStreamConfig ¶
type SupportedVideoStreamConfig struct {
Codecs []VideoCodec `tlv8:"1"`
}
type VideoAttrs ¶
type VideoCodec ¶
type VideoCodec struct { CodecType byte `tlv8:"1"` CodecParams []VideoParams `tlv8:"2"` VideoAttrs []VideoAttrs `tlv8:"3"` RTPParams []RTPParams `tlv8:"4"` }
type VideoParams ¶
type VideoParams struct { ProfileID []byte `tlv8:"1"` // 0 - baseline, 1 - main, 2 - high Level []byte `tlv8:"2"` // 0 - 3.1, 1 - 3.2, 2 - 4.0 PacketizationMode byte `tlv8:"3"` // only 0 - non interleaved CVOEnabled []byte `tlv8:"4"` // 0 - not supported, 1 - supported CVOID []byte `tlv8:"5"` // ??? }
Click to show internal directories.
Click to hide internal directories.