19864 Commits

Author SHA1 Message Date
sheenachhabra
4a07d13838 Version bump to media3:1.3.0-alpha01
#minor-release

PiperOrigin-RevId: 598588547
2024-01-15 05:44:03 -08:00
tofunmi
7f087243bb Add supportsMimeType API to bitmapLoader
PiperOrigin-RevId: 597942459
2024-01-12 13:49:38 -08:00
tofunmi
6879698d7e Move setting bitmapFactory options from interface to implementation
Moves setting bitmapFactory options from BitmapLoader to DatasourceBitmapLoader

BitmapLoader is a general interface for bitmap loading that could use loading implementations other that BitmapFactory, with the rise of Glide being a loader of choice. It's best to correct this interface so that it remains generic

We can't deprecate easily because the other loadBitmap method in that case has a default implementation that relies on the first one, so the change is still breaking. BitmapLoader is public api in common, but it's @UnstableAPI and hasn't been around for very long (be38670391 added it), so it seems this is the best way forward.

PiperOrigin-RevId: 597897098
2024-01-12 11:21:48 -08:00
sheenachhabra
09a547953b Update RELEASENOTES for 1.3.0-alpha01
#minor-release

PiperOrigin-RevId: 597862117
2024-01-12 09:33:58 -08:00
ibaker
d4be30b04d Mark CompositeSequenceableLoader final
Subclasses of this component can customize it by wrapping with the
decorator pattern, and a custom `CompositeSequencableLoaderFactory`
allows access to the list of delegate `SequenceableLoader` instances.

The `final` keyword was removed as part of <unknown commit> but this
component never ended up being subclassed within the library.

Making this class `final` makes upcoming changes easier to reason
about.

PiperOrigin-RevId: 597853429
2024-01-12 09:02:06 -08:00
ibaker
4061d476a1 MP3: Assume an Info header indicates CBR for seeking purposes
The seek table in a Xing/Info header is very imprecise (max resolution
of 255 to describe each of 100 byte positions in the file). Seeking
using a constant bitrate assumption is more accurate, especially for
longer files (which exacerbates the imprecision of the Info header).

VBR files should contain an Xing header, while an Info header is
identical but indicates the file is CBR.

Issue: androidx/media#878
PiperOrigin-RevId: 597827891
2024-01-12 06:48:00 -08:00
christosts
5056dfaa2b Regression fix of ExoPlayer.setVideoEffects()
7e65cce967 introduced a regression on ExoPlayer.setVideoEffects()
where there is flash on the screen after the first few frames are shown.

Before 7e65cce967, the first frames of the content are missed, until
MediaCodecVideoRenderer sends the onVideoSizeChanged() callback. The
first frame is processed but not shown, the onVideoSizeChanged() is
triggered and the renderer receives a video output resolution message as
a response from the UI.

7e65cce967 fixed the missed first frames by setting a surface on the
CompositingVideoSinkProvider before the provider is initialized, and as
as result:
- the first frames are rendered
- the MediaCodecVideoRenderer sends the the onVideoSizeChanged() after
  frames are shown
- the UI sends a video output resolution change
- the MediaCodecVideoRenderer updates the CompositingVideoSinkProvider
  which causes the flash.

The underlying problem is with onVideoSizeChanged() not being
triggered early enough, before the first frame is shown.

Because the flashing is a regression, this commit is reverting
7e65cce967 but keeps the test that was added as ignored, so that the
test is re-enabled as soon as we address the underlying issue.

PiperOrigin-RevId: 597814013
2024-01-12 05:20:46 -08:00
tofunmi
78c419e566 Extension to Gaussian Blur: support changing blur over time
PiperOrigin-RevId: 597809380
2024-01-12 04:53:02 -08:00
jbibik
59afb4fb01 Plumb SubtitleParser.Factory into WebvttExtractor
WebvttExtractor will no longer be wrapped in SubtitleTranscodingExtractor, but instead use SubtitleTranscodingExtractorOutput under the hood.

A new constructor will take a boolean parameter to toggle between subtitle parsing during extraction (before the sample queue) or during decoding (after the sample queue).

