7500 Commits

Author SHA1 Message Date
samrobinson
ae400176b2 Add a mediaType field to MediaMetadata.
#minor-release

PiperOrigin-RevId: 375097412
2021-06-06 23:31:23 +01:00
tonihei
6d6efed6d4 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

PiperOrigin-RevId: 375053638
2021-06-06 23:30:59 +01:00
tonihei
10c19afa35 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-06-06 23:30:03 +01:00
claincly
5fc6b2ff9d Define the default RTSP character set.
#minor-release

PiperOrigin-RevId: 374433331
2021-06-06 23:29:53 +01:00
samrobinson
941a71ae28 Add track number & total to MediaMetadata
#minor-release

PiperOrigin-RevId: 374235979
2021-06-06 23:28:41 +01:00
samrobinson
6bba218e72 Add an artwork field to MediaMetadata
#minor-release

PiperOrigin-RevId: 373410795
2021-06-06 23:28:08 +01:00
olly
795594f862 Update avcLevelToMaxFrameSize for AVCLevel6, 61 and 62
PiperOrigin-RevId: 374161340
2021-06-06 23:23:33 +01:00
kim-vde
cfe2811091 Merge pull request #8860 from KeiMurayamaS:dev-v2-add-mpegh-parser
PiperOrigin-RevId: 373142159
2021-06-06 23:15:12 +01:00
olly
34428b699a Minor translation updates
#minor-release

PiperOrigin-RevId: 373543587
2021-05-13 11:08:06 +01:00
claincly
d608254ab0 Remove RTSP message logging.
#minor-release

PiperOrigin-RevId: 373336127
2021-05-12 13:02:54 +01:00
claincly
77008e16fe Allow RTSP streaming using TCP.
NAT will block off incoming UDP connection because the router has no knowledge
of the necessary port mapping (the mapping is never set up because UDP is
connectionless).

The end result is, the UDP socket to receive RTP data will timeout. After the
`SocketTimeoutException` is caught, the following takes place to try streaming
with TCP (or, RTP over RTSP).

- `RtspClient` sends TEARDOWN to tear down the current session.
- `RtspClient` re-connect to the RTSP server.
- `RtspMediaPeriod` cancels all loading `RtpDataLoadables` (that are using UDP)
- `RtspMediaPeriod` constructs new `RtpDataLoadables` that use
    `TransferRtpDataChannel`, and starts loading.
- Once the `RtpDataLoadables` are up and running, we are ready to receive.
  `RtspClient` sends the SETUP requests.

- The rest of the flow is unchanged.

#minor-release

PiperOrigin-RevId: 373310774
2021-05-12 13:02:48 +01:00
kim-vde
ef61fa5244 Merge pull request #8894 from cdongieux:fix/issue-8847
PiperOrigin-RevId: 373128118
2021-05-12 13:01:18 +01:00
claincly
0ea6c8998d Enable reading interleaved message in RtspMessageChannel.
RTSP interleaving enables RTP packets to be sent using RTSP's TCP connection.
The interleaving RTSP messages contain binary data only and always start with a
'$'. Normal RTSP messages contain line breaks (CRLFs) that indicate complete
lines.

#minor-release

PiperOrigin-RevId: 372990181
2021-05-10 23:50:18 +01:00
olly
923ba5138b Include RTSP module in gradle project
#minor-release

PiperOrigin-RevId: 372981022
2021-05-10 23:50:13 +01:00
tonihei
d55c68807e Remove reference to deprecated Player.EventListener.
PiperOrigin-RevId: 372925409
2021-05-10 23:49:46 +01:00
olly
eb195eff36 Fix Javadoc references to deprecated EventListener
#minor-release

PiperOrigin-RevId: 372919342
2021-05-10 23:49:20 +01:00
olly
2ff4e5a657 Clean up RtspMediaSource.Factory
- Don't deprecate methods not deprecated in the base class and that
  could one day be useful.
- Better document deprecation of other methods.

#minor-release

PiperOrigin-RevId: 372919080
2021-05-10 23:49:15 +01:00
olly
90fc24c900 Bump version to 2.14.0 and tidy release notes
PiperOrigin-RevId: 372910834
2021-05-10 23:49:01 +01:00
ibaker
207825fbec Swallow exceptions in TestContentProvider when writing to a pipe fails
The existing code results in flaky tests, where sometimes the write
fails (with "EPIPE (broken pipe)") and the exception propagates out
and causes the test to never complete and time out.

Swallowing the exception resolves this flakiness.

#minor-release

PiperOrigin-RevId: 372909415
2021-05-10 23:47:52 +01:00
kimvde
2145261dda Deprecate ExoPlayer.Builder.
Apps should migrate from ExoPlayerImpl to SimpleExoPlayer.

#minor-release

PiperOrigin-RevId: 372562923
2021-05-10 23:47:44 +01:00
samrobinson
e295a15d2d Add javadoc to the MediaMetadata setters.
#minor-release

PiperOrigin-RevId: 372549185
2021-05-10 23:47:37 +01:00
samrobinson
1c8f91c130 Rename MediaMetadata trackTitle and trackArtist to title and artist.
#minor-release

PiperOrigin-RevId: 372537414
2021-05-07 14:59:09 +01:00
samrobinson
07cd8d101d Add fields to MediaMetadata requested by MediaAPIs
#minor-release

PiperOrigin-RevId: 372448985
2021-05-07 11:00:53 +01:00
bachinger
31897af14b Avoid media item transitions for auto discontinuities when ads involved
#minor-release

PiperOrigin-RevId: 372433555
2021-05-07 11:00:23 +01:00
samrobinson
c97956ea29 Use getters in Rating subclasses rather than direct field access.
#minor-release

PiperOrigin-RevId: 372368685
2021-05-07 10:59:51 +01:00
gyumin
3be50b26a0 Revise javadoc for Rating classes
PiperOrigin-RevId: 371625281
2021-05-07 10:59:05 +01:00
jaewan
54440261b0 Move Rating class to library-common
Rating class should be in the same module as MediaMetadata.

Tested:
  $ ./gradlew --stacktrace :exo-library-common:tDUT
  $ ./gradlew --stacktrace :media2-session:tDUT
  $ ./gradlew --stacktrace :media2-session-vct-current:cAT
PiperOrigin-RevId: 370902917
2021-05-07 10:52:40 +01:00
tonihei
309fd20a11 Clarify timebase of media times in MediaLoadData.
Also fix unncessary adjustment done in ClippingMediaSource.

#minor-release

PiperOrigin-RevId: 372080724
2021-05-06 13:46:31 +01:00
olly
bfcf8736cd Use correct Log class
#minor-release

PiperOrigin-RevId: 372314890
2021-05-06 13:44:28 +01:00
tonihei
1a06f3c855 Add missing isPlaceholder forwarding in SinglePeriodAdTimeline
Also make future similar issues less likely by adding isPlaceholder
to the set method of Period (in case forwarding Timeline
implementations use this instead of just updating values selectively)

#minor-release

PiperOrigin-RevId: 372138523
2021-05-06 13:43:47 +01:00
krocard
002ee4de26 Deprecate EventListener in favor of Listener
#minor-release

PiperOrigin-RevId: 371348520
2021-05-04 11:25:52 +01:00
claincly
762d19b090 Flatten packages within the RTSP package.
#minor-release

PiperOrigin-RevId: 371337762
2021-05-04 11:25:11 +01:00
claincly
a64c6e80ed Introduce RtpDataChannel interface.
#minor-release

PiperOrigin-RevId: 371326814
2021-05-04 11:24:53 +01:00
claincly
3ddf73fdcf Allow retry opening RTP ports.
In RtpDataLoadable.load, the second UDP data source is opened on the port we
specify. If the port is already in use, a BindException is thrown.

#minor-release

PiperOrigin-RevId: 371319522
2021-05-04 11:24:33 +01:00
krocard
3375ee9c6a Deprecate component listener in favor of player
All `add*Listener` and `add*Output` methods are
deprecated in favor of `addListener`.

As for the class themselves `VideoListener` and
`AudioListener` are not used internaly by ExoPlayer,
`VideoRendererEventListener`
and `AudioRendererEventListener` are use in their
place.
As a result `VideoListener` and `AudioListener`
can be deprecated in favor `Listener`.

On the other hand `TextOutput` and `MedataOutput`
are used both in the player interface and internally in
renderers.
This means that those class can't be deprecated.
There usage in the public interface are indirectly
deprecated as their is no way to use them without
using the deprecated `add*Output`.
Thus it's not an issue that the class themselves are
not deprecated.

#minor-release

PiperOrigin-RevId: 371318268
2021-05-04 11:24:03 +01:00
dlafayet
cd3ebb3fe7 Merge #8858: Support ebutts:multiRowAlign in TTML text renderer
Imported from GitHub PR https://github.com/google/ExoPlayer/pull/8858

Fix bug in text alignment inheritance where child does not correctly inherit ancestor's setting

@icbaker
Merge 70eb4bceb73b3f07e2f8d545b4fa7961189ac52a into 45616f916b28c9187b3e0f0dd18797464a079cdc

COPYBARA_INTEGRATE_REVIEW=https://github.com/google/ExoPlayer/pull/8877 from dlafayet:multirowalign-cue d942b50a40525fea5d11b35a33d3bbc512550960
PiperOrigin-RevId: 371306966
2021-05-04 11:23:37 +01:00
bachinger
e0c39ade1e Merge pull request #8877 from dlafayet:textAlign
PiperOrigin-RevId: 371306900
2021-05-04 11:22:54 +01:00
ibaker
92253e1a30 Tweak verifyApplicationThread to compare Threads, not Loopers
#minor-release

PiperOrigin-RevId: 371306241
2021-05-04 11:22:32 +01:00
kimvde
ce8259e20a Avoid NPEs when checking the current thread in SimpleExoPlayer
Before, Looper.myLooper().getThread() could throw an NPE if the current
thread didn't have any looper.

#minor-release

PiperOrigin-RevId: 371097485
2021-05-04 11:22:01 +01:00
ibaker
cfec557ff0 Reformat some javadoc
PiperOrigin-RevId: 371068549
2021-05-04 11:21:28 +01:00
bachinger
d8da136d0f Remove ForwardingPlayer from 2.14.0 release 2021-04-30 12:05:07 +01:00
Ian Baker
b70fdf1bc4 Remove FfmpegVideoRenderer from 2.14.0 release 2021-04-30 11:53:37 +01:00
krocard
0f7ef1ea60 Add get video size
Move VideoSize in the common module and have the Player return it.

`Listener` and `AnalyticsListener` `onVideoSizeChanged` are updated
with the old method deprecated.

`VideoRendererEventListener.onVideoSizeChanged` was also migrated to
`VideoSize` but the old method is removed, not deprecated.
This is because:
 - apps calling/listening to this method is a rare and niche use-case.
 - it would introduce hard to diagnostic issues where if only the caller
   or the callee is updated to use the new method, the event will be lost.
   This doesn't occur with the other 2 listeners as the caller is always
   in ExoPlayer library and was updated to call both the old and new methods.

VideoSize is used everywhere except in `Format` as this would lead to
too much refactoring and backward compatibility breakage for little gain.

#minor-release

PiperOrigin-RevId: 371087419
2021-04-29 13:26:41 +01:00
samrobinson
79316aa5ac Add track artist, album artist and album title to MediaMetadata.
#minor-release

PiperOrigin-RevId: 370881618
2021-04-28 17:39:28 +01:00
ibaker
64e32d7c4c Fix flaky DRM assertion in AnalyticsCollectorTest
Session pre-fetching caused this ordering assertion to no longer be
always true. It should have been removed in
795ddfee40

#minor-release

PiperOrigin-RevId: 370880530
2021-04-28 17:39:01 +01:00
bachinger
b71b067b81 Revert "Add initial code for PlaybackException"
This reverts commit 1d96d6b6b097cca0ba511821e2309e4c966b4954.
2021-04-28 16:35:29 +01:00
samrobinson
b336df3ed3 Move the ownership of MediaMetadata to ExoPlayerImpl.
Add the onMediaMetadataChanged event to onEvents.

PiperOrigin-RevId: 370738521
2021-04-27 21:42:39 +01:00
aquilescanta
1d96d6b6b0 Add initial code for PlaybackException
Deferred the addition of error codes to ease the review process.

PiperOrigin-RevId: 370687238
2021-04-27 17:43:09 +01:00
claincly
537e8aadd5 Allow the extractor deplete the reordering queue as much as possible.
#minor-release

PiperOrigin-RevId: 370673852
2021-04-27 17:42:54 +01:00
tonihei
26a6aad3e4 Misc ad handling improvements.
1. Clarify intention of getAdGroupIndexForPositionUs and
   getAdGroupIndexAfterPositionUs. Both methods are used for very
   specific but different purposes and encode the logic of which
   ads should be played at which time, so it's helpful to clarify
   this in the documentation as well.
2. Change one usage getAdGroupIndexForPositionUs to use the already
   existing nextAdGroupIndex. This is also more in line with the
   intended usage as clarified in step 1.
3. Update MediaPeriodQueueTest for updateQueuedPeriods to only
   look for duration changes in future periods, not in the
   current one, because that's not handled MediaPeriodQueue for ads
   and the test is just passing by chance now. Also remove wrong
   advancePlaying() calls that are already implicitly included in
   the preceding enqueueNext() call.
4. Fix a minor bug where post-roll ads are not checked whether they
   are played already before using them as the next ad group. Also
   added a test covering this case.

#minor-release

PiperOrigin-RevId: 370664131
2021-04-27 17:42:39 +01:00