19310 Commits

Author SHA1 Message Date
samrobinson
c33a17d89c Wrap AudioSamplePipeline input and processing within AudioGraph.
This is a no-op refactor.

PiperOrigin-RevId: 545421300
2023-07-05 09:20:12 +00:00
kimvde
8ea79a13f9 Add a TODO to make TransformationRequest.Builder package private
PiperOrigin-RevId: 545400150
2023-07-05 09:19:06 +00:00
ibaker
3456382ae7 Include timing info in some SCTE-35 toString implementations
This was helpful in investigating Issue: androidx/media#471

PiperOrigin-RevId: 545393217
2023-07-05 09:18:00 +00:00
kimvde
81c83e4213 Remove HDR modes from TransformationRequest
PiperOrigin-RevId: 545352306
2023-07-05 09:16:52 +00:00
michaelkatz
de4575da28 Add nanoTime method to Clock to support overriding System.nanoTime()
#minor-release

PiperOrigin-RevId: 545237925
2023-07-05 09:15:49 +00:00
ibaker
a783d704b2 Add duration to text/x-exoplayer-cues binary format
This plumbs a duration through `SampleQueue` which will make it easier
to handle transcoding muxed subtitles from e.g. SubRip to
`text/x-exoplayer-cues`.

This change is a no-op to the end-to-end behaviour of ExoPlayer because
currently we only support parsing sideloaded subtitles before
`SampleQueue`, and by adding the duration we don't affect the cues that
are ultimately output by `Player.Listener.onCues` (as shown by no change
to the golden files for `WebvttPlaybackTest` in this commit).

I considered making `CuesWithStartTimeAndDuration` implement
`Bundleable` (and deleting `CueEncoder/Decoder`) but decided against
it because we are deliberately not encoding `startTimeUs` (since that's
encoded as the sample time in `SampleQueue`). I also considered
introducing another type that only has `List<Cue>` and `durationUs`
fields, but it didn't seem necessary, since we want `startTimeUs`
everywhere else (except inside `SampleQueue`).

PiperOrigin-RevId: 545226847
2023-07-05 09:14:38 +00:00
ibaker
4ae36cc175 Fix Error Prone warning in SubtitleExtractorTest
Also make some casting that is needed a bit safer.

Error Prone was complaining about casting `long` to `int` before passing
it to `Extractor.seek(long, long)`:
> Converting a `long` or `Long` to an `int` to pass as a `long`
> parameter is usually not necessary. If this conversion is intentional,
> consider `Longs.constrainToRange()` instead.

PiperOrigin-RevId: 545226063
2023-07-05 09:13:29 +00:00
ibaker
412e9398f9 Add SubtitleParser.Factory
This is a corollary of `SubtitleDecoderFactory`. We may add a
`boolean supportsFormat(Format)` method later if it turns out to be
useful.

PiperOrigin-RevId: 545225489
2023-07-05 09:12:17 +00:00
ibaker
e67e28c4aa Introduce CuesWithTiming and use it in SubtitleParser
PiperOrigin-RevId: 545224876
2023-07-05 09:11:08 +00:00
huangdarwin
1fce0cfd4d Test: Fix missed latch exceptions.
Catch timeouts, and general errors in the case of an InterupptedException.

PiperOrigin-RevId: 545219647
2023-07-05 09:09:59 +00:00
ibaker
5e96d355e1 Suppress NewApi lint warning on <vector> usage in drawables
PiperOrigin-RevId: 545207308
2023-07-05 09:08:51 +00:00
tonihei
5e19a33095 Replace exoplayer.dev@gmail.com with android-media-github@google.com
#minor-release

PiperOrigin-RevId: 545165879
2023-07-05 09:07:22 +00:00
huangdarwin
546b9a2a88 Effect Test: Use latch instead of thread.sleep.
The timeout time of 5000ms is quite long, and means that for tests with >1
VFPTestRunner, like texture output and compositor tests, we have to wait 10s.

The latch allows us to continue with the test once we're done processing input,
instead of needing to wait longer, until the timeout is reached.

PiperOrigin-RevId: 545159839
2023-07-05 09:06:14 +00:00
andrewlewis
6d351a3c12 Add back release notes about deprecated HDR symbols
These were accidentally removed in 832d5b5f98

PiperOrigin-RevId: 545156495
2023-07-05 09:05:08 +00:00
Googler
f486074f82 AudioDeviceCallback should not be used below SDK 23.
This gating should have been added in 6e46234589.

PiperOrigin-RevId: 544720503
2023-07-05 09:03:51 +00:00
huangdarwin
9945033867 Effect: Create basic VideoCompositor.
Allow two DefaultVideoFrameProcessor instances to output to one
VideoCompositor, which then outputs a frame.

PiperOrigin-RevId: 544705821
2023-07-05 09:02:45 +00:00
huangdarwin
854c5254ec GL: Print egl errors in hex.
The actual errors are all positive hex values. Without this CL, we must first
convert decimal errors to hex ones before figuring out what went wrong.

PiperOrigin-RevId: 544695961
2023-07-05 09:01:36 +00:00
tofunmi
d14122b029 Create queue of sync objects in FinalShaderProgramWrapper
PiperOrigin-RevId: 544683524
2023-07-05 09:00:20 +00:00
ibaker
e8fdd83558 CEA-608: Only truncate to 32 visible characters
We introduced truncation to 32 chars in <unknown commit>
and included indent and offset in the calculation. I think this is
technically correct, but it causes problems with the content in
Issue: google/ExoPlayer#11019 and it doesn't seem a problem to only truncate actual
cue text (i.e. ignore offset and indent).

#minor-release

PiperOrigin-RevId: 544677965
2023-07-05 08:59:08 +00:00
tofunmi
6f9731ce7e TextureInput: Advise client to delete syncObject after use
PiperOrigin-RevId: 544670927
2023-07-05 08:57:55 +00:00
Googler
58180a0f2a Rename certain tests and modify documentation.
PiperOrigin-RevId: 544664238
2023-07-05 08:56:46 +00:00
tonihei
2f113c8b82 Remove dead code in ProgressiveMediaSource.Builder
These fields cannot be set and the logic to handle them can be removed.

PiperOrigin-RevId: 544646460
2023-07-05 08:55:36 +00:00
huangdarwin
a875fa72a8 GL: Move fallback to glFinish to GlUtil.
This may happen, for example, on older OpenGL versions.

This may be used in the compositor too.

PiperOrigin-RevId: 544613566
2023-07-05 08:54:24 +00:00
microkatz
9513f2c551 Merge pull request #487 from vishnuchilakala:allow_unsigned_int_for_adaptation_set_id
PiperOrigin-RevId: 544601945
2023-07-05 08:53:09 +00:00
ibaker
f2c0eab468 Replace exoplayer.dev@gmail.com with android-media-github@google.com
#minor-release

PiperOrigin-RevId: 544596686
2023-06-30 10:20:38 +01:00
tonihei
4169386c12 Switch parsing to Long
This avoids issues with potential number clashes with ID_UNSET.
Also fixes some further parsing where adaptation set ids are referenced
from manifest properties.
2023-06-30 08:42:59 +01:00
Googler
6732c0e286 Resume/Pause on playback suppression changes with timeout.
Auto-resume playback when the removal of playback suppression due to unsuitable output is conveyed via change in playback suppression to Player.PLAYBACK_SUPPRESSION_REASON_NONE within a configurable timeout defaulting to 5 minutes.

PiperOrigin-RevId: 544411987
2023-06-29 23:17:57 +00:00
Googler
832d5b5f98 Update playback suppression states dynamically.
Instead of playing or pausing itself, the ExoPlayer implementation should only update the playback suppression reason as and when audio outputs are added or removed dynamically.

PiperOrigin-RevId: 544379033
2023-06-29 23:16:39 +00:00
huangdarwin
4e4045b98e GL: Allow differentiation of error messages
In the absence of stack traces, these 2 messages were hard to differentiate
before this CL.

PiperOrigin-RevId: 544368823
2023-06-29 23:15:24 +00:00
samrobinson
f60f79bb10 Handle media item (Effects/Format) changes in AudioSamplePipeline.
On a MediaItem change, the input Format (and Effects to apply) may be
different. Therefore the AudioProcessingPipeline must be reconfigured
to determine what processing is active, and what the AudioFormat of the
data output is. In the event that it is different, additional
AudioProcessor instances must be used to ensure the encoder will still
be able to accept the audio buffers.

