743 Commits

Author SHA1 Message Date
Oliver Woodman
2f4c96781d Refactor handling of period start times and durations.
- It's not possible to determine a period's duration just from the
corresponding Period element in a DASH manifest. It's necessary
to look at the start time of the next period (or the duration of the
manifest for the last period) to determine how long a period is. We
don't currently do this in the parser, and hence set duration incorrectly.
We also set period start times incorrectly because we don't set it to
equal to sum of the durations of prior periods in the case where it's
not explicitly defined.

- We're currently propagating these (incorrect) values all over the place
through data-structures that we build when parsing the Period element.

- This CL removes this redundancy, storing only the start time of each
period in Period elements, and not propagating it elsewhere. It's then
used when required in DashChunkSource.
2015-09-01 14:18:28 +01:00
Oliver Woodman
cb85dc25aa Clean up max dimension handling. 2015-09-01 14:17:21 +01:00
Oliver Woodman
a953e7217f Fix naming/documentation for SmoothStreaming. 2015-09-01 14:16:02 +01:00
Oliver Woodman
a704b3d338 Tweak video renderer. 2015-09-01 14:15:20 +01:00
Oliver Woodman
39babb779f Magic tests fix... 2015-09-01 14:14:46 +01:00
Oliver Woodman
f8824ac390 Support dynamic TimeRange for DASH live. 2015-09-01 14:14:10 +01:00
Oliver Woodman
d5f8d1a1b1 Don't crash updating a representation without an index. 2015-09-01 14:13:22 +01:00
Oliver Woodman
ebeafe23c0 Refactor multi-period Period updates.
The main change here is to add PeriodHolder.updatePeriod, which is
analogous to RepresentationHolder.updateRepresentation.
2015-09-01 14:12:52 +01:00
Oliver Woodman
b55a80dbf9 Fixed potential issue in which a live-edge latency greater than the duration of the manifest would result in the latest available time being lower than the earliest available time. 2015-09-01 14:12:22 +01:00
Oliver Woodman
476cefa7cc Remove extra constructors. 2015-09-01 14:11:50 +01:00
Oliver Woodman
96734144ba Extract DTS samples in DASH, MP4 and Matroska. 2015-09-01 14:07:28 +01:00
Oliver Woodman
bca2d16cc1 Specify locale when using String.format. 2015-09-01 14:06:16 +01:00
Oliver Woodman
adf82c7f5e Correctly read mimeType for ISO 13818-7 objectTypeIndication values.
Issue: #731
2015-09-01 14:05:43 +01:00
Oliver Woodman
83568ca52f Support MKV embedded SubRip captions. 2015-09-01 14:04:58 +01:00
Oliver Woodman
009d4d0c2c Fix retries if failure occurrs when reading seek map.
The following sequence was problematic:

1. See start of a cluster having not output a seek map. Decide
   to seek for the cues. Enter CUES_STATE_BUILDING state.
2. Error occurs before seek map is output.
3. ExtractorSampleSource isn't prepared yet, so restarts from the
   start of the stream.
4. See start of the same cluster having not output a seek map.
   This time cuesState is CUES_STATE_BUILDING, so we just carry
   on. We then fill the buffer with sample data, despite the
   source not being prepared, at which point we get stuck.

It's unclear to me why cuesState needed three states, so I've rm'd
the BUILDING state. Step (4) above will now do the same thing as
in step (1). If the failure repeats, we'll eventually fail, which
is WAI.
2015-09-01 14:03:45 +01:00
Oliver Woodman
b3ba7e16c1 Close DefaultHttpDataSource connections quietly. 2015-09-01 14:02:16 +01:00
Oliver Woodman
10badcc430 Support multi-track in MKV/WebM extractor.
Issue: #514
2015-09-01 14:01:43 +01:00
Oliver Woodman
e07c35815e Don't move to next subtitle too soon.
Second time lucky. We should just move to the next subtitle
when it's started. Simples.
2015-09-01 14:01:06 +01:00
Oliver Woodman
530aa265ff Fix playback of MKV audio tracks that use default channel/frequency vals.
Also do some significant cleanup to the extractor.
2015-09-01 14:00:37 +01:00
Oliver Woodman
64c0e5c997 Use XING headers without size/table of contents.
These MP3s are unseekable but allow calculating the VBR duration correctly.

Treat streams as live only if they are unseekable and lack a duration.

Issue: #713
2015-09-01 13:59:34 +01:00
Oliver Woodman
6799d6dad0 Fixed issue where calling valueAt on a SparseArray with an index greater than the size of the SparseArray would sometimes return the class' internal DELETED object and cause a ClassCastException. 2015-09-01 13:58:57 +01:00
Oliver Woodman
7bf1d89168 Fixed overlapping captions. 2015-09-01 13:58:22 +01:00
Oliver Woodman
9231520ee8 Some misc cleanup.
- Remove unused method in DashChunkSource.
- Remove inputEncoding parameter for subtitle parsers. We're
  ignoring it in all but one of the parsers, and for the one
  that does use it, it'll only ever receive null, since that's
  all we're passing.
- Make TextTrackRenderer advance to the next subtitle even if
  the current one hasn't finished, in the case that they overlap.
  This shouldn't ever really happen, but it seems best to trust
  the start time of the new sample rather than the last event
  time of the previous one.
2015-09-01 13:57:51 +01:00
Oliver Woodman
8e9aadc5e5 Workaround for vorbis EOS flush bug (23361053).
I'm assuming this will be fixed in API level 24.
2015-09-01 13:56:10 +01:00
Oliver Woodman
879da81218 Expose more sensible HLS track information.
- Video track is always marked as adaptive, the resolution is
  stripped out (since it's otherwise just set to whatever the
  resolution of the first selected variant is), and the max
  dimensions are set.

Issue #514
2015-09-01 13:55:02 +01:00
Oliver Woodman
0efaec59b8 Implemented limited support for multi-period DASH manifests.
Limitation: Successive periods must expose the same adaptation
sets and representations.

GitHub Issue: #557
2015-09-01 13:54:00 +01:00
Oliver Woodman
f69f948991 Fixed issue in which ContainerMediaChunk would throw an NPE for self-initializing chunks. 2015-09-01 13:52:30 +01:00
Patrik Åkerfeldt
c373800492 Enable override of open/close in StreamingDrmSessionManager
Make it so that extensions of StreamingDrmSessionManager may override open/close.
2015-08-27 09:20:57 +02:00
Oliver Woodman
25fe9db5d1 Set the sync flag on all audio samples in WebM.
Issue: #690
2015-08-19 16:35:32 +01:00
Oliver Woodman
cde1c27e2b Make Opus codec-specific data match the platform.
Issue: #690
2015-08-19 16:34:59 +01:00
Oliver Woodman
02f1efd118 Add bitrate to MediaFormat.
Issue: #514
2015-08-19 16:34:20 +01:00
Oliver Woodman
ff201db981 Allow renderers to pull tracks from multiple sample sources.
This is needed for several use cases:

- ExtractorSampleSource with option to play both embedded and out-of-band
  subtitles.
- HLS multi-audio and out-of-band-webvtt.
2015-08-19 16:33:01 +01:00
Oliver Woodman
ea7caf4f91 Bit of a hack to pass through original MediaFormat from FrameworkSampleSource. 2015-08-19 16:32:33 +01:00
Oliver Woodman
c9d9808013 Make getRendererEnabled behavior the same as it used to be, until it's removed. 2015-08-19 16:32:01 +01:00
Oliver Woodman
679fa8de03 Only use passthrough for passthrough MIME types. 2015-08-19 16:31:28 +01:00
Oliver Woodman
e770e5c24b Multi-track - The (nearly) final step.
- Migrate demo app to use new APIs.
- Add multi-track support for ExtractorSampleSource case.
- Add multi-track support for SmoothStreaming use case.

The final step is to add support back for the DASH use case and
delete MultiTrackChunkSource. This is blocked on multi-period support
landing, in order to prevent a horrendous merge conflict. We also
need to update HLS to expose sensible track information.

Issue: #514
2015-08-19 16:29:30 +01:00
hori-ryota
3714751b95 Fixed bug of AES URI Pattern for hls 2015-08-19 18:22:33 +09:00
Oliver Woodman
3b9ca40b05 Add ISO 14496-30 embedded TTML (stpp) subtitle support.
Issue: #689
2015-08-17 17:15:53 +01:00
Oliver Woodman
38f2413290 Allow ChunkSource an opportunity to fail preparation.
When ChunkSource implementations implement multi-track for DASH and SS,
format selection will move inside of ChunkSource. If we, for example, fail
to query the decoder to determine which tracks are playable, we need an
opportunity to fail (i.e. say we're not prepared, so that maybeThrowError
is called, from which we can throw).

This may go away in the future if we remove the distinct preparation step
and treat tracks/formats as things that can change dynamically, but for now
this is what we have.

Issue #514.
2015-08-17 17:14:21 +01:00
Oliver Woodman
d49d5a1765 Fix reading HEVC in MPEG TS.
Fix reading the first slice flag, which before could cause a read out of bounds
if the NAL unit started at the end of the buffer.

Handle non-VCL NAL units by flushing a pending sample when starting to read one.
2015-08-17 17:13:23 +01:00
Oliver Woodman
37ebec6e82 Skip more than one ID3 header.
Issue: 713
2015-08-17 17:12:33 +01:00
Oliver Woodman
90f9f7314d Allow MediaFormat to express that it's adaptive (not yet used).
Also:
- Better document MediaFormat.
- Document getFormat to indicate what it's good (and not good) for.
2015-08-17 17:11:37 +01:00
Oliver Woodman
6e527c550f Expose new multi-track APIs in the ExoPlayer interface + plumb
multi-track support upstream to the ChunkSource interface.

This change does not yet make use of the newly exposed APIs. This
will come in a subsequent CL.

Issue #514.
2015-08-17 17:09:55 +01:00
Oliver Woodman
bf77f3b289 Simplify subtitle parsing.
- Currently all subtitles we parse contain timestamps relative to the sample
  timestamp, however we add the sample timestamp in inconsistent ways (sometimes
  in the Subtitle, sometimes in the SubtitleParser). This change converges on
  a single approach. It also paves the way for passing absolute offsets to use
  instead, and being able to apply them in a consistent way in a single place
  (PlayableSubtitle). This functionality will be required for ISO 14496-30 TTML
  embedded subtitles.

Issue: #689
2015-08-13 20:36:50 +01:00
Oliver Woodman
fbf590fdf6 Fix reading PCM configuration in HEVC SPS. 2015-08-13 20:35:52 +01:00
Oliver Woodman
6b44c6e6b1 Fix single sample loading + seeking in HLS.
Issue #587
2015-08-13 20:32:09 +01:00
Oliver Woodman
d3995eaa7a Fix rotation handling as far as is possible.
Issue: #91
2015-08-13 11:18:15 +01:00
Oliver Woodman
8db1331021 Propagate MediaFormat instead of TrackInfo.
Issue #514.
2015-08-11 18:23:22 +01:00
Oliver Woodman
f7ffeb75cf Parse pixel aspect ratio from SPS for use when there's no pasp atom.
Issue: #697
2015-08-11 18:18:19 +01:00
Oliver Woodman
69466adbe3 Remove unused exception class. 2015-08-11 18:17:33 +01:00