Commit Graph

181 Commits

Author SHA1 Message Date
Scott Lamb
8caa1d9ae3 rename ReceivedCompoundPacket::context -> ctx
The latter matches other types within Retina.
2022-05-11 08:29:23 -07:00
Scott Lamb
eecea0b474 update changelog for new msrv 2022-05-10 16:53:19 -07:00
Scott Lamb
6bc3b004a4 Merge branch 'main' into next 2022-05-10 16:52:58 -07:00
Scott Lamb
511e968733 bump minimum Rust to 1.59
27c5ed5 uses destructuring assignments, introduced in this version.
Should address this CI failure:
https://github.com/scottlamb/retina/actions/runs/2303800235
2022-05-10 16:03:33 -07:00
Scott Lamb
27c5ed5f04 expose RTCP compound packets
...and rename `PacketItem` variants to `Rtp` and `Rtcp` for brevity.

Fixes #59
2022-05-10 15:58:54 -07:00
Scott Lamb
06d7150989 fix inverted condition in mp4 bug
This caused it to say every video frame had new parameters.
2022-05-10 15:58:54 -07:00
Scott Lamb
2530014cce ignore unparseable rtptime values
https://github.com/scottlamb/moonfire-nvr/issues/224
2022-05-09 12:57:20 -07:00
Scott Lamb
2cc35d1733 shrink Presentation by a word 2022-04-30 16:16:08 -07:00
Scott Lamb
a5e198b0cf use accessors for fields in Stream
* and take advantage of it to use `Box<str>` rather than `String`
  in a couple places (saving a couple words)
* also rename clock_rate to clock_rate_hz for clarity
2022-04-30 12:26:27 -07:00
Scott Lamb
2bbc847754 replace new_parameters with has_new_parameters
As described in #47
2022-04-30 12:08:01 -07:00
Scott Lamb
efc02236d5 use accessors for most codec fields for #47
I left alone `VideoFrame::new_parameters`, as I'll likely eliminate it
as described in #47.
2022-04-30 11:40:28 -07:00
Scott Lamb
f94e2f78d3 fix typo in comment 2022-04-29 12:52:04 -07:00
Scott Lamb
2c8832d02b clippy 2022-04-28 22:31:31 -07:00
Scott Lamb
3b9c6b8719 bump minimum Rust version to 1.56
The last commit needs at least 1.53 for its use of array's IntoIterator
impl. We might as well bump up to 1.56 and take advantage of the 2021
edition.
2022-04-28 22:19:20 -07:00
Scott Lamb
d664f6b1af bump version 2022-04-28 16:14:09 -07:00
Scott Lamb
2e34bf927e revamp Packet type
As described in #47 and #58: revamp this type to keep the full raw
packet, and provide accessors rather than raw fields. It's also
smaller now, which is nice.
2022-04-28 16:13:05 -07:00
Scott Lamb
7ea09dde3c make item enums non_exhaustive 2022-04-28 16:13:05 -07:00
Scott Lamb
1646142322 take transport options at setup time 2022-04-28 16:13:05 -07:00
Scott Lamb
8744bf52d3 split PacketContext and StreamContext
As listed in #47.

This improves throughput in the client/h264 benchmark by about 20%,
I think because we copy fewer bytes around. CodecItem went from 256
bytes to 176.
2022-04-28 16:12:54 -07:00
Scott Lamb
1bbaf29dc9 setup should take a SetupOptions 2022-04-28 15:16:39 -07:00
Scott Lamb
7879414ff8 decruft interface 2022-04-28 15:16:39 -07:00
Scott Lamb
f335e6cbd4 remove deprecated methods 2022-04-28 15:16:39 -07:00
Scott Lamb
1ea14cbfaf fix roundtrip_h264 fuzz test bitrot
This broke with 6155d4eb.
2022-04-28 15:15:49 -07:00
Scott Lamb
1a36e4f252 fix broken doc links 2022-04-27 22:34:30 -07:00
Scott Lamb
9bc2c8eca5 fix typo in RTCP padding parsing
This was accidentally looking at the bottom bit of the V=2 field, so
it effectively never subtracted padding from the payload.

