formats: Make reference discarding disabled by default

This commit is contained in:
Joni Räsänen 2022-07-07 09:57:22 +03:00
parent 8340f428dd
commit 0b7f4604c9
2 changed files with 7 additions and 5 deletions

View File

@ -163,10 +163,12 @@ enum RTP_CTX_ENABLE_FLAGS {
* most cases. */
RCE_H26X_PREPEND_SC = 1 << 3,
/** By default, uvgRTP discards inter frames until an intra (key) frame has been
* received in case a frame is dropped. This flag disables this behavior and frames
* without dependencies are let through. */
RCE_H26X_NO_DEPENDENCY_ENFORCEMENT = 1 << 4,
/** Obsolete */
RCE_H26X_NO_DEPENDENCY_ENFORCEMENT = 0,
/** Use this flag to discard inter frames that don't have their previous dependencies
arrived. Does not work if the dependencies are not in monotonic order. */
RCE_H26X_DEPENDENCY_ENFORCEMENT = 1 << 4,
/** Fragment generic frames into RTP packets of 1500 bytes.
*

View File

@ -694,7 +694,7 @@ rtp_error_t uvgrtp::formats::h26x::packet_handler(int flags, uvgrtp::frame::rtp_
// have we received every fragment and can the frame can be reconstructed?
if (received == frames_[fragment_ts].received_packet_seqs.size()) {
bool enable_reference_discarding = !(flags & RCE_H26X_NO_DEPENDENCY_ENFORCEMENT);
bool enable_reference_discarding = (flags & RCE_H26X_DEPENDENCY_ENFORCEMENT);
// here we discard inter frames if their references were not received correctly
if (discard_until_key_frame_ && enable_reference_discarding) {
if (nal_type == uvgrtp::formats::NAL_TYPE::NT_INTER) {