-
Notifications
You must be signed in to change notification settings - Fork 2
Feat: Track switching using SUBSCRIBE and SUBSCRIBE_UPDATE #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tobbee
wants to merge
9
commits into
main
Choose a base branch
from
subscribe-update-switch
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Add Location struct and GetLargestObject function with comprehensive tests - Calculates the largest object location based on current time - Add TrackPublisher interface with MediaType alignment (VIDEO/AUDIO) - Implement MediaSyncer for media-type group synchronization ensuring video tracks share group timing, audio tracks share separate timing - Create ConcreteTrackPublisher with enhanced subscription state supporting SUBSCRIBE_UPDATE - Add PublisherManager coordinating all track publishers with unified group generation - Integrate new architecture into mlmpub with -new flag for backward compatibility - Establish foundation for seamless same-media-type track switching at group boundarie - Object (G, 0) available at G seconds + sampleOffset + objectDuration - Object (G, N) available N*objectDuration later - Video has sampleOffset = 0 - Audio has sampleOffset depenging on loop wrap start - Enhanced subscriber error handling with aggressive disconnect detection - Add multiple subscription state checks during publishing lifecycle - Mark removed subscriptions as failed immediately to prevent error spam - Add early termination checks at OpenSubgroup, WriteMoQGroup, and Close operations - Prevent publishing goroutines from continuing when subscription is removed - Reduce repeated error logging when mlmsub clients disconnect from mlmpub - Use client-provided request IDs and add structured subscription logging - Add structured logging for subscription messages in handler - Log requestID, track, namespace, filterType, and subscriberPriority - Improves debugging and monitoring of subscription requests
- Add SUBSCRIBE_UPDATE message handling in mlmpub handler - Implement HandleSubscribeUpdate method in PublisherManager - Support end_group parameter for clean subscription termination - Implement SUBSCRIBE_DONE message transmission using Publisher.CloseWithError - Add structured logging for SUBSCRIBE_UPDATE messages - Check for stale subscriptions - Add -end-after flag to mlmsub for automatic subscription termination after X groups.
Standardize logging across mlmpub and mlmsub clients with consistent slog usage: - Add centralized log level parsing with ParseLogLevel function - Replace direct slog calls with logger instances for better control - Update subscription handling to use structured logging - Improve error tracking and debug information in track switching - Maintain logging consistency across publisher and subscriber components 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add new modular architecture with clean separation of control plane and media transport - Implement channel-based MediaObject communication between components - Add SubscriptionManager for control plane operations (subscriptions, updates) - Add MediaRouter for object routing with duplicate detection and new track preference - Add MediaPipeline for output handling (mux, video, audio) with proper init segment handling - Add SimpleClient demonstrating new architecture usage - Maintain full compatibility with existing seamless track switching functionality - Fix init segment handling: catalog initData written first, then media objects processed - Support all output modes: muxout, videoout, audioout with proper CMAF multiplexing - Use moqtransport LargestLocation API for immediate SUBSCRIBE_UPDATE - Calculate firstNewGroup as largestGroup+1 from SUBSCRIBE_OK response - Send SUBSCRIBE_UPDATE immediately after subscription confirmation - Eliminate wait for first object arrival during track switching - Improve switching performance and reduce transition latency
- Document new modular mlmsub architecture with separated concerns - Explain SubscriptionManager, MediaRouter, MediaPipeline, TrackSwitcher components - Add track switching examples and debugging guidance - Include staircase switching pattern documentation - Provide troubleshooting guide for common issues 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added
-switch-tracksoptionChanged