149 Commits

Author SHA1 Message Date
microkatz
61343cd75f Format with google-java-format 2024-09-12 04:47:05 +00:00
Lavamancer
17e0fd22b1 Fixed removal of user info for URLs that contain encoded @ characters 2024-09-12 04:47:05 +00:00
kimvde
8367e420ad Import correct nullable annotation
PiperOrigin-RevId: 668521379
2024-08-28 10:54:29 -07:00
michaelkatz
8b33ad5811 Skip invalid media description in SessionDescriptionParser
Some RTSP servers may provide media descriptions for custom streams that are not supported. ExoPlayer should skip the invalid media description and continues parsing the following media descriptions.

To start, ExoPlayer will still error on malformed SDP lines for media descriptions, but will now skip media descriptions with "non-parsable" formats as described by [RFC 8866 Section 5.14](https://datatracker.ietf.org/doc/html/rfc8866#section-5.14).

Issue: androidx/media#1472
PiperOrigin-RevId: 660826116
2024-08-08 07:22:22 -07:00
kak
2202397758 Automated Code Change
PiperOrigin-RevId: 660491742
2024-08-07 12:28:25 -07:00
Googler
3da63eeaa7 Add NAL unit parsing needed for stereo MV-HEVC playback.
Add the following NAL unit parsing utility functions that will be needed for the MV-HEVC support as proposed in Apple's HEVC stereo video interoperability profile:
- NAL unit header parsing to get the layer information needed for MV-HEVC support.
- VPS parsing, including vps_extension() needed for MV-HEVC support.
- SPS parsing modifications to support MV-HEVC.

PiperOrigin-RevId: 647329211
2024-06-27 08:39:12 -07:00
claincly
89fbd0d27a Add Accept header to DESCRIBE request
The Accept header is required by some servers, and we only support SDP.

Issue: google/ExoPlayer#10919
PiperOrigin-RevId: 645361576
2024-06-21 05:47:52 -07:00
kimvde
d27549d29a Skip 4K export test on Pixel 3a
PiperOrigin-RevId: 644659699
2024-06-19 01:18:05 -07:00
ibaker
c6f4ed0b66 Remove /* package */ comment from public classes
Also make one class truly package-private and keep the comment instead.

This comment should only appear on elements with default (package-private) visibility.

PiperOrigin-RevId: 633911914
2024-05-15 05:23:30 -07:00
ibaker
ed4820cb61 Remove @UnstableApi from package-private files
This annotation is only needed on public classes.

This change also removes the `/* package */` comment from some `public`
classes.

PiperOrigin-RevId: 633864544
2024-05-15 02:26:55 -07:00
michaelkatz
52c1d60d39 Allow empty information attributes in RTSP Session Description
Issue: androidx/media#1087
PiperOrigin-RevId: 608534659
2024-02-20 02:47:40 -08:00
tonihei
ed5b7004b4 Replace or suppress deprecated usages
Many usages are needed to support other deprecations and some
can be replaced by the recommended direct alternative.

Also replace links to deprecated/redirected dev site

PiperOrigin-RevId: 601795998
2024-01-26 10:06:18 -08:00
Copybara-Service
009d48a75e Merge pull request #491 from v-novaltd:dsparano-exo128
PiperOrigin-RevId: 574129451
2023-10-17 06:35:19 -07:00
microkatz
716240776e Updated golden file tests and readded constructor 2023-10-17 11:42:33 +00:00
microkatz
e28288f9c5 Updated golden file tests and removed deprecated ColorInfo constructor usage 2023-10-17 11:42:33 +00:00
microkatz
212e138bcf Removed deprecated ColorInfo constructor call and fixed formatting 2023-10-17 11:42:33 +00:00
microkatz
d206be74ef Updated to use ColorInfo.Builder() and formatting issues 2023-10-17 11:42:33 +00:00
Daniele Sparano
f8d98861ea Move luma and chroma bitdepths to ColorInfo class 2023-10-17 11:42:33 +00:00
Daniele Sparano
d454bd0601 Set luma and chroma bit depths in Format from Rtsp 2023-10-17 11:42:33 +00:00
michaelkatz
417970f713 Deflake RTSP keep-alive monitor test
Alters RTSP KeepAlive monitor test to just make sure that keep-alive message is sent.

The test was added in 42c1846984

#minor-release

PiperOrigin-RevId: 571349013
2023-10-06 08:51:27 -07:00
michaelkatz
42c1846984 Use RTSP Setup response timeout value in KeepAliveMonitor intervalMs
Set KeepAliveMonitor to send a keep-alive message at half the timeout value, if provided, by the RTSP Setup response.

Issue: androidx/media#662
PiperOrigin-RevId: 570946237
2023-10-05 02:13:54 -07:00
michaelkatz
916b4b0ad7 Allow custom methods in Rtsp Options response public header
ExoPlayer will not fail playback if an RTSP server responds to the Options request with an unknown RTSP method request type. ExoPlayer will parse the response and just not call methods it does not know how to use.

Issue: androidx/media#613
PiperOrigin-RevId: 568152076
2023-09-25 02:15:42 -07:00
michaelkatz
cf3fd1f4dd Added condition to RtspMediaPeriod.isLoading to check RtspState
If a RtspMediaSource is used within a combining source like MergingMediaSource, then it could become stuck in a loop of calling continueLoading when the source has not actually started loading yet.

Issue: androidx/media#577
PiperOrigin-RevId: 561322900
2023-08-30 06:29:53 -07:00
ibaker
9533f5cd1c RtspMediaPeriod: Use a new ExtractorOutput for each SampleQueue
This removes concurrent access from `rtspLoaderWrappers`. Previously
there was a race between the playback thread clearing & re-adding
entries to this list in `retryWithRtpTcp()`, and the loading thread
accessing the entries in `InternalListener.track()` (implemented from
`ExtractorOutput`).

This change means each `ExtractorOutputImpl` uses exactly one
`SampleQueue` for its one `TrackOutput`. When the `RtspLoaderWrapper`
instances are replaced in `retryWithRtpTcp()`, any stale instances will
only be able to access their own (also stale) `SampleQueue` instances
(vs before, where the stale `ExtractorOutput` could accidentally access
'new' `SampleQueue` instances via the `rtspLoaderWrappers` field).

As well as fixing a race condition in the prod code, this also de-flakes
`RtspPlaybackTest`.

#minor-release

PiperOrigin-RevId: 559130479
2023-08-24 09:16:36 +01:00
rohks
481ea4a274 Enhance continueLoading() API to allow passing more information
Modifies the `SequenceableLoader.continueLoading(long)` method in the `SequenceableLoader` interface to `SequenceableLoader.continueLoading(LoadingInfo)`.

`LoadingInfo` contains additional parameters, including `playbackSpeed` and `lastRebufferRealtimeMs` in addition to the existing `playbackPositionUs`. The additional parameters will allow us to pass these information to Common Media Client Data (CMCD) logging.

By using the `LoadingInfo` object, we ensure future flexibility to add more fields without causing any breaking changes to the API.

PiperOrigin-RevId: 555123961
2023-08-10 12:16:41 +00:00
claincly
5ba0ec9b40 Remove stale TODO
It says RTSP doesn't support this in the javadoc.

PiperOrigin-RevId: 551541942
2023-08-01 14:14:34 +01:00
tonihei
3d4bd7ce19 Make MediaItems updateable
This changes all MediaSources in our library to allow updates to
their MediaItems (if supported).

Issue: google/ExoPlayer#9978
Issue: androidx/media#33
PiperOrigin-RevId: 546808812
2023-07-13 15:26:30 +01:00
tonihei
2322462404 Do not trim audio samples by changing their timestamp
MP4 edit lists sometimes ask to start playback between two samples.
If this happens, we currently change the timestamp of the first
sample to zero to trim it (e.g. to display the first frame for a
slightly shorter period of time). However, we can't do this to audio
samples are they have an inherent duration and trimming them this
way is not possible.

#minor-release

PiperOrigin-RevId: 543420218
2023-06-29 22:50:04 +00:00
tonihei
51fb72b00d Replace deprecated NullableType from checkerframework with our own one
The existing NullableType has been deprecated 5 years ago and causes
crashes in Kotlin apps because Kotlin doesn't recognize this annotation
as a nullable type annotation.

While we can't align on a single @Nullable annotation yet, we can at
least replace this one by JSR305's @Nonnull(MAYBE) as it fulfils all
requirements, including full Kotlin compatiblity. To avoid the
cumbersome name, we can redefine it as our own @NullableType
annotation. (We can't use @Nullable to avoid name clashes with the main
@Nullable annotation from AndroidX)

Issue: google/ExoPlayer#6792
PiperOrigin-RevId: 540497469
2023-06-19 16:08:20 +01:00
ibaker
7e6dae7b31 Remove exoplayer2-only javadoc machinery from media3
This introduces whitespace-only changes in exoplayer2 due to the way
copybara stripping works.

PiperOrigin-RevId: 537296933
2023-06-05 09:47:58 +00:00
michaelkatz
85f83b1208 Use base Uri from the RTSP DESCRIBE response header for relative paths
Issue: google/ExoPlayer#11160

#minor-release

PiperOrigin-RevId: 534896789
2023-05-25 09:58:12 +01:00
ibaker
d5f9cf4f19 Add singleVariant publishing config to all published gradle files
Docs:
* https://developer.android.com/build/publish-library/configure-pub-variants#single-pub-var
* https://developer.android.com/reference/tools/gradle-api/8.0/com/android/build/api/dsl/PublishingOptions

This resolves the following warning from Android Gradle Plugin 7.2.2 and
helps unblock the upgrade to AGP 8.0.1:

> Software Components will not be created automatically for Maven
> publishing from Android Gradle Plugin 8.0. To opt-in to the future
> behavior, set the Gradle property
> `android.disableAutomaticComponentCreation=true` in the
> `gradle.properties` file or use the new publishing DSL.
>
> Affected Modules: `lib-cast`, `lib-common`, `lib-container`,
> `lib-database`, `lib-datasource`, `lib-datasource-cronet`,
> `lib-datasource-okhttp`, `lib-datasource-rtmp`, `lib-decoder`,
> `lib-effect`, `lib-exoplayer`, `lib-exoplayer-all (legacy)`,
> `lib-exoplayer-dash`, `lib-exoplayer-hls`, `lib-exoplayer-ima`,
> `lib-exoplayer-rtsp`, `lib-exoplayer-smoothstreaming`,
> `lib-exoplayer-workmanager`, `lib-extractor`, `lib-media2 (legacy)`,
> `lib-mediasession (legacy)`, `lib-muxer`, `lib-session`,
> `lib-transformer`, `lib-ui`, `lib-ui-leanback`, `test-utils`,
> `test-utils-robolectric`

Issue: androidx/media#409
PiperOrigin-RevId: 533464133
2023-05-19 17:22:21 +01:00
ibaker
b3db85133a Add android.namespace to all build.gradle files
This is a pre-requisite for the Android Studio upgrade assistant to
upgrade from AGP 7.2.2 to 8.0.1, otherwise it fails and complains
this is missing.

Issue: androidx/media#409
PiperOrigin-RevId: 533463246
2023-05-19 17:19:15 +01:00
sheenachhabra
e0d6f67dd9 Move NAL unit related methods from common to container module
PiperOrigin-RevId: 532750099
2023-05-17 16:32:46 +01:00
claincly
29fc16484a Handle seek after playback ends
Reusing the loader wrappers allows us to use the current RTSP connection
without having to set up a new RTSP connection. Consequently, the Extractors,
RTP readers are also preserved.

PiperOrigin-RevId: 524663012
2023-04-17 17:14:21 +01:00
michaelkatz
165f4f2fd4 Use default profile-level-id if absent in Describe SDP for MPEG4-LATM
PiperOrigin-RevId: 524003092
2023-04-17 17:00:52 +01:00
sheenachhabra
28aa5e847b Move NAL unit utility classes into common
Need to use NAL unit util methods in muxer module.

PiperOrigin-RevId: 521772831
2023-04-05 15:45:35 +01:00
rohks
766e7d7d35 Add media3 guide entries in README files
PiperOrigin-RevId: 520650881
2023-03-30 17:28:03 +00:00
rohks
6a928805d4 Fix javadoc links in media README files
Also fixed the javadoc link in devsite and removed javadoc links from decoder extensions as it is not published yet on developer.android.com.

#minor-release

PiperOrigin-RevId: 520636868
2023-03-30 17:26:40 +00:00
michaelkatz
ecf4d8b891 Retry RTSP Setup with TCP if response with UDP is UnsupportedTransport
If RTSP Setup Request with UDP receives HTTP Error Status 461 UnsupportedTransport, then client will retry with TCP.

Issue: google/ExoPlayer#11069
PiperOrigin-RevId: 518807829
2023-03-30 17:04:07 +00:00
michaelkatz
a8c87453db Catch IllegalArgumentExceptions in RTSP Response parsing
In parsing Describe RTSP response messages, IllegalArgumentExceptions are thrown for invalid parameters and values. These exceptions were not caught and crashed the Playback thread. Now these exceptions will be caught and their errors forwarded to the proper error handling listeners.

#minor-release

Issue: google/ExoPlayer#10971
PiperOrigin-RevId: 509207881
2023-02-13 14:18:53 +00:00
ibaker
636a4a8538 Add javadoc links to README files
Fix some other link titles and destinations spotted along the way.

#minor-release

PiperOrigin-RevId: 493276172
2022-12-12 11:19:23 +00:00
ibaker
4f04a284ed Add missing IntDef on MediaSource.Factory.getSupportedTypes overrides
Without this the annotation isn't shown in javadoc (same in Dackka)

No annotation:
https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/source/DefaultMediaSourceFactory.html#getSupportedTypes()

Annotation present:
https://exoplayer.dev/doc/reference/com/google/android/exoplayer2/source/MediaSource.Factory.html#getSupportedTypes()

#minor-release

PiperOrigin-RevId: 487498450
2022-11-10 14:56:54 +00:00
ibaker
dbfc0cc770 Fix Dackka/Metalava errors in the HLS and RTSP modules
This makes two fixes:
1. Remove `HlsSampleStreamWrapper.Callback` (package-private) from the
   list of interfaces implemented by `HlsMediaPeriod` (`public`) and
   move the implementation to a private inner class instead. This avoids
   Metalava complaining about a public class that inherits from a
   package-private type.
2. Reduce the visibility of
   `RtpPayloadFormat.isFormatSupported(MediaDescription)` from `public`
   to package-private. The `MediaDescription` type is already
   package-private, so this method was already unusable outside the
   package.

#minor-release

PiperOrigin-RevId: 487472781
2022-11-10 14:43:04 +00:00
Rohit Singh
d21c9488df Merge pull request #162 from ittiam-systems:rtp-mp4a-latm
PiperOrigin-RevId: 482490230
2022-10-24 10:49:25 +00:00
Rakesh Kumar
ce98d6da84 Fix review comment in CSD parsing of Mp4a-Latm
Change-Id: I70c412870952e18826f43d218b074b2829127e10
2022-10-04 17:45:59 +05:30
Rakesh Kumar
0ac84fe16f Fix review comment in mp4a-latm Reader
Change-Id: I004f4a9ed9bd7cc48708d82a01c945789d1e9e5e
2022-10-03 17:38:22 +05:30
claincly
b9bcf5224f Fix outdated RtpDataLoadable javadoc
PiperOrigin-RevId: 469443086
2022-09-30 16:59:12 +00:00
claincly
a62cf312b7 Handle initial RTSP seek
PiperOrigin-RevId: 469143613
2022-09-30 16:55:19 +00:00
Rakesh Kumar
9f8d69929d Fix review comment in CSD parsing of Mp4a-Latm Reader
Change-Id: I6fc07d88a7dbc52fc2fbe0e5ad45a53f8f25c4fd
2022-09-30 14:07:27 +05:30