20226 Commits

Author SHA1 Message Date
michaelkatz
4192924622 Use playing period TrackSelectorResult in track reselection update
If the reading period has already advanced and a track reselection procs that only affects the reading period media, then ExoPlayer may try and apply the reading period's track selection incorrectly unto the playing period. ExoPlayer should apply the playing period's track selection to the playing period instead.

PiperOrigin-RevId: 609375077
2024-02-22 08:08:18 -08:00
huangdarwin
0d1b35477d Test: Use testId throughout media3 tests.
No more instances of this codesearch query after this CL in non-parameterized
tests:
`String\ testId\ \=\ \" f:media3`
PiperOrigin-RevId: 609364413
2024-02-22 07:28:55 -08:00
ibaker
d1ae9ffc52 Add more details about why Extractor.sniff returned false
PiperOrigin-RevId: 609335656
2024-02-22 05:20:16 -08:00
sheenachhabra
41886434ad Remove duplicate Mp4Location class
PiperOrigin-RevId: 609313551
2024-02-22 03:40:35 -08:00
michaelkatz
9046f2edb6 Allow renderer retry for audio track offload initialization failure
If render error occurs due to AudioTrack initialization failure in offload mode, then ExoPlayer should allow retry as subsequent attempt will be with DefaultAudioSink disabling offload.

PiperOrigin-RevId: 609304897
2024-02-22 03:00:10 -08:00
tianyifeng
d952a06214 Fix a bug in retaining streams when preload a PreloadMediaPeriod again
The `PreloadMediaPeriod.selectTracksForPreloading` can be called for multiple times at the preloading stage (before the period is being played). For example, when the period resumes preloading. This change fix the assertion failure in `ProgressiveMediaPeriod.selectTracks` caused by the wrong implementation of `PreloadMediaPeriod.selectTracksForPreloading` when it is trying to retain the previously preloaded streams.

Also the `TrackSelectorResult` parameter is changed to a list of `ExoTrackSelection`. We should compare the selections only rather than considering the `RendererConfiguration` in the `TrackSelectorResult` to decide whether to retain the streams, as for preloading case the renderers haven't consumed the samples yet.

PiperOrigin-RevId: 609126868
2024-02-21 14:41:33 -08:00
huangdarwin
fde6a32156 Transformer: Input decoder output color to VideoSampleExporter.
Previously, the track format was used in VideoSampleExporter. Now, we use a
simulated decoder output format.

As the last expected change for this bug, also adds release notes

PiperOrigin-RevId: 609080629
2024-02-21 12:15:11 -08:00
ibaker
bb5c688543 Update TestPlayerRunHelper to fail on non-fatal errors by default
Also introduce a fluent API that allows callers to ignore non-fatal
errors (while avoiding adding boolean overloads for every method).

**Most** tests want to fail on non-fatal errors (since they likely
indicate user-visible issues like codec errors etc), only tests
explicitly testing fallback in error scenarios should want to ignore
them.

Before this change there were a few `playUntilXXX` methods. These can
now all be triggered via `play(player).untilXXX`, which means
effectively every 'until' condition is available in a 'play until'
variant that calls `play` just before waiting for the condition.

PiperOrigin-RevId: 608988234
2024-02-21 07:39:07 -08:00
huangdarwin
2e9cc2784f Test: Add sequence effect test with bt601 image and bt709 video.
The lack of this test was the *real* root cause for our partner's regression :P

PiperOrigin-RevId: 608956530
2024-02-21 05:22:11 -08:00
Googler
dca7bae416 Allow mismatching H.264/AVC level for trimming or resuming
MediaCodec docs already allude to potentially mismatching H.264 level
between container and bitstream. Relax the initialization data check to
reflect this.

PiperOrigin-RevId: 608942322
2024-02-21 04:20:50 -08:00
sheenachhabra
a82d7e7098 Improve retrieveTrackFormat() java doc and remove catch block
PiperOrigin-RevId: 608939192
2024-02-21 04:11:39 -08:00
tofunmi
7a632a43ba Move bitmap decoding into datasource util
PiperOrigin-RevId: 608588505
2024-02-20 06:57:02 -08:00
sheenachhabra
ebcb4e8b21 Fix nit issues in 1.3.0-rc01 release notes
PiperOrigin-RevId: 608580903
2024-02-20 06:22:14 -08:00
tonihei
711d24a12f Clarify purpose of omitting zero duration clipped audio samples
When applying edit lists, we need to output the last partial samples
to have all the necessary data needed for rendering.

The only case where we can omit the sample is for zero duration
audio data that has no additional information.

The current comment and variable name doesn't make this very clear
and this change improves the naming and the comment.

PiperOrigin-RevId: 608579746
2024-02-20 06:17:28 -08:00
christosts
8dd6590fe9 Use application context in CompositingVideoSinkProvider.Builder
PiperOrigin-RevId: 608572065
2024-02-20 05:45:44 -08:00
sheenachhabra
063fbc7b84 Remove FileUtil.java class
PiperOrigin-RevId: 608556329
2024-02-20 04:35:49 -08:00
tofunmi
f1c21f6c07 Rollback of 5a3f18f837
PiperOrigin-RevId: 608551290
2024-02-20 04:09:26 -08: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
huangdarwin
04bdf3e814 Test: Use Format.colorInfo instead of hardcoded format.
PiperOrigin-RevId: 608399485
2024-02-19 14:21:36 -08:00
huangdarwin
9e352d5c27 Test: Add sequence effect test with bt601.
PiperOrigin-RevId: 608377195
2024-02-19 11:53:09 -08:00
tofunmi
e6facd6a7e Fix: make VFP test runner propagate the right exceptions
PiperOrigin-RevId: 608337651
2024-02-19 07:57:33 -08:00
sheenachhabra
d097fe11d0 Add E2E test for Mp4Muxer to verify overall box structure
There is no super test which covers whole MP4 structure.
In all the E2E test, it verified against `ExtractorOutput` which
would remain same if there are changes in the box structure.

PiperOrigin-RevId: 608310006
2024-02-19 05:31:34 -08:00
sheenachhabra
2cd0cb30cd Use default asset loader factory for remuxing video step
PiperOrigin-RevId: 608308406
2024-02-19 05:22:07 -08:00
tofunmi
5a3f18f837 Make DataSourceBitmapLoader non-final
PiperOrigin-RevId: 608275835
2024-02-19 02:52:58 -08:00
ibaker
3bbb0e7453 Add documented support for android.resource://package/id URIs
These were previously somewhat supported, but the `package` part was
never read (so it only worked if it was either absent or the same as the
current application's package). This change parses and uses the
`package` part.

This partially reverts 35121a2d3d.

This is hard to test for the same reasons as 88f554c74b:

> This is hard to test because to do so robustly requires being able to guaranteed that another test APK will be installed with a known raw resource inside it.

PiperOrigin-RevId: 608270463
2024-02-19 02:28:39 -08:00
Googler
e43f96687c Fix failure to write negative PTS sample
Fixes an issue caused by no support for negative audio PTS and edit lists
in FrameworkMuxer, Android versions before 11

PiperOrigin-RevId: 607690507
2024-02-16 08:03:38 -08:00
ibaker
c872af4bc0 Consolidate requiresSecureDecoder logic in ExoMediaDrm
This change:
1. Updates the implementation of
   `FrameworkMediaDrm.requiresSecureDecoder` to include the
   'force allow insecure decoder' workaround logic.
2. Removes the 'force allow insecure decoder' logic from MCR
3. Removes the `requiresSecureDecoder` field from MCR (it can just
   be a local derived from `codecDrmSession` now).

PiperOrigin-RevId: 607664186
2024-02-16 05:57:50 -08:00
ibaker
fa3212e73e Fix docs on playUntilStartOfMediaItem to match playUntilPosition
The behaviour and docs of `playUntilPosition` were changed in
00c7a9bcbb.

This change also affects `playUntilStartOfMediaItem` (since it delegates
to `playUntilPosition`), so the same doc change should also be made
here.

#minor-release

PiperOrigin-RevId: 607364897
2024-02-15 09:49:51 -08:00
Copybara-Service
fb7438378d Merge pull request #983 from MGaetan89:min_api_19
PiperOrigin-RevId: 607319987
2024-02-15 07:00:17 -08:00
bachinger
4777d62d31 Rollback of 8e2869278c
PiperOrigin-RevId: 607264513
2024-02-15 02:35:12 -08:00
claincly
ae0da442b1 Fix forward for 216f3fedb8
The original change missed copying the newly added flag in `buildUpon()`, which
caused some test flakes.

PiperOrigin-RevId: 607232373
2024-02-15 00:05:10 -08:00
asinclair
8e2869278c Internal Cleanup
PiperOrigin-RevId: 607117264
2024-02-14 15:06:10 -08:00
ibaker
a0727fe4d7 Demo app: Clarify that only Widevine DRM content can be downloaded
Issue: androidx/media#1085
PiperOrigin-RevId: 606921440
2024-02-14 03:28:57 -08:00
Ian Baker
b82f341007 In-line DashTestRunner.MediaDrmBuilder 2024-02-13 17:11:03 +00:00
bachinger
89571c0a92 Check whether the session activity pending intent is an activity
PiperOrigin-RevId: 606613694
2024-02-13 07:28:31 -08:00
Ian Baker
868d2fedcb Update api.txt 2024-02-13 15:11:24 +00:00
Ian Baker
e24febf1e2 Small clean-ups and added @InlineMe annotation 2024-02-13 14:48:15 +00:00
tofunmi
caf584152d Add release notes for recent transformer features
PiperOrigin-RevId: 606565385
2024-02-13 12:23:50 +00:00
Ian Baker
1bf3101269 Remove V19 from AudioTimestampPoller.AudioTimestampV19 2024-02-13 10:26:20 +00:00
Ian Baker
205c8734cc In-line more V19 methods in TrackSelectionParameters, AudioTimestampPoller and CaptionStyleCompat 2024-02-13 10:26:20 +00:00
Ian Baker
c4d9df970c Format with google-java-format 2024-02-13 10:26:20 +00:00
Ian Baker
c0c1c315c5 In-line GlUtil.Api18 and VideoFrameReleaseHelper.DisplayHelperV16/17
Also put back a comment in DownloadTracker that is still relevant on API 19.

Also deprecate PlaceholderSurface.newInstanceV17() in favour of just
newInstance()
2024-02-13 10:26:20 +00:00
Gaëtan Muller
d327cb4795 Code cleanup 2024-02-13 10:26:20 +00:00
Gaëtan Muller
e1ba75c871 Remove some API-dependant classes 2024-02-13 10:26:20 +00:00
Gaëtan Muller
08ab18be77 Remove unnecessary TargetApi annotation 2024-02-13 10:26:20 +00:00
Gaëtan Muller
963e517a5a Remove unnecessary RequiresApi annotation 2024-02-13 10:26:19 +00:00
Gaëtan Muller
973b717914 Remove unnecessary SDK_INT checks 2024-02-13 10:26:19 +00:00
tianyifeng
2b473831c6 Implement onInit() and onRelease() in FakeRenderer
PiperOrigin-RevId: 606301390
2024-02-12 10:57:14 -08:00
claincly
216f3fedb8 Loosen the requirement to register every input frame
VideoFrameProcessor requires every input frame to be registered before they are
rendered to its input Surface. This CL adds the option to register the input
frame only once. This is useful for camera inputs where not all input frames
come with changing FrameInfo.

PiperOrigin-RevId: 606294894
2024-02-12 10:38:42 -08:00
huangdarwin
69f651a40d HDR: Use better color test.
Our previous test video was difficult to use for testing our tone-mapping
algorithm, because it didn't have many different colors. Use a better
video for tone-map tests, by having one with more different colors

PiperOrigin-RevId: 606274843
2024-02-12 09:31:02 -08:00