18790 Commits

Author SHA1 Message Date
samrobinson
64f93a895e Assert that Formats passed to ASP represent valid decoded audio.
Ensure SequenceAssetLoader knows downstream is decoding audio if
silence is generated.

PiperOrigin-RevId: 542293633
2023-06-22 15:37:26 +00:00
sheenachhabra
7a819bc275 Add java doc link to muxer README files
PiperOrigin-RevId: 542249083
2023-06-22 15:36:06 +00:00
Tofunmi Adigun-Hameed
6e9df8df77 Merge pull request #461 from almiki:release
PiperOrigin-RevId: 542228372
2023-06-22 15:34:28 +00:00
Tofunmi Adigun-Hameed
e665e2aee8 Merge pull request #419 from v-novaltd:vnova-104
PiperOrigin-RevId: 542214119
2023-06-22 15:33:06 +00:00
samrobinson
d2105204e1 Propagate Metadata from extracted Format to decoded Format.
MediaCodec does not retain the `Metadata` of its input `Format`, so
add it to the output `Format`.

PiperOrigin-RevId: 542194322
2023-06-22 15:31:30 +00:00
tofunmi
09fe0d7390 Correct the DefaultFrameDroppingShaderProgram logic
copies the previous texture to a temp texture to ensure the correct frame is queued.

#minor-release

PiperOrigin-RevId: 541972349
2023-06-22 15:29:41 +00:00
ibaker
34f23451e6 Switch to SVG assets hosted on developer.android.com for reference docs
#minor-release

PiperOrigin-RevId: 541970884
2023-06-22 15:27:58 +00:00
bachinger
4604f0cde6 Fix ArrayIndexOutOfBoundIndex when re-preparing after exception
When an app tried to re-prepare a live streeam with server side inserted
ad after a playback exception, the player tried to find the ad group by
its index in the ad playback state of the next timeline when creating
the first period.

If a source that supports server side ad, has removed the ad playback
state when the source has been removed, this causes a crash. For live
streams this is a reasonable thing to do given the exception could be
caused by an invalid ad playback state.

This change removes the ad metadata from the current period for live
streams and the timeline. In case the ad playback state is not reset
by the source, the first timeline refresh would ad the metadata again.

PiperOrigin-RevId: 541959628
2023-06-22 15:26:25 +00:00
Googler
63ca2595be Add public API for isWear check in media3-common.
PiperOrigin-RevId: 541925117
2023-06-22 15:24:56 +00:00
jbibik
b9cc70d9e2 Fixed spelling across various PlayerInfo *ChangeReason fields
PiperOrigin-RevId: 541892788
2023-06-22 15:23:21 +00:00
Ian Baker
7cb7e8c666 Update TS dump files with extra final sample 2023-06-21 10:00:47 +01:00
Ian Baker
35e179f080 Add a release note, fix some nullness and comments 2023-06-21 10:00:47 +01:00
Rohit Singh
d4034bb9b9 Add release notes entry for the fix 2023-06-20 18:50:14 +01:00
Alex Kinney
77c7c189a6 Fixed typo when determining 'rotationDegrees'
projectionPosePitch => projectionPoseRoll
2023-06-20 18:48:10 +01:00
Daniele Sparano
b553d2c3f9 Add end of TS input fix to HLS mode 2023-06-20 17:08:11 +01:00
Daniele Sparano
550bc5be20 Add end of input fix to H262 reader 2023-06-20 17:08:11 +01:00
Daniele Sparano
45372911b0 Add end of input fix to H263 reader 2023-06-20 17:08:11 +01:00
Daniele Sparano
f0666c605c Fix lib-extractor tests 2023-06-20 17:08:11 +01:00
Daniele Sparano
c6c048f542 Send empty pusi flagged data, on end of input, from TS extractor to readers; add end of input flag to readers to flush accumulated data from last PES 2023-06-20 17:08:11 +01:00
tonihei
e0191ddded Fix spurious sessions created for events after the playlist is cleared
Some events may arrive after the playlist is cleared (e.g. load
cancellation). In this case, the DefaultPlaybackSessionManager may
create a new session for the already removed item.

We already have checks in place that ignore events with old
windowSequenceNumbers, but these checks only work if the current
session is set (i.e. the playlist is non-empty). The fix is to add
the same check for empty playlists by keeping note of the last
removed window sequence number.

PiperOrigin-RevId: 541870812
2023-06-20 14:08:06 +01:00
ibaker
71f73229dd Fix two more unresolved SVGs in Timeline.Window and Timeline.Period
These were missed in 10342507f7

#minor-release

