9533 Commits

Author SHA1 Message Date
claincly
51d1c0b892 Fix VideoEncoderSetting.bitrate is ignored when set
PiperOrigin-RevId: 491377695
2022-11-29 19:31:11 +00:00
Rohit Singh
3a7f940f41 Merge pull request #10776 from dongvanhung:feature/add_support_clear_download_manager_helpers
PiperOrigin-RevId: 491336828
2022-11-29 19:23:32 +00:00
ibaker
043546a034 Remove impossible UnsupportedEncodingException from Id3Decoder
The list of charsets is already hard-coded, and using `Charset` types
ensures they will all be present at run-time, hence we will never
encounter an 'unsupported' charset.

PiperOrigin-RevId: 491324466
2022-11-29 19:19:43 +00:00
huangdarwin
39f01bfb93 HDR: Apply OETF in HDR external sampler GLSL shader.
This should fix how color matrix transforms look when applied on HDR colors

PiperOrigin-RevId: 491323228
2022-11-29 19:15:52 +00:00
kimvde
2a0dc414da Add Transformer internal thread
This thread just starts the player and handles the player callbacks for
now. Sample pipelines are still run on the playback thread.

PiperOrigin-RevId: 491299671
2022-11-29 19:11:59 +00:00
ibaker
bf77290fbe Split up Id3DecoderTest methods
It's clearer if each test method follows the Arrange/Act/Assert pattern

PiperOrigin-RevId: 491299379
2022-11-29 19:08:02 +00:00
Rohit Singh
c827e46c3d Merge pull request #10799 from OxygenCobalt:id3v2-multi-value
PiperOrigin-RevId: 491289028
2022-11-29 19:04:05 +00:00
ibaker
ed8c196e2e Clean up javadoc on Metadata.Entry.populateMediaMetadata
Remove self-links, and remove section that is documenting internal
ordering behaviour of
[`SimpleBasePlayer.getCombinedMediaMetadata`](bb270c62cf/library/common/src/main/java/com/google/android/exoplayer2/SimpleBasePlayer.java (L1770))
rather than anything specifically about this method.

#minor-release

PiperOrigin-RevId: 490923719
2022-11-29 18:56:01 +00:00
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
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
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
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
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
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
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
kimvde
19bf020d84 Build TransformationResult only when transformation succeeded
PiperOrigin-RevId: 489442518
2022-11-21 15:46:56 +00:00
christosts
d9d716869b Pass correct frame size for passthrough playback
When estimating the AudioTrack min buffer size, we must use a PCM
frame of 1 when doing direct playback (passthrough). The code was
passing -1 (C.LENGTH_UNSET).

PiperOrigin-RevId: 489238392
2022-11-21 15:29:59 +00:00
tonihei
cbcdbfe021 Add additional codecs to the eosPropagationWorkaround list.
Issue: google/ExoPlayer#10756
PiperOrigin-RevId: 489236336
2022-11-21 15:24:23 +00:00
ibaker
058cba95d4 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
2022-11-21 15:12:52 +00:00
tonihei
c1fd03df74 Mark broadcast receivers as not exported
They are called from the system only and don't need to be exported
to be visible to other apps.

PiperOrigin-RevId: 489210264
2022-11-21 14:56:11 +00:00
kimvde
289a0e089e Make sure the AudioProcessors do not receive AP.EMPTY_BUFFER
PiperOrigin-RevId: 489174645
2022-11-21 14:46:26 +00:00
kimvde
59badba5fb Make sure Muxer is always accessed from playback thread
This thread will become the Transformer internal thread.

PiperOrigin-RevId: 489168435
2022-11-21 14:42:47 +00:00
kimvde
b23559456e Fix audio slow motion flattening
PiperOrigin-RevId: 488981968
2022-11-21 14:38:53 +00:00
Googler
79b809b556 Add setPlaybackLooper ExoPlayer builder method
The method allows clients to specify a pre-existing thread
to use for playback. This can be used to run multiple ExoPlayer
instances on the same playback thread.

PiperOrigin-RevId: 488980749
2022-11-21 14:35:11 +00:00
Googler
f52bb274b8 Fix NPE when listener is not set
PiperOrigin-RevId: 488970696
2022-11-21 14:31:26 +00:00
kimvde
ea7e8cff3a Refactor transformation completion
PiperOrigin-RevId: 488929446
2022-11-21 14:27:00 +00:00