link to mediacommon (#223)

* move codecs and bits to mediacommon

* add SafeSetParams() to H264 and H265

* update README
This commit is contained in:
Alessandro Ros
2023-04-01 16:38:08 +02:00
committed by GitHub
parent af3ed2bd83
commit f905598d2e
287 changed files with 329 additions and 6381 deletions

View File

@@ -10,43 +10,43 @@ import (
type MJPEG struct{}
// String implements Format.
func (t *MJPEG) String() string {
func (f *MJPEG) String() string {
return "M-JPEG"
}
// ClockRate implements Format.
func (t *MJPEG) ClockRate() int {
func (f *MJPEG) ClockRate() int {
return 90000
}
// PayloadType implements Format.
func (t *MJPEG) PayloadType() uint8 {
func (f *MJPEG) PayloadType() uint8 {
return 26
}
func (t *MJPEG) unmarshal(payloadType uint8, clock string, codec string, rtpmap string, fmtp map[string]string) error {
func (f *MJPEG) unmarshal(payloadType uint8, clock string, codec string, rtpmap string, fmtp map[string]string) error {
return nil
}
// Marshal implements Format.
func (t *MJPEG) Marshal() (string, map[string]string) {
func (f *MJPEG) Marshal() (string, map[string]string) {
return "JPEG/90000", nil
}
// PTSEqualsDTS implements Format.
func (t *MJPEG) PTSEqualsDTS(*rtp.Packet) bool {
func (f *MJPEG) PTSEqualsDTS(*rtp.Packet) bool {
return true
}
// CreateDecoder creates a decoder able to decode the content of the format.
func (t *MJPEG) CreateDecoder() *rtpmjpeg.Decoder {
func (f *MJPEG) CreateDecoder() *rtpmjpeg.Decoder {
d := &rtpmjpeg.Decoder{}
d.Init()
return d
}
// CreateEncoder creates an encoder able to encode the content of the format.
func (t *MJPEG) CreateEncoder() *rtpmjpeg.Encoder {
func (f *MJPEG) CreateEncoder() *rtpmjpeg.Encoder {
e := &rtpmjpeg.Encoder{}
e.Init()
return e