mjpeg

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encoder added in v1.9.3

func Encoder(codec *core.Codec, handler core.HandlerFunc) core.HandlerFunc

func FixJPEG added in v1.9.1

func FixJPEG(b []byte) []byte

FixJPEG - reencode JPEG if it has wrong header

for example, this app produce "bad" images: https://github.com/jacksonliam/mjpg-streamer

and they can't be uploaded to the Telegram servers: {"ok":false,"error_code":400,"description":"Bad Request: IMAGE_PROCESS_FAILED"}

func MakeHeaders

func MakeHeaders(p []byte, t byte, w, h uint16, lqt, cqt []byte) []byte

func MakeHuffmanHeader

func MakeHuffmanHeader(p, codelens, symbols []byte, tableNo, tableClass byte) []byte

func MakeQuantHeader

func MakeQuantHeader(p []byte, qt []byte, tableNo byte) []byte

func MakeTables

func MakeTables(q byte) (lqt, cqt []byte)

func NewWriter added in v1.9.2

func NewWriter(w io.Writer) io.Writer

func RTPDepay

func RTPDepay(handlerFunc core.HandlerFunc) core.HandlerFunc

func RTPPay

func RTPPay(handlerFunc core.HandlerFunc) core.HandlerFunc

func Transcode added in v1.2.0

func Transcode(b []byte) ([]byte, error)

Types

type Client

type Client struct {
	core.Listener

	UserAgent  string
	RemoteAddr string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(res *http.Response) *Client

func (*Client) GetMedias

func (c *Client) GetMedias() []*core.Media

func (*Client) GetTrack

func (c *Client) GetTrack(media *core.Media, codec *core.Codec) (*core.Receiver, error)

func (*Client) Handle added in v1.7.0

func (c *Client) Handle() error

func (*Client) MarshalJSON

func (c *Client) MarshalJSON() ([]byte, error)

func (*Client) Start

func (c *Client) Start() error

func (*Client) Stop

func (c *Client) Stop() error

type Consumer

type Consumer struct {
	core.SuperConsumer
	// contains filtered or unexported fields
}

func NewConsumer added in v1.7.0

func NewConsumer() *Consumer

func (*Consumer) AddTrack

func (c *Consumer) AddTrack(media *core.Media, _ *core.Codec, track *core.Receiver) error

func (*Consumer) Stop added in v1.3.0

func (c *Consumer) Stop() error

func (*Consumer) WriteTo added in v1.7.0

func (c *Consumer) WriteTo(wr io.Writer) (int64, error)

Jump to

Keyboard shortcuts

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