124 Commits

Author SHA1 Message Date
olly
cdae9ac5d2 ExoPlayer V2 Refactor - Steps 1/2.
GitHub note - Apologies for the cryptic change descriptions,
they relate to a design doc that's not externally visible.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=113043764
2016-06-15 18:53:40 +01:00
Oliver Woodman
a02fd14c31 Fix Eclipse project for library tests. 2016-01-22 12:19:49 +00:00
andrewlewis
4bea0b184f Fix warnings in OggVorbisExtractorTest and VorbisBitArrayTest.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112699244
2016-01-22 12:11:16 +00:00
andrewlewis
9d89d48f56 Fix ParsableByteArrayTest.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112693523
2016-01-22 12:11:16 +00:00
andrewlewis
bed89730a7 Fix path to Mockito for Eclipse.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112691130
2016-01-22 12:11:15 +00:00
andrewlewis
588d5a6e55 Parse encoder delay and padding from ID3 metadata in MP3.
Based on AOSP's MP3Extractor.cpp and ID3.cpp.

Issue: #497
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112685664
2016-01-22 12:11:15 +00:00
Oliver Woodman
89ce1ccedf OggVorbisExtractor (WIP - Seeking not yet enabled) 2016-01-22 11:46:37 +00:00
Oliver Woodman
88fa1495c4 Use consistent naming for Xing headers/tags.
Also fix a couple of style nits.
2016-01-22 11:40:27 +00:00
Oliver Woodman
cef1f12f1d Add readString to ParsableByteArray 2016-01-22 11:40:02 +00:00
Oliver Woodman
eda8ac4e01 Add eventSourceId to onAvailableRangeChange events 2016-01-22 11:38:06 +00:00
Oliver Woodman
7974a61476 Fix TtmlColorParser test.
Also simplify the implementation slightly.
2016-01-15 19:06:27 +00:00
aquilescanta
5baf55176b Add support for Cue Settings and Spanned text in MP4WebVTT
Using the provided methods by the previous refactors, it is now possible to use all of the WebVTT features already available.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112243172
2016-01-15 18:47:00 +00:00
olly
bc1d76a3eb Fix ParsableByteArray.readLine + discard BOM at start of line.
- I think \r and \n are handled the wrong way around?
- We only expect to encounter a BOM sequence at the start of a
  file, but it feels fine to automatically discard it in all
  cases for simplicity. A BOM sequence doesn't mean anything in
  UTF-8. See https://en.wikipedia.org/wiki/Byte_order_mark. Note
  that I think the advice not to remove it on that page relates
  only to the case where the file is being edited + saved.

Issue #1136
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112143407
2016-01-14 17:13:32 +00:00
aquilescanta
651996983b Refactored the Webvtt parsing classes
Moved the behaviors related to Cue's to the WebvttCueParser class.
This way, the parsing methods will be more easily accessible to
other classes, such as the MP4Webvtt parser. This class also has
some methods that require state to avoid repetitive avoidable
allocations. The method visibility is subject to changes in
further CLs.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111616824
2016-01-07 22:52:34 +00:00
eguven
69a42b60f8 Implement ID3 Metadata support for audio only HLS.
Issue: #862
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111403855
2016-01-05 14:52:51 +00:00
aquilescanta
1e4f2f6a1f Refactored WebvttCueParser methods to be static
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111402555
2016-01-05 14:52:44 +00:00
andrewlewis
7c103ca5f8 Using ExtractorInput.peek* instead of BufferingInput.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111394118
2016-01-05 14:52:39 +00:00
aquilescanta
681df4e4aa Refactored the SubtitleParser's parse() signature
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111326567
2016-01-05 14:52:30 +00:00
andrewlewis
890dd5afb5 Add a peekFully overload with allowEndOfInput.
This is in preparation for removing BufferingInput,
and using peeking instead.

Also add tests for peeking with allowEndOfInput and
resetPeekPosition.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111318236
2016-01-04 20:59:06 +00:00
aquilescanta
33a2b2d0c5 Added test cases to the MP4Webvtt parser
This CL is prepares the ground for refactoring the Webvtt parser,
so as to use the common parsing algorithms in both parsers. In order
to do this, the Webvtt Parser will be refactored. As a side note, many
more test cases will be added once the new subtitle features are
implemented. Some useful test cases have also been left for a following
CL, to allow an easy code review.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=110466914
2016-01-04 20:58:04 +00:00
eguven
f16b8baf75 ExtractorInput new skip methods to make skip methods analogous to the three read methods.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=110155932
2015-12-16 20:41:51 +00:00
Oliver Woodman
7f8ddeac39 Added little endian methods to ParsableByteArray. 2015-12-16 20:33:04 +00:00
eguven
a1d5626fe7 Fixed DefaultExtractorInput.read(...) to allow to read bytes in the peek buffer
when the dataSource reaches to the end.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=110131793
2015-12-14 10:39:55 +00:00
andrewlewis
63dc769bff Improve seeking in MP3 files with XING headers.
Fix behavior of getTimeUs when seeking after the last entry in the table of
contents. Round correctly in getPosition, clipping to the stream duration based
on the input length (if known), falling back to the stream size from the header.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=109993852
2015-12-14 10:39:45 +00:00
Andrew Lewis
33506adab5 Remove executable bit from some test assets. 2015-11-30 16:01:35 +00:00
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