1707 Commits

Author SHA1 Message Date
Oliver Woodman
52c5342158 getBufferedPosition can't return unknown anymore 2016-07-07 20:15:27 +01:00
olly
4c434005d4 Remove/simplify some extractor tests.
We have our snazzy new file-based extractor tests now,
and the other ones have historically proven way more
hassle than they're worth (e.g. I spent a good few hours
once just trying to work out how to fix the Mp4 extractor
test, having established it was the test and not the
code that was broken!).

I think some more can go from the ogg package, but leaving
in place for now because it's a bit less clear what to
get rid of.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125330072
2016-07-07 20:11:18 +01:00
eguven
53cc88e2dc DefaultOggSeeker small optimization.
skipToNextPage() isn't necessary anymore.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125147444
2016-07-07 20:09:28 +01:00
olly
4fe6e5d755 Misc fixes for playback tests.
- AllowedVideoJoiningTimeMs must be set to 0 for tests so
  that tests which disable/enable video renderers don't
  register a large number of dropped frames.
- Fixed a threading issue that could cause occassional test
  failure.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124978843
2016-06-15 20:28:17 +01:00
olly
aab551e907 Add HlsTest to V2.
The ones that are commented out are legitimately broken
and will need a library fix.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124978438
2016-06-15 20:27:48 +01:00
olly
e9f9df8faa Track selection UI needs to scroll.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124976833
2016-06-15 20:27:14 +01:00
olly
ec4c7d3acf Remove Eclipse support. Simplify manifests.
It looks like the manifests are essentially pointless,
but various tools are unhappy if I delete them.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124976509
2016-06-15 20:26:37 +01:00
andrewlewis
66a5c96c5a Calculate ExtractorSampleSource duration if unknown (playlists #4).
When buffering playlist items after the currently-playing one,
continueBuffering should take a position that is negative because the playback
position is before the start of the source being buffered. This change makes
sure that ExtractorSampleSources always have a known duration when they are
fully buffered, which means that the correct (negative) source-relative
position can be calculated.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124949409
2016-06-15 20:25:26 +01:00
eguven
e6267cd253 DefaultOggSeeker: use skipFully() instead skip().
skip() may skip less than what we want here.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124930478
2016-06-15 19:43:17 +01:00
olly
c45a3959b6 Bump version to 1.5.9.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124864123
2016-06-15 19:43:17 +01:00
andrewlewis
365812e820 Remove FrameworkSampleSource.
ExtractorSampleSource covers almost all use cases (except for AMR, AVI and
legacy Widevine). The FLAC extension must be compiled for support for FLAC
extraction.

FrameworkSampleSource has device-specific issues, makes blocking calls to the
underlying MediaExtractor, and does not provide much control over buffering.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124850102
2016-06-15 19:43:17 +01:00
andrewlewis
a6b7cfb5e4 Close ParsingLoadable input streams that fail to open.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124836804
2016-06-15 19:43:17 +01:00
olly
bd248ffee5 Ahem (fix bad constant value).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124836700
2016-06-15 19:43:17 +01:00
eguven
61df9aeb26 DashChunkSource: Workaround for missing segment at the end of the period.
Issue: #836
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124832221
2016-06-15 19:43:17 +01:00
olly
266c0dce40 Add DashTest to V2
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124831095
2016-06-15 19:43:17 +01:00
olly
f4e4fd51c6 Clean up chunked media source event listeners.
- Event listener is now at the SampleSource level, since the
  individual ChunkTrackStream instances are created internally.
- Event listener receives events corresponding to loads made
  at the SampleSource level (e.g. manifest fetches) in addition
  to those made by the ChunkTrackStream instances.
- Added ability for FormatEvaluators to propagate arbitrary
  information (as an Object) through to the listeners. This was
  a request from YouTube.
- Added significantly more information to each event, for example
  the DataSpec that defines the load being made is now passed, as
  is timing information.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124732984
2016-06-15 19:43:17 +01:00
eguven
172bc4e8d8 Increase mkv test sample file seek granularity to have better seek results.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124724113
2016-06-15 19:43:17 +01:00
olly
5cd7deffe7 Add playback tests to V2.
DashTest will be migrated separately, since it's a little
more work.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124722462
2016-06-15 19:43:17 +01:00
olly
0978227a84 Create a new CodecCounters on enable
If the same instance is reset then rapidly re-enabling the
renderer after disabling it can prevent an application from
reading the final values at the time when the renderer was
disabled. Hence we now instantiate a new CodecCounters each
time. This is needed to migrate DashTest to V2.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124721106
2016-06-15 19:42:58 +01:00
andrewlewis
7ae9bf409b Play a sequence of sources (playlists #3).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124713796
2016-06-15 19:42:58 +01:00
olly
df4e4a72fa Print the name of the decoder we failed to query.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124712775
2016-06-15 19:42:58 +01:00
andrewlewis
189a2502c5 Fix order of arguments in Format.copyWithDrmInitData.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124705921
2016-06-15 19:42:58 +01:00
sharjeel
41b86f660c sgpd support in ExoV2
This is basically clone of [] for Exo V2.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124682237
2016-06-15 19:42:58 +01:00
andrewlewis
2a3b4f6780 Don't flip() TextTrackRenderer EoS input buffers.
TextTrackRenderer would unconditionally flip input buffers read from its
source TrackStream, but the data could be null in the case where the buffer
signaled end of stream. Only flip if the corresponding flag is not set.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124559077
2016-06-15 19:42:58 +01:00
eguven
4279e22138 TestUtil.assertOutput() also tests seeking.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124556278
2016-06-15 19:42:58 +01:00
aquilescanta
461751b194 Add codec profiles for video container/sample formats.
This allows better decoding support checking.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124550351
2016-06-15 19:42:58 +01:00
olly
ca9bd5e8e4 Define DATA_TYPE constants in C.
Things like manifests are loaded not in the context of a Chunk,
but we want to eventually be reporting all loading events. So
it makes senes to define data types at a global level.

Also added {@code} in a few places for consistency.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124549737
2016-06-15 19:42:58 +01:00
eguven
1afe480a30 FakeExtractorOutput: add option to write dump files to external storage.
So dump files can be created easily.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124455709
2016-06-15 19:42:58 +01:00
eguven
b206cff98c FakeExtractorInput: Fix exception type
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124446331
2016-06-15 19:42:42 +01:00
tasnimsunny
b4746eddb3 Add cache initializtion signal to CacheEvictor
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124374161
2016-06-15 19:42:12 +01:00
eguven
4b3c72c057 FlacExtractorTest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124357946
2016-06-15 19:42:12 +01:00
eguven
544d88ca56 PsExtractorTest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124355441
2016-06-15 19:42:12 +01:00
eguven
110c819939 FragmentedMp4ExtractorTest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124346810
2016-06-15 19:42:12 +01:00
olly
4a3980c71e Add format change events to SimpleExoPlayer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124344637
2016-06-15 19:42:12 +01:00
eguven
80b10b5fc1 TestUtil.consumeTestData(): Make sure extractor doesn't use the position holder out of purpose.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124335837
2016-06-15 19:42:09 +01:00
eguven
98b7e7f4e2 AdtsExtractorTest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124335597
2016-06-15 19:42:09 +01:00
eguven
57d6c49e73 TsExtractorTest: Speed up the test with a smaller test sample file.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124333753
2016-06-15 19:42:09 +01:00
eguven
b5a9e4181b FlacJni: Add exceptions to jni methods' definitions.
These methods call read(...) method which may throw these exceptions.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124332828
2016-06-15 19:42:09 +01:00
eguven
cec658d573 ExtractorInput.setRetryPosition(): Called when reading fails and the required retry position is different from the last position.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124242428
2016-06-15 19:42:04 +01:00
olly
1a1a454d09 Remove stray break from HLS playlist parser.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124225444
2016-06-15 19:42:04 +01:00
olly
aa73e137d6 Propagate manifest format info through to renderers.
DASH and SS manifests define potentially useful information
that isn't present in the actual media streams. Primarily
the representation id, but bitrate, fps and language may
also be defined only at the manifest leve. This change merges
the information into the sample format that's propagated to
the renderers.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124225175
2016-06-15 19:42:04 +01:00
olly
cb9a64da33 Merge ID3 parsing improvements from GitHub.
- Parse APIC and TextInformation frames.
- In MPEG-TS, don't mind if packets contain end padding.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124079930
2016-06-15 19:42:04 +01:00
olly
444d21563c Fix MediaCodecUtil regression.
On older devices getCapabilitiesForType calls fail for some
secondary codecs. We didn't used to call getCapabilitiesForType
on secondary codecs, and so avoided this issue.

This change suppresses any exceptions encountered when
querying secondary decoders on API levels prior to N, to
restore previous behavior when a failure occurs.

Issue: #1534
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124010242
2016-06-15 19:42:04 +01:00
andrewlewis
e684e42994 Clean up DefaultDataSources and add factory for okhttp DataSources.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123991352
2016-06-15 19:42:04 +01:00
olly
c622483f79 Enable seamless rejoing for Vp9 extension.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123982330
2016-06-15 19:42:04 +01:00
olly
afa1ad1a6a Keep playback position advancing when all renderers are disabled.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123977520
2016-06-15 19:42:04 +01:00
olly
69bd31f7c2 Fix video renderer rejoining.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123976645
2016-06-15 19:42:03 +01:00
andrewlewis
a100175b72 Rename TrackRenderer.reset to TrackRenderer.onReset.
This allows the TrackRenderer superclass to do things when the renderer is
reset, and makes resetting consistent with other 'events' on renderers.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123974633
2016-06-15 19:42:03 +01:00
olly
ff745ac444 Make ExtractorSampleSource constructor consistent.
The allocator and buffering policy (e.g. how large the buffer
is) is moving to the top level as part of playlist support,
so it no longer makes sense to inject these parameters as
args into ExtractorSampleSource's constructor.

Instantiating the allocator and buffer size inside of the
source is temporary and only until they're moved up.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123968976
2016-06-15 19:42:03 +01:00
aquilescanta
6fd610fc5f Added max video size selection to DefaultTrackSelectionPolicy.
It is possible to add use of this feature in the demo app, restricting the selected
tracks to the viewport size. But it should be added in a future CL.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123965232
2016-06-15 19:42:03 +01:00