go fmt
This commit is contained in:
+13
-13
@@ -23,7 +23,7 @@ type API struct {
|
|||||||
StreamSessionID string
|
StreamSessionID string
|
||||||
|
|
||||||
// RTSP
|
// RTSP
|
||||||
StreamToken string
|
StreamToken string
|
||||||
StreamExtensionToken string
|
StreamExtensionToken string
|
||||||
|
|
||||||
extendTimer *time.Timer
|
extendTimer *time.Timer
|
||||||
@@ -120,7 +120,7 @@ func (a *API) GetDevices(projectID string) (map[string]string, error) {
|
|||||||
|
|
||||||
supported := false
|
supported := false
|
||||||
for _, protocol := range device.Traits.SdmDevicesTraitsCameraLiveStream.SupportedProtocols {
|
for _, protocol := range device.Traits.SdmDevicesTraitsCameraLiveStream.SupportedProtocols {
|
||||||
if (protocol == "WEB_RTC" || protocol == "RTSP") {
|
if protocol == "WEB_RTC" || protocol == "RTSP" {
|
||||||
supported = true
|
supported = true
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
@@ -231,7 +231,7 @@ func (a *API) ExtendStream() error {
|
|||||||
var reqv struct {
|
var reqv struct {
|
||||||
Command string `json:"command"`
|
Command string `json:"command"`
|
||||||
Params struct {
|
Params struct {
|
||||||
MediaSessionID string `json:"mediaSessionId,omitempty"`
|
MediaSessionID string `json:"mediaSessionId,omitempty"`
|
||||||
StreamExtensionToken string `json:"streamExtensionToken,omitempty"`
|
StreamExtensionToken string `json:"streamExtensionToken,omitempty"`
|
||||||
} `json:"params"`
|
} `json:"params"`
|
||||||
}
|
}
|
||||||
@@ -272,10 +272,10 @@ func (a *API) ExtendStream() error {
|
|||||||
|
|
||||||
var resv struct {
|
var resv struct {
|
||||||
Results struct {
|
Results struct {
|
||||||
ExpiresAt time.Time `json:"expiresAt"`
|
ExpiresAt time.Time `json:"expiresAt"`
|
||||||
MediaSessionID string `json:"mediaSessionId"`
|
MediaSessionID string `json:"mediaSessionId"`
|
||||||
StreamExtensionToken string `json:"streamExtensionToken"`
|
StreamExtensionToken string `json:"streamExtensionToken"`
|
||||||
StreamToken string `json:"streamToken"`
|
StreamToken string `json:"streamToken"`
|
||||||
} `json:"results"`
|
} `json:"results"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -293,8 +293,8 @@ func (a *API) ExtendStream() error {
|
|||||||
|
|
||||||
func (a *API) GenerateRtspStream(projectID, deviceID string) (string, error) {
|
func (a *API) GenerateRtspStream(projectID, deviceID string) (string, error) {
|
||||||
var reqv struct {
|
var reqv struct {
|
||||||
Command string `json:"command"`
|
Command string `json:"command"`
|
||||||
Params struct {} `json:"params"`
|
Params struct{} `json:"params"`
|
||||||
}
|
}
|
||||||
reqv.Command = "sdm.devices.commands.CameraLiveStream.GenerateRtspStream"
|
reqv.Command = "sdm.devices.commands.CameraLiveStream.GenerateRtspStream"
|
||||||
|
|
||||||
@@ -324,10 +324,10 @@ func (a *API) GenerateRtspStream(projectID, deviceID string) (string, error) {
|
|||||||
|
|
||||||
var resv struct {
|
var resv struct {
|
||||||
Results struct {
|
Results struct {
|
||||||
StreamURLs map[string]string `json:"streamUrls"`
|
StreamURLs map[string]string `json:"streamUrls"`
|
||||||
StreamExtensionToken string `json:"streamExtensionToken"`
|
StreamExtensionToken string `json:"streamExtensionToken"`
|
||||||
StreamToken string `json:"streamToken"`
|
StreamToken string `json:"streamToken"`
|
||||||
ExpiresAt time.Time `json:"expiresAt"`
|
ExpiresAt time.Time `json:"expiresAt"`
|
||||||
} `json:"results"`
|
} `json:"results"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -17,7 +17,7 @@ type WebRTCClient struct {
|
|||||||
|
|
||||||
type RTSPClient struct {
|
type RTSPClient struct {
|
||||||
conn *rtsp.Conn
|
conn *rtsp.Conn
|
||||||
api *API
|
api *API
|
||||||
}
|
}
|
||||||
|
|
||||||
func Dial(rawURL string) (core.Producer, error) {
|
func Dial(rawURL string) (core.Producer, error) {
|
||||||
@@ -168,4 +168,4 @@ func (c *RTSPClient) Stop() error {
|
|||||||
|
|
||||||
func (c *RTSPClient) MarshalJSON() ([]byte, error) {
|
func (c *RTSPClient) MarshalJSON() ([]byte, error) {
|
||||||
return c.conn.MarshalJSON()
|
return c.conn.MarshalJSON()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user