forked from brutella/hc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcamera.go
29 lines (24 loc) · 811 Bytes
/
camera.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package accessory
import (
"github.com/brutella/hc/service"
)
// Camera provides RTP video streaming.
type Camera struct {
*Accessory
Control *service.CameraControl
StreamManagement1 *service.CameraRTPStreamManagement
StreamManagement2 *service.CameraRTPStreamManagement
}
// NewCamera returns an IP camera accessory.
func NewCamera(info Info) *Camera {
acc := Camera{}
acc.Accessory = New(info, TypeIPCamera)
acc.Control = service.NewCameraControl()
acc.AddService(acc.Control.Service)
// TODO (mah) a camera must support at least 2 rtp streams
acc.StreamManagement1 = service.NewCameraRTPStreamManagement()
acc.StreamManagement2 = service.NewCameraRTPStreamManagement()
acc.AddService(acc.StreamManagement1.Service)
// acc.AddService(acc.StreamManagement2.Service)
return &acc
}