PiperOrigin-RevId: 541860649
2023-06-20 14:06:02 +01:00
claincly
4cb5f38007 Increase pixel difference
PiperOrigin-RevId: 541860433
2023-06-20 14:05:07 +01:00
samrobinson
125c39eec3 Use AudioFormat within SilenceAudioGenerator.
PiperOrigin-RevId: 541856580
2023-06-20 14:04:06 +01:00
tonihei
2ac5d8f1af Make FakeClock Espresso and Compose UI test compatible
FakeClock currently doesn't work well with Espresso and Compose UI
tests because view interactions in both frameworks intentionally idle
the main looper to handle pending UI effects. However, this also
advances playback progress even though we want to deterministically
trigger progress from the test itself.

To solve this problem, we can detect the idling Robolectric call and
postpone any further updates until we leave this state.

PiperOrigin-RevId: 541831050
2023-06-20 14:03:06 +01:00
Googler
abd1c006fc Player.Listener implementation to resolve playback suppression on Wear.
Add a Wear OS specific implementation of 'Player.Listener' to help resolving the playback suppression due to unsuitable output by launching a system media output switcher dialog.

PiperOrigin-RevId: 541698125
2023-06-20 14:02:05 +01:00
sheenachhabra
911a6430f3 Remove UdtaInfo class
The class seems unnecessary and the code can be simplified by
removing this.

PiperOrigin-RevId: 541675378
2023-06-20 14:00:50 +01:00
samrobinson
74948d5424 Add a constructor for AudioFormat that takes Format.
PiperOrigin-RevId: 541662208
2023-06-20 13:59:47 +01:00
ibaker
69769c77b3 Clear buffer's timeUs when setting end-of-stream in SampleQueue
PiperOrigin-RevId: 541657834
2023-06-20 13:58:29 +01:00
samrobinson
6d648f8bdb Add dump tests for concatenating 2 audio items.
Audio only tests are now using RAW audio where possible, which is
passed through the Robolectric decoders/encoders, and can be handled by
the AudioProcessor instances accurately.

PiperOrigin-RevId: 541648853
2023-06-20 13:57:33 +01:00
bachinger
8d8c514d12 Fix bug where PlayerView distorts video when video size is unknown
PiperOrigin-RevId: 541640959
2023-06-19 16:30:23 +01:00
huangdarwin
949e9cbd96 GL: Rename GL methods.
To more accurately describe what they do, especially as Compositor will
starts to use more contexts or threads, and it's important to know what
needs to be reset/recreated/focused before what methods.

PiperOrigin-RevId: 541010135
2023-06-19 16:29:03 +01:00
sheenachhabra
c0e8513b7a Make dump files deterministic
Issue: When running the Transformer related test cases, the tests are flaky
because the order in which audio and video samples are interleaved seems to
differ in few instances.

Root cause: When running a transformation the sample producer (Asset loader)
and sample consumer (Sample pipeline) both runs on different thread and
theoretically there is no reason for behaviour to be deterministic because
the number of samples produced/written depends on how fast individual thread
works. So it is indeed surprising that test somehow worked deterministically in
majority of instances (may be something to do with Robolectric environment).

Solution: Since we don't expect the order of sample interleaving to be deterministic, make the dumping logic deterministic where all the video
samples will be collected and then dumped together (similarly for audio). This would mean we won't be able to see the interleaving so for that we need to
add separate test case verifying the interleaving logic only.

Pending: Test case for interleaving.
PiperOrigin-RevId: 540930871
2023-06-19 16:28:07 +01:00
huangdarwin
daa42322d7 GL: Remove configAttributes from createFocusedPlaceholderEglSurface.
PiperOrigin-RevId: 540901189
2023-06-19 16:27:02 +01:00
Marc Baechinger
af69d5822a Merge pull request #436 from jaeho-lee104:feature/improve_condition
PiperOrigin-RevId: 540875285
2023-06-19 16:25:40 +01:00
claincly
fe33f0e390 Simplify EOS signaling in DefaultVideoFrameProcessor
Previously, TextureMangers have a method to signal ending of a current input
stream, and a method to end the **entire input**. The responsibility of both
methods are not easy to document, understand and read.

With the new design,

- Only `TextureManager.signalEndOfCurrentInputStream()` is kept
  - It's called for every MediaItem in the sequence, include the final one
- FinalWrapper now takes explicit signal that frame processing is ending,
  rather than relying on the return value of `onCurrentInputStreamProcessed()`
- On DVFP receiving EOS from the pipeline, it signals FinalWrapper the stream
  is ending, **before** signaling the input switcher, so that FinalWrapper is
  able to end the stream when the onCurrentInputStreamEnded signal eventually
  reaches FinalWrapper

PiperOrigin-RevId: 540856680
2023-06-19 16:24:33 +01:00
claincly
0d3082e6ad Reduce the pixel differnce in TransformerSequenceEffectTest
As the test images are re-gened on the emulators.

