2148 Commits

Author SHA1 Message Date
tonihei
aeb2fefe48 Further language normalization tweaks for API < 21.
1. Using the Locale on API<21 doesn't make any sense because it's a no-op
   anyway. Slightly restructured the code to avoid that.
2. API<21 often reports languages with non-standard underscores instead of
   dashes. Normalize that too.
3. Some invalid language tags on API>21 get normalized to "und". Use original
   tag in such a case.

Issue:#6153
PiperOrigin-RevId: 258773463
2019-07-18 19:39:33 +01:00
andrewlewis
e4f849076c Remove unused extractor constructors
PiperOrigin-RevId: 258754710
2019-07-18 14:16:49 +01:00
olly
c67f18764f Move Format equality check back to write side of sample queue
PiperOrigin-RevId: 258752996
2019-07-18 14:16:29 +01:00
olly
e25340be3d Pass format instead of codec string when getting profile and level
AV1 profile recognition requires additional info contained in format.

PiperOrigin-RevId: 258746315
2019-07-18 14:16:09 +01:00
tonihei
c779e84cbb Switch language normalization to 2-letter language codes.
2-letter codes (ISO 639-1) are the standard Android normalization and thus we
should prefer them to 3-letter codes (although both are technically allowed
according the BCP47).

This helps in two ways:
 1. It simplifies app interaction with our normalized language codes as the
    Locale class makes it easy to convert a 2-letter to a 3-letter code but
    not the other way round.
 2. It better normalizes codes on API<21 where we previously had issues with
    language+country codes (see tests).
 3. It allows us to normalize both ISO 639-2/T and ISO 639-2/B codes to the same
    language.

PiperOrigin-RevId: 258729728
2019-07-18 14:15:50 +01:00
aquilescanta
80d5dabd52 Fix DataSchemeDataSource re-opening and range requests
Issue:#6192
PiperOrigin-RevId: 258592902
2019-07-18 14:15:31 +01:00
andrewlewis
bee35ed9d7 Fix DeprecationMismatch errors
PiperOrigin-RevId: 258590215
2019-07-18 14:15:12 +01:00
tonihei
049f3cf5cd Keep default start position (TIME_UNSET) as content position for preroll ads.
If we use the default start position, we currently resolve it immediately
even if we need to play an ad first, and later try to project forward again
if we believe that the default start position should be used.

This causes problems if a specific start position is set and the later
projection after the preroll ad shouldn't take place.

The problem is solved by keeping the content position as TIME_UNSET (= default
position) if an ad needs to be played first. The content after the ad can
then be resolved to its current default position if needed.

PiperOrigin-RevId: 258583948
2019-07-18 14:14:52 +01:00
olly
1a479387f2 Fix the equals check
PiperOrigin-RevId: 258574110
2019-07-18 14:14:33 +01:00
olly
a3ded59f28 Check codec profile/level for AV1
Add appropriate unit tests.

PiperOrigin-RevId: 258552404
2019-07-18 14:14:14 +01:00
olly
5e4f52541d Extend RK video_decoder workaround to newer API levels
Issue: #6184
PiperOrigin-RevId: 258527533
2019-07-18 14:13:55 +01:00
tonihei
01376443b3 Add MediaSource.enable/disable.
These methods helps to indicate that a media source isn't used to create new
periods in the immediate term and thus limited resources can be released.

PiperOrigin-RevId: 258373069
2019-07-18 14:13:36 +01:00
olly
7760eca238 Deep compare formats in SampleMetadataQueue instead of shallow compare
PiperOrigin-RevId: 258285645
2019-07-18 14:12:55 +01:00
tonihei
2b5c42e027 Fix some inline parameter name comments.
The name of this parameter recently changed in 3fe0b1a6fe and I forgot
to change these inline comment usages.

PiperOrigin-RevId: 258160659
2019-07-18 14:12:11 +01:00
Yannick RUI
1909987dc8 Change all the conditions and scores that are currently in the constructor of TextTrackScore to comparisons in TextTrackScore.compareTo 2019-07-15 16:05:01 +02:00
Yannick RUI
af98883a7b Reintroducing existing logic as requested here https://github.com/google/ExoPlayer/pull/6178#pullrequestreview-261298162 2019-07-15 11:35:32 +02:00
tonihei
bbcd1126b2 Remove DownloadService from nullness blacklist.
PiperOrigin-RevId: 258038961
2019-07-14 16:25:37 +01:00
tonihei
3fe0b1a6fe Rename SourceInfoRefreshListener to MediaSourceCaller.
This better reflects its usage as a caller identifier and not just a listener.

