codecs: Check H265 DPB full before we add the new picture.
The current DPB check of H265 is not very correct. The current frame is already in the DPB when we check whether the DPB is full. For example, the DPB max size is 16 and we have 15 ref frames in the DPB, so the gst_h265_dpb_delete_unused() cleans no one, and then plus the current frame, the DPB is 16 and full. This causes an error return, but in fact, the stream is correct. We should check the DPB full before we insert current frame.
Edited by He Junyan