You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lal/pkg/remux/rtmp.go

31 lines
729 B
Go

// Copyright 2020, Chef. All rights reserved.
// https://github.com/q191201771/lal
//
// Use of this source code is governed by a MIT-style license
// that can be found in the License file.
//
// Author: Chef (191201771@qq.com)
package remux
import (
"github.com/q191201771/lal/pkg/base"
"github.com/q191201771/lal/pkg/rtmp"
)
func MakeDefaultRTMPHeader(in base.RTMPHeader) (out base.RTMPHeader) {
out.MsgLen = in.MsgLen
out.TimestampAbs = in.TimestampAbs
out.MsgTypeID = in.MsgTypeID
out.MsgStreamID = rtmp.MSID1
switch in.MsgTypeID {
case base.RTMPTypeIDMetadata:
out.CSID = rtmp.CSIDAMF
case base.RTMPTypeIDAudio:
out.CSID = rtmp.CSIDAudio
case base.RTMPTypeIDVideo:
out.CSID = rtmp.CSIDVideo
}
return
}