49 Commits

Author SHA1 Message Date
Oliver Woodman
1a9b2be551 WebVTT styling.
- parse webvtt cue
- remove all tags from string (supported or not)
- apply spans for b, i and u
- honor class names in tags to properly parse the cue but do not apply styles for them
2015-11-27 16:02:30 +00:00
Oliver Woodman
72f093c4f6 WebVTT parser improvements.
* Split findNextCueHeader and validateWebVttHeader into static methods.
  This is a step toward WebVTT in HLS, where we'll need to re-use these
  to peek at the top of the WebVTT file (they'll be moved into a util
  class).
* Made parser robust against bad cue headers + added a test.
* Removed spurious looking assertion in WebvttSubtitle.
2015-11-25 17:05:20 +00:00
Oliver Woodman
ddaa9092ec Parse the sequence number at discontinuities.
This is required to match up segments in one playlist (e.g. VTT)
to those in another (e.g. Audio/Video).
2015-11-25 17:00:18 +00:00
Oliver Woodman
6f62b499c5 Merge seek/playback positions in ChunkSource interface. 2015-11-25 16:50:30 +00:00
Oliver Woodman
f11a204b4a Remove caption parser strict modes.
They don't seem particularly useful; they don't technically force
strict compliance, but rather just catch a few token things in
each case. Furthermore, for playback, probably the right thing to
do is to always turn strict mode off.
2015-11-25 16:49:25 +00:00
Oliver Woodman
7e2fffe74d Make sure we use the correct mimeType with DRM initialization data.
We were previously using the container format of the media being
played as the mimeType generating key requests, but this is not
always correct. As an example, where a manifest contains webm streams
but specifies initialization data using cenc:pssh elements in the
manifest, the media has a webm mimeType, but the DRM initialization
data has an mp4 mimeType.
2015-11-25 16:47:05 +00:00
Oliver Woodman
b293cf2a76 Parse QuickTime variant audio sample entries.
Issue: #958
2015-11-17 15:50:20 +00:00
Oliver Woodman
02cc495f1c Cleanup following #884 2015-10-27 21:03:16 +00:00
Oliver Woodman
f4b07ab147 Resolve conflicts 2015-10-27 20:37:54 +00:00
Oliver Woodman
a74fd17e92 Handle curle braces in SystemID UUID.
Issue: #863
2015-10-26 15:31:09 +00:00
Oliver Woodman
941ca3f304 Add readShort to ParsableByteArray 2015-10-26 15:25:46 +00:00
Oliver Woodman
b766253116 m 2015-10-26 15:23:06 +00:00
Oliver Woodman
c0f0cbcb7a Move to target API level 23 2015-10-26 15:02:32 +00:00
Rik Heijdens
bc3125c5d2 Fixed MediaFormatTests 2015-10-26 09:59:05 -04:00
Rik Heijdens
1d31521710 Merge branch 'dev' of github.com:/google/ExoPlayer into mediaformat-id-dash
Syncing my fork
2015-10-20 15:49:45 -04:00
Rik Heijdens
42351d3127 Added id property to MediaFormat
Added the property 'id' to the MediaFormat class
 which serves as an identifier for the track.

DASH Representations will have the "id's" from their
Media Presentation Description mapped to the id property
 in the MediaFormat class that will represent the track.

We needed this for an use case where we wanted to read the 'id'
value from the DASH representation and present it to the user
in order for the user to select the right track.
2015-10-20 14:21:41 -04:00
Oliver Woodman
20e05a31b2 Do TTML color parsing directly in Exoplayer.
- Added TtmlColorParser to workaround JellyBean issues with named colors.
- Support rgb and rgba expressions as well.
2015-10-12 17:57:10 +01:00
Oliver Woodman
3682141ee1 webm_extractor: Re-sync to next level 1 element on invalid data
Try re-sync'ing to the next level 1 element when invalid data is found. This
corrects the behavior for test case 4 in the mkv test suite.

Partially Fixes Issue #631
2015-10-12 12:18:12 +01:00
Oliver Woodman
decb7f58c7 Expose container track identifier via MediaFormat.
Issue: #770
2015-09-28 12:36:28 +01:00
Oliver Woodman
e4e02f9189 Further improve WebVTT parser according to WebVTT spec 2015-09-28 12:20:27 +01:00
ojw28
de68c982ab Merge pull request #795 from jeoliva/webvtt-parser-improvements
Improve WebVTT parser according to WebVTT spec
2015-09-17 16:34:33 +01:00
joli
925795cb4f Improve WebVTT parser according to WebVTT spec
- Line parameter
  - Added support for value and line alignment attributes.
  - Support negative numbers when line is an absolute number (not a
percentage).
- Position parameter
  - Added support for value and position alignment attributes
- Added support for WebVTT comment blocks
- Percentage values now accept decimal numbers (as webvtt spec states)
- Added new WebVTT tests for testing all new implemented features
2015-09-16 21:09:44 +02:00
Oliver Woodman
d7697176ed Include language in audio formats.
Issue: #437
2015-09-15 13:45:54 +01:00
Oliver Woodman
b6f15a17e0 TTML improvements.
- do not denormalize styles at parsing time but only put normalized style info
into TtmlNode tree. Resolve styles on demand when Cues are requested for a
given timeUs.
- create TtmlRenderUtil to have static render functions separate
- added unit test for TtmlRenderUtil
- adjusted testing strategy for unit test to check resolved style on Spannables after rendering
2015-09-15 13:44:52 +01:00
Oliver Woodman
721956710f Remove MediaFormat.create methods that don't take a duration. 2015-09-15 13:43:12 +01:00
Oliver Woodman
e6e1e2c1d1 Tweaking TTML parsing logic. 2015-09-10 19:03:40 +01:00
Oliver Woodman
1f3bd97a2d Add non-strict SubRip parsing (enabled by default). 2015-09-10 18:29:36 +01:00
Oliver Woodman
ab66dfa7c2 Parsing embedded TTML styling. 2015-09-10 18:27:03 +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
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
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
83568ca52f Support MKV embedded SubRip captions. 2015-09-01 14:04:58 +01:00
Oliver Woodman
10badcc430 Support multi-track in MKV/WebM extractor.
Issue: #514
2015-09-01 14:01:43 +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
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
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
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
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
02c7525ff7 Remove custom VTT logic. 2015-08-11 18:16:56 +01:00
Oliver Woodman
7d306ae593 Add language to MediaFormat + parse it from mdhd box.
+ Move conversion from framework -> exo format to FrameworkSampleSource.
+ Improve MediaFormat conversion test.
2015-08-11 18:10:46 +01:00
Oliver Woodman
adf98b0fcc Make seekTo(currentPosition) a no-op in ExoPlayer.
- Also avoid boxing when passing the seek position to the background
  thread.

Issue: #654
2015-08-11 17:55:19 +01:00
Oliver Woodman
574e554e01 Make classes/methods final to prevent uncontrolled extension. 2015-08-03 15:18:09 +01:00
Oliver Woodman
5f51a4ff83 Cleanup - Make RollingSampleBuffer append methods more consistent. 2015-07-30 17:13:24 +01:00
Oliver Woodman
48826836d1 Put tests where they belong + bump bintray-release version.
Issue: #651
2015-07-27 16:32:55 +01:00