83 Commits

Author SHA1 Message Date
olly
64d7f2f846 Deduplicate functions for parsing hex strings.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117149421
2016-06-15 19:37:43 +01:00
olly
554817cca6 Extract gapless playback data in MP4 files.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117148015
2016-06-15 19:37:43 +01:00
olly
2380857bf2 Clip the skip length in DefaultExtractorInput.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117141509
2016-06-15 19:37:43 +01:00
olly
028ce2582c Fix handling of extended ID3 tags in MPEG-TS/HLS.
Issue #1181
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117136370
2016-06-15 19:36:29 +01:00
olly
c8d81abd52 WebM extractor tests: Fix up byte/int conversions.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117131005
2016-06-15 19:36:29 +01:00
olly
a7adcce018 One Format object to rule them all.
- Format can represent both container and sample formats.
  If a container contains a single track (as is true in
  DASH and SmoothStreaming) then the container Format can
  also contain sufficient information about the samples
  to allow for track selection. This avoids the Format to
  MediaFormat conversions that we were previously doing in
  ChunkSource implementations.

- One important result of this change is that adaptive
  format evaluation and static format selection now use the
  same format objects, which is a whole lot less confusing
  for someone who wants to implement both initial selection
  and subsequent adaptation logic. It's not in the V2 doc,
  but it may well make sense if the TrackSelector not only
  selects the tracks to enable for an adaptive playback, but
  also injects a FormatEvaluator when enabling them that will
  control the subsequent adaptive selections. That would make
  it so that all format selection logic originates from the
  same place.

- As part of this change, the adaptiveX variables are removed
  from the format object; they don't really correspond to a
  single format. This also saves on having to inject the max
  video dimensions through a bunch of classes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=114546777
2016-06-15 18:54:50 +01:00
olly
782817d524 Remove durationUs from MediaFormat.
Duration was originally included in MediaFormat to match the
framework class, but it actually doesn't make much sense. In
many containers there's no such thing as per-stream duration,
and in any case we don't really care. Setting the duration on
each format required excessive piping.

This change moves duration into SeekMap instead, which seems
to make a lot more sense because it's at the container level,
and because being able to seek is generally couplied with
knowing how long the stream is.

This change is also a step toward merging Format and MediaFormat
into a single class (because Format doesn't have a duration),
which is coming soon.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=114428500
2016-06-15 18:54:50 +01:00
olly
ce324f1ca9 ExoPlayer V2 Refactor - Step 7 (partial)
This change removes the need for SourceBuilders to load their
manifests before building their sources. This is done by pushing
initial manifest loads into the ChunkSource classes. This simplifies
the SourceBuilders a lot, and also DemoPlayer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=113259259
2016-06-15 18:54:38 +01:00
olly
be47148940 ExoPlayer V2 Refactor - Step 4
Notes:
1. The logic in ExoPlayerImplInternal is very temporary, until we
   have proper TrackSelector implementations. Ignore the fact that
   it's crazy and has loads of nesting.
2. This change removes all capabilities checking. TrackRenderer
   implementations will be updated to perform these checks in a
   subsequent CL.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=113151233
2016-06-15 18:54:26 +01:00
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