1183 Commits

Author SHA1 Message Date
olly
0fc53f6e37 Fix Flac test + bring v2 fully in sync (I think!).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120335929
2016-06-15 19:39:10 +01:00
olly
6635dd0ef7 Fix infinite loop in AdtsExtractor sniffing malformed or non-ADTS streams.
Here is a WAV that exhibits this issue:
https://storage.googleapis.com/courtside-public/dcower/reaper_16bit_nonbwf.wav
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120334203
2016-06-15 19:39:10 +01:00
olly
157f5ff886 Workaround for issue #1443
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120334164
2016-06-15 19:39:10 +01:00
olly
8f2e56d59b Add support for a bext chunk *before* the fmt chunk in WAV files.
This can occur in some Broadcast Wave Format (BWF) files, such as those
produced by the Zoom H2n. See the included sample for an example.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120334117
2016-06-15 19:39:10 +01:00
olly
b3f732cd05 Fix parsing of QT sample desc version 2.
Also support "lpcm" and "sowt" sample descriptors.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120334017
2016-06-15 19:39:10 +01:00
olly
2a37b02ee2 Merge updates from GitHub.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120332794
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
andrewlewis
6f32636f40 Use long instead of int for MP3 sample counter.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120331805
2016-06-15 19:39:09 +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
69b431b8c2 Stop using SparseArray where a regular array will do.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120240634
2016-06-15 19:39:09 +01:00
olly
b5bdbedfd5 Move HLS to use a single RollingSampleBuffer per track.
Notes:
- RollingSampleBuffer will be renamed DefaultTrackOutput in a
  following CL, and variable naming will be sanitized.
- TsChunk will also be renamed to HlsMediaChunk, since it can
  be used for non-TS containers (e.g. MP3).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120240243
2016-06-15 19:39:09 +01:00
eguven
a7d7859478 Shared super class for LibflacAudioTrackRenderer and LibopusAudioTrackRenderer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120225655
2016-06-15 19:39:09 +01:00
olly
a760c9bfd9 Use RollingSampleBuffer directly for non-HLS.
This also fixes the largest queued timestamp to be the
correct value if upstream samples are discarded.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120207054
2016-06-15 19:39:09 +01:00
olly
5ce210e374 Propagate format information through RollingSampleBuffer.
At this point the only reason preventing the chunk package
from using RollingSampleBuffer directly, rather than
DefaultTrackOutput, is that the latter maintains the largest
parsed timestamp. This will be pushed inside the former in
the next CL. Following that, splicing logic will also be
pushed inside of RollingSampleBuffer, and HLS will be moved
over to using a single RollingSampleBuffer per track, with
the splicing done inline.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120206658
2016-06-15 19:39:09 +01:00
olly
4e0638ce06 Remove unnecessary extension of DefaultTrackOutput.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120123489
2016-06-15 19:39:09 +01:00
olly
4451be929d Move sample offset application to RollingSampleBuffer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120123335
2016-06-15 19:39:09 +01:00
olly
ffb4aeaa8c Remove pointless constructor argument.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120123223
2016-06-15 19:39:09 +01:00
olly
17d7a0cb4b Make RollingSampleBuffer implement TrackOutput
This is the first step toward merging of RollingSampleBuffer
and DefaultTrackOutput, which is a precursor to removing some
indirection for DASH/SS playbacks, and to moving HLS playbacks
to use a single output buffer per track (with inline splicing).

Where this is heading is that sample format changes will
eventually be attached to samples in the rolling buffer. This
will eliminate the need for piping sample formats around the
edges of the rolling buffer (e.g. via redirection in
ChunkExtractorWrapper and BaseMediaChunk.getSampleFormat).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120123093
2016-06-15 19:39:09 +01:00
andrewlewis
4161dc8d62 Infer TYPE_SS for .isml.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120119973
2016-06-15 19:39:08 +01:00
olly
5e93c0b6e4 Fix spurious comment.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120115490
2016-06-15 19:39:08 +01:00
olly
fa04c713f6 Discard all sample data for disabled tracks.
There's a more nuanced version of this where we actually
disable on the loading side, but it's quite tricky to get
the threading just right. I have a change that I'll
probably manage to clean up and send out at some point.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120106967
2016-06-15 19:39:08 +01:00
olly
1e4a3c162e Remove setVideoScalingMode call that doesn't do anything.
Oops, forgot this from my previous CL!
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120104992
2016-06-15 19:39:08 +01:00
olly
ed188d1bc8 Apply video scaling mode correctly.
Issue: #1428
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119952373
2016-06-15 19:39:08 +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
olly
28e926602f Remove layer of indirection when piping sample data.
For DASH + SS, sample data is currently plumbed through:

Extractor
->ChunkExtractorWrapper
->ContainerMediaChunk
->DefaultTrackOutput
->RollingSampleNBuffer

This change bypasses the ContainerMediaChunk layer. It
should be possible to completely delete DefaultTrackOutput
in the future, but such a change may well be tied to
changes in HLS format splicing + how we buffer (or don't
buffer) disabled tracks.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119853857
2016-06-15 19:39:08 +01:00
aquilescanta
7ad34c5c5c Fix hashCode method for TrackSelection
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119842923
2016-06-15 19:39:08 +01:00
andrewlewis
e4ee19513c Remove ExoPlayer.STATE_PREPARING.
prepare(SampleSource) is renamed to setSource(SampleSource). The player
immediately transitions to STATE_BUFFERING when the source is set, at which
point doSomeWork is called.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119838825
2016-06-15 19:39:08 +01:00
olly
3ae1c615d9 LoadControl - Start cleaning up usage somewhat.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119758106
2016-06-15 19:39:07 +01:00
olly
fec7798005 Remove dead code + simplify commitSample.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119752741
2016-06-15 19:39:07 +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
andrewlewis
e594eccd4d Merge SampleSourceTrackRenderer into TrackRenderer.
TrackRenderer and SampleSourceTrackRenderer both now use a TrackStream
so they can be merged.

(This may also be useful for adding playlist support, in case TrackStreams need
to be replaced during playback.)
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119743228
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
f963c626af Remove seeking to live edge.
This is in preparation for the player knowing about the live
window, at which point only correct playback positions will be
passed into ChunkSource implementations. Note that both
implementations bound the chunk index within range in case of,
for example, off-by-one errors caused by very recent manifest
updates.

This will temporarily cause live playbacks to always start at
the beginning of the current live window (we'll be trying to
play from t=0, which will be adjusted to the start of the live
window as a result of the bounding).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119733559
2016-06-15 19:39:07 +01:00
olly
730e4ac953 Remove workaround for FrameworkSampleSource.
FrameworkSampleSource will still be useful for audio, where
sample interleaving isn't an issue. We could optionally add
a "don't wait for first frame" boolean to the video renderer
if we *really* need to keep some form of this workaround in
place, but I'd rather not do so for now.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119733224
2016-06-15 19:39:07 +01:00
olly
35e0dd8401 Use a single set of track type constants.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119732992
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
eguven
192f566a1b Copy opus extension v1->v2
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119643009
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
def59ebb26 Replaced full reference with import
This CL removes a warning by adding the import, and removes a qualified reference in the process.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119618343
2016-06-15 19:39:06 +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
andrewlewis
eb877f0cb7 Handle udta as a leaf atom.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119532634
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
cblay
1c0a120aeb Give the SimpleCache.initialize() Thread a better name.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119393264
2016-06-15 19:39:06 +01:00
olly
e5d028c425 Merge https://github.com/google/ExoPlayer/pull/1397.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119182077
2016-06-15 19:39:06 +01:00
olly
92ac270ce5 Return C constant rather than -1, as documented.
Note that the DataSourceInputStream read methods
are implementing a different interface (InputStream,
not DataSource), which is why -1 is still used in
that case.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119180851
2016-06-15 19:39:06 +01:00
eguven
05ef643e28 Copy from V1: Extractor.release() method releases all kept resources.
This method is needed by FlacExtractor to release native resources.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119143922
2016-06-15 19:39:06 +01:00
olly
7c35e38b4e Fix a few issues with SmoothStreaming in V2.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=119049397
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
olly
9282710f04 Decouple next chunk evaluation and queue trimming.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=118925372
2016-06-15 19:39:06 +01:00