PiperOrigin-RevId: 257827188
2019-07-14 16:25:18 +01:00
aquilescanta
510f1883b0 Plumb DrmSessionManager into ProgressiveMediaSource
PiperOrigin-RevId: 257777513
2019-07-14 16:24:59 +01:00
tonihei
df81bd6a68 Make ExtractorMediaSource a CompositeMediaSource instead of just wrapping.
It's easy to forget to forward methods when using basic wrapping. For example,
ExtractorMediaSource.addEventListener is currently a no-op because it's not
forwarded.

PiperOrigin-RevId: 257757556
2019-07-14 16:24:39 +01:00
tonihei
ccc82cdb4a Remove some remaining references to manifests.
PiperOrigin-RevId: 257757496
2019-07-14 16:24:21 +01:00
Oliver Woodman
56a922c121 Merge pull request #6151 from ittiam-systems:bug-5527
PiperOrigin-RevId: 257668797
2019-07-14 16:24:02 +01:00
aquilescanta
3f24d4433a Optimize DrmSession reference replacement
Potentially avoids up to two calls to synchronized methods

PiperOrigin-RevId: 257578304
2019-07-14 16:22:41 +01:00
aquilescanta
91750b8009 Plumb DrmSessionManager into DashMediaSource
PiperOrigin-RevId: 257576791
2019-07-14 16:22:22 +01:00
aquilescanta
6796b179a6 Make onInputFormatChanged methods in Renderers take FormatHolders
PiperOrigin-RevId: 257478434
2019-07-14 16:22:02 +01:00
aquilescanta
972c6c2f5c Avoid acquiring DrmSessions using the dummy DrmSessionManager
This is a temporary workaround until we have migrated all MediaSources uses.
This change avoids having to migrate all uses of MediaSources immediately.

PiperOrigin-RevId: 257459138
2019-07-14 16:21:43 +01:00
aquilescanta
d4e3e8f2e0 Add overridingDrmInitData to DecryptableSampleQueueReader
To use in HLS when session keys are provided

PiperOrigin-RevId: 257421156
2019-07-14 16:21:04 +01:00
bachinger
49a2e5a5cb add manifest to Timeline.Window
- Remove manifest argument from callbacks of Player.EventListener and
  SourceInfoRefreshListener. Instead make it accessible through
  Player.getCurrentManifest() and Timeline.Window.manifest.
- Fix all MediaSource implementation to include the manifest in the
  Timeline instead of passing it to the SourceInfoRefreshListener.
- Refactor ExoPlayerTestRunner, FakeTimeline, FakeMediaSource to
  reflect these changes and make tests pass.

PiperOrigin-RevId: 257359662
2019-07-14 16:20:45 +01:00
Yannick RUI
29a099cf03 Switch text track score from the score based logic to a comparison based logic similar to the one we use for audio track selection (see AudioTrackScore). 2019-07-12 13:28:41 +02:00
Venkatarama NG. Avadhani
4b776ffe42 Refactor FlacStreamInfo to FlacStreamMetadata 2019-07-11 11:43:55 +05:30
Venkatarama NG. Avadhani
fb1f91b2a1 Clean up vorbis comment extraction 2019-07-11 11:43:55 +05:30
Venkatarama NG. Avadhani
77e1e4cc1e Add vorbis comments support to flac extractor
Decode and add vorbis comments from the flac file to metadata.

 #5527
2019-07-09 17:25:21 +05:30
olly
65d9c11027 Bump version to 2.10.3
PiperOrigin-RevId: 257161518
2019-07-09 11:54:39 +01:00
olly
b3d258b6cf Fix race condition in DownloadHelper
Sending MESSAGE_PREPARE_SOURCE should happen last in the constructor.
It was previously happening before initialization finished (and in
particular before pendingMediaPeriods was instantiated).

Issue: #6146
PiperOrigin-RevId: 257158275
2019-07-09 11:41:54 +01:00
tonihei
e3af045adb CEA608: Fix repeated Special North American chars.
We currently handle most the control code logic after handling special
characters. This includes filtering out repeated control codes and checking
for the correct channel. As the special character sets are control codes as well,
these checks should happen before parsing the characters.

Issue:#6133
PiperOrigin-RevId: 256993672
2019-07-08 19:42:09 +01:00
tonihei
d66f0c51a4 CEA608: no-op readability clean-up
PiperOrigin-RevId: 256676196
2019-07-05 17:33:30 +01:00
olly
fbb76243bd Clean up DRM post requests
- Explicitly specify HTTP_METHOD_POST (previously this was
  implicit as a result of the body data being non-null)
- Use null when there's no body data (it's converted to
  null inside of the DataSpec constructor anyway)

PiperOrigin-RevId: 256573384
2019-07-05 17:33:13 +01:00
olly
924cfac966 Remove more low hanging fruit from nullness blacklist
PiperOrigin-RevId: 256573352
2019-07-05 17:32:55 +01:00
tonihei
81e7b31be1 Apply playback parameters in a consistent way.
Currently, we sometimes apply new playback parameters directly and sometimes
through the list of playbackParameterCheckpoints. Only when using the checkpoints,
we also reset the offset and corresponding position for speedup position
calculation. However, these offsets need to be changed in all cases to prevent
calculation errors during speedup calculation[1].

This change channels all playback parameters changes through the checkpoints to
ensure the offsets get updated accordingly. This fixes an issue introduced in
31911ca54a.

[1] - The speed up is calculated using the ratio of input and output bytes in
SonicAudioProcessor.scaleDurationForSpeedUp. Whenever we set new playback
parameters to the audio processor these two counts are reset. If we don't reset
the offsets too, the scaled timestamp can be a large value compared to the input
and output bytes causing massive inaccuracies (like the +20 seconds in the
linked issue).

Issue:#6117
PiperOrigin-RevId: 256533780
2019-07-05 17:32:21 +01:00
tonihei
0145edb60d Move MediaSource masking code into separate class.
The masking logic for unprepared MediaSources is currently part of
ConcatanatingMediaSource. Moving it to its own class nicely separates the
code responsibilities and allows reuse.

PiperOrigin-RevId: 256360904
2019-07-05 17:31:11 +01:00
olly
7964e51e0e Remove more classes from nullness blacklist
PiperOrigin-RevId: 256202135
2019-07-05 17:30:19 +01:00
aquilescanta
7408b4355a Add DRM format support checks for MediaSource provided DRM
PiperOrigin-RevId: 256161522
2019-07-02 17:50:06 +01:00
olly
6febc88dce FLV extractor fixes
1. Only output video starting from a keyframe
2. When calculating the timestamp offset to adjust live streams to start
   at t=0, use the timestamp of the first tag from which a sample is actually
   output, rather than just the first audio/video tag. The test streams in
   the referenced GitHub issue start with a video tag whose packet type is
   AVC_PACKET_TYPE_SEQUENCE_HEADER (i.e. does not contain a sample) and whose
   timestamp is set to 0 (i.e. isn't set). The timestamp is set correctly on
   tags that from which a sample is actually output.

Issue: #6111
PiperOrigin-RevId: 256147747
2019-07-02 17:49:24 +01:00
tonihei
04959ec648 Remove unnecessary variables from ConcatenatingMediaSource.
The total window and period count, as well as the period offset for each holder
are not actually needed and can be removed.

Also added a TODO to remove two other variables if possible.

PiperOrigin-RevId: 255945584
2019-07-02 17:48:04 +01:00
andrewlewis
6fe70ca43d Use the floor of the frame rate for capability checks
PiperOrigin-RevId: 255584000
2019-07-02 17:47:26 +01:00
andrewlewis
244c202c56 Fix hidden API warnings from Metalava
PiperOrigin-RevId: 255442455
2019-07-02 17:46:49 +01:00
tonihei
2a765f6b5a Visibility clean-up: Don't extend visibility of protected methods in overrides.
PiperOrigin-RevId: 255412493
2019-07-02 17:46:30 +01:00
tonihei
1bd73eb70e Cleanup: Remove DynamicConcatenatingMediaSource
PiperOrigin-RevId: 255410268
2019-07-02 17:46:10 +01:00
olly
cf68d4eb47 Cleanup: Remove deprecated text and metadata output interfaces
PiperOrigin-RevId: 255380951
2019-07-02 17:45:51 +01:00
olly
1d36edc214 Remove unnecessary FileDescriptor sync
PiperOrigin-RevId: 255380796
2019-07-02 17:45:32 +01:00