This bug didn't have any effect...yet. We currently only support
parsing the sender report. RFC 3550 says that SRs are sent
in "compound packets" that start with the SR and have at least one
other entry (a CNAME). Only the last packet within the compound packet
can have padding, so it's never come up in SR parsing. Fix this bug now
before we start parsing more things and run into trouble.
2022-04-27 22:23:55 -07:00
Scott Lamb
375754a88f cleanup: use LimitedHex in another spot 2022-04-13 20:07:28 -07:00
Scott Lamb
c58ac94fe4 CI: fix clippy flags 2022-04-12 14:24:35 -07:00
Scott Lamb
decab965a3 prepare v0.3.9 2022-04-12 14:19:24 -07:00
Scott Lamb
0bd76e1346 cargo fmt 2022-04-12 14:19:24 -07:00
Scott Lamb
70294f4641 improve debug logging on wrong ssrc
As described here:
https://github.com/scottlamb/moonfire-nvr/issues/209#issuecomment-1083307174
2022-04-12 14:14:58 -07:00
Scott Lamb
e358f0cd0c make clippy warnings fail on CI 2022-04-12 14:09:58 -07:00
Scott Lamb
ed7be5da0e remove extra blank line in hexdump output 2022-04-12 14:06:29 -07:00
Scott Lamb
3153355807 clarify tokio runtime expectations 2022-04-12 13:22:44 -07:00
Scott Lamb
31515887de FromStr, Display for UnassignedChannelDataPolicy 2022-04-12 13:02:34 -07:00
Scott Lamb
c887998636 mp4 example: mid-stream video param changes
https://github.com/scottlamb/moonfire-nvr/issues/217
2022-04-11 21:47:46 -07:00
Scott Lamb
7cbe39213d support ignoring msgs on unassigned RTSP channels
https://github.com/scottlamb/moonfire-nvr/issues/213#issuecomment-1089411093
2022-04-08 15:37:37 -07:00
Scott Lamb
ba8b00b4fd clippy 2022-04-05 13:17:31 -07:00
Scott Lamb
1ee6d95cc3 tweak handling of data on unassigned channels
*   Call `note_stale_live555_data` when this happens in playing state.
    This makes it more consistent with what happens while waiting for
    a response in the described state, or in playing state on an
    assigned channel.
*   Print a hex dump of some initial bytes, enough to analyze it to
    see if it looks like RTP or RTCP, what the ssrc is, etc. And do the
    same for other places we log (parts of) packets.
2022-04-05 13:16:23 -07:00
Scott Lamb
1e733ab0c4 cargo fmt fix 2022-04-04 19:38:29 -07:00
Scott Lamb
31080f324d ignore trailing spaces in rtpmap attribute
https://github.com/scottlamb/moonfire-nvr/issues/213
2022-04-04 19:35:34 -07:00
Scott Lamb
27bc8caf04 fix out-of-date cmd name in README 2022-04-04 16:05:25 -07:00
Scott Lamb
443de81c0d better debug output on SDP parse failure
https://github.com/scottlamb/moonfire-nvr/issues/213#issuecomment-1086927479
2022-04-04 15:44:14 -07:00
Scott Lamb
d49e77a668 API and example for printing a session's SDP
This is useful for debugging.
2022-04-04 15:08:52 -07:00
Scott Lamb
76d5d883fa tweak TeardownPolicy::Auto
Now when using TCP, it makes some attempt to send a TEARDOWN, even when
the server is not known to be affected by live555 bugs.
2022-04-01 21:25:20 -07:00
Scott Lamb
3cc7381056 improve debuggability of stale session tracking
*   export a `Session::tool` to allow callers to see the server's
    version. Servers have many quirks (including but not limited to
    the live555 version bug), and exposing this can help hunt them down.
*   call out when we see the live555 stale session bug with a tool not
    known to be affected.
*   in several log messages, identify the session group and stale
    session seqnum.
*   add a `log::trace!` for status within
    `SessionGroup::await_stale_sessions`, just in case I get really
    puzzled again.
2022-04-01 21:06:52 -07:00
Scott Lamb
3b4a6ba985 update deps 2022-04-01 16:07:48 -07:00
Scott Lamb
fd7c5a3eb0 fix bench; test it properly on CI 2022-04-01 10:09:23 -07:00
Scott Lamb
9b4f50231c prepare v0.3.8 2022-03-08 10:37:49 -08:00
Scott Lamb
aff87d1919 fix possible panic reading data from server
Found by inspection. It'd be nice to fuzz the tokio module to more
reliably find problems like this, but it looks like I'd have to make
a bunch more stuff public for that. Maybe later...
2022-03-08 10:34:11 -08:00
Scott Lamb
9b907b79ff cargo fmt 2022-03-08 10:34:11 -08:00