3112 Commits

Author SHA1 Message Date
olly
49b83c01ca Throw ParserException if parsing unsupported media
This is for consistency with what we do elsewhere;
specifically in FragmentedMp4Extractor.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163974960
2017-08-02 17:43:28 +01:00
tonihei
22ea9ed687 Clean-up ExoHostedTest/HostActivity.
This change clearly seperates the hosting of a test (HostActivity) from
the internals of hosting an ExoPlayer lifecycle (ExoHostedTest).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163967960
2017-08-02 17:42:11 +01:00
aquilescanta
55fe5d21a2 Create the demos dir
Now the demo app is under demos/main.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163967883
2017-08-02 17:40:54 +01:00
olly
8e08d982ab Further fix H262 segmentation
Issue: #2891

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163951910
2017-08-02 13:26:05 +01:00
andrewlewis
962a71314a Fix handling of H.262 CSD
The start code for H.262 codec-specific data may be across a packet boundary.
Before this change the offset passed to CsdBuffer.onData may have been before
the start point of the data in the newData buffer.

After this change, start codes are added directly to the CSD buffer when it's
filling and any start code bytes added by onData (at the end of a packet) are
discarded.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163943584
2017-08-02 13:24:47 +01:00
Oliver Woodman
1a95a35434 Minor cleanup 2017-08-01 18:20:54 +01:00
olly
c01c8cd2a6 Bump version to 2.5.0-beta2
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163830353
2017-08-01 16:23:39 +01:00
olly
13513b9c3e Clean up MediaSessionExt documentation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163828712
2017-08-01 16:23:39 +01:00
andrewlewis
55620348d4 Fix sequence extension position calculation
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163814942
2017-08-01 16:23:39 +01:00
tonihei
1151104e2f Use TrackGroup instead of TrackSelection in FakeAdaptiveDataSet.
This was a bug as the data set should contain sample data for all available
tracks. Also added a unit test.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163806579
2017-08-01 16:23:39 +01:00
ojw28
08faafb4c1 Merge pull request #3115 from goffioul/h262-segmentation
Fix H262 segmentation.
2017-08-01 11:09:30 +01:00
ojw28
b562eb215f Merge pull request #3098 from dbrain/custom_playback_control_view
Allow PlaybackControlView to be overridden in SimpleExoPlayerView
2017-08-01 10:48:51 +01:00
olly
957158b7ff Fix 2.5.0 lint errors
- Publish IMA extension
- Force IMA to use the correct version of the support library
- Add missing sr translations for repeat mode strings

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163705883
2017-07-31 21:19:42 +01:00
olly
516762946d Fix typo in Id3Decoder
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163694825
2017-07-31 21:18:25 +01:00
olly
ecd9cff058 Robustness fix for malformed ID3 metadata
Issue: #3116

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163693235
2017-07-31 21:17:02 +01:00
olly
3ec0ccabbc Check for null entries in ConcatenatingMediaSource
We do this in the dynamic case, and I think we've seen
a few GitHub issues where developers do this and don't
understand what they've done wrong (because the failure
comes later).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163688557
2017-07-31 21:15:42 +01:00
olly
c2d7e05429 Propagate skipped input buffers through to CodecCounters
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163683081
2017-07-31 21:14:23 +01:00
andrewlewis
cdeea27973 Handle release() while initializing the ads manager
Also don't detach any attached player in release() to prevent a possible
NullPointerException if ImaAdsLoader.release() runs first, then the MediaSource
is released and detaches the player. This is safe because if the loader was
attached it's guaranteed to be detached.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163673750
2017-07-31 21:13:00 +01:00
andrewlewis
1f0c85bd73 Allow apps to handle ad clicked/tapped events
Issue: #3106

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163455563
2017-07-31 21:09:00 +01:00
aquilescanta
bb04456324 Fix IndexOutOfBounds when reading a multiple of 8 number of bits
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163455269
2017-07-31 21:07:40 +01:00
tonihei
5bd5af8c60 Replace canStop with blockUntilEnded in HostedActiviy.
The canStop method gets called every second in a seperate thread until the
test can be stopped. Replacing it with blockUntilEnded forwards the
responsibility to stop to the test itself which has better control over the
stop condition.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163343824
2017-07-31 21:06:11 +01:00
eguven
c3d7ccc3cb Replace iterable foreach loops with indexed for loops
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163343347
2017-07-31 21:04:55 +01:00
tonihei
ad5ca0812d Add unit test for FakeDataSource.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163341994
2017-07-31 21:03:36 +01:00
aquilescanta
84d19c464b Add support for AAC-LATM in transport streams
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163337073
2017-07-31 20:59:45 +01:00
aquilescanta
5278a63768 Change copyRenditionsList parameters names
Also instantiate the resulting list with a predicted size to minimize
list resizing.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163332285
2017-07-31 20:58:21 +01:00
eguven
bcc69c2da7 Add HlsMasterPlaylist.copy method
Creates a copy of this playlist which includes only the variants identified by the given variantUrls.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163212562
2017-07-31 20:56:56 +01:00
eguven
9936bc6702 Replace iterable foreach loops with indexed for loops
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163193118
2017-07-31 20:55:34 +01:00
tonihei
b631755b63 Clean up test runner for ExoPlayer tests.
Currently the ExoPlayerWrapper is used to run tests using an ExoPlayer
implementation. Some properties of the test are set in the constructor, some
are set by overloading the class, others are hard-coded in the
ExoPlayerWrapper class, and a mechanism similar to the existing ActionSchedule
is missing.

This change does the following:
 1. Renames ExoPlayerWrapper to ExoPlayerTestRunner as it better reflects
    its purpose.
 2. Adds an internal Builder to easily set-up the test in a coherent way. This
    allows to only set necessary test components while using defaults for the rest.
 3. Integrate ActionSchedule.
 4. Apply the new structure to the existing tests currently using ExoPlayerWrapper.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163186578
2017-07-31 20:54:18 +01:00
eguven
cdb71a80aa Remove empty line after copyright text
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163186057
2017-07-31 20:52:49 +01:00
eguven
2dc1870dd4 Simple Java style fix
Put space between ] and {.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163116816
2017-07-31 20:51:29 +01:00
eguven
3f7b4dc75f Add HlsDownloader
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=163052346
2017-07-31 20:50:10 +01:00
tonihei
3991a6198b Extend ActionSchedule with new actions.
The new actions are: prepare source, set repeat mode, wait for timeline
change, wait for position discontinuity, execute Runnable.

Moreover, this change removes the restriction of using a SimpleExoPlayer to
allow ActionSchedule to be used in other scenarios.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162918554
2017-07-31 20:46:35 +01:00
tonihei
0411add91e Add fake adaptive media source.
This class extends the existing FakeMediaSource by creating a
FakeAdaptiveMediaPeriod instead of a FakeMediaPeriod.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162918487
2017-07-31 20:45:08 +01:00
tonihei
1bc01c09ee Add fake adaptive media period.
This class extends the existing FakeMediaPeriod by using a ChunkSampleStream
with chunks from a FakeChunkSource instead of a FakeSampleStream.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162916656
2017-07-31 20:43:51 +01:00
aquilescanta
df562bc8d1 Fix PlaybackControlView's repeat mode button update when player is null
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162824522
2017-07-31 20:42:29 +01:00
Michael Goffioul
908362bdf3 Fix H262 segmentation.
Prepend sequence headers to the next frame, instead of appending them to
the previous frame. Tested decoders like FFMPEG and Google's
Android/MPEG2 expects to read the sequence headers before the first
frame they apply to. When sequence headers are appended to the previous
frame, these are ignored and this leads to incorrect decoding.
2017-07-27 15:44:28 -04:00
Danny Brain
be85da3a69 Allow PlaybackControlView to be overridden in SimpleExoPlayerView 2017-07-26 11:34:49 +10:00
olly
13732fe618 Release notes + version bump for 2.5.0-beta1
There's no way to represent a beta in our integer versioning
scheme. I propose we just set it the same for all betas + the
stable release. The versioning for the demo app isn't that
important, so I've just put it directly to 2.5.0 as well.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162749130
2017-07-21 17:39:12 +01:00
olly
4436e94ba8 Hardcode libopus output frequency to 48000Hz
Issue: #3080

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162746202
2017-07-21 17:37:56 +01:00
andrewlewis
cdfe57833d Update IMA extension README
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162742982
2017-07-21 17:36:31 +01:00
olly
3eb85446a2 Fully document DefaultTrackSelector
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162740498
2017-07-21 16:12:41 +01:00
olly
9bb8b240d2 Improve Player/ExoPlayer Javadoc
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162740451
2017-07-21 16:11:29 +01:00
bachinger
6f600a8fa5 Take care playback preparer and queue navigator can not register overlapping
playback actions.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162736210
2017-07-21 16:10:10 +01:00
bachinger
3bc3900dba Do not update queue when the queue did not actually change to avoid
unnecessary updates are broadcasted to all clients.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162728670
2017-07-21 16:08:45 +01:00
olly
89181cf4bc Fully document MappingTrackSelector
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162721489
2017-07-21 11:24:29 +01:00
andrewlewis
07de4d1b2c Handle ad skipping and content resume
SKIPPED can't be handled as CONTENT_RESUME_REQUESTED because after skipping an
ad there may be further ads to play in its ad group.

Remove workaround for handling unexpected playAd without stopAd, as the player
can instead recover when IMA sends CONTENT_RESUME_REQUESTED. This in turn fixes
handling of the case where playAd is called twice but IMA expects only the
first ad to play, when skipping a particular ad. (Add an ad tag where this
occurs to internal samples.)

Check whether a currently playing ad has been marked as played in
ExoPlayerImplInternal, and handle this case as a seek. This ensures that any
loaded ad periods are discarded in the case of CONTENT_RESUME_REQUESTED.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162610621
2017-07-21 11:23:10 +01:00
olly
94b08b27e9 Fix MediaSession gradle file to use modulePrefix
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162610352
2017-07-21 11:21:46 +01:00
andrewlewis
554a399407 Switch to non-deprecated player constants
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162605429
2017-07-21 11:20:07 +01:00
bachinger
8d56f904a0 make MediaSessionConnector depend only to the Player interface
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162604746
2017-07-21 11:18:42 +01:00
olly
33f5bd6aed Start better documenting track selection
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=162601990
2017-07-21 11:17:21 +01:00