3877 Commits

Author SHA1 Message Date
olly
17e73bdc78 Optimize ParsableNalUnitBitArray
Apply the same learnings as in ParsableBitArray.

Issue: #3040

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161674119
2017-07-15 22:27:31 +01:00
olly
fba0546774 Optimize ParsableBitArray
ParsableBitArray.readBit in particular was doing an excessive
amount of work. The new implementation is ~20% faster on desktop.

Issue: #3040

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161666420
2017-07-15 22:27:26 +01:00
olly
4cb5b34977 Don't use ParsableBitArray to parse TS packet headers
Really low hanging fruit optimization for TS extraction.

ParsableBitArray is quite expensive. In particular readBits
contains at least 2 if blocks and a for loop, and was being
called 5 times per 188 byte packet (4 times via readBit). A
separate change will follow that optimizes readBit, but for
this particular case there's no real value to using a
ParsableBitArray anyway; use of ParsableBitArray IMO only
really becomes useful when you need to parse a bitstream more
than 4 bytes long, or where parsing the bitstream requires
some control flow (if/for) to parse.

There are probably other places where we're using
ParsableBitArray over-zealously. I'll roll that into a
tracking bug for looking in more detail at all extractors.

Issue: #3040

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161650940
2017-07-15 22:27:20 +01:00
olly
2665e42f85 Correctly propagate format identifier for CEA-608 in HLS
Issue: #3033

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161512537
2017-07-15 22:27:13 +01:00
olly
4233f81ed7 Misc tweaks to UI components
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161454491
2017-07-15 22:27:06 +01:00
olly
f94db63366 Fix reporting of width/height
1. maybeRenotifyVideoSizeChanged should report reported* variables
2. Add check into maybeNotifyVideoSizeChanged to suppress reporting
   in the case that the width and height are still unknown.

Issue: #3007

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160879625
2017-07-15 22:26:39 +01:00
olly
bf5495f2f5 Optimize in-buffer seeking for HLS
Also move to using an array to hold the SampleQueues,
as we've moved to doing in ExtractorMediaPeriod.

Issue: #551

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161972990
2017-07-15 17:33:33 +01:00
olly
a2ffcec200 Fix NPE setting drm scheme type
drmInitData can be null in DASH if all of the init data is
specified at the manifest level instead. I took a look at
injecting the manifest format into the extractors, so that
we can actually copy the scheme type into it, but that's
at least non-trivial enough to delay for a subsequent CL.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161956246
2017-07-15 17:32:28 +01:00
olly
0869802173 Show last seek position when playing an ad
We'd normally expect playback controls to be hidden during
ad playback, although if they are visible for whatever reason,
it makes sense to set the position to the current content
position now that we have it.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161950098
2017-07-15 17:31:01 +01:00
matttt
7b20e130ce Allow a direct executor for Cronet's response handling thread.
We want to experiment with a direct executor to avoid thread hops between the
network thread and the response handling thread. This change is needed to do
so.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161812382
2017-07-15 17:29:41 +01:00
andrewlewis
68e5e91735 Store the resume position even if the window is not seekable
Note: this temporarily exposes a bug where seeking a non-seekable source leads
to the player position being negative before playback starts.

Issue: #2655

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161801111
2017-07-15 17:28:20 +01:00
olly
8378c3dc1f Simplify + optimize VorbisBitArray
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161796758
2017-07-15 17:26:55 +01:00
eguven
90398c5811 Check if thread is interrupted before opening connection
On an old version of okhttp, opening connection clears the thread interrupt flag silently. This is a workaround
to reduce the effect of the bug.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161784435
2017-07-15 17:24:09 +01:00
andrewlewis
70c5bf7052 Support resuming ads
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161778560
2017-07-15 17:22:52 +01:00
andrewlewis
6c74a31556 Support resuming content after ads
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161775394
2017-07-15 17:21:32 +01:00
olly
4f2fae4fba Minor tweak to demo app
"Default (none)" is sometimes just wrong, since the track
selector may attempt to select a track even if it exceeds
the renderer's capabilities. Just "Default", as it used to
be, was more accurate.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161695241
2017-07-15 17:20:08 +01:00
olly
0da2299c49 Fix FlacStreamInfo to not call readBits with a >32 value
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161677399
2017-07-12 18:29:31 +01:00
olly
5885f34d12 Optimize ParsableNalUnitBitArray
Apply the same learnings as in ParsableBitArray.