PiperOrigin-RevId: 540851288
2023-06-19 16:23:13 +01:00
huangdarwin
4178d61ccd Effect: Move VideoFrameProcessingTask to VFPTaskexecutor
Group things that are closely related. VFPTask is only ever
used alongside VFPTaskExecutor.

PiperOrigin-RevId: 540850948
2023-06-19 16:22:09 +01:00
tofunmi
251fb013c3 Reset the simple frame dropping logic on flush or EOS.
#minor-release

PiperOrigin-RevId: 540633875
2023-06-19 16:20:09 +01:00
rohks
be9b057dda Refactor method CmcdLog.createInstance to accept bufferedDurationUs
Instead of providing `playbackDurationUs` and `loadPositionUs` individually, which are used to calculate the buffer duration for CMCD logging, we can directly pass the pre-calculated `bufferedDurationUs` available in the `getNextChunk` method of the chunk source classes.

Issue: google/ExoPlayer#8699

#minor-release

PiperOrigin-RevId: 540630112
2023-06-19 16:19:04 +01:00
sheenachhabra
18bc893210 Remove copying sample data in Mp4Muxer
PiperOrigin-RevId: 540623370
2023-06-19 16:18:09 +01:00
rohks
52878b2aca Add CMCD logging when requesting initialization chunk for DASH and HLS
Additionally, two existing methods to `buildDataSpec` in `DashUtil` have been deprecated, while a new method has been added that allows the inclusion of `httpRequestHeaders`.

Issue: google/ExoPlayer#8699

#minor-release

PiperOrigin-RevId: 540594444
2023-06-19 16:17:16 +01:00
ibaker
8bf40e7355 Add a demo app sample of SubRip muxed into MKV
I created this by:
1. Downloading https://storage.googleapis.com/exoplayer-test-media-1/mkv/android-screens-lavf-56.36.100-aac-avc-main-1280x720.mkv
2. Crafting a `test.srt` file with a text editor
3. Muxing them together:

   ```
   $ mkvmerge -o android-screens-with-subrip.mkv \
       android-screens-lavf-56.36.100-aac-avc-main-1280x720.mkv \
       test.srt
   ```

Tested in the demo app, the subtitle track is selected by default
(default behaviour for Matroska spec afaict).

PiperOrigin-RevId: 540577912
2023-06-19 16:15:43 +01:00
samrobinson
1236d37acb Improve SequenceExportTest test and dump file naming.
No-op change to highlight when video and/or audio are transmuxed and
reorder the methods.

PiperOrigin-RevId: 540567375
2023-06-19 16:14:38 +01:00
jbibik
501da109ce Default RepeatMode for conversion is NONE/OFF
Current behaviour causes an app to crash if it receives an unrecognized repeat mode send over the wire. In order to avoid the crash, a sensible default had to be chosen.

For `Player.RepeatMode`, it is `Player.REPEAT_MODE_OFF`, which is the same value we use as default when unbundling `PlayerInfo`.

For `PlaybackStateCompat.RepeatMode`, it is `PlaybackStateCompat.REPEAT_MODE_NONE`, which is what we use in the no-arg `LegacyPlayerInfo` constructor.

Issue: androidx/media#448

#minor-release

PiperOrigin-RevId: 540563792
2023-06-19 16:13:39 +01:00
Googler
42915e9a58 Rename the APIs for playback suppression due to unsuitable output.
The APIs /related fields for playback suppression due to unsuitable output should be renamed from '..SuppressPlaybackWhenNoSuitableOutputAvailable' to '..SuppressPlaybackOnUnsuitableOutput'

PiperOrigin-RevId: 540555715
2023-06-19 16:12:33 +01:00
ibaker
3ce6c06169 Rollback of 45d35c5d78
*** Original commit ***

Suppress warnings in preparation for Checker Framework version 3.34.0-eisop1

***

PiperOrigin-RevId: 540539608
2023-06-19 16:11:42 +01:00
huangdarwin
5fc5105f7a Test: Log saved bitmap file path.
This helps debug bitmap tests. Without this CL, I typically
need to go into the file to find the test name and absolute
path. With this CL, I can just adb pull the printed file path,
which is much simpler.

PiperOrigin-RevId: 540539042
2023-06-19 16:10:30 +01:00
bachinger
bd97dd8519 Rollback of 7956c80f73
*** Original commit ***

Rollback of 2a6f893fba

*** Original commit ***

Set video size to 0/0 when video render is disabled

In terms of MCVR wi...

***

PiperOrigin-RevId: 540525069
2023-06-19 16:09:13 +01: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
567890da9e Remove = from parameter args in call to Constructor.newInstance
These comments reflect the parameter names of the constructor that
we're reflectively calling, but errorprone complains that they don't
match the parameter names of `Constructor.newInstance`.

PiperOrigin-RevId: 540348118
2023-06-19 16:07:18 +01:00