This may break some implementation if they don't want start code prefix
for some reason or if they already implemented start code prefix in
their code.
Those who implemented themselves are using an inferior solution
(one extra stream copy for fragmented frames) and should update anyway.
Those who use the flag will just get a warning to update their flags.
Those whose decoder doesn't want start code prefix may not work without
adding a flag.
There was a mistake in fef90f154c. I'm
still not 100% sure how the SCL code works, but as long as it works,
I'm happy. At least it is more readable than before.
I've already created one bug by not being able to distinguish between
different flags. uvgRTP has four types of flags: enable, context, rtp
and socket. I'm planning on adding one more flag type which makes this
a good point to rename all flags.
The code doesn't seem to work and the code does not solve the problem
of invalid frames getting through very well. Should be replaced with a
full solution that discards invalid frames.
The allowed payload sizes were calculated slightly incorrectly and
this caused frames with sizes near the allowed frame size to be not
sent or sent incorrectly. Now all these errors should be fixed.
uvgRTP was using incorrect terms in few places which made the code more
difficult to understand. This commit fixes this by changing NAL header
(incorrect) to payload header (correct).
These were somewhat mixed together before this commit and now they are
clearly divided into their own functions, making fixes and expansions
easier.
Also removed some unnecessary code from aggregate packets.
Funnily, this commit made the different formats behave in the same
way in regards to lost frames bug (sizes 1444 - 1449 are lost), whereas
previously different sizes were lost for different formats. Unsure if
this is a good or a bad thing.
There is a bug in uvgRTP which drops certain size frames and it seems
to be located in push functions of h26x. I will continue to refactor
them until I either find the cause or I conclude that the problem is
elsewhere.
There were so many push_frame functions that I removed the least
necessary to help better making sense of the flow and modifications
a little bit easier.