Commit Graph

83 Commits

Author SHA1 Message Date
Joni Räsänen 7e41c00716 common: Rename a flag for consistency with other flags 2022-09-21 08:40:07 +03:00
Joni Räsänen 80433cfcc4 common: Move internal definition out from public header 2022-09-19 09:34:02 +03:00
Joni Räsänen 3cd1a0fdaf build: Select default build type on Unix systems 2022-09-12 15:57:40 +03:00
Joni Räsänen f7040a4992 formats: Make restoration of stream the default option
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.
2022-09-08 08:14:52 +03:00
Joni Räsänen 9ee5518147 common: Move socket.hh away from public API
Socket has never been part of the public API.
2022-09-07 14:10:24 +03:00
Joni Räsänen 6b883beb3f formats: Fix frame loss caused by bug in SCL
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.
2022-09-07 12:47:44 +03:00
Joni Räsänen 1e751e051f common: Remove memory leaks shown by Valgrind with tests 2022-09-01 12:18:46 +03:00
Joni Räsänen fef90f154c formats: Improve start code lookup
Refactored so the code is somewhat readable. Added few missing cases
for partial start codes.
2022-09-01 11:25:06 +03:00
Joni Räsänen f915b2aa17 common: Remove most MSVC compiler warnings 2022-08-25 17:30:09 +03:00
Joni Räsänen f9a89f7408 common: Rename all flags to distinguish between types
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.
2022-08-23 09:47:41 +03:00
Joni Räsänen 0d795f5f8a common: Remove buffer expansion feature from receiver 2022-08-19 12:26:31 +03:00
Joni Räsänen 207d3c56ea formats: Aggregate packet may be followed by intra frame with same ts 2022-08-19 12:22:52 +03:00
Joni Räsänen 2e57c2e3a7 formats: Track both dropped and completed frames
This is to prevent completing the same frame twice.
2022-08-19 12:21:10 +03:00
Joni Räsänen 5e304ecc56 common: Fix some of the minor issues pointed out by static clang analysis 2022-08-17 16:13:20 +03:00
Joni Räsänen 3410d70aa3 common: Move debug.hh away from public include
I don't feel that the internal debug print API of uvgRTP needs to be
part of the public API for uvgRTP.
2022-08-17 13:57:49 +03:00
Matt Durgavich 2d378a3161 common: prepend logging macros with UVG_ to avoid collisions. 2022-08-17 01:00:13 -04:00
Joni Räsänen 6f5f4858b6 formats: Simplify the code for h26x FU division 2022-08-16 11:30:55 +03:00
Joni Räsänen 8272b26ab8 formats: Make get_nal_header_from_fu_headers pure virtual in h26x 2022-08-15 09:05:33 +03:00
Joni Räsänen 0b7f4604c9 formats: Make reference discarding disabled by default 2022-07-07 10:55:40 +03:00
Joni Räsänen bca3bdb18e formats: Add RTP flag that can be used to disable SCL
This obsoletes the old RCE flag, that did not work.
2022-07-04 12:01:49 +03:00
Joni Räsänen 9f8a3b2319 formats: Check nal_type so it is the same as previous frame FUs 2022-06-18 18:50:05 +03:00
Joni Räsänen b7ff2777b5 formats: Have only one system of timeout in h26x
The garbage collection is now the only system of timing out frames, the
old one did not make sense to me.
2022-06-17 10:33:22 +03:00
Joni Räsänen 6ed33cb564 formats: Fix off by one error causing crash 2022-06-17 08:39:17 +03:00
Joni Räsänen bfd6d3eff5 formats: Add frag for disabling no reference frame drops 2022-06-17 08:26:18 +03:00
Joni Räsänen 6a6a4afaaa formats: Discard frames which do not have their references 2022-06-16 07:41:42 +03:00
Joni Räsänen ea00db4d12 formats: Streamline the h26x fragment reception 2022-06-16 07:41:41 +03:00
Joni Räsänen a316554760 formats: Change enum to enum class for fragment and nal type 2022-06-16 07:41:41 +03:00
Joni Räsänen 2a8cc733a8 formats: Remove invalid frame drop code
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.
2022-06-16 07:41:41 +03:00
Joni Räsänen 0c8b4ffb1e formats: Clarify the h26x reception with updated comments and vars 2022-06-16 07:41:41 +03:00
Joni Räsänen 4e66be7917 formats: Remove invalid comment 2022-05-13 09:31:04 +03:00
Joni Räsänen 84c66b7c1c formats: Add a way to disable H26x SCL 2022-04-01 08:24:37 +03:00
Joni Räsänen d44936d0e5 formats: Remove warnings from h26x 2022-03-31 14:48:59 +03:00
Joni Räsänen a0a60cb07d formats: Clear aggregation info in case of errors 2022-03-31 14:16:37 +03:00
Joni Räsänen 4ecfedcdc8 formats: Fix dropped frames based on size bug
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.
2022-03-31 10:05:41 +03:00
Joni Räsänen c3c1f60140 formats: Fix not taking the lost start code prefix length
There is still one bug related to length of the packet, uvgRTP seems to
skip payload header length of bytes, which is causing problems.
2022-03-30 10:04:04 +03:00
Joni Räsänen 2321ccd1d1 formats: Move payload calculation to format side from rtp
It makes more sense that format defines its packet structure size
rather than the RTP which should have no knowledge of such.
2022-03-29 15:05:43 +03:00
Joni Räsänen 2fcdd3cc63 formats: Rename variables to reflect RFC specification
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).
2022-03-29 14:55:13 +03:00
Joni Räsänen ec68aaaaa7 formats: Separate aggregate packets, single NAL packets and FU division
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.
2022-03-29 13:24:03 +03:00
Joni Räsänen 84e65f58eb formats: Separate scl from rest of the push frame function 2022-03-28 14:15:47 +03:00
Joni Räsänen 80704e84a7 formats: Add safety check for using non-initiated transaction 2022-03-28 13:01:27 +03:00
Joni Räsänen 9299dade49 formats: Refactor the order and flow of push functions
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.
2022-03-25 13:01:04 +02:00
Joni Räsänen 7e1685da0c formats: Return error in case of incorrect aggregate packet 2022-03-25 12:58:09 +02:00
Joni Räsänen 6918f849b3 formats: Improve dropped frame print 2022-03-25 12:56:39 +02:00
Joni Räsänen c289d357f8 formats: Remove unnecessary extra function from h26x
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.
2022-03-25 08:48:35 +02:00
Joni Räsänen 144b60b5aa formats: Use two helper function in h26x packet_handler
This makes the code clearer.
2022-03-25 07:58:23 +02:00
Joni Räsänen 07a802546e formats: Add send test + comments to distinguish different packet types 2022-03-22 15:10:16 +02:00
Joni Räsänen 59f464e24c formats: Prevent crash if aggregation claims to be larger than packet 2022-03-22 09:03:50 +02:00
Joni Räsänen 48bab5a54f common: Try releasing reserved memory
If a frame was caught in a buffer without querying by user, it would
not get deleted. This commit tries to free those frame buffers.
2022-03-03 13:28:10 +02:00
Joni Räsänen ed8f37eb85 formats: Rename queue filename to match class name
It's just good practice to always have the files named the same as the
class to make finding the files easier.
2022-03-03 12:36:16 +02:00
Joni Räsänen 32839127f4 common: Use shared_ptr for managing socket memory 2022-03-03 10:31:36 +02:00