@@ -597,16 +597,25 @@ void RtcpRemb::setBitrate(unsigned int numSSRC, unsigned int in_bitrate) {
597597 }
598598
599599 // "length" in packet is one less than the number of 32 bit words in the packet.
600- header.header .setLength (uint16_t ((offsetof (RtcpRemb, _ssrc ) / sizeof (uint32_t )) - 1 + numSSRC));
600+ header.header .setLength (uint16_t ((offsetof (RtcpRemb, _ssrcs ) / sizeof (uint32_t )) - 1 + numSSRC));
601601
602602 _bitrate = htonl ((numSSRC << (32u - 8u )) | (exp << (32u - 8u - 6u )) | in_bitrate);
603603}
604604
605- void RtcpRemb::setSsrc (int iterator, SSRC newSssrc) { _ssrc[iterator] = htonl (newSssrc); }
605+ SSRC RtcpRemb::getSSRC (int num) const {
606+ if (num < 0 || static_cast <unsigned >(num) >= getNumSSRC ())
607+ throw std::out_of_range (" SSRC num out of range" );
608+ return ntohl (_ssrcs[num]);
609+ }
610+ void RtcpRemb::setSSRC (int num, SSRC newSsrc) {
611+ if (num < 0 || static_cast <unsigned >(num) >= getNumSSRC ())
612+ throw std::out_of_range (" SSRC num out of range" );
613+ _ssrcs[num] = htonl (newSsrc);
614+ }
606615
607- unsigned int RtcpRemb::getNumSSRC () { return ntohl (_bitrate) >> 24u ; }
616+ unsigned int RtcpRemb::getNumSSRC () const { return ntohl (_bitrate) >> 24u ; }
608617
609- unsigned int RtcpRemb::getBitrate () {
618+ unsigned int RtcpRemb::getBitrate () const {
610619 uint32_t br = ntohl (_bitrate);
611620 uint8_t exp = (br << 8u ) >> 26u ;
612621 return (br & 0x3FFFF ) * static_cast <unsigned int >(pow (2 , exp));
0 commit comments