rtmp

package
v0.0.0-...-40768b1 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EmptyID = ""
)

Functions

This section is empty.

Types

type FFProbeData

type FFProbeData struct {
	Streams []FFProbeDataStream `json:"streams"`
	Format  FFProbeDataFormat   `json:"format"`
}

func (FFProbeData) GetAudio

func (d FFProbeData) GetAudio() FFProbeDataStream

func (FFProbeData) GetVideo

func (d FFProbeData) GetVideo() FFProbeDataStream

type FFProbeDataFormat

type FFProbeDataFormat struct {
	FormatLongName string            `json:"format_long_name"`
	Duration       string            `json:"duration"`
	Filename       string            `json:"filename"`
	NbPrograms     float64           `json:"nb_programs"`
	FormatName     string            `json:"format_name"`
	StartTime      string            `json:"start_time"`
	ProbeScore     float64           `json:"probe_score"`
	Tags           map[string]string `json:"tags"`
	NbStreams      float64           `json:"nb_streams"`
}

type FFProbeDataStream

type FFProbeDataStream struct {
	AvgFrameRate       string                       `json:"avg_frame_rate"`
	CodecName          string                       `json:"codec_name"`
	CodecType          string                       `json:"codec_type"`
	SampleFmt          string                       `json:"sample_fmt"`
	BitsPerSample      float64                      `json:"bits_per_sample"`
	RFrameRate         string                       `json:"r_frame_rate"`
	Profile            string                       `json:"profile"`
	Channels           float64                      `json:"channels"`
	StartPts           float64                      `json:"start_pts"`
	BitRate            string                       `json:"bit_rate"`
	Index              float64                      `json:"index"`
	ChannelLayout      string                       `json:"channel_layout"`
	TimeBase           string                       `json:"time_base"`
	CodecLongName      string                       `json:"codec_long_name"`
	CodecTagString     string                       `json:"codec_tag_string"`
	CodecTag           string                       `json:"codec_tag"`
	SampleRate         string                       `json:"sample_rate"`
	StartTime          string                       `json:"start_time"`
	FilmGrain          float64                      `json:"film_grain"`
	HasBFrames         float64                      `json:"has_b_frames"`
	ColorSpace         string                       `json:"color_space"`
	FieldOrder         string                       `json:"field_order"`
	ClosedCaptions     float64                      `json:"closed_captions"`
	PixFmt             string                       `json:"pix_fmt"`
	Level              float64                      `json:"level"`
	ColorTransfer      string                       `json:"color_transfer"`
	IsAvc              string                       `json:"is_avc"`
	SampleAspectRatio  string                       `json:"sample_aspect_ratio"`
	ColorRange         string                       `json:"color_range"`
	ColorPrimaries     string                       `json:"color_primaries"`
	NalLengthSize      string                       `json:"nal_length_size"`
	Height             float64                      `json:"height"`
	DisplayAspectRatio string                       `json:"display_aspect_ratio"`
	CodedHeight        float64                      `json:"coded_height"`
	Width              float64                      `json:"width"`
	CodedWidth         float64                      `json:"coded_width"`
	ChromaLocation     string                       `json:"chroma_location"`
	Refs               float64                      `json:"refs"`
	BitsPerRawSample   string                       `json:"bits_per_raw_sample"`
	Disposition        FFProbeDataStreamDisposition `json:"disposition"`
}

type FFProbeDataStreamDisposition

type FFProbeDataStreamDisposition struct {
	AttachedPic     float64 `json:"attached_pic"`
	TimedThumbnails float64 `json:"timed_thumbnails"`
	Metadata        float64 `json:"metadata"`
	HearingImpaired float64 `json:"hearing_impaired"`
	Karaoke         float64 `json:"karaoke"`
	CleanEffects    float64 `json:"clean_effects"`
	Descriptions    float64 `json:"descriptions"`
	Comment         float64 `json:"comment"`
	Original        float64 `json:"original"`
	Lyrics          float64 `json:"lyrics"`
	Dependent       float64 `json:"dependent"`
	Dub             float64 `json:"dub"`
	Forced          float64 `json:"forced"`
	VisualImpaired  float64 `json:"visual_impaired"`
	Captions        float64 `json:"captions"`
	StillImage      float64 `json:"still_image"`
	Default         float64 `json:"default"`
}

type GetInFo

type GetInFo interface {
	GetInfo() (string, string, string)
}

type PackWriterCloser

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

func (*PackWriterCloser) GetWriter

func (p *PackWriterCloser) GetWriter() av.WriteCloser

type RtmpStream

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

func NewRtmpStream

func NewRtmpStream() *RtmpStream

func (*RtmpStream) CheckAlive

func (rs *RtmpStream) CheckAlive()

func (*RtmpStream) GetStreams

func (rs *RtmpStream) GetStreams() *sync.Map

func (*RtmpStream) HandleReader

func (rs *RtmpStream) HandleReader(r av.ReadCloser)

func (*RtmpStream) HandleWriter

func (rs *RtmpStream) HandleWriter(w av.WriteCloser)

type Server

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

func NewRtmpServer

func NewRtmpServer(gCtx global.Context, h av.Handler) *Server

func (*Server) Serve

func (s *Server) Serve(listener net.Listener)

type StaticsBW

type StaticsBW struct {
	VideoDataInBytes uint64
	AudioDataInBytes uint64
}

type Stream

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

func NewStream

func NewStream() *Stream

func (*Stream) AddReader

func (s *Stream) AddReader(r av.ReadCloser)

func (*Stream) AddWriter

func (s *Stream) AddWriter(w av.WriteCloser)

func (*Stream) CheckAlive

func (s *Stream) CheckAlive() (n int)

func (*Stream) Copy

func (s *Stream) Copy(dst *Stream)

func (*Stream) GetReader

func (s *Stream) GetReader() av.ReadCloser

func (*Stream) GetWs

func (s *Stream) GetWs() *sync.Map

func (*Stream) ID

func (s *Stream) ID() string

func (*Stream) TransStart

func (s *Stream) TransStart()

func (*Stream) TransStop

func (s *Stream) TransStop()

type StreamReadWriteCloser

type StreamReadWriteCloser interface {
	GetInFo
	Close() error
	Write(core.ChunkStream) error
	Read(c *core.ChunkStream) error
}

type VirReader

type VirReader struct {
	Uid string
	Key string
	av.RWBaser

	ReadBWInfo StaticsBW
	// contains filtered or unexported fields
}

func NewVirReader

func NewVirReader(conn StreamReadWriteCloser, id string, key string) *VirReader

func (*VirReader) Close

func (v *VirReader) Close(err error)

func (*VirReader) Info

func (v *VirReader) Info() (ret av.Info)

func (*VirReader) Read

func (v *VirReader) Read(p *av.Packet) (err error)

func (*VirReader) SaveStatics

func (v *VirReader) SaveStatics(length uint64, isVideoFlag bool)

type VirWriter

type VirWriter struct {
	Uid string

	av.RWBaser
	// contains filtered or unexported fields
}

func NewVirWriter

func NewVirWriter(conn StreamReadWriteCloser) *VirWriter

func (*VirWriter) Check

func (v *VirWriter) Check()

func (*VirWriter) Close

func (v *VirWriter) Close(err error)

func (*VirWriter) DropPacket

func (v *VirWriter) DropPacket(pktQue chan *av.Packet, info av.Info)

func (*VirWriter) Info

func (v *VirWriter) Info() (ret av.Info)

func (*VirWriter) SendPacket

func (v *VirWriter) SendPacket() error

func (*VirWriter) Write

func (v *VirWriter) Write(p *av.Packet) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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