rtsp

package
v0.0.1-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2020 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	VideoWidth  int
	VideoHeight int
)

Functions

func GetMD5Hash

func GetMD5Hash(text string) string

func ParseDirective

func ParseDirective(header, name string) string

func ParseMedia

func ParseMedia(header string) []string

func ParseSession

func ParseSession(header string) string

Types

type RTSP

type RTSP struct {
	engine.InputStream
	*RtspClient
	RTSPInfo
}

func (*RTSP) Publish

func (rtsp *RTSP) Publish(streamPath string, rtspUrl string) (result bool)

type RTSPInfo

type RTSPInfo struct {
	SyncCount  int64
	Header     *string
	BufferRate int
	RoomInfo   *engine.RoomInfo
}

type RtspClient

type RtspClient struct {
	OutGoing chan []byte //out chanel
	Signals  chan bool   //Signals quit

	SPS                 []byte
	PPS                 []byte
	Header              string
	AudioSpecificConfig []byte
	// contains filtered or unexported fields
}

func RtspClientNew

func RtspClientNew(bufferLength int) *RtspClient

RtspClientNew 返回空的初始化对象

func (*RtspClient) AuthBasic

func (this *RtspClient) AuthBasic(phase string, message string) bool

func (*RtspClient) AuthDigest

func (this *RtspClient) AuthDigest(phase string, message string) bool

func (*RtspClient) AuthDigest_Only

func (this *RtspClient) AuthDigest_Only(phase string, message string) string

func (*RtspClient) Client

func (this *RtspClient) Client(rtsp_url string) (bool, string)

func (*RtspClient) Close

func (this *RtspClient) Close()

func (*RtspClient) Connect

func (this *RtspClient) Connect() bool

func (*RtspClient) ParseMedia

func (this *RtspClient) ParseMedia(header string) []string

func (*RtspClient) ParseUrl

func (this *RtspClient) ParseUrl(rtsp_url string) bool

func (*RtspClient) Read

func (this *RtspClient) Read() (bool, string)

func (*RtspClient) RtspRtpLoop

func (this *RtspClient) RtspRtpLoop()
	The RTP header has the following format:
    0                   1                   2                   3
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |V=2|P|X|  CC   |M|     PT      |       sequence number         |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                           timestamp                           |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |           synchronization source (SSRC) identifier            |
   +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
   |            contributing source (CSRC) identifiers             |
   |                             ....                              |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   version (V): 2 bits
      This field identifies the version of RTP.  The version defined by
      this specification is two (2).  (The value 1 is used by the first
      draft version of RTP and the value 0 is used by the protocol
      initially implemented in the "vat" audio tool.)
   padding (P): 1 bit
      If the padding bit is set, the packet contains one or more
      additional padding octets at the end which are not part of the
      payload.  The last octet of the padding contains a count of how
      many padding octets should be ignored, including itself.  Padding
      may be needed by some encryption algorithms with fixed block sizes
      or for carrying several RTP packets in a lower-layer protocol data
      unit.
   extension (X): 1 bit
      If the extension bit is set, the fixed header MUST be followed by
      exactly one header extension, with a format defined in Section
      5.3.1.

func (*RtspClient) SendBufer

func (this *RtspClient) SendBufer(bufer []byte)

unsafe!

func (*RtspClient) Write

func (this *RtspClient) Write(message string) bool

Jump to

Keyboard shortcuts

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