Delete unused RTPFragmentationHeader members
Deleted fragmentationTimeDiff and fragmentationPlType. Unused since cl https://webrtc-review.googlesource.com/c/src/+/134212. Bug: webrtc:6471 Change-Id: I36b45be6f6babeda5a5f172c1f1a3876bb752e7f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134308 Commit-Queue: Niels Moller <nisse@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Oskar Sundbom <ossu@webrtc.org> Reviewed-by: Kári Helgason <kthelgason@webrtc.org> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27972}
This commit is contained in:
@ -21,9 +21,7 @@ namespace webrtc {
|
||||
RTPFragmentationHeader::RTPFragmentationHeader()
|
||||
: fragmentationVectorSize(0),
|
||||
fragmentationOffset(nullptr),
|
||||
fragmentationLength(nullptr),
|
||||
fragmentationTimeDiff(nullptr),
|
||||
fragmentationPlType(nullptr) {}
|
||||
fragmentationLength(nullptr) {}
|
||||
|
||||
RTPFragmentationHeader::RTPFragmentationHeader(RTPFragmentationHeader&& other)
|
||||
: RTPFragmentationHeader() {
|
||||
@ -39,8 +37,6 @@ RTPFragmentationHeader& RTPFragmentationHeader::operator=(
|
||||
RTPFragmentationHeader::~RTPFragmentationHeader() {
|
||||
delete[] fragmentationOffset;
|
||||
delete[] fragmentationLength;
|
||||
delete[] fragmentationTimeDiff;
|
||||
delete[] fragmentationPlType;
|
||||
}
|
||||
|
||||
void swap(RTPFragmentationHeader& a, RTPFragmentationHeader& b) {
|
||||
@ -48,8 +44,6 @@ void swap(RTPFragmentationHeader& a, RTPFragmentationHeader& b) {
|
||||
swap(a.fragmentationVectorSize, b.fragmentationVectorSize);
|
||||
swap(a.fragmentationOffset, b.fragmentationOffset);
|
||||
swap(a.fragmentationLength, b.fragmentationLength);
|
||||
swap(a.fragmentationTimeDiff, b.fragmentationTimeDiff);
|
||||
swap(a.fragmentationPlType, b.fragmentationPlType);
|
||||
}
|
||||
|
||||
void RTPFragmentationHeader::CopyFrom(const RTPFragmentationHeader& src) {
|
||||
@ -65,10 +59,6 @@ void RTPFragmentationHeader::CopyFrom(const RTPFragmentationHeader& src) {
|
||||
fragmentationOffset = nullptr;
|
||||
delete[] fragmentationLength;
|
||||
fragmentationLength = nullptr;
|
||||
delete[] fragmentationTimeDiff;
|
||||
fragmentationTimeDiff = nullptr;
|
||||
delete[] fragmentationPlType;
|
||||
fragmentationPlType = nullptr;
|
||||
|
||||
if (src.fragmentationVectorSize > 0) {
|
||||
// allocate new
|
||||
@ -78,12 +68,6 @@ void RTPFragmentationHeader::CopyFrom(const RTPFragmentationHeader& src) {
|
||||
if (src.fragmentationLength) {
|
||||
fragmentationLength = new size_t[src.fragmentationVectorSize];
|
||||
}
|
||||
if (src.fragmentationTimeDiff) {
|
||||
fragmentationTimeDiff = new uint16_t[src.fragmentationVectorSize];
|
||||
}
|
||||
if (src.fragmentationPlType) {
|
||||
fragmentationPlType = new uint8_t[src.fragmentationVectorSize];
|
||||
}
|
||||
}
|
||||
// set new size
|
||||
fragmentationVectorSize = src.fragmentationVectorSize;
|
||||
@ -99,14 +83,6 @@ void RTPFragmentationHeader::CopyFrom(const RTPFragmentationHeader& src) {
|
||||
memcpy(fragmentationLength, src.fragmentationLength,
|
||||
src.fragmentationVectorSize * sizeof(size_t));
|
||||
}
|
||||
if (src.fragmentationTimeDiff) {
|
||||
memcpy(fragmentationTimeDiff, src.fragmentationTimeDiff,
|
||||
src.fragmentationVectorSize * sizeof(uint16_t));
|
||||
}
|
||||
if (src.fragmentationPlType) {
|
||||
memcpy(fragmentationPlType, src.fragmentationPlType,
|
||||
src.fragmentationVectorSize * sizeof(uint8_t));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -133,26 +109,6 @@ void RTPFragmentationHeader::Resize(size_t size) {
|
||||
memcpy(fragmentationLength, oldLengths, sizeof(size_t) * oldVectorSize);
|
||||
delete[] oldLengths;
|
||||
}
|
||||
// time diff
|
||||
{
|
||||
uint16_t* oldTimeDiffs = fragmentationTimeDiff;
|
||||
fragmentationTimeDiff = new uint16_t[size16];
|
||||
memset(fragmentationTimeDiff + oldVectorSize, 0,
|
||||
sizeof(uint16_t) * (size16 - oldVectorSize));
|
||||
memcpy(fragmentationTimeDiff, oldTimeDiffs,
|
||||
sizeof(uint16_t) * oldVectorSize);
|
||||
delete[] oldTimeDiffs;
|
||||
}
|
||||
// payload type
|
||||
{
|
||||
uint8_t* oldTimePlTypes = fragmentationPlType;
|
||||
fragmentationPlType = new uint8_t[size16];
|
||||
memset(fragmentationPlType + oldVectorSize, 0,
|
||||
sizeof(uint8_t) * (size16 - oldVectorSize));
|
||||
memcpy(fragmentationPlType, oldTimePlTypes,
|
||||
sizeof(uint8_t) * oldVectorSize);
|
||||
delete[] oldTimePlTypes;
|
||||
}
|
||||
fragmentationVectorSize = size16;
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,18 +44,13 @@ class RTC_EXPORT RTPFragmentationHeader {
|
||||
|
||||
size_t Offset(size_t index) const { return fragmentationOffset[index]; }
|
||||
size_t Length(size_t index) const { return fragmentationLength[index]; }
|
||||
uint16_t TimeDiff(size_t index) const { return fragmentationTimeDiff[index]; }
|
||||
int PayloadType(size_t index) const { return fragmentationPlType[index]; }
|
||||
|
||||
// TODO(danilchap): Move all members to private section,
|
||||
// simplify by replacing 4 raw arrays with single std::vector<Fragment>
|
||||
// simplify by replacing raw arrays with single std::vector<Fragment>
|
||||
uint16_t fragmentationVectorSize; // Number of fragmentations
|
||||
size_t* fragmentationOffset; // Offset of pointer to data for each
|
||||
// fragmentation
|
||||
size_t* fragmentationLength; // Data size for each fragmentation
|
||||
uint16_t* fragmentationTimeDiff; // Timestamp difference relative "now" for
|
||||
// each fragmentation
|
||||
uint8_t* fragmentationPlType; // Payload type of each fragmentation
|
||||
};
|
||||
|
||||
// Interface used by the CallStats class to distribute call statistics.
|
||||
|
||||
Reference in New Issue
Block a user