This patch reworks SegmentIndexes so that any SegmentReference they
contain is guaranteed to be available. This makes SegmentIndexes work
consistently between static content and live content (specifically
content specified using SegmentTemplate with @duration).
* Rework StreamInfo to use a ISegmentIndexSource and a ISegmentInitSource,
which construct a SegmentIndex and an intiailization segment
respectively.
* Make ManifestInfo destructible and various async operations in
StreamVideoSource safer.
* Introduce LiveSegmentIndex, which manages SegmentReference eviction.
* Introduce DynamicLiveSegmentIndex, which manages SegmentReference
eviction and generation.
* Implement improved segment availability logic for segment eviction.
* Move SegmentIndex construction from MpdProcessor to several
ISegmentIndexSource implementations.
* Use a SegmentIndex to represent subtitles to simplify Stream creation
in StreamVideoSource.
* Move manifest update code from StreamVideoSource to ManifestUpdater.
* Move PeriodInfo.duration determination in MpdProcessor to StreamVideoSource.
* Since "forced" manifest updates are no longer required for content
specified using SegmentTemplate with @duration, simplify manifest update
code in DashVideoSource.
* Make Stream continue to update even if it runs out of
SegmentReferences, this simplifies previous resync logic and makes
DynamicLiveSegmentIndex work seamlessly.
* Refactor SegmentIndex and initialization fetch code in ContentDatabase.
* Download all SegmentIndexes in the background after the initial streams
have started.
Follow up work is required to remove seek range logic from
DashVideoSource.
Change-Id: I4a908195aba632a911a6e55213fc41d41428162b
* Rename SegmentIndex functions to shorter names.
* Add first() and last() functions for convenience.
* Throw exceptions for out of range errors.
* Handle more corner-cases in merge().
* Add more unit tests.
Change-Id: If875cd766e7091504c028413694326fcdf2aae5b
If a stream insertion didn't complete successfully, it was possible an error
would occur during the next stream insertion due to a key (streamId) conflict.
Updated to always take the max next stream id from the indexStore/contentStore
and to try to delete partially inserted streams.
Change-Id: I85c379a6ef17853da28ae873c448873006b1dce4
Chrome 42+ is crashing when we insert roughly 64MB of data into the
database at a time. The database now tries to batch up 1MB of
segments, which means only single segments will be inserted for high
bitrate content, but we will still get a performance boost from
batching up segments for low bitrate content.
Change-Id: I3205b108dc089ea2901ea6b9eae5125901535f0c
Tests were failing if an existing database had a greater version
number. This was an artifact of an older version of ContentDatabase
which used a different version number.
Tests would also fail if one of the 'stores a stream' tests was run
several times in a row, such that the stream ID had more than one
digit. The reference matcher now accepts multi-digit IDs.
Change-Id: I8d8949e46bd0720abd761248790b2ee5965ff4a1
Rejected promises now pass an Error object instead of a simple event.
This causes test failures to display useful error messages now.
Change-Id: I9d9a756e84d204185ca9a2e36ca92ef814d05e4d