1129 Commits

Author SHA1 Message Date
Oliver Woodman
1f3bd97a2d Add non-strict SubRip parsing (enabled by default). 2015-09-10 18:29:36 +01:00
Oliver Woodman
ede7a69d95 Change DTS MIME type to vnd.dts. 2015-09-10 18:28:50 +01:00
Oliver Woodman
ab66dfa7c2 Parsing embedded TTML styling. 2015-09-10 18:27:03 +01:00
Oliver Woodman
95fcb3b411 Draw subtitles over the shutter.
This allows the demo app to display subtitles without video
(when there's no video, the shutter view does not hide itself).
2015-09-10 18:24:31 +01:00
Oliver Woodman
e48851d8cc Share PTS timestamp adjustment across format changes.
When switching format in HLS, we instantiate a new extractor, which
adjusts TS presentation timestamps so that they align properly with
the start of the first segment in the new format. Some HLS streams
appear to have slightly misalignment that causes a glitch when using
this approach.

It's better to re-use the same timestamp adjustment across formats,
and only reset it when seeking or when there's an actual discontinuity.
This is because the HLS spec guarantees PTS timestamp alignment across
different formats.

We'll also need something like PtsTimestampAdjuster to share between
separated audio and WebVTT tracks, which also contain PTS timestamps
that are aligned, and will need to share a common adjustment.

Issue: #692
2015-09-10 18:23:57 +01:00
Oliver Woodman
7d38d2ef3c CuePainter fixes for caption styling.
- Don't allow "nothing has changed" optimization in the case
  that only styling has changed (TextUtils.equals will return
  true in this case, but we shouldn't optimize).
- Add functionality to suppress embedded styling; seems useful
  to have.
- Added "this." for clarity.
2015-09-10 18:22:44 +01:00
Oliver Woodman
68f2dc5998 Remove MultiTrackChunkSource (multi track now supported directly). 2015-09-10 18:22:07 +01:00
Oliver Woodman
e6ca2df514 Fix end-of-stream for live streams.
Issue: #764
2015-09-10 18:21:21 +01:00
Oliver Woodman
89fcafec5b Correctly set a format duration. 2015-09-10 18:20:07 +01:00
Oliver Woodman
820433de06 Call stop() to fully play out remaining audio!
Issue: #707
2015-09-10 18:19:09 +01:00
Oliver Woodman
9bcc00f369 Fix reported buffered position for HLS across format switches. 2015-09-10 18:16:42 +01:00
Oliver Woodman
a7ba393d54 When multiple BaseURL elements are present, prefer the first one.
Issue: #771
2015-09-10 18:16:23 +01:00
Oliver Woodman
4a29be498b Correctly use "current-manifest-live" v.s. "stream-is-live"
When a live stream ends, what typically happens is that the manifest
is refreshed and the refreshed version is not marked as live/dynamic.
When this happens we:

1. Don't want the duration of the track to change.
2. Still want to consider the possibility that we may have fallen behind
   the live window.
3. Don't want to allow futher manifest refreshes.

This change uses the right thing in the right place.
2015-09-10 18:15:15 +01:00
Oliver Woodman
143a4deee8 If no buffers were queued, handle EoS directly.
Issue: #707
2015-09-10 18:12:32 +01:00
Oliver Woodman
59a789b340 Include missing durations in AC3/DTS formats. 2015-09-10 18:11:18 +01:00
ojw28
e13e23e3e0 Merge pull request #776 from IanDBird/srt-fix
Ignore extra returns in Subrip parsing
2015-09-09 14:31:49 +01:00
Ian Bird
4b69fad6b7 Ignore extra returns in Subrip parsing 2015-09-09 11:56:10 +01:00
Oliver Woodman
5c0745cedf Add some generally useful error propagation logic for HLS.
Issue #765
2015-09-07 13:59:55 +01:00
Oliver Woodman
fb8f0113c6 Hide captions when the track is disabled.
Issue #763
2015-09-07 13:59:18 +01:00
Oliver Woodman
5d1052f6ec Allow specifying the AudioTrack's stream type.
Issue: #755
2015-09-07 13:58:54 +01:00
Oliver Woodman
ab2aac9d3f Infer mime types from DASH manifest. 2015-09-07 13:58:31 +01:00
Oliver Woodman
9592a8a4ff Fix IFR parsing 2015-09-07 13:57:45 +01:00
Oliver Woodman
8c3f93d6bf Start to fix media mime types.
- Admit we don't know the mime type (using unknown mime types) rather
  than passing the container mime type.
- Pass the correct mime type for opus, vp9 and vp8, and remove the incorrect
  container checks in the corresponding extensions.
2015-09-07 13:56:54 +01:00
Oliver Woodman
4104a8def9 Handle raw TTML in DASH correctly. 2015-09-07 13:55:35 +01:00
Oliver Woodman
0c968703c8 Add playback tests (work in progress).
All valid Android devices should pass these tests.
2015-09-01 14:29:47 +01:00
Oliver Woodman
e6a93a08de Update instructions for building with latest libvpx.
- Fix building with APP_ABI=all by configuring for all architectures.
- Keep vpx_dsp which is required for building successfully.
- Use perl -pi -e not sed, for building on Macs.
2015-09-01 14:24:46 +01:00
Oliver Woodman
7a0f00ce41 No-op setting volume to current volume. 2015-09-01 14:23:35 +01:00
Oliver Woodman
3c65df92c2 Allow multiple sources for text.
Issue #753
2015-09-01 14:23:10 +01:00
Oliver Woodman
ecd48da1de Multi-track support for DASH.
- With this change, you can select from the individual video formats in
the demo app, as well as the regular "auto" (adaptive) track.
- DashRendererBuilder no longer needs to create MultiTrackChunkSource
instances for the multiple tracks to be exposed.
2015-09-01 14:22:18 +01:00
Oliver Woodman
6cf261aed7 Move default SmoothStreaming track selection to library. 2015-09-01 14:20:23 +01:00
Oliver Woodman
4b2991267e Some renaming to make format use slightly clearer. 2015-09-01 14:19:40 +01:00
Oliver Woodman
fae6c65367 Be robust against manifests that don't define top level duration explicitly.
I think such manifests are invalid, and I haven't seen any examples,
but given it's trivial to fill in the duration if the periods define
durations, it seems worth being robust.
2015-09-01 14:19:06 +01:00
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
4a9ff7b094 Correctly propagate END_OF_STREAM through Opus decoder. 2015-09-01 14:16:36 +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
35a744a5d4 Use perl for in-place substitution. 2015-09-01 14:11:01 +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