common: Remove unused prohibition optimization
This commit is contained in:
parent
cc79dd0314
commit
3d63ea4074
|
@ -55,28 +55,12 @@ namespace uvgrtp {
|
||||||
struct ext_header *ext = nullptr;
|
struct ext_header *ext = nullptr;
|
||||||
|
|
||||||
size_t padding_len = 0; /* non-zero if frame is padded */
|
size_t padding_len = 0; /* non-zero if frame is padded */
|
||||||
size_t payload_len = 0; /* payload_len: total_len - header_len - padding length (if padded) */
|
|
||||||
|
|
||||||
/* Probation zone is a small area of free-to-use memory for the frame receiver
|
size_t payload_len = 0;
|
||||||
* when handling fragments. For example HEVC fragments that belong to future frames
|
uint8_t* payload = nullptr;
|
||||||
* but cannot be relocated there (start sequence missing) are copied to probation
|
|
||||||
* zone and when the frame becomes active, all fragments in the probation are relocated
|
|
||||||
*
|
|
||||||
* NOTE 1: Probation zone will increase the memory usage and will increase
|
|
||||||
* the internal fragmentation as this memory is not usable for anything else
|
|
||||||
*
|
|
||||||
* NOTE 2: This is a Linux-only optimization */
|
|
||||||
size_t probation_len = 0;
|
|
||||||
size_t probation_off = 0;
|
|
||||||
uint8_t *probation = nullptr;
|
|
||||||
uint8_t *payload = nullptr;
|
|
||||||
|
|
||||||
uint8_t *dgram = nullptr; /* pointer to the UDP datagram (for internal use only) */
|
uint8_t *dgram = nullptr; /* pointer to the UDP datagram (for internal use only) */
|
||||||
size_t dgram_size = 0; /* size of the UDP datagram */
|
size_t dgram_size = 0; /* size of the UDP datagram */
|
||||||
|
|
||||||
rtp_format_t format = RTP_FORMAT_GENERIC;
|
|
||||||
int type = 0;
|
|
||||||
sockaddr_in src_addr = {};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct rtcp_header {
|
struct rtcp_header {
|
||||||
|
@ -168,7 +152,6 @@ namespace uvgrtp {
|
||||||
* RTP_MEMORY_ERROR if allocation of memory failed */
|
* RTP_MEMORY_ERROR if allocation of memory failed */
|
||||||
rtp_frame *alloc_rtp_frame();
|
rtp_frame *alloc_rtp_frame();
|
||||||
rtp_frame *alloc_rtp_frame(size_t payload_len);
|
rtp_frame *alloc_rtp_frame(size_t payload_len);
|
||||||
rtp_frame *alloc_rtp_frame(size_t payload_len, size_t pz_size);
|
|
||||||
|
|
||||||
|
|
||||||
/* Deallocate RTP frame
|
/* Deallocate RTP frame
|
||||||
|
|
21
src/frame.cc
21
src/frame.cc
|
@ -22,7 +22,6 @@ uvgrtp::frame::rtp_frame *uvgrtp::frame::alloc_rtp_frame()
|
||||||
frame->header.ssrc = 0;
|
frame->header.ssrc = 0;
|
||||||
|
|
||||||
frame->payload = nullptr;
|
frame->payload = nullptr;
|
||||||
frame->probation = nullptr;
|
|
||||||
|
|
||||||
return frame;
|
return frame;
|
||||||
}
|
}
|
||||||
|
@ -40,23 +39,6 @@ uvgrtp::frame::rtp_frame *uvgrtp::frame::alloc_rtp_frame(size_t payload_len)
|
||||||
return frame;
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
uvgrtp::frame::rtp_frame *uvgrtp::frame::alloc_rtp_frame(size_t payload_len, size_t pz_size)
|
|
||||||
{
|
|
||||||
uvgrtp::frame::rtp_frame *frame = nullptr;
|
|
||||||
|
|
||||||
if ((frame = uvgrtp::frame::alloc_rtp_frame()) == nullptr)
|
|
||||||
return nullptr;
|
|
||||||
|
|
||||||
frame->probation = new uint8_t[pz_size * MAX_IPV4_MEDIA_PAYLOAD + payload_len];
|
|
||||||
frame->probation_len = pz_size * MAX_IPV4_MEDIA_PAYLOAD;
|
|
||||||
frame->probation_off = 0;
|
|
||||||
|
|
||||||
frame->payload = (uint8_t *)frame->probation + frame->probation_len;
|
|
||||||
frame->payload_len = payload_len;
|
|
||||||
|
|
||||||
return frame;
|
|
||||||
}
|
|
||||||
|
|
||||||
rtp_error_t uvgrtp::frame::dealloc_frame(uvgrtp::frame::rtp_frame *frame)
|
rtp_error_t uvgrtp::frame::dealloc_frame(uvgrtp::frame::rtp_frame *frame)
|
||||||
{
|
{
|
||||||
if (!frame)
|
if (!frame)
|
||||||
|
@ -70,9 +52,6 @@ rtp_error_t uvgrtp::frame::dealloc_frame(uvgrtp::frame::rtp_frame *frame)
|
||||||
delete frame->ext;
|
delete frame->ext;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frame->probation)
|
|
||||||
delete[] frame->probation;
|
|
||||||
|
|
||||||
else if (frame->payload)
|
else if (frame->payload)
|
||||||
delete[] frame->payload;
|
delete[] frame->payload;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue