mirror of
https://github.com/aler9/gortsplib
synced 2025-10-29 01:33:00 +08:00
improve examples (#703)
* add client-play-format-av1-to-jpeg * improve client-play-format-av1 to decode frames * improve speed of sample decoders by using pointers instead of copies * improve client-record-format-h264 and client-record-format-h265 to encode frames * add client-record-format-av1
This commit is contained in:
@@ -69,11 +69,6 @@ func (e *Encoder) Init() error {
|
||||
|
||||
// Encode encodes OBUs into RTP packets.
|
||||
func (e *Encoder) Encode(obus [][]byte) ([]*rtp.Packet, error) {
|
||||
isKeyFrame, err := av1.IsRandomAccess(obus)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var curPacket *rtp.Packet
|
||||
var packets []*rtp.Packet
|
||||
curPayloadLen := 0
|
||||
@@ -138,7 +133,7 @@ func (e *Encoder) Encode(obus [][]byte) ([]*rtp.Packet, error) {
|
||||
|
||||
finalizeCurPacket(false)
|
||||
|
||||
if isKeyFrame {
|
||||
if av1.IsRandomAccess2(obus) {
|
||||
packets[0].Payload[0] |= 1 << 3
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user