mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 07:06:58 +08:00
convert Tracks into Medias and Formats (#155)
* split tracks from medias * move tracks into dedicated package * move media into dedicated package * edit Medias.Marshal() in order to return SDP * add medias.Find() and simplify examples * improve coverage * fix rebase errors * replace TrackIDs with MediaIDs * implement media-specific and track-specific callbacks for reading RTCP and RTP packets * rename publish into record, read into play * add v2 tag * rename tracks into formats
This commit is contained in:
42
pkg/format/jpeg.go
Normal file
42
pkg/format/jpeg.go
Normal file
@@ -0,0 +1,42 @@
|
||||
package format
|
||||
|
||||
import (
|
||||
"github.com/pion/rtp"
|
||||
)
|
||||
|
||||
// JPEG is a JPEG format.
|
||||
type JPEG struct{}
|
||||
|
||||
// String implements Format.
|
||||
func (t *JPEG) String() string {
|
||||
return "JPEG"
|
||||
}
|
||||
|
||||
// ClockRate implements Format.
|
||||
func (t *JPEG) ClockRate() int {
|
||||
return 90000
|
||||
}
|
||||
|
||||
// PayloadType implements Format.
|
||||
func (t *JPEG) PayloadType() uint8 {
|
||||
return 26
|
||||
}
|
||||
|
||||
func (t *JPEG) unmarshal(payloadType uint8, clock string, codec string, rtpmap string, fmtp string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Marshal implements Format.
|
||||
func (t *JPEG) Marshal() (string, string) {
|
||||
return "JPEG/90000", ""
|
||||
}
|
||||
|
||||
// Clone implements Format.
|
||||
func (t *JPEG) Clone() Format {
|
||||
return &JPEG{}
|
||||
}
|
||||
|
||||
// PTSEqualsDTS implements Format.
|
||||
func (t *JPEG) PTSEqualsDTS(*rtp.Packet) bool {
|
||||
return true
|
||||
}
|
Reference in New Issue
Block a user