RTMP server enhancement to support OpenIPC cameras
This commit is contained in:
+7
-6
@@ -117,10 +117,6 @@ func (c *Conn) acceptCommand(b []byte) error {
|
||||
}
|
||||
}
|
||||
|
||||
if c.App == "" {
|
||||
return fmt.Errorf("rtmp: read command %x", b)
|
||||
}
|
||||
|
||||
payload := amf.EncodeItems(
|
||||
"_result", tID,
|
||||
map[string]any{"fmsVer": "FMS/3,0,1,123"},
|
||||
@@ -129,9 +125,16 @@ func (c *Conn) acceptCommand(b []byte) error {
|
||||
return c.writeMessage(3, TypeCommand, 0, payload)
|
||||
|
||||
case CommandReleaseStream:
|
||||
// if app is empty - will use key as app
|
||||
if c.App == "" && len(items) == 4 {
|
||||
c.App, _ = items[3].(string)
|
||||
}
|
||||
|
||||
payload := amf.EncodeItems("_result", tID, nil)
|
||||
return c.writeMessage(3, TypeCommand, 0, payload)
|
||||
|
||||
case CommandFCPublish: // no response
|
||||
|
||||
case CommandCreateStream:
|
||||
payload := amf.EncodeItems("_result", tID, nil, 1)
|
||||
return c.writeMessage(3, TypeCommand, 0, payload)
|
||||
@@ -140,8 +143,6 @@ func (c *Conn) acceptCommand(b []byte) error {
|
||||
c.Intent = cmd
|
||||
c.streamID = 1
|
||||
|
||||
case CommandFCPublish: // no response
|
||||
|
||||
default:
|
||||
println("rtmp: unknown command: " + cmd)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user