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:
Alessandro Ros
2025-02-19 22:00:49 +01:00
committed by GitHub
parent 55556f1ecf
commit a17e1f776e
26 changed files with 1978 additions and 647 deletions

View File

@@ -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
}