PiperOrigin-RevId: 597604942
2024-01-11 11:13:08 -08:00
tofunmi
f2be3fd0cb Trim Opt: Calculate duration based on sample rate from audio format
Calculating the encoded audio buffer duration.

PiperOrigin-RevId: 597591689
2024-01-11 10:28:14 -08:00
jbibik
a728ec8e67 Plumb SubtitleParser.Factory into TsExtractor
PiperOrigin-RevId: 597578122
2024-01-11 09:35:22 -08:00
huangdarwin
c59711f592 Effect: Remove unused arguments in DefaultShaderProgram factories.
Partially addresses the following TODO, by simplifying the DefaultShaderProgram
API surface.
```
// TODO(b/274109008): Refactor DefaultShaderProgram to create a class just for sampling.
```

PiperOrigin-RevId: 597575575
2024-01-11 09:25:25 -08:00
huangdarwin
b4dfbed73d Update javadoc param name to match argument name
PiperOrigin-RevId: 597554111
2024-01-11 07:50:13 -08:00
lpribanic
e93188fe7f Crop and pass thumbnails to ImageOutput
Image grids are now cropped into tiles. The tiles are provided to
ImageOutput at their correct timestamps.

PiperOrigin-RevId: 597553029
2024-01-11 07:45:50 -08:00
tonihei
cd2d7f5da5 Forward getStreamKeys in ClippingMediaPeriod
Not doing this prevents downloads of clipped media.

PiperOrigin-RevId: 597541395
2024-01-11 06:48:52 -08:00
sheenachhabra
085bc6c416 Upgrade robolectric version to 4.11
Testing details: All tests are passing on github branch as well.

PiperOrigin-RevId: 597529943
2024-01-11 05:47:52 -08:00
michaelkatz
03328848ce Fix typo of missing closing parentheses in RELEASENOTES
PiperOrigin-RevId: 597496311
2024-01-11 02:39:04 -08:00
rohks
0f33ef3906 Improve readability of constant numbers and documentation in DtsUtil
PiperOrigin-RevId: 597493602
2024-01-11 02:25:44 -08:00
tianyifeng
733301d562 Remove the parameter PlayerId from PreloadMediaSource.Factory
Originally a `PlayerId` has to be passed and it should be the same id of the player who is going to play the sources, but it turns out to be unnecessary.

When preloading, we can set a `PlayerId.UNSET` inside of the `PreloadMediaSource`, as there is no ongoing playback. And when the source is handed over to player, player will set the player's `PlayerId`.

PiperOrigin-RevId: 597475119
2024-01-11 00:48:58 -08:00
simakova
d884f19871 Add edit label
PiperOrigin-RevId: 597257431
2024-01-10 08:36:14 -08:00
ibaker
1202f8690c Bump effect and leanback minSdk to 19
These were overriding the previous minimum of 16 and therefore not
included in e54abaa75d.

PiperOrigin-RevId: 597242364
2024-01-10 07:22:00 -08:00
ibaker
3f9e0540b7 Remove non-progressive limitation from DefaultMediaSourceFactory.experimentalParseSubtitlesDuringExtraction
This involves promoting `setTextTranscodingEnabled` to
`ExtractorsFactory`, and also making it experimental, to indicate it's a
short-lived method.

PiperOrigin-RevId: 597235252
2024-01-10 06:46:50 -08:00
jbibik
d6ef48fff8 Plumb SubtitleParser.Factory into Mp4Extractor
Mp4Extractor will no longer be wrapped in SubtitleTranscodingExtractor, but instead use SubtitleTranscodingExtractorOutput under the hood.

FLAG_EMIT_RAW_SUBTITLE_DATA flag will be used to toggle between subtitle parsing during extraction (before the sample queue) or during decoding (after the sample queue).

PiperOrigin-RevId: 597221831
2024-01-10 05:36:08 -08:00
tofunmi
51d60e1f3a GaussianBlur: make short constructor call the longer one
PiperOrigin-RevId: 597212434
2024-01-10 04:42:35 -08:00
tonihei
3596bc332d Use AudioAtributes when determining AudioCapabilities
The capabilities change depending on the attributes, so we should
pass down the actual attributes used during playback and update
the capabilities whenever these change.