PiperOrigin-RevId: 544338451
2023-06-29 23:14:10 +00:00
kimvde
32bd5dd718 Fix forceInterpretHdrAsSdr not being set in DefaultAssetLoaderFactory
PiperOrigin-RevId: 544296301
2023-06-29 23:13:00 +00:00
claincly
98eb339333 Add tracing info for EOS signaling in the texture managers
PiperOrigin-RevId: 544063377
2023-06-29 23:11:44 +00:00
tianyifeng
d895a46b28 Ensure that ShuffleOrder has the same length as the current playlist
Add a fail-fast check in `ExoPlayerImpl` to ensure the equality of the lengths of `ShuffleOrder` and the current playlist. Also improve the documentation of `setShuffleOrder(ShuffleOrder)` with explicit instruction on this.

Issue: androidx/media#480

#minor-release

PiperOrigin-RevId: 544009359
2023-06-29 23:10:29 +00:00
andrewlewis
fd284d7de2 Remove unnecessary final on DefaultHttpDataSource.Factory method
PiperOrigin-RevId: 543997872
2023-06-29 23:09:14 +00:00
tofunmi
a98b33b03c Replace glFinish in texture output with Gl sync token
Providing the sync token in the api allows the client to decide which waiting method they would like to use depending on the use case, allowing them to optimise if possible.

PiperOrigin-RevId: 543997311
2023-06-29 23:07:56 +00:00
andrewlewis
81fc9ea509 Make DefaultDecoderFactory visible
This fixes a broken javadoc link and makes it possible to customize media
source creation via the asset loader factory without also having to
implementing a decoder factory from scratch.

PiperOrigin-RevId: 543995538
2023-06-29 23:06:47 +00:00
tonihei
b324b8aa72 Clarify MediaPeriod.readDiscontinuity Javadoc
It currently wrongly documents that it is only called before reading
streams (that has never been the case and all MediaPeriods already need
to handle calls after reading samples from the streams).

It was also a bit unclear what a discontinuity implies and the new
Javadoc calls out the main use case for discontinuties and the intended
meaning of returning a discontinuity.

#minor-release

PiperOrigin-RevId: 543989124
2023-06-29 23:05:31 +00:00
kimvde
a632118875 Remove TransformationRequest.Builder deprecated methods
TransformationRequest.Builder will become package private.

PiperOrigin-RevId: 543987255
2023-06-29 23:03:41 +00:00
tofunmi
8cecb93570 Texture Input: Add GLSyncToken to the OnInputFrameProcessedListener
PiperOrigin-RevId: 543867944
2023-06-29 23:02:20 +00:00
claincly
f98a10f3f2 Move GlShaderProgram creation away from VFP creation
PiperOrigin-RevId: 543773418
2023-06-29 23:00:11 +00:00
kimvde
b358d075a1 Replace usages of deprecated TransformationRequest setter
PiperOrigin-RevId: 543765376
2023-06-29 22:59:06 +00:00
ibaker
dc311fd0ca Remove IfAny suffix from @Nullable IntDef locals in MCImplBase
We use `@Nullable` for IntDefs in other places and don't use this suffix
elsewhere, so I don't think we need it here either.

PiperOrigin-RevId: 543687285
2023-06-29 22:57:38 +00:00
kimvde
f8491fc61f Deprecate Transformer.Builder.setTransformationRequest()
Usages will be removed in follow-up changes.

PiperOrigin-RevId: 543654397
2023-06-29 22:55:29 +00:00
tianyifeng
140c83ce7e Use different package names in DiagnosticInfo for media3 and exoplayer
Issue: androidx/media#476

#minor-release

PiperOrigin-RevId: 543460075
2023-06-29 22:54:02 +00:00
samrobinson
0d67733d28 Update media in silence concatentation test to match silent format.
Goal of tests (SequenceExportTest) that use this media is for the
silence and the media to match exactly with audio format, however
`sample_with_increasing_timestamps.mp4` had a different sample rate.

testvid_1022ms.mp4: channel count = 2, sample rate = 44100.

PiperOrigin-RevId: 543458948
2023-06-29 22:52:32 +00:00
sheenachhabra
8735382590 Move SSIM related files to test_util
PiperOrigin-RevId: 543444043
2023-06-29 22:51:20 +00: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
154eee7d9e Avoid Integer.parseUnsignedInt because it's only available from API 26 2023-06-29 12:31:38 +01:00
tonihei
58baeeb1bb Formatting and Javadoc updates 2023-06-29 10:25:58 +01:00
Vishnu Chilakala
e06c72ba26 Allow unsigned integers in adaptation set id 2023-06-29 10:25:58 +01:00