Skip to content

stream.segmented: add common base Segment class #5594

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

Merged
merged 8 commits into from
Oct 8, 2023

Conversation

bastimeyer
Copy link
Member

@bastimeyer bastimeyer commented Oct 7, 2023

#5498

This PR currently includes the commits of #5593. I will rebase and remove those commits once #5593 got merged into master.

As explained in #5498, all segmented streams should operate on segments which inherit from a common base segment. This base segment should define common attributes like uri, num and duration. The goal is to be able to have logic for a max stream duration and a stream start offset in the segmented stream base classes instead of having to implement this in each individual stream type separately.

  1. Rename segment classes of the various segmented streams, so there are no duplicates
  2. Rename and update the attributes of the DASHSegment, so they align with the base Segment
    Since the HLS spec (RFC 8216) defines segment sources as URIs (superset of URLs) because data can be retrieved from literally anywhere, I used that terminology.
  3. Finally add the base Segment and make segment dataclasses of each segmented stream implementation inherit from it
  4. Move HLSSegment and DASHSegment into dedicated modules as well

@bastimeyer bastimeyer force-pushed the stream/base-segment branch from 629ee42 to 4046a64 Compare October 8, 2023 12:54
@bastimeyer bastimeyer marked this pull request as ready for review October 8, 2023 12:54
@bastimeyer bastimeyer merged commit 32e4ff6 into streamlink:master Oct 8, 2023
@bastimeyer bastimeyer deleted the stream/base-segment branch October 8, 2023 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant