16333 Commits

Author SHA1 Message Date
huangdarwin
07d1970f35 HDR: Add COLOR_TRANSFER_LINEAR in C.java.
This is more clear than using Format.NO_VALUE, when we do actually intend for an
output value.

Also, fix @see formatting by using summary fragments instead, and add an error
output for OETF and EOTF transfer functions.

PiperOrigin-RevId: 490910229
2022-11-29 18:52:13 +00:00
tonihei
7d62943bcd Remove flakiness from DefaultAnalyticsCollectorTest
Our FakeClock generally makes sure that playback tests are fully
deterministic. However, this fails if the test uses blocking waits
with clock.onThreadBlocked and where relevant Handlers are created
without using the clock.

To fix the flakiness, we can make the following adjustments:
 - Use TestExoPlayerBuilder instead of legacy ExoPlayerTestRunner
   to avoid onThreadBlocked calls. This also makes the tests more
   readable.
 - Use clock to create Handler for FakeVideoRenderer and
   FakeAudioRenderer. Ideally, this should be passed through
   RenderersFactory, but it's too disruptive given this is a
   public API.
 - Use clock for MediaSourceList and MediaPeriodQueue update
   handler.

PiperOrigin-RevId: 490907495
2022-11-29 18:47:59 +00:00
kimvde
7fffe65717 Add checkbox in demo to enable watchdog timer
PiperOrigin-RevId: 490836952
2022-11-29 18:44:06 +00:00
rohks
67955e0ce3 Convert bitrates to bps before setting it
Format expects the values of `averageBitrate` and `peakBitrate` in bps and the value fetched from AC3SpecificBox and EC3SpecificBox is in kbps.

PiperOrigin-RevId: 490756581
2022-11-29 18:40:08 +00:00
samrobinson
fd40cd4a25 Bump muxer watchdog abort timer default timeout to 10s.
PiperOrigin-RevId: 490756055
2022-11-29 18:36:07 +00:00
rohks
89e4b8d049 Use ParsableBitArray instead of ParsableByteArray
To avoid complicated bit shifting and masking. Also makes the code more readable.

PiperOrigin-RevId: 490749482
2022-11-29 18:32:10 +00:00
Lev
101b712267 Cleanup 2022-11-26 03:04:35 +03:00
Lev
5e3b817b81 Cleanup 2022-11-26 02:56:58 +03:00
Lev
184761f79e
Merge branch 'dev-v2' into subrip_utf_16 2022-11-26 02:44:17 +03:00
Lev
90e9807ab2 Fixes after review 2022-11-26 02:37:26 +03:00
ibaker
bb270c62cf Remove two media3-only release notes from the ExoPlayer release notes
Issue: google/ExoPlayer#10811
PiperOrigin-RevId: 490726544
2022-11-24 15:41:18 +00:00
kimvde
df2c9ce4ec Surface player release timeouts
Also make sure the demo app doesn't crash when it happens.

PiperOrigin-RevId: 490725959
2022-11-24 15:37:38 +00:00
rohks
8c91a31ced Rollback of ea3552c1a0
*** Original commit ***

Rollback of 01eddb34f5

*** Original commit ***

Parse and set `peakBitrate` for Dolby TrueHD(AC-3) and (E-)AC-3

#minor-release

***

***

PiperOrigin-RevId: 490707234
2022-11-24 15:22:45 +00:00
rohks
ea3552c1a0 Rollback of 01eddb34f5
*** Original commit ***

Parse and set `peakBitrate` for Dolby TrueHD(AC-3) and (E-)AC-3

#minor-release

***

PiperOrigin-RevId: 490570517
2022-11-24 15:15:12 +00:00
huangdarwin
6ca67af455 Tests: Set SSIM decoder KEY_PRIORITY to 1.
This reduces the priority to best effort (from the default that seems to be best effort), and allows us to run SSIM even on 8k24fps video. Without this CL,
start()'ing a second codec may result in a MediaCodec.CodecException.

Tested to confirm that transformation8k24():
* fails deterministically without this CL, or with KEY_PRIORITY set to 0.
* succeeds deterministically after this CL (~18s on Samsung Z Fold 4)

PiperOrigin-RevId: 490570416
2022-11-24 15:11:33 +00:00
huangdarwin
87e98b483b Transformer: Document when OMX video codecs will no longer exist.
We cannot check this in code, due to DEVICE_INITIAL_SDK_INT being a @SystemApi, and
reflection being a bit risky/unstable.

PiperOrigin-RevId: 490537916
2022-11-24 15:07:49 +00:00
rohks
01eddb34f5 Parse and set peakBitrate for Dolby TrueHD(AC-3) and (E-)AC-3
#minor-release

PiperOrigin-RevId: 490527831
2022-11-24 15:04:03 +00:00
huangdarwin
e61ff42adb Transformer: Remove obsolete TODO from TransformationException.
The bug has since been fixed.

The values still could change, as the API is labelled as @UnstableApi, so it's
probably fine to leave the <p> tag mostly as is.

PiperOrigin-RevId: 490509205
2022-11-24 15:00:08 +00:00
bachinger
f262e9132b Exclude tracks from PlayerInfo if not changed
This change includes a change in the `IMediaController.aidl` file and needs
to provide backwards compatibility for when a client connects that is of an older or
newer version of the current service implementation.

This CL proposes to create a new AIDL method `onPlayerInfoChangedWithExtensions`
that is easier to extend in the future because it does use an `Bundle` rather than
primitives. A `Bundle` can be changed in a backward/forwards compatible way
in case we need further changes.

The compatibility handling is provided in `MediaSessionStub` and `MediaControllerStub`. The approach is not based on specific AIDL/Binder features but implemented fully in application code.

Issue: androidx/media#102
#minor-release
PiperOrigin-RevId: 490483068
2022-11-24 14:55:15 +00:00
samrobinson
412c98e230 Return output immediately if available from AudioProcessingPipeline.
If there is output data available (outputBuffer.hasRemaining()), then
there is no need to move other data between the underlying processors.
It will not change the buffer being returned by that call to getOutput.

If there is no output data readily available, it's necessary to go to
the AudioProcessors and pass buffers between them, as this may produce
data for output.

PiperOrigin-RevId: 490482653
2022-11-24 14:51:18 +00:00
Ian Baker
8a9a66c288 Merge pull request #10786 from TiVo:p-aacutil-test-impl
PiperOrigin-RevId: 490465182
2022-11-24 14:47:25 +00:00
huangdarwin
4d421e7bd4 Tests: Move codec configure() out of VideoDecodingWrapper constructor.
This allows us to release both codecs used in SSIM when one fails to
configure() or start().

Tested and confirmed that on Samsung Galaxy Z Flip 4, running all
TransformationTest.java tests, tests after transform8k24() fails to start the
2nd codec:
* Before this CL, all fail.
* After this CL, all pass.

PiperOrigin-RevId: 490461560
2022-11-24 14:43:34 +00:00
samrobinson
c1e292374d Fix SpeedChangingAudioProcessor handling of EMPTY_BUFFER.
PiperOrigin-RevId: 490265564
2022-11-24 14:38:59 +00:00
microkatz
309f24adcd Merge branch 'release-v2' into dev-v2 2022-11-23 12:06:38 +00:00
Michael Katz
a9444c8802
Merge pull request #10806 from google/release-v2-r2.18.2
r2.18.2
2022-11-23 11:38:07 +00:00
christosts
a114b0e01f Fix compilation error in ffmpeg JNI layer
PiperOrigin-RevId: 490263003
(cherry picked from commit 202e03fc64dac568955ce00684368cbea9b244f7)
2022-11-23 09:51:59 +00:00
christosts
202e03fc64 Fix compilation error in ffmpeg JNI layer
PiperOrigin-RevId: 490263003
2022-11-22 18:00:24 +00:00
tofunmi
2584530e47 Update effect test results bitmaps following emulator update.
Ran all the [effects instrumentation tests](https://source.corp.google.com/piper///depot/google3/third_party/java_src/android_libs/media/libraries/effect/src/androidTest/java/androidx/media3/effect/;bpv=1;bpt=0) and replaced the [bitmaps](https://source.corp.google.com/piper///depot/google3/third_party/java_src/android_libs/media/libraries/test_data/src/test/assets/media/bitmap/;bpv=0;bpt=0) for the tests that were failing due to a small difference over the targeted 0.1 [threshold](https://source.corp.google.com/piper///depot/google3/third_party/java_src/android_libs/media/libraries/effect/src/androidTest/java/androidx/media3/effect/BitmapTestUtil.java;rcl=477974779;l=64) whose new bitmaps could be generated from the` crow --device generic_phone --api_level 31 --arch=arm64
` emulator.

PiperOrigin-RevId: 490261228
2022-11-22 17:56:23 +00:00
huangdarwin
82b59b7228 Tests: Throw exception when network is needed but not available.
This exception is a bit shorter and more clear (and is more clear that this is a
test issue, as opposed to the prior issue that was thrown as an ExoPlayer
DataSourceException, which may seem like a legitimate Transformer failure)

PiperOrigin-RevId: 490252772
2022-11-22 17:52:20 +00:00
huangdarwin
0d863ddc91 HDR Tests: Rename remote URIs to REMOTE instead of ASSET.
Following naming conventions throughout AndroidTestUtil, REMOTE files should have REMOTE instead of ASSET. Update the URI and FORMAT names accordingly.

PiperOrigin-RevId: 490237673
2022-11-22 17:48:23 +00:00
Alexander Capehart
85c4d9870b
Move ID3v2 text frame fallback to ID3v2 decoder
Instead of the ID3v2 text frame falling back to a singleton list of an
empty string when the given values are empty, make that case throw
an exception within the text frame, and move that fallback behavior
into the ID3v2 decoder.
2022-11-22 09:28:05 -07:00
tonihei
9b0790e418 Reorder some release notes in other sections.
#minor-release

PiperOrigin-RevId: 490224795
(cherry picked from commit e567594cf7640bd96ec13d071c4523f7898b55be)
2022-11-22 15:04:38 +00:00
tonihei
e567594cf7 Reorder some release notes in other sections.
#minor-release

PiperOrigin-RevId: 490224795
2022-11-22 14:27:28 +00:00
ibaker
4853444f0d Add DefaultExtractorsFactory.setTsSubtitleFormats
ExoPlayer is unable to detect the presence of subtitle tracks in some
MPEG-TS files that don't fully declare them. It's possible for a
developer to provide the list instead, but doing so is quite awkward
without this helper method. This is consistent for how
`DefaultExtractorsFactory` allows other aspects of the delegate
`Extractor` implementations to be customised.

* Issue: google/ExoPlayer#10175
* Issue: google/ExoPlayer#10505

#minor-release

PiperOrigin-RevId: 490214619
2022-11-22 14:23:23 +00:00
michaelkatz
aef5330960 Update JavaDoc for exoplayer:2.18.2
#minor-release

PiperOrigin-RevId: 490202192
(cherry picked from commit 6f1cf6dab4dd7e37e5d2ea15ad0cc34eafba601c)
2022-11-22 12:44:28 +00:00
michaelkatz
6f1cf6dab4 Update JavaDoc for exoplayer:2.18.2
#minor-release

PiperOrigin-RevId: 490202192
2022-11-22 12:06:09 +00:00
michaelkatz
66995dbdfc Version bump to exoplayer:2.18.2 and media3:1.0.0-beta03
#minor-release

PiperOrigin-RevId: 489959918
(cherry picked from commit ca190c084bd9ef8c281fac7655344d48f265042c)
2022-11-22 11:04:51 +00:00
ibaker
bd6570f6c7 Remove @hide javadoc annotation from ExoPlayer GitHub
This tag is only understood by Dackka, which is used to generate the media3 javadoc.

PiperOrigin-RevId: 489233200
(cherry picked from commit 058cba95d40db83c77f4dd0aa8cb561221463b3a)
2022-11-22 11:04:51 +00:00
michaelkatz
f4259f3633 Filter bogus AndroidX core jar file when creating javadoc
#minor-release

PiperOrigin-RevId: 489202167
(cherry picked from commit 7e82d4ec44b88a54ac022acf1cccdcd383457e1a)
2022-11-22 11:04:51 +00:00
michaelkatz
788f74740b Fixed Exoplayer imports for SimpleBasePlayerTest
PiperOrigin-RevId: 490181547
2022-11-22 09:59:16 +00:00
michaelkatz
1551bea398 Fixed missing imports for Metadata and AdPlaybackState for Exoplayer
PiperOrigin-RevId: 490012573
2022-11-22 09:55:26 +00:00
ibaker
f834419744 Add set -eu to all shell scripts
These flags ensure that any errors cause the script to exit (instead of
just carrying on) (`-e`) and that any unrecognised substitution variables
cause an error instead of silently resolving to an empty string (`-u`).

Issues like Issue: google/ExoPlayer#10791 should be more quickly resolved with
`set -e` because the script will clearly fail with an error like
`make: command not found` which would give the user a clear pointer
towards the cause of the problem.

#minor-release

PiperOrigin-RevId: 490001419
2022-11-22 09:51:36 +00:00
kimvde
b75b421353 Refactor progress logic to be thread safe
PiperOrigin-RevId: 489984147
2022-11-22 09:47:45 +00:00
Alexander Capehart
46f376e40b
Fix non-updated constructor usage
Fix a constructor usage that tried to use an array instead of a list.
2022-11-21 14:01:01 -07:00
Alexander Capehart
6dd20ed13a
Make text information frame values abstract
Make the values of TextInformationFrame an abstract list instead of an
explicit ImmutableList.
2022-11-21 12:51:47 -07:00
Alexander Capehart
0eb56f65b0
Improve multi-value text frame parsing
Rework the parsing of multi-value text frames to reduce duplication
and increase efficiency.
2022-11-21 11:55:14 -07:00
Alexander Capehart
157f1f0787
Rework ID3v2 text frame values interface
Rework the interface for ID3v2 text frames by:
- Switching from a mutable array to ImmutableList
- Never leaving the array empty, instead filling it with "" if there
are no values

This makes the surface safer and more in line with the rest of the
module.
2022-11-21 11:35:05 -07:00
michaelkatz
ca190c084b Version bump to exoplayer:2.18.2 and media3:1.0.0-beta03
#minor-release

PiperOrigin-RevId: 489959918
2022-11-21 16:04:00 +00:00
claincly
47d63504c2 Destroy eglSurface in FrameProcessor
Previously, FrameProcessor never had the usecase in which the output surface
is replaced, while previewing introduced this usecase.

When switching output surfaces, we need to destroy the EGL Surface linked to the
surface that is being swapped out, because an EGL surface is linked to the EGL
display (which is not destroyed even when releasing FrameProcessor).

A GL exception will be thrown in the following scenario if we don't destroy the
EGL surface:

1. Creates a Surface, the surface is identified by address 0x11
2. Sets Surface(0x11) on FrameProcessor. Eventually an EGL surface is created
  to wrap Surface(0x11)
3. Release FrameProcess, this releases the EGL context
4. Instantiate a new FrameProcessor, sets Surface(0x11) as the output
5. When FrameProcessor creates an EGL surface to wrap Surface(0x11), GL throws
  an exception, becasue Surface(0x11) has previouly been connected to an EGL
  surface.

PiperOrigin-RevId: 489590072
2022-11-21 15:58:13 +00:00
tonihei
b81cd08271 Add remaining state and getters to SimpleBasePlayer
This adds the full Builders and State representation needed to
implement all Player getter methods and listener invocations.

PiperOrigin-RevId: 489503319
2022-11-21 15:52:36 +00:00