mirror of
https://github.com/livekit/livekit.git
synced 2026-10-23 02:12:44 +00:00
update pion, export vp8munger header (#684)
* update pion, export vp8munger header * fix test
This commit is contained in:
1 parent
710e06b7da
commit
fa53da18e7
7 files changed
+29
-23
No files matched your search
+1
-5
@@ -55,13 +55,9 @@ func ToProtoParticipants(participants []types.LocalParticipant) []*livekit.Parti
|
||||
}
|
||||
|
||||
func ToProtoSessionDescription(sd webrtc.SessionDescription) *livekit.SessionDescription {
|
||||
sdp := sd.SDP
|
||||
// enable mixed of one-byte and two-byte rtp extension
|
||||
// TODO : should move this to pion's option
|
||||
sdp = strings.Replace(sdp, "m=", "a=extmap-allow-mixed\r\nm=", 1)
|
||||
return &livekit.SessionDescription{
|
||||
Type: sd.Type.String(),
|
||||
Sdp: sdp,
|
||||
Sdp: sd.SDP,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -375,11 +375,11 @@ func (d *DownTrack) WriteRTP(extPkt *buffer.ExtPacket, layer int32) error {
|
||||
incomingVP8, _ := extPkt.Payload.(buffer.VP8)
|
||||
|
||||
outbuf := &payload
|
||||
if incomingVP8.HeaderSize != tp.vp8.header.HeaderSize {
|
||||
if incomingVP8.HeaderSize != tp.vp8.Header.HeaderSize {
|
||||
pool = PacketFactory.Get().(*[]byte)
|
||||
outbuf = pool
|
||||
}
|
||||
payload, err = d.translateVP8PacketTo(extPkt.Packet, &incomingVP8, tp.vp8.header, outbuf)
|
||||
payload, err = d.translateVP8PacketTo(extPkt.Packet, &incomingVP8, tp.vp8.Header, outbuf)
|
||||
if err != nil {
|
||||
d.pktsDropped.Inc()
|
||||
return err
|
||||
@@ -389,7 +389,7 @@ func (d *DownTrack) WriteRTP(extPkt *buffer.ExtPacket, layer int32) error {
|
||||
if d.sequencer != nil {
|
||||
meta := d.sequencer.push(extPkt.Packet.SequenceNumber, tp.rtp.sequenceNumber, tp.rtp.timestamp, int8(layer))
|
||||
if meta != nil && tp.vp8 != nil {
|
||||
meta.packVP8(tp.vp8.header)
|
||||
meta.packVP8(tp.vp8.Header)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1003,7 +1003,7 @@ func TestForwarderGetTranslationParamsVideo(t *testing.T) {
|
||||
timestamp: 0xabcdef,
|
||||
},
|
||||
vp8: &TranslationParamsVP8{
|
||||
header: &buffer.VP8{
|
||||
Header: &buffer.VP8{
|
||||
FirstByte: 25,
|
||||
PictureIDPresent: 1,
|
||||
PictureID: 13467,
|
||||
@@ -1079,7 +1079,7 @@ func TestForwarderGetTranslationParamsVideo(t *testing.T) {
|
||||
timestamp: 0xabcdef,
|
||||
},
|
||||
vp8: &TranslationParamsVP8{
|
||||
header: &buffer.VP8{
|
||||
Header: &buffer.VP8{
|
||||
FirstByte: 25,
|
||||
PictureIDPresent: 1,
|
||||
PictureID: 13467,
|
||||
@@ -1160,7 +1160,7 @@ func TestForwarderGetTranslationParamsVideo(t *testing.T) {
|
||||
timestamp: 0xabcdef,
|
||||
},
|
||||
vp8: &TranslationParamsVP8{
|
||||
header: &buffer.VP8{
|
||||
Header: &buffer.VP8{
|
||||
FirstByte: 25,
|
||||
PictureIDPresent: 1,
|
||||
PictureID: 13468,
|
||||
@@ -1256,7 +1256,7 @@ func TestForwarderGetTranslationParamsVideo(t *testing.T) {
|
||||
timestamp: 0xabcdf0,
|
||||
},
|
||||
vp8: &TranslationParamsVP8{
|
||||
header: &buffer.VP8{
|
||||
Header: &buffer.VP8{
|
||||
FirstByte: 25,
|
||||
PictureIDPresent: 1,
|
||||
PictureID: 13469,
|
||||
|
||||
@@ -12,7 +12,7 @@ import (
|
||||
// VP8 munger
|
||||
//
|
||||
type TranslationParamsVP8 struct {
|
||||
header *buffer.VP8
|
||||
Header *buffer.VP8
|
||||
}
|
||||
|
||||
type VP8MungerParams struct {
|
||||
@@ -139,7 +139,7 @@ func (v *VP8Munger) UpdateAndGet(extPkt *buffer.ExtPacket, ordering SequenceNumb
|
||||
HeaderSize: vp8.HeaderSize + buffer.VP8PictureIdSizeDiff(mungedPictureId > 127, vp8.MBit),
|
||||
}
|
||||
return &TranslationParamsVP8{
|
||||
header: vp8Packet,
|
||||
Header: vp8Packet,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ func (v *VP8Munger) UpdateAndGet(extPkt *buffer.ExtPacket, ordering SequenceNumb
|
||||
HeaderSize: vp8.HeaderSize + buffer.VP8PictureIdSizeDiff(mungedPictureId > 127, vp8.MBit),
|
||||
}
|
||||
return &TranslationParamsVP8{
|
||||
header: vp8Packet,
|
||||
Header: vp8Packet,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ func TestOutOfOrderPictureId(t *testing.T) {
|
||||
extPkt, _ = testutils.GetTestExtPacketVP8(params, vp8)
|
||||
|
||||
tpExpected := TranslationParamsVP8{
|
||||
header: &buffer.VP8{
|
||||
Header: &buffer.VP8{
|
||||
FirstByte: 25,
|
||||
PictureIDPresent: 1,
|
||||
PictureID: 13469,
|
||||
@@ -236,7 +236,7 @@ func TestOutOfOrderPictureId(t *testing.T) {
|
||||
extPkt, _ = testutils.GetTestExtPacketVP8(params, vp8)
|
||||
|
||||
tpExpected = TranslationParamsVP8{
|
||||
header: &buffer.VP8{
|
||||
Header: &buffer.VP8{
|
||||
FirstByte: 25,
|
||||
PictureIDPresent: 1,
|
||||
PictureID: 13468,
|
||||
@@ -345,7 +345,7 @@ func TestGapInSequenceNumberSamePicture(t *testing.T) {
|
||||
v.SetLast(extPkt)
|
||||
|
||||
tpExpected := TranslationParamsVP8{
|
||||
header: &buffer.VP8{
|
||||
Header: &buffer.VP8{
|
||||
FirstByte: 25,
|
||||
PictureIDPresent: 1,
|
||||
PictureID: 13467,
|
||||
@@ -367,7 +367,7 @@ func TestGapInSequenceNumberSamePicture(t *testing.T) {
|
||||
|
||||
// telling there is a gap in sequence number will add pictures to missing picture cache
|
||||
tpExpected = TranslationParamsVP8{
|
||||
header: &buffer.VP8{
|
||||
Header: &buffer.VP8{
|
||||
FirstByte: 25,
|
||||
PictureIDPresent: 1,
|
||||
PictureID: 13467,
|
||||
|
||||
Reference in new issue
Block a user