Refactor MoQT Upstream SUBSCRIBE processing and data structures.
Streamline and simplify in preparation for also sending FETCH.
- Move subscribe-specific properties to SubscribeRemoteTrack, derived from RemoteTrack.
- A map of subscribes by track_alias_. Also, a separate map of pointers to those records indexed by subscribe_id_. pointers to FetchTask will also be stored in the latter.
- Eliminate "active subscribes" and just put the state into SubscribeRemoteTrack, since we are now indexing all subscribe by ID.
- Allow access to the stream type in the parser to verify it's correct for the subscription.
- Based on @vasilvv suggestion, deleted a check in quiche_weak_ptr.h that was misfiring.
- Added support for Upstream UNSUBSCRIBE to avoid a problem with ChatClient not clearing subscription state.
Not in production.
PiperOrigin-RevId: 700756286
diff --git a/quiche/quic/moqt/moqt_track.cc b/quiche/quic/moqt/moqt_track.cc
index ee85664..07f44d7 100644
--- a/quiche/quic/moqt/moqt_track.cc
+++ b/quiche/quic/moqt/moqt_track.cc
@@ -4,18 +4,15 @@
#include "quiche/quic/moqt/moqt_track.h"
-#include <cstdint>
-
#include "quiche/quic/moqt/moqt_messages.h"
namespace moqt {
-bool RemoteTrack::CheckForwardingPreference(
- MoqtForwardingPreference preference) {
- if (forwarding_preference_.has_value()) {
- return forwarding_preference_.value() == preference;
+bool RemoteTrack::CheckDataStreamType(MoqtDataStreamType type) {
+ if (data_stream_type_.has_value()) {
+ return data_stream_type_.value() == type;
}
- forwarding_preference_ = preference;
+ data_stream_type_ = type;
return true;
}