PiperOrigin-RevId: 597197507
2024-01-10 03:17:54 -08:00
ibaker
4fde35c9cc MP3: Extract Xing/Info parsing code from XingSeeker
This means in a later change we can still use some of the info for CBR
files, even if we want to ignore the imprecise table of contents and
seek based on a constant bitrate assumption instead.

PiperOrigin-RevId: 597193997
2024-01-10 03:00:30 -08:00
Googler
460501fcd1 Log ExportResult information when running transformer demo app
Log elapsed time, in addition to displaying it on screen.
Reuse logging logic between tests and demo.

PiperOrigin-RevId: 597186692
2024-01-10 02:24:31 -08:00
ibaker
143d782b1c Add private @SeekHeader IntDef to Mp3Extractor
Also use `switch` instead of `if-else`.

PiperOrigin-RevId: 597004322
2024-01-09 12:04:24 -08:00
ibaker
1c1d4d506d MP3: Correct duration calculation in XingSeeker
An audio file can only play sound between two PCM samples (the 'start'
and 'end' of section of a wave form). Therefore when calculating
duration from a count of PCM samples we need to subtract one first (the
'end' sample which has no duration of its own).

This only changes durations by one PCM sample (21us - 22us for 44.1kHz sample
rate).

PiperOrigin-RevId: 596990306
2024-01-09 11:16:49 -08:00
tonihei
ba8f55694a Set PCM encoding in Flac extractor
The extractor knows the PCM encoding of the losslessly
encoded data in the samples and should set it in the
Format to allow downstream components to use this information.

PiperOrigin-RevId: 596974863
2024-01-09 10:28:55 -08:00
ibaker
320dd32be9 Add extractor test for an MP3 file with Info header
Issue: androidx/media#878
PiperOrigin-RevId: 596957503
2024-01-09 09:30:21 -08:00
jbibik
da724c8cc4 Plumb SubtitleParser.Factory into FragmentedMp4Extractor
We introduce SubtitleParser.Factory that supports no formats to be used FragmentedMp4Extractors that will not do any subtitle parsing on the extraction side. We also slowly move away from using SubtitleTranscodingExtractor to SubtitleTranscodingExtractorOutput (hence making it public).

This is required by individual Extractor impls so that they can start using SubtitleTranscodingExtractorOutput rather than be wrapped by SubtitleTranscodingExtractor. The latter is to be deprecated after all the subtitle related Extractors have achieved this migration.

PiperOrigin-RevId: 596942147
2024-01-09 08:33:27 -08:00
ibaker
e54abaa75d Increase minSdk to 19
This is aligned with all other AndroidX libraries, and is required for
us to upgrade to the latest versions of our AndroidX dependencies:
https://android-developers.googleblog.com/2023/10/androidx-minsdkversion-19.html

PiperOrigin-RevId: 596923511
2024-01-09 07:15:21 -08:00
michaelkatz
324e1beef2 Bump media3 version to 1.2.1 and update RELEASENOTES
#minor-release

PiperOrigin-RevId: 596916027
2024-01-09 06:39:56 -08:00
tofunmi
dee2d3af73 GlassianBlurTest: move golden images comment next to the test
PiperOrigin-RevId: 596892569
2024-01-09 04:41:46 -08:00
christosts
4198f7e242 Add utility testing Player.Listener in transformer tests
PiperOrigin-RevId: 596891721
2024-01-09 04:36:45 -08:00
Copybara-Service
6f8249184b Merge pull request #942 from datdoantelus:CC_708_parser_fix
PiperOrigin-RevId: 596836615
2024-01-09 00:25:58 -08:00
huangdarwin
c6b51003d3 Effect: Allow updating inputColorInfo between streams in VFP.
Whenever the inputColorInfo updates, update the samplingGlShaderProgram.

Also, allow either SDR or gamma2.2 to be used for HDR->SDR tone-mapping
`outputColorInfo` request. This is required because we can't update the
`outputColorInfo`, but plan to always use gamma2.2 for `outputColorInfo` in the
future.

This allows VideoFrameProcessor to work as is for exoplayer previewing, but
only when not seeking. As we haven't plumbed the per-stream inputColorInfo from
ExoPlayer down to VFP.registerInputStream, follow-up CLs will be needed to
properly support previewing with changing inputColorInfo.

