|
LibQuicR
|
MOQ track handler for subscribed track. More...
#include <subscribe_track_handler.h>
Classes | |
| struct | JoiningFetch |
| Attributes to use when subscribing with a Joining Fetch. More... | |
Public Types | |
| enum class | Error : uint8_t { kOk = 0 , kNotAuthorized , kNotSubscribed , kNoData } |
| Receive status codes. More... | |
| enum class | Status : uint8_t { kOk = 0 , kNotConnected , kError , kNotAuthorized , kNotSubscribed , kPendingResponse , kSendingUnsubscribe , kPaused , kNewGroupRequested } |
| Status codes for the subscribe track. More... | |
Public Member Functions | |
| constexpr Status | GetStatus () const noexcept |
| Get the status of the subscribe. | |
| void | SetPriority (uint8_t priority) noexcept |
| Set the priority of received data. | |
| constexpr messages::SubscriberPriority | GetPriority () const noexcept |
| Get subscription priority. | |
| constexpr messages::GroupOrder | GetGroupOrder () const noexcept |
| Get subscription group order. | |
| constexpr messages::FilterType | GetFilterType () const noexcept |
| Get subscription filter type. | |
| constexpr std::optional< messages::Location > | GetLatestLocation () const noexcept |
| constexpr void | SetLatestLocation (messages::Location new_location) noexcept |
| std::optional< JoiningFetch > | GetJoiningFetch () const noexcept |
| Get joining fetch info, if any. | |
| void | SetTrackAlias (uint64_t track_alias) |
| Set the track alias. | |
| std::optional< uint64_t > | GetTrackAlias () const noexcept |
| Get the track alias. | |
| void | SetReceivedTrackAlias (uint64_t track_alias) |
| Set the received track alias. | |
| std::optional< uint64_t > | GetReceivedTrackAlias () const noexcept |
| Get the received track alias. | |
| void | Pause () noexcept |
| Pause receiving data. | |
| void | Resume () noexcept |
| Resume receiving data. | |
| void | RequestNewGroup () noexcept |
| Generate a new group request for this subscription. | |
| std::chrono::milliseconds | GetDeliveryTimeout () const noexcept |
| void | SetDeliveryTimeout (std::chrono::milliseconds timeout) noexcept |
| bool | IsPublisherInitiated () const noexcept |
| Check if the subscribe is publisher initiated or not. | |
Callbacks | |
| virtual void | ObjectReceived (const ObjectHeaders &object_headers, BytesSpan data) |
| Notification of received [full] data object. | |
| virtual void | StreamDataRecv (bool is_start, uint64_t stream_id, std::shared_ptr< const std::vector< uint8_t > > data) |
| Notification of received stream data slice. | |
| virtual void | DgramDataRecv (std::shared_ptr< const std::vector< uint8_t > > data) |
| Notification of received datagram data. | |
| virtual void | PartialObjectReceived (const ObjectHeaders &object_headers, BytesSpan data) |
| Notification of a partial object received data object. | |
| virtual void | StatusChanged (Status status) |
| Notification of subscribe status. | |
| virtual void | MetricsSampled (const SubscribeTrackMetrics &metrics) |
| Notification callback to provide sampled metrics. | |
Static Public Member Functions | |
| static std::shared_ptr< SubscribeTrackHandler > | Create (const FullTrackName &full_track_name, messages::SubscriberPriority priority, messages::GroupOrder group_order=messages::GroupOrder::kAscending, messages::FilterType filter_type=messages::FilterType::kLargestObject) |
| Create shared Subscribe track handler. | |
Public Attributes | |
| SubscribeTrackMetrics | subscribe_track_metrics_ |
| Subscribe metrics for the track. | |
Protected Member Functions | |
| SubscribeTrackHandler (const FullTrackName &full_track_name, messages::SubscriberPriority priority, messages::GroupOrder group_order, messages::FilterType filter_type, const std::optional< JoiningFetch > &joining_fetch=std::nullopt, bool publisher_initiated=false) | |
| Subscribe track handler constructor. | |
| void | SetStatus (Status status) noexcept |
| Set the subscribe status. | |
Protected Attributes | |
| StreamBuffer< uint8_t > | stream_buffer_ |
| uint64_t | next_object_id_ { 0 } |
| uint64_t | current_group_id_ { 0 } |
| bool | sent_first_object_ { false } |
MOQ track handler for subscribed track.
MOQ subscribe track handler defines all track related callbacks and functions for subscribe. Track handler operates on a single track (namespace + name).
This extends the base track handler to add subscribe handling
|
strong |
|
strong |
Status codes for the subscribe track.
| Enumerator | |
|---|---|
| kOk | |
| kNotConnected | |
| kError | |
| kNotAuthorized | |
| kNotSubscribed | |
| kPendingResponse | |
| kSendingUnsubscribe | In this state, callbacks will not be called,. |
| kPaused | |
| kNewGroupRequested | |
|
inlineprotected |
Subscribe track handler constructor.
| full_track_name | Full track name struct |
| joining_fetch | If set, subscribe with a joining fetch using these attributes. |
| publisher_initiated | True if publisher initiated the subscribe, otherwise False |
|
inlinestatic |
Create shared Subscribe track handler.
| full_track_name | Full track name struct |
| priority | Subscription priority, if omitted, publisher priority is considered |
| group_order | Order for group delivery |
|
virtual |
Notification of received datagram data.
Event notification to provide the caller the raw data received as a datagram
| data | Shared pointer to the data received |
|
inlinenoexcept |
|
inlineconstexprnoexcept |
Get subscription filter type.
|
inlineconstexprnoexcept |
Get subscription group order.
|
inlinenoexcept |
Get joining fetch info, if any.
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
Get subscription priority.
|
inlinenoexcept |
Get the received track alias.
If the track alias is set, it will be returned, otherwise std::nullopt.
|
inlineconstexprnoexcept |
Get the status of the subscribe.
|
inlinenoexcept |
Get the track alias.
If the track alias is set, it will be returned, otherwise std::nullopt.
|
inlinenoexcept |
Check if the subscribe is publisher initiated or not.
|
inlinevirtual |
Notification callback to provide sampled metrics.
Callback will be triggered on Config::metrics_sample_ms to provide the sampled data based on the sample period. After this callback, the period/sample based metrics will reset and start over for the new period.
| metrics | Copy of the subscribed metrics for the sample period |
|
virtual |
Notification of received [full] data object.
Event notification to provide the caller the received full data object
| object_headers | Object headers, must include group and object Ids |
| data | Object payload data received, MUST match ObjectHeaders::payload_length. |
|
inlinevirtual |
Notification of a partial object received data object.
Event notification to provide the caller the received data object
| object_headers | Object headers, must include group and object Ids |
| data | Object payload data received, can be <= ObjectHeaders::payload_length |
|
noexcept |
Pause receiving data.
Pause will send a MoQT SUBSCRIBE_UPDATE to change the forwarding state to be stopped *
|
noexcept |
Generate a new group request for this subscription.
|
noexcept |
Resume receiving data.
Rresume will send a MoQT SUBSCRIBE_UPDATE to change the forwarding state to send
|
inlinenoexcept |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
Set the priority of received data.
| priority | Priority value of received data |
|
inline |
Set the received track alias.
| track_alias | MoQ track alias for track namespace+name that is relative to the QUIC connection session |
|
inlineprotectednoexcept |
Set the subscribe status.
| status | Status of the subscribe |
|
inline |
Set the track alias.
| track_alias | MoQ track alias for track namespace+name that is relative to the QUIC connection session |
|
inlinevirtual |
Notification of subscribe status.
Notification of the subscribe status
| status | Indicates status of the subscribe |
|
virtual |
Notification of received stream data slice.
Event notification to provide the caller the raw data received on a stream
| is_start | True to indicate if this data is the start of a new stream |
| stream_id | Stream ID data was received on |
| data | Shared pointer to the data received |
Reimplemented in quicr::FetchTrackHandler.
|
protected |
|
protected |
|
protected |
|
protected |
| SubscribeTrackMetrics quicr::SubscribeTrackHandler::subscribe_track_metrics_ |
Subscribe metrics for the track.
Subscribe metrics are updated real-time and transport quic metrics on metrics_sample_ms period.