rtmp

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package rtmp provides RTMP connectivity.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

Conn is a RTMP connection.

func NewClientConn added in v1.0.0

func NewClientConn(rw io.ReadWriter, u *url.URL, publish bool) (*Conn, error)

NewClientConn initializes a client-side connection.

func NewServerConn added in v1.0.0

func NewServerConn(rw io.ReadWriter) (*Conn, *url.URL, bool, error)

NewServerConn initializes a server-side connection.

func (*Conn) BytesReceived

func (c *Conn) BytesReceived() uint64

BytesReceived returns the number of bytes received.

func (*Conn) BytesSent

func (c *Conn) BytesSent() uint64

BytesSent returns the number of bytes sent.

func (*Conn) Read added in v1.0.0

func (c *Conn) Read() (message.Message, error)

Read reads a message.

func (*Conn) Write added in v1.0.0

func (c *Conn) Write(msg message.Message) error

Write writes a message.

type OnDataAV1Func added in v1.0.0

type OnDataAV1Func func(pts time.Duration, tu [][]byte)

OnDataAV1Func is the prototype of the callback passed to OnDataAV1().

type OnDataH26xFunc added in v1.0.0

type OnDataH26xFunc func(pts time.Duration, au [][]byte)

OnDataH26xFunc is the prototype of the callback passed to OnDataH26x().

type OnDataMPEG1AudioFunc added in v1.0.0

type OnDataMPEG1AudioFunc func(pts time.Duration, frame []byte)

OnDataMPEG1AudioFunc is the prototype of the callback passed to OnDataMPEG1Audio().

type OnDataMPEG4AudioFunc added in v1.0.0

type OnDataMPEG4AudioFunc func(pts time.Duration, au []byte)

OnDataMPEG4AudioFunc is the prototype of the callback passed to OnDataMPEG4Audio().

type Reader added in v1.0.0

type Reader struct {
	// contains filtered or unexported fields
}

Reader is a wrapper around Conn that provides utilities to demux incoming data.

func NewReader added in v1.0.0

func NewReader(conn *Conn) (*Reader, error)

NewReader allocates a Reader.

func (*Reader) OnDataAV1 added in v1.0.0

func (r *Reader) OnDataAV1(cb OnDataAV1Func)

OnDataAV1 sets a callback that is called when AV1 data is received.

func (*Reader) OnDataH264 added in v1.0.0

func (r *Reader) OnDataH264(cb OnDataH26xFunc)

OnDataH264 sets a callback that is called when H264 data is received.

func (*Reader) OnDataH265 added in v1.0.0

func (r *Reader) OnDataH265(cb OnDataH26xFunc)

OnDataH265 sets a callback that is called when H265 data is received.

func (*Reader) OnDataMPEG1Audio added in v1.0.0

func (r *Reader) OnDataMPEG1Audio(cb OnDataMPEG1AudioFunc)

OnDataMPEG1Audio sets a callback that is called when MPEG-1 Audio data is received.

func (*Reader) OnDataMPEG4Audio added in v1.0.0

func (r *Reader) OnDataMPEG4Audio(cb OnDataMPEG4AudioFunc)

OnDataMPEG4Audio sets a callback that is called when MPEG-4 Audio data is received.

func (*Reader) Read added in v1.0.0

func (r *Reader) Read() error

Read reads data.

func (*Reader) Tracks added in v1.0.0

func (r *Reader) Tracks() (formats.Format, formats.Format)

Tracks returns detected tracks

type Writer added in v1.0.0

type Writer struct {
	// contains filtered or unexported fields
}

Writer is a wrapper around Conn that provides utilities to mux outgoing data.

func NewWriter added in v1.0.0

func NewWriter(conn *Conn, videoTrack formats.Format, audioTrack formats.Format) (*Writer, error)

NewWriter allocates a Writer.

func (*Writer) WriteH264 added in v1.0.0

func (w *Writer) WriteH264(pts time.Duration, dts time.Duration, idrPresent bool, au [][]byte) error

WriteH264 writes H264 data.

func (*Writer) WriteMPEG1Audio added in v1.0.0

func (w *Writer) WriteMPEG1Audio(pts time.Duration, h *mpeg1audio.FrameHeader, frame []byte) error

WriteMPEG1Audio writes MPEG-1 Audio data.

func (*Writer) WriteMPEG4Audio added in v1.0.0

func (w *Writer) WriteMPEG4Audio(pts time.Duration, au []byte) error

WriteMPEG4Audio writes MPEG-4 Audio data.

Directories

Path Synopsis
Package bytecounter contains a reader/writer that allows to count bytes.
Package bytecounter contains a reader/writer that allows to count bytes.
Package chunk implements RTMP chunks.
Package chunk implements RTMP chunks.
Package h264conf contains a H264 configuration parser.
Package h264conf contains a H264 configuration parser.
Package handshake contains the RTMP handshake mechanism.
Package handshake contains the RTMP handshake mechanism.
Package message contains a RTMP message reader/writer.
Package message contains a RTMP message reader/writer.
Package rawmessage contains a RTMP raw message reader/writer.
Package rawmessage contains a RTMP raw message reader/writer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL