1736 Commits

Author SHA1 Message Date
olly
6b9c43e578 Avoid expensive equality checks in DefaultTrackOutput.
If the media format changes from one Format object to another
one that's is equal (but not the same object), readData would
end up performing an expensive equality evaluation on every
invocation.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121362300
2016-06-15 19:39:52 +01:00
andrewlewis
c2bd01a756 Removed unused parameter.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121102072
2016-06-15 19:39:52 +01:00
olly
f0e6fff011 Remove unused private constants.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121101188
2016-06-15 19:39:52 +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
andrewlewis
9b57487845 Handle gapless audio metadata in elst.
Only edit lists that truncate the first/last sample are supported, which is
sufficient to handle AAC encoder delay/padding.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121011278
2016-06-15 19:39:52 +01:00
olly
23cb9532c5 Refactor #6.5: Restore DASH UTC timing element support.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121002218
2016-06-15 19:39:52 +01:00
olly
0841d043b8 Refactor #6.4: Create child source instances on demand.
Dash/SS SampleSources now instantiate ChunkSource and
ChunkSampleSource (renamed to ChunkTrackStream) instances
on demand as tracks are enabled. The TrackGroups exposed
by the DASH/SS SampleSources are now constructed at the
top level.

Note that this change resolves the TODOs at the top of the
ChunkSource classes, allowing multiple adaptation sets of
the same type.

Next steps will include:

- Bring back UTC timing element support for DASH, which
  will be an extra request during preparation in  the DASH
  SampleSource.
- Simplification of manifest fetching to use a Loader directly
  in the two top level SampleSource classes. ManifestFetcher
  should eventually go away once HLS no longer needs it.
- Eventually, some consolidation between DASH/SS. There's a
  lot of common code there now.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121001777
2016-06-15 19:39:52 +01:00
olly
d82bb3f657 Refactor #6.3: Pull drm parsing up to SS SampleSource.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121001478
2016-06-15 19:39:52 +01:00
olly
eb3460b3aa Refactor #6.2: Start to simplify components.
Parse the duration of the media directly from the manifest
in the DASH/SS SampleSource implementations.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121001296
2016-06-15 19:39:52 +01:00
olly
b38d004553 Refactor #6.1: Pull up manifest requests.
This change pulls manifest refresh responsibility up to the
top level Dash/SS SampleSource implementations. In following
steps more of the manifest processing logic will be pulled
up (e.g. extracting track groups from the initial manifest),
which will allow ChunkSampleSource/ChunkSource instances to
be further simplified and created on demand.

I've avoided moving/renaming anything for now, so as to keep
it fairly easy to review.

Note that this change does the TODO related to releasing the
manifest fetchers.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121001139
2016-06-15 19:39:52 +01:00
olly
15a890c3ce Refactor #6.0: Add SampleSources for DASH and SS.
This is a mechanical change. The two new SampleSource classes
are forked from MultiSampleSource, with the logic that previously
was in the demo app's SourceBuilder methods copied into the
corresponding constructors. Subsequent steps will:

1. Pull the initial manifest processing from DashChunkSource and
SmoothStreamingChunkSource into the new SampleSource classes.
2. Remove the construction of ChunkSampleSource instances from
the constructors, instead instantiating children only as needed
when tracks are enabled.
3. Simplify ChunkSampleSource down into a ChunkTrackStream object.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121001021
2016-06-15 19:39:52 +01:00
cdrolle
3d14c7242d Refactored Eia608Parser so that it manipulates the caption string builder directly, avoiding unnecessary object allocation.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120926283
2016-06-15 19:39:52 +01:00
eguven
ab3489efc1 Remove unnecessary reset() method.
pageHeader.headerArray is only used in getNextSeekPosition()
in which populatePageHeader() resets them both at the beginning
anyway.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120902428
2016-06-15 19:39:35 +01:00
olly
784a18a188 Use C constants as event source ids.
The construction currently in SourceBuilder will be
moving inside of the core lib, so it can't refer to
DemoPlayer constants.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120822759
2016-06-15 19:39:35 +01:00
andrewlewis
845d250442 Restore renderer.isEnded check when updating the playback position.
If rendererMediaClock is non-null, the rendererMediaClockSource is enabled or
started, so remove the check in updatePositionUs.

When disabling renderers for track selection, renderers with changing track
selections always transition from started -> enabled.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120819483
2016-06-15 19:39:35 +01:00
olly
e88eeba859 Fix compiler warnings.
- You can't link to a generic type (apparently).
- Suppress unchecked conversion warning.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120817601
2016-06-15 19:39:35 +01:00
olly
7313c26a56 Properly document processOutputBuffer.
Plus add processOutputBuffersChanged just for consistency
with processOutputBuffer and processOutputFormat.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120811608
2016-06-15 19:39:35 +01:00
cdrolle
0bd26b74b2 Remove Eia608TrackRenderer
Functionality is moved into Eia608Parser, so that Eia608Parser
can be used with TextTrackRenderer, similar to all the other
text/subtitle formats. Modified some of the other
text/subtitle-related classes to support the new behaviour.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120755145
2016-06-15 19:39:11 +01:00
olly
6c45233653 Attempt to make drainOutputBuffer clearer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120722975
2016-06-15 19:39:11 +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
olly
5cbf75b619 Make AudioTrack.handleBuffer more sane.
Now uses buffer position + limit in both new and legacy modes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120713837
2016-06-15 19:39:11 +01:00
eguven
d1eb43ad62 V2 Extension fixes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120699171
2016-06-15 19:39:11 +01:00
olly
da5e4dbe92 Fix wrong-way-round-sign. Oops!
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120694784
2016-06-15 19:39:11 +01:00
andrewlewis
50f5616266 Fix documentation and logging in LongArray.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120693278
2016-06-15 19:39:11 +01:00
andrewlewis
c60470339b Remove unused parameter from ChunkSource.continueBuffering.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120691990
2016-06-15 19:39:11 +01:00
olly
ab615682b5 Fix green screen problem when using VpxRenderer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120689946
2016-06-15 19:39:11 +01:00
olly
854acaa1ac Set decode only flag in DefaultTrackOutput.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120553402
2016-06-15 19:39:11 +01:00
olly
9a893e3003 Fix thread-safety issue using DefaultTrackOutput.
Reading the format and/or a sample needs to be done as a
single operation. Else you can have a situation where the
queue is initially empty, and this happens:

1) Read downstream format X
2) Read downstream format X (unchanged)
3) Write format Y
4) Write first sample
5) Read first sample

The first sample then appears to be format X rather than Y.

Note that readData in the SampleSource implementations always
looks roughly the same. readReset is identical in all cases.
isReady is identical in all cases now I've fixed them to be
that way. So it should be pretty easy to get DefaultTrackOutput
to implement TrackStream directly, at which point a whole load
of duplication will disappear.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120546377
2016-06-15 19:39:11 +01:00
olly
90b7081824 Propagate resets at the source rather than track level.
- Code is simpler. We only ever reset all tracks.
- Allows the standalone media clock to be updated properly. This
  allows simpler recovery for live streams in ExtractorSampleSource.
- Fixes #1285 and paves the way for a fix for #758.

Issue: #1285
Issue: #758
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120530682
2016-06-15 19:39:10 +01:00
olly
2b13165738 Optimize HLS seeking.
I think the concept of a sparse track might need formalizing
in Format at some point. We should probably do a similar thing
with sparse tracks in ExtractorSampleSource as well. WDYT?

Issue: #551
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120530195
2016-06-15 19:39:10 +01:00
olly
b1de997388 Remove incorrect AudioTrack timestamp adjustment.
This is just wrong. I think there used to be an off-by-one
timestamp error in YouTube's fmp4 streams, and this code
was initially designed exclusively to play such streams. I
don't see this issue any more though, if it was ever there!
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120447694
2016-06-15 19:39:10 +01:00
olly
e390bdf98c Align Chunk/HLS sample sources.
Having moved HLS to use single sample queues per track, these
classes have become relatively similar. This CL aligns the two
to make this more obvious. It remains unclear whether it'll
ever be sensible to merge them; there are still some niggly
complications for HLS.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120429618
2016-06-15 19:39:10 +01:00
[]inger
ae8f95f64d Added Ogg/Vorbis samples to internal samples for main and experimental.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120425278
2016-06-15 19:39:10 +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
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
andrewlewis
febf86c54e Clean up demo app source building.
- Rename preparePlayer to initializePlayer, to reflect the fact that the
preparing state is gone. Replace playerNeedsPrepare with playerNeedsSource.
- playWhenReady is now always true in calls to initializePlayer.
- Handle the intent just before setting the source.
- Use URIs consistently instead of Strings to avoid reparsing.
- onShown becomes initializePlayer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120125576
2016-06-15 19:39:09 +01:00