Issue: #3040

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161674119
2017-07-12 18:28:20 +01:00
olly
01c0ccbdbd Optimize ParsableBitArray
ParsableBitArray.readBit in particular was doing an excessive
amount of work. The new implementation is ~20% faster on desktop.

Issue: #3040

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161666420
2017-07-12 18:27:08 +01:00
olly
2b1614cc7b Don't use ParsableBitArray to parse TS packet headers
Really low hanging fruit optimization for TS extraction.

ParsableBitArray is quite expensive. In particular readBits
contains at least 2 if blocks and a for loop, and was being
called 5 times per 188 byte packet (4 times via readBit). A
separate change will follow that optimizes readBit, but for
this particular case there's no real value to using a
ParsableBitArray anyway; use of ParsableBitArray IMO only
really becomes useful when you need to parse a bitstream more
than 4 bytes long, or where parsing the bitstream requires
some control flow (if/for) to parse.

There are probably other places where we're using
ParsableBitArray over-zealously. I'll roll that into a
tracking bug for looking in more detail at all extractors.

Issue: #3040

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161650940
2017-07-12 18:24:23 +01:00
olly
ecc8f6c4fa Upgrade dependencies
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161648060
2017-07-12 18:23:11 +01:00
aquilescanta
f72833476e Add DRM support to RendererCapabilities
This CL also makes DefaultTrackSelector take it into account when RendererCapabilities
sets it to unsupported.

A following CL could add a DefaultTrackSelector parameter to force DRM "known support" for specific track types.

Issue:#1661
Issue:#1989
Issue:#2089

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161556467
2017-07-12 18:22:04 +01:00
olly
3c5688de73 Optimize in-queue seeking when non-AV tracks are present
Let's do it this way for now. Note there's an implicit
assumption in here that non-AV tracks consist of only
key-frames, but I think we'll not encounter any issues
in the real world as a result, we already make this
assumption in ChunkSampleStream, and actually tagging
every queue with this information explicitly is a very
painful amount of plumbing.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161545383
2017-07-12 18:20:54 +01:00
andrewlewis
6b17e2cf3f Fix handling of postrolls
adsLoader.contentComplete was called twice which led to postrolls not seeing
the STARTED event.

Also make the onPositionDiscontinuity handler easier to follow by renaming
variables, and remove the adGroupIndex field.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161537765
2017-07-12 18:19:41 +01:00
tonihei
0621651476 Add buffer length metric to ABR playback test.
This metric is measured once every second.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161527345
2017-07-12 18:18:25 +01:00
andrewlewis
0b58c33632 Handle detaching and reattaching the ads loader
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161526026
2017-07-12 18:17:13 +01:00
andrewlewis
94683d1e8c Show ad markers for non-multi-window time bars
Ads don't have their own periods any more, so show ad group markers even if the
time bar is not multi-window.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161524411
2017-07-12 18:15:53 +01:00
tonihei
6f2f8e49b8 Add rebuffer test metrics to ABR playback tests.
This includes a metric logger class which logs events and generates metrics, and some changes to the Perfgate benchmark config to add the metrics. So far, only rebuffer counts, rebuffer time and startup time are measured, together with auxiliary values of total playback time used for testing and number of playback failures.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161513672
2017-07-12 18:14:33 +01:00
olly
0052a70f60 Correctly propagate format identifier for CEA-608 in HLS
Issue: #3033

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161512537
2017-07-12 18:13:12 +01:00
andrewlewis
ef56c9fe39 Move ad playback state into ImaAdsLoader
Once background and resuming is supported, the ads loader will be kept when the
player is destroyed and recreated. Move the state relating to the structure of
ads and what ads have been loaded/played out of the media source and into the
loader so the information is not lost when the source is released, in
preparation for supporting background and resuming.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161503571
2017-07-12 18:11:39 +01:00
olly
b31fd5bc7c Misc tweaks to UI components
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161454491
2017-07-12 18:10:25 +01:00
tonihei
45f94eab62 Allow moving media source within DynamicConcatenatingMediaSource.
This option allows to move the currently playing media source to another position
and also to move other media source without creating a new MediaSource object.

