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.
|
|
|
// 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/httpflv"
|
|
|
|
)
|
|
|
|
|
|
|
|
// @return 返回的内存块为新申请的独立内存块
|
|
|
|
func RtmpMsg2FlvTag(msg base.RtmpMsg) *httpflv.Tag {
|
|
|
|
var tag httpflv.Tag
|
|
|
|
tag.Header.Type = msg.Header.MsgTypeId
|
|
|
|
tag.Header.DataSize = msg.Header.MsgLen
|
|
|
|
tag.Header.Timestamp = msg.Header.TimestampAbs
|
|
|
|
tag.Raw = httpflv.PackHttpflvTag(msg.Header.MsgTypeId, msg.Header.TimestampAbs, msg.Payload)
|
|
|
|
return &tag
|
|
|
|
}
|