Skip to content

Open bounded TimeRange support #367

@reinecke

Description

@reinecke

When working with media times, it can often be useful to refer to ranges that are things like "all times after two seconds" or "all times until 90 minutes". With time ranges expressing this, you can do things like: two_seconds_to_infinity_range.contains(RationalTime(36, 24)).
This can be thought of in two ways:

  1. A TimeRange that goes from a concrete time to infinity or from negative infinity to a concrete time
  2. A TimeRange with open end bounds or open front bounds

Modeling this as the first described solution would mean:

  1. Define RationalTime constants for -infinity and infinity
  2. Updating TimeRange to be expressed in terms of start_time and end_time(exclusive?) - instead of start_time and duration

For the second described solution one implementation might be to add TimeRange subclasses that are TimeRangeOpenEnd and TimeRangeOpenFront.

The second described solution would imply some API footprint changes for TimeRange.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    To do

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions