124 Commits

Author SHA1 Message Date
eguven
9ee3030b79 Opus initialization data should be in native order.
http://developer.android.com/reference/android/media/MediaCodec.html#CSD
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121957004
2016-06-15 19:41:30 +01:00
eguven
3674f9598e ogg't'opus reader
Support for opus content in ogg container.
TODO: Sample duration and seeking.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121940392
2016-06-15 19:41:29 +01:00
olly
9f2707cfa3 Push DrmInitData into Format.
- This means DrmInitData is propagated through sample queues (i.e.
  is effectively attached to every sample, so we can see when it
  changes when reading from the queue).
- It also allows different DrmInitData per track, which is possible
  in muxed MKV/WebM, and per Representation for DASH, although we
  wont be able to seamlessly adapt in the latter case.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121821928
2016-06-15 19:40:39 +01:00
olly
99c0ba005a Add support for TTML Regions extent
This allows limiting the horizontal extension of the cues.
NOTE: So far, we only support percentages for size magnitudes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121682404
2016-06-15 19:40:39 +01:00
olly
1fea3fe3c0 Add support for TTML regions.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121564959
2016-06-15 19:40:38 +01:00
olly
6e86cafce0 Fix broken test.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121501144
2016-06-15 19:40:09 +01:00
olly
6e5ae4eddc Simplify DrmInitData.
- This moves to a single DrmInitData implementation that supports
  both specific and universal UUID matching. You can also do a
  combination of the two, which was not previously possible.
- The object model is simplified as a result. This is a precursor
  to a change where DrmInitData will be included directly in the
  Format to enable key rotation.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121472592
2016-06-15 19:40:09 +01:00
olly
a1299ea722 Have DrmInitData classes implement hashCode/equals.
This will be required for key rotation to work, since
we'll need a way to determine whether or not the init
data has changed.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121018211
2016-06-15 19:39:52 +01:00
aquilescanta
81383f8022 Add full selector support to CSS in WebVTT
This CL allows near-complete support to CSS selectors (I say near because not every
CSS rule applies to WebVTT).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120717498
2016-06-15 19:39:11 +01:00
aquilescanta
c11fda04e5 Add CSS Specificity score system to WebvttCssStyle
This CL provides the necessary infrastructure to add styling by class. This was separated
into two different CLs to ease reviewing.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120336976
2016-06-15 19:39:10 +01:00
olly
7638bea016 Bring V2 ogg extractor up to date.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120332721
2016-06-15 19:39:10 +01:00
olly
2e0518f47b Apply Android studio code analysis suggestions.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120326293
2016-06-15 19:39:09 +01:00
olly
48bc98f1ed Naming cleanup.
- RollingSampleBuffer -> DefaultTrackOutput
- TsChunk -> HlsMediaChunk
- Established hls.playlist package for HLS playlist things
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120325049
2016-06-15 19:39:09 +01:00
olly
c99250d9c5 Constant simplification.
- Use same constant for unknown/unset microsecond times/durations.
- Change constant values to be nowhere near the "normal" range.
- Misc cleanup.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119944019
2016-06-15 19:39:08 +01:00
aquilescanta
51df2dce46 Add support for voice selection in WebVTT CSS
Allow styling <v Someone>Hello</v> with ::cue(v[voice="Someone"]) { ... }.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119748009
2016-06-15 19:39:07 +01:00
aquilescanta
c2beffc6c5 WebVTT CSS Styling -- Support for element selectors
This CL allows style blocks to reference elements. For example: we could style
a cue with text "Sometimes <b>bold</b> is not enough" with the style block
::cue(b) { ... }.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119734779
2016-06-15 19:39:07 +01:00
olly
956cbe4a09 Delete Clock/FakeClock from V2 until we need them.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119655941
2016-06-15 19:39:07 +01:00
aquilescanta
767c7ab169 Fixed id referencing in WebVTT CSS styling
In CSS, ids are references using #. The absence of # references elements.

NOTE: If the id of a cue was "1", we support its reference with ::cue(#1).
In CSS, however, this is not valid, and the number should be escaped with
\3 as in ::cue(\31). We still do not use number escaping (and I doubt
whether we should at some point).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119634708
2016-06-15 19:39:07 +01:00
aquilescanta
efe76def89 Add support to CSS in WebVTT files
This CL adds the support of CSS styling in Cues through id and "universal" cue selector.
The more sophisticated selectors will be left for later, because they requier a bit more
complex logic. Also narrowed a little bit the responsibilities of the WebvttCueParser to
move some to the WebvttParser.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119547731
2016-06-15 19:39:06 +01:00
olly
7170ff380c Remove V1 DASH multi-period + seeking-in-window from V2.
Both of these features are being promoted to first class
citizens in V2 (multi-period support will be handled via
playlists, seeking-in-window will be handled by exposing
the window/timeline from the player and via the normal
seek API). For now, it's much easier to continue the
refactoring process with the features removed.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119518675
2016-06-15 19:39:06 +01:00
andrewlewis
3c1239826c Rename webm.WebmExtractor to mkv.MatroskaExtractor.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119020538
2016-06-15 19:39:06 +01:00
andrewlewis
3208e20673 Add ParsableNalUnitBitArray which unescapes while reading.
This replaces calls to unescape except for SEI unescaping.

Use the new ParsableNalUnitBitArray for reading the slice header in HLS
access unit detection and slice_type reading.

Unescape the SPS before parsing in FLV and MP4. Before this change it was
parsed in its original (escaped) form.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=118777869
2016-06-15 19:39:05 +01:00
olly
305d8aa049 Improve ExoCacheTest.
- Use FakeDataSource as the upstream source.
- Actually validate that caching is happening (i.e. reads happen
  on the upstream source only if the data hasn't been read through
  the CacheDataSource already).
- Move FakeClock to sit alongside the other Fake classes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=118555903
2016-06-15 19:39:04 +01:00
olly
6cc507aac0 Make all DataSource implementations implement getUri.
In V2 we'll at some point start using DataSource factories
for creating DataSource instances. If there are two DataSource
interfaces this gets unnecessarily awkward.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=118470751
2016-06-15 19:39:04 +01:00
andrewlewis
ce9b309aa1 Rename SampleHolder to DecoderInputBuffer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=118040127
2016-06-15 19:39:04 +01:00
olly
0ee45550c9 Use longs rather than ints for HLS byterange.
Issue #1387
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=118021498
2016-06-15 19:39:04 +01:00
andrewlewis
8353463bf5 Detect sample boundaries in H.264 TSs without AUDs.
Issue: #1263
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117813106
2016-06-15 19:38:06 +01:00
andrewlewis
fc716b5711 Signal end of stream in SampleHolder flags.
Also use MediaCodec buffer flag constants instead of those on MediaExtractor.

This is in preparation for merging InputBuffer and SampleHolder.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117810136
2016-06-15 19:38:06 +01:00
aquilescanta
60ba7823e0 Add Css styles in the WebVTT parser
This is the first version and is still not linked to the WebVTT parser nor
does it support all the intended features, but it was left this way to
ease the review a little bit.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117722492
2016-06-15 19:38:06 +01:00
cdrolle
14c5114049 Fixed issue in which unknown sample mime types would cause MediaPresentationDescription to throw an NPE.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117560114
2016-06-15 19:38:06 +01:00
olly
03ed811c7c Add missing eclipse files to experimental.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117544932
2016-06-15 19:38:06 +01:00
olly
0dc0d70397 Use SimpleDecoder for subtitles.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117543706
2016-06-15 19:38:05 +01:00
olly
16e1eaf410 Removed VorbisUtilTests throws declarations to avoid warning
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117326253
2016-06-15 19:38:05 +01:00
olly
a067bd0965 Make OggVorbisExtractor seekable.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117252304
2016-06-15 19:38:05 +01:00
olly
0135aaa122 Migrate ExoCache CacheSpan filenames from v1 to v2
V2 supports encoding special characters while on disk.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117228319
2016-06-15 19:37:51 +01:00
olly
8447781a44 Add workaround to discard NAL units up to the first SPS.
Some devices fail to decode an avc3 stream that doesn't start with an SPS (for
example, if an access unit delimiter appears first). Workaround the issue by
discarding input sample data up to the first SPS on those devices.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117224602
2016-06-15 19:37:45 +01:00
olly
9cfff0b028 Merge cleaned version of https://github.com/google/ExoPlayer/pull/1234.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117224172
2016-06-15 19:37:44 +01:00
olly
99606f6e2e Allow equality assertions on FakeExtractorOutput.
The idea here is that you'll be able to feed data through an extractor
to a FakeExtractorOutput, then do the same again with some or all of the
simulated flakiness settings toggled on FakeExtractorInput, and then
assert that the output was the same in both cases.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117224019
2016-06-15 19:37:44 +01:00
olly
b37e9f6980 For both alignment cue setting value and position cue setting alignment value,
allow "center".
This value (and not "middle") is listed in
https://w3c.github.io/webvtt/ ( WebVTT: The Web Video Text Tracks Format, Draft
Community Group Report, 21 December 2015).

Leaving the behavior for "middle" unchanged.
It was the value listed in older drafts, e.g.
https://www.w3.org/TR/2014/WD-webvtt1-20141113/ ( W3C First Public Working
Draft 13 November 2014 )
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117220612
2016-06-15 19:37:44 +01:00
olly
7cddd1b1d9 Move OGG extractor to use FakeExtractorInput + Simplify.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117220360
2016-06-15 19:37:44 +01:00
olly
300b58e530 Introduce FakeExtractorInput (based loosely on RecordableExtractorInput).
- Use it to simplify a bunch of tests.
- Will also replace RecordableExtractorInput in a subsequent CL.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=117220030
2016-06-15 19:37:44 +01:00
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