11415 Commits

Author SHA1 Message Date
tonihei
0d0ccadc83 Add getter for ad groups in AdPlaybackState.
This allows to decouple the data structure from the access. In
a future change, this allows to completely remove old ad groups
(e.g. for live streams where the number of groups would otherwise
grow forever).

Also move the time into the group itself for better encapsulation.

PiperOrigin-RevId: 376170408
2021-05-27 18:48:40 +01:00
aquilescanta
4e749e7afe Disable reconnection CastOptions
This includes setResumeSavedSession(false) and setEnableReconnectionService(false).

PiperOrigin-RevId: 376162880
2021-05-27 16:10:54 +01:00
ibaker
4033832cba Cleanup the MediaItem.Builder javadoc for 'conditional' setters
Many of the setters are ignored unless others are set - this change:
* Lists these conditions exhaustively.
* Uses more concise language to avoid overshadowing the main details
  of what the setter sets.
* Tweaks the language from 'is ignored' to 'shouldn't be called', to
  open up the future possibility of throwing an error if these are
  called without the 'required' setter also being present (see
  Issue: #8957).

#minor-release

PiperOrigin-RevId: 376162385
2021-05-27 16:10:54 +01:00
olly
f2680d3169 Tweak readme
PiperOrigin-RevId: 376155192
2021-05-27 16:10:39 +01:00
claincly
6d04b998f9 Use more factory method to create ParserException.
ParserException's constructor methods are deprecated.

#minor-release

PiperOrigin-RevId: 376150191
2021-05-27 16:04:10 +01:00
ibaker
41ce635a42 Fix docs on MediaItem.Builder#setDrmUuid
The docs on setLicenseUri say it's optional, and it has been since
379cd8a04f
(which should have changed this javadoc too)

#minor-release

PiperOrigin-RevId: 376139158
2021-05-27 16:02:56 +01:00
claincly
4f59394f51 Use factory method to create ParserException.
ParserException's constructor methods are deprecated.

#minor-release

PiperOrigin-RevId: 376127494
2021-05-27 16:01:38 +01:00
aquilescanta
c353151288 Add errorCode to the EventLogger
PiperOrigin-RevId: 376126959
2021-05-27 16:00:32 +01:00
claincly
0fb5fa75cf Support basic and digest authentication.
Authentication sequence in RTSP:

- Server replies "Unauthorized" to our DESCRIBE request, and includes the
  necessary information (i.e. realm, digest nonce, etc) in WWW-Authenticate
  header

- After `RtspClient` receives the response, we

  - Parse the WWW-Authenticate header, stores the auth info. The info is saved
    for all further RTSP requests (that all need to carry authorization headers)
  - send the second DESCRIBE request with the Authorization header.

#minor-release

PiperOrigin-RevId: 376116302
2021-05-27 10:47:18 +01:00
aquilescanta
8f04d36f59 Inline redundant constructor
PiperOrigin-RevId: 376005620
2021-05-27 10:46:06 +01:00
aquilescanta
85e4137b81 Add test for ColorInfo in MP4
PiperOrigin-RevId: 375992816
2021-05-27 10:44:50 +01:00
aquilescanta
e8498054d7 Add ColorInfo to extractor tests' format serialization
PiperOrigin-RevId: 375992627
2021-05-27 10:43:36 +01:00
bachinger
095e2feb20 Enable source code formatting
PiperOrigin-RevId: 375979170
2021-05-27 10:42:22 +01:00
olly
ee2af43a54 Fix file formatting
PiperOrigin-RevId: 375919564
2021-05-27 10:40:54 +01:00
olly
4b0c987675 Fix StyledPlayerView detachment
Issue: #8985
#minor-release
PiperOrigin-RevId: 375913914
2021-05-27 10:40:14 +01:00
claincly
614f9d8d55 Rename RtspMessageChannel.openSocket() to open().
The method openSocket in RtspMessageChannel does not actually open a socket.
The 'open' term refers more to opening the message channel.

#minor-release

PiperOrigin-RevId: 375908999
2021-05-27 10:38:56 +01:00
claincly
cfb90e4b70 Remove the default RTSP message handling off playback thread.
The callbacks received RTSP messages and RTSP sending errors are now invoked
directly from RtspMessageChannel's internal threads. It's up to the handler
implementation to decide which thread to handle the messages.

#minor-release

PiperOrigin-RevId: 375908282
2021-05-27 10:38:17 +01:00
claincly
68b2875a42 Move RTP packet forwarding off playback thread.
Previously, RTSP interleaved binary data is posted onto the playback thread
for handling, the playback thread then adds the received data to a queue.
A loader thread will later dequeue the data and process it.

In this CL, the binary data is sent through a separate listener, on
RtspMessageChannel's RTSP receiving thread.

#minor-release

PiperOrigin-RevId: 375907609
2021-05-27 10:37:39 +01:00
claincly
4a780fb90a Allow RtspHeaders to take multiple header values under the same name.
Some RTSP servers will offer multiple WWW-Authenticate options. We wanted to
be able to pick them up.

#minor-release

PiperOrigin-RevId: 375907276
2021-05-27 10:37:00 +01:00
ibaker
e7516fe4e0 Throw from (pre)acquireSession if the DrmSessionManager isn't prepared
Currently acquireSession() fails with an NPE from
checkNotNull(exoMediaDrm). A follow-up change will result in exoMediaDrm
sometimes being non-null while prepareCount==0 (and in this case we
still want acquireSession() to fail).

preacquireSession() doesn't currently fail in a way the caller can
observe - the same NPE is thrown, but asynchronously and it doesn't
propagate out of the background thread. Throwing directly seems
preferable since it's a clear bug to be trying to preacquire sessions
from an unprepared/released manager.

PiperOrigin-RevId: 375906450
2021-05-27 10:36:20 +01:00
gyumin
beb13f62a7 Add FOLDER_TYPE_NONE to MediaMetadata
PiperOrigin-RevId: 375883879
2021-05-26 11:33:41 +01:00
klhyun
2e5c95e80a Remove obsolte TODO
PiperOrigin-RevId: 375830765
2021-05-26 11:33:04 +01:00
aquilescanta
ddc047c235 Add ColorInfo parsing support in MP4 files
PiperOrigin-RevId: 375719035
2021-05-26 11:32:29 +01:00
aquilescanta
2e8d4c9110 Extract function for mapping ColorInfo-related constants
PiperOrigin-RevId: 375705247
2021-05-26 11:31:52 +01:00
aquilescanta
4e5e654eff Add convenience method for getting the name of an error code
PiperOrigin-RevId: 375686596
2021-05-26 11:31:12 +01:00
samrobinson
6b7a0d8c11 Add year to MediaMetadata.
#minor-release

PiperOrigin-RevId: 375674759
2021-05-26 11:30:36 +01:00
aquilescanta
a1ecf3193a Assign ERROR_CODE_PARSING_* to ParsingException
PiperOrigin-RevId: 375515685
2021-05-26 11:29:53 +01:00
aquilescanta
6a8b9557cc Use ERROR_CODE_BEHIND_LIVE_WINDOW instead of instanceof checks
PiperOrigin-RevId: 375514509
2021-05-26 11:29:16 +01:00
Oliver Woodman
afe4217c1c Merge pull request #8943 from dlafayet:embeddedstyle2
PiperOrigin-RevId: 375484765
2021-05-26 11:28:37 +01:00
ibaker
926df59081 Defensively copy potentially mutable text in Cue constructor
Without this the Cue isn't deeply immutable, which can be a bit
surprising.

PiperOrigin-RevId: 375477571
2021-05-26 11:27:59 +01:00
ibaker
2081f4b466 Annotate Cue.Builder getters with @Pure
This reduces the null-checking required in a follow-up change.

PiperOrigin-RevId: 375468504
2021-05-26 11:27:22 +01:00
ibaker
5afc915e51 Don't restore DRM keys before releasing them
#minor-release

PiperOrigin-RevId: 375436117
2021-05-26 11:26:09 +01:00
samrobinson
8d550bf05b Add an extras bundle to MediaMetadata.
#minor-release

PiperOrigin-RevId: 375435339
2021-05-26 11:25:27 +01:00
aquilescanta
1fa61feb7e Migrate AtomParsers to using new ParserException fields
PiperOrigin-RevId: 375133184
2021-05-26 11:24:46 +01:00
samrobinson
e793a9031b Add a mediaType field to MediaMetadata.
#minor-release

PiperOrigin-RevId: 375097412
2021-05-21 18:25:49 +01:00
aquilescanta
3f33f10a32 Add ExtractorUtil method for checking input conditions
Unlike Assertions, the introduced method cannot be disabled and throws
a ParserException instead. This method is meant to replace regular
assertions (which throw RuntimeExceptions) which check input in the
parsing code.

PiperOrigin-RevId: 375085160
2021-05-21 18:24:37 +01:00
krocard
e8ca443389 Add to realease note DefaultDrmSessionEventListener's rename.
Its absence seems to have caused
https://github.com/google/ExoPlayer/issues/8969.

#minor-release

PiperOrigin-RevId: 375058222
2021-05-21 18:24:01 +01:00
olly
e9f66fc5d1 Replace internal dependencies on monolithic module
PiperOrigin-RevId: 375054051
2021-05-21 12:05:56 +01:00
tonihei
8ded11753e Fix issue where getFirstSampleIndex was called on spliced in chunks.
We need to avoid reading and skipping into preload chunks as they
may need to be discarded. The current code iterates over all chunks,
but this can be simplified by just checking the last chunk knowing
that the preload chunk must always be the last one.

As a result, we avoid calling getFirstSampleIndex on all chunks. This
is a bug since the method is not allowed to be called for chunks
that have been spliced in. This still leaves the smaller issue of
potentially calling this method for spliced-in preload chunks, which
will be solved separately.

Issue: #8937

#minor-release

PiperOrigin-RevId: 375053638
2021-05-21 12:05:23 +01:00
olly
8c9c0f8d3f Gradle cleanup #3
Tweak the way directories are passed

PiperOrigin-RevId: 374912886
2021-05-21 12:04:15 +01:00
aquilescanta
2c2197d12c Assign ERROR_CODE_IO_BAD_HTTP_STATUS to InvalidResponseCodeException
PiperOrigin-RevId: 374885599
2021-05-21 12:03:39 +01:00
aquilescanta
23d4efad7b Make TYPE_* constant declarations in lexicographic order
PiperOrigin-RevId: 374880929
2021-05-21 12:03:04 +01:00
aquilescanta
1c4294175f Add contentIsMalformed and dataType to ParserException
PiperOrigin-RevId: 374874272
2021-05-21 12:02:29 +01:00
tonihei
08259f8987 Don't allow spliced-in preload chunks.
Preload chunks may still need to be discarded. However, we don't
currently support discarding spliced-in chunks. Thus, we need to
avoid loadng a preload chunk that needs to be spliced-in.

Issue: #8937

#minor-release

PiperOrigin-RevId: 374851661
2021-05-20 15:45:30 +01:00
olly
20fcb42872 Gradle cleanup #2
PiperOrigin-RevId: 374847609
2021-05-20 15:44:28 +01:00
olly
45fde20b0e Gradle cleanup #1
Colocate lines that refer to the same module, to reduce probability of
accidentally removing one line and not the other (which has happened
more than once :)).

PiperOrigin-RevId: 374847082
2021-05-20 15:43:59 +01:00
tonihei
d08303d05d Add ServerSideInsertedAdsMediaSource.
This media source wraps another source and publishes a Timeline with
ads. The created MediaPeriods for ad and content are mapped back to
the original stream to allow seamless playback.

PiperOrigin-RevId: 374836091
2021-05-20 15:43:00 +01:00
tonihei
1a6f36d4a4 Fix reading position at stream transition.
PiperOrigin-RevId: 374836046
2021-05-20 15:42:31 +01:00
tonihei
8eb990e47a Make SSAI player logic more targeted.
There is a newly added condition to help advancing between SSAI ads
and content in case the ad group position or ad duration changed. The
condition currently doesn't check directly whether it's a SSAI
transition but relies on indrect signals. Making this more direct
helps to understand the purpose and avoid unintentional bugs where
this condition would apply in other cases too.

In addition, we need to exclude TextRenderer from the check because
its read position doesn't correspond to the actual decode position
since the decoding happens in the renderer itself (b/181312195).

PiperOrigin-RevId: 374835985
2021-05-20 15:42:02 +01:00
tonihei
5ff4211c5e Avoid recalculation of whether a MediaPeriod is part of a SSAI stream
We can instead just save this information in MediaPeriodInfo, similar
to how we store whether the MediaPeriod is last in the timeline etc.

PiperOrigin-RevId: 374835918
2021-05-20 15:41:34 +01:00