Process and check create stream command, store transaction id
This commit is contained in:
parent
b0239ed761
commit
9f0cf39b3b
1 changed files with 20 additions and 0 deletions
|
@ -33,6 +33,26 @@ func (amf_obj_root AMFObj) ProcessConnect() (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (amf_obj_root AMFObj) ProcessCreateStream(trans_id *float64) (err error) {
|
||||||
|
err = errors.New("Bad AMF create stream")
|
||||||
|
if _, ok := amf_obj_root[0]; !ok {
|
||||||
|
return
|
||||||
|
} else if command_string, ok := amf_obj_root[0].(string); !ok || command_string != "createStream" {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if _, ok := amf_obj_root[1]; !ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
transac_id_float, ok := amf_obj_root[1].(float64)
|
||||||
|
if !ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
*trans_id = transac_id_float
|
||||||
|
err = nil
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func EncodeConnectResponse() ([]byte, error) {
|
func EncodeConnectResponse() ([]byte, error) {
|
||||||
amf_root_obj := make(AMFObj)
|
amf_root_obj := make(AMFObj)
|
||||||
amf_root_obj[0] = "_result"
|
amf_root_obj[0] = "_result"
|
||||||
|
|
Loading…
Reference in a new issue