Issue:#1706

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161402022
2017-07-12 18:09:08 +01:00
olly
06b3b3ca8d Migrate HLS over to new SampleQueue methods
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161391296
2017-07-10 16:17:09 +01:00
Oliver Woodman
5ebbb6ef45 Merge branch 'jcable-dev-v2' into dev-v2 2017-07-10 12:29:16 +01:00
Oliver Woodman
b333169ada Merge branch 'dev-v2' of git://github.com/jcable/ExoPlayer into jcable-dev-v2 2017-07-10 12:29:06 +01:00
Oliver Woodman
78e0545774 Re-add RTMP extension classes 2017-07-10 12:16:20 +01:00
tonihei
68827878e9 Fix RTMP library gradle file.
(GitHub issue #3038)

Module prefix was missing for library-core module.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161366375
2017-07-10 12:09:56 +01:00
andrewlewis
4180b9656d Show played ad groups
By default played ad groups are shown faded out. This helps the user know
whether they will see an ad when they seek to a given position.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=161098491
2017-07-10 12:07:35 +01:00
olly
a0aa9a3803 Update moe equivalence
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160955809
2017-07-10 12:06:23 +01:00
Oliver Woodman
7524228160 Clean up rtmp extension 2017-07-05 15:08:00 +01:00
ojw28
1279b7dcf1 Merge pull request #2503 from b95505017/rtmp_client
Rtmp client
2017-07-05 15:04:58 +01:00
ojw28
0ecbe5dc04 Merge branch 'dev-v2' into rtmp_client 2017-07-05 15:04:49 +01:00
aquilescanta
a04663372f Detect playlist stuck and playlist reset conditions in HLS
This CL aims that the player fails upon:

- Playlist that don't change in a suspiciously long time,
  which might mean there are server side issues.
- Playlist with a media sequence lower that its last snapshot
  and no overlapping segments.

This two error conditions are propagated through the renderer,
but not through MediaSource#maybeThrowSourceInfoRefreshError.

Issue:#2872

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160899995
2017-07-05 15:02:39 +01:00
olly
dda3616f5a Fix reporting of width/height
1. maybeRenotifyVideoSizeChanged should report reported* variables
2. Add check into maybeNotifyVideoSizeChanged to suppress reporting
   in the case that the width and height are still unknown.

Issue: #3007

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160879625
2017-07-05 15:02:39 +01:00
eguven
37faead26e Rename some assert methods in CacheAsserts to better reflect what they do
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160873280
2017-07-05 15:02:39 +01:00
tonihei
05a77eef5d Move Extractor test assertion methods to ExtractorAsserts class.
This cleans up test the TestUtil class that in large parts consisted of
assertions for Extractor tests.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160829066
2017-07-05 15:02:39 +01:00
olly
ad3d1e0cf2 Add reset() to SampleQueue. Deprecate reset(boolean) and disable()
The deprecated methods will be removed as soon as HLS is migrated
to use the new ones.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160827936
2017-07-05 15:02:39 +01:00
andrewlewis
d733bb4101 Fix video tunneling state transition to ready
Issue: #2985

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160827532
2017-07-05 15:02:39 +01:00
tonihei
960315c4d5 Move extractTimelineFromMediaSource to test util class.
This also ensures that TimelineAsserts only contains assert methods.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160827271
2017-07-05 15:02:39 +01:00
aquilescanta
a82e51070b Add playback tests for CENC/DASH streams.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=160825705
2017-07-05 15:02:39 +01:00