MCPcopy
hub / github.com/q191201771/lal / writePublish

Method writePublish

pkg/rtmp/message_packer.go:186–203  ·  view source on GitHub ↗
(writer io.Writer, appName string, streamName string, streamid int)

Source from the content-addressed store, hash-verified

184}
185
186func (packer *MessagePacker) writePublish(writer io.Writer, appName string, streamName string, streamid int) error {
187 packer.b.ModWritePos(12)
188
189 _ = Amf0.WriteString(packer.b, "publish")
190 _ = Amf0.WriteNumber(packer.b, float64(tidClientPublish))
191 _ = Amf0.WriteNull(packer.b)
192 _ = Amf0.WriteString(packer.b, streamName)
193
194 // <spec-rtmp_specification_1.0.pdf>
195 // 7.2.2.6. publish
196 //
197 // Type of publishing.
198 // Set to "live": Live data is published without recording it in a file.
199 //
200 _ = Amf0.WriteString(packer.b, "live")
201
202 return packer.ChunkAndWrite(writer, csidOverStream, base.RtmpTypeIdCommandMessageAmf0, streamid)
203}
204
205func (packer *MessagePacker) writeOnStatusPublish(writer io.Writer, streamid int) error {
206 packer.b.ModWritePos(12)

Callers 3

TestWriteFunction · 0.95
TestPackCornerFunction · 0.95
doResultMessageMethod · 0.80

Calls 5

ChunkAndWriteMethod · 0.95
ModWritePosMethod · 0.80
WriteStringMethod · 0.80
WriteNumberMethod · 0.80
WriteNullMethod · 0.80

Tested by 2

TestWriteFunction · 0.76
TestPackCornerFunction · 0.76