import { RtcpPacketConverter } from "../../../src" ; import { RtcpPayloadSpecificFeedback } from "../../../src/rtcp/psfb" ; import { FullIntraRequest } from "../../../src/rtcp/psfb/fullIntraRequest" ; describe ( "fullIntraRequest" , ( ) => { test ( "valid" , ( ) => { const data = Buffer . from ( [ 0x84 , 0xce , 0x00 , 0x03 , 0x00 , 0x00 , 0x00 , 0x00 , 0x4b , 0xc4 , 0xfc , 0xb4 , 0x12 , 0x34 , 0x56 , 0x78 , 0x42 , 0x00 , 0x00 , 0x00 , ] ) ; const [ psfb ] = RtcpPacketConverter . deSerialize ( data ) as [ RtcpPayloadSpecificFeedback ] ; const fir = psfb . feedback as FullIntraRequest ; expect ( fir . senderSsrc ) . toBe ( 0 ) ; expect ( fir . mediaSsrc ) . toBe ( 0x4bc4fcb4 ) ; expect ( fir . fir ) . toEqual ( [ { ssrc : 0x12345678 , sequenceNumber : 0x42 } ] ) ; expect ( psfb . serialize ( ) ) . toEqual ( data ) ; } ) ; } ) ;