PiperOrigin-RevId: 596627890
2024-01-08 10:09:04 -08:00
ibaker
77f311917f Play clear samples in DRM content without keys by default
This behavior was previously available as opt-in via
`MediaItem.DrmConfiguration.Builder.setPlayClearContentWithoutKey` and
`DefaultDrmSessionManager.Builder.setPlayClearSamplesWithoutKeys`. This
change flips the default of both these properties to true.

This should speed up the time for playback to start when playing DRM
content with a 'clear lead' of unencrypted samples at the start.
Previously playback would wait until the keys for the later encrypted
samples were ready. The new behaviour could result in mid-playback
stalls/rebuffers if the keys are not ready yet by the transition from
clear to encrypted samples, but this is not really a regression since
previously playback wouldn't have started at all at this point.

PiperOrigin-RevId: 595992727
2024-01-05 07:46:25 -08:00
ibaker
62f6c64a91 Rename test.mp3 test asset to test-cbr-info-header.mp3
This file is CBR encoded with LAME, so it has an `Info` header (the CBR
equivalent to `Xing`).

A follow-up change will use this file in `Mp3ExtractorTest`.

Issue: androidx/media#878
PiperOrigin-RevId: 595938327
2024-01-05 02:31:20 -08:00
ibaker
95e742948c Clarify docs on Player.setMediaItem(s) and replaceMediaItem(s)
These methods sound similar, but have different behaviour. This change
tries to make the distinction clearer, and sign-post from one to the
other.

#minor-release

Issue: androidx/media#910
PiperOrigin-RevId: 595701540
2024-01-04 07:41:34 -08:00
bachinger
5c50b27e8f Return null if media notification controller Future is not done
When the media notification controller is requested for a session
with `getConnectedControllerForSession` and the `Future` is not null
but not yet completed, the `Future` was returned either way. This was
reported as creating a race condition between the notification
being requested for update the very first time, and the media
notification controller having completed connecting to the session.

Returning null from `getConnectedControllerForSession` when the
`Future` is available but not yet done fixes the problem. This is
safe because for the case when a notification update is dropped,
the media notification controller will trigger the update as soon
as the connection completes.

Issue: androidx/media#917
#minor-release
PiperOrigin-RevId: 595699929
2024-01-04 07:35:54 -08:00
ibaker
1cb6865884 Remove CEA-6/708 support from DefaultSubtitleParserFactory
`Cea608Parser` and `Cea708Parser` don't currently work correctly on
their own without the re-ordering of input buffers implemented in
`CeaDecoder`, and it's not clear how we can properly do this re-ordering
during extraction. This change ensures that if 'parse subtitles
during extraction' is enabled, CEA-6/708 subs will be passed through
without transcoding and can then be decoded during rendering by
`Cea6/708Decoder`.

PiperOrigin-RevId: 595658628
2024-01-04 03:48:41 -08:00
Copybara-Service
8eda9f2ed2 Merge pull request #369 from Tolriq:fix_invalid_frames
PiperOrigin-RevId: 595650068
2024-01-04 03:02:29 -08:00
rohks
5970d2d586 Document and remove check for C.TIME_UNSET when consuming data in TS
PiperOrigin-RevId: 595647795
2024-01-04 02:50:04 -08:00
Ian Baker
0b482ef58c Remove columnLock, columnCount (unimplemented) and rowLock (always true)
Also add a release note and simplify the test by removing the garbage
prefix and suffix.
2024-01-03 17:49:35 +00:00
Ian Baker
04751a1cdb Format with google-java-format 2024-01-03 17:36:55 +00:00
datdoantelus
a58ddcfa23 Update test comment. 2024-01-03 17:36:55 +00:00
datdoantelus
28eb55c077 Use skipBits(2) instead of readBits for ignored bits.
Add singleServiceAndWindowDefinition_ignoreRowLock test to Cea708ParserTest
2024-01-03 17:36:55 +00:00
datdoantelus
8b39f7e287 Ignore rowLock and columnLock values as specified by ANSI/CTA-708-E S-2023 document (section 8.4.7) 2024-01-03 17:36:55 +00:00