563 Commits

Author SHA1 Message Date
hschlueter
422dfe0f95 Add an instrumentation unit test for TransformationFrameProcessor.
This test tests the same cases as the FrameEditorDataProcessingTest
as currently the main FrameEditor functionality is to apply a
transformation matrix using a TransformationFrameProcessor.

PiperOrigin-RevId: 431642066
2022-03-03 12:11:00 +00:00
samrobinson
d187df9afe Restructure regression androidTests, adding a 4k60 video and test.
Test list can be structured so tests don't need to be in different
classes, cleaning up the location of new test cases.

PiperOrigin-RevId: 431492941
2022-03-01 09:47:53 +00:00
claincly
50ac89eb82 Add SSIM support to AndroidTestUtil.
PiperOrigin-RevId: 431479473
2022-03-01 09:47:11 +00:00
hschlueter
da9aa4fded Use Color helper for packing in BitmapTestUtil.
PiperOrigin-RevId: 431451974
2022-03-01 09:46:31 +00:00
olly
68c310a94a TrackSelectionParameters: Simplify disabling of track types
As evidenced by the somewhat awkward logic in PlayerControlView, the
previous design wasn't very friendly to expected usage. There will be
more usage when the track selection dialog components are migrated,
which would be similarly awkward without this change.

PiperOrigin-RevId: 431407675
2022-03-01 09:45:38 +00:00
Ian Baker
c961ea1ca7 Merge pull request #10011 from tonykwok:dev-v2
PiperOrigin-RevId: 431395359
2022-03-01 09:44:52 +00:00
bachinger
9821dd282c Accept page index 0 for getChildren() in MediaLibraryServiceLegacyStub
This is consistent with the new MediaSessionStub that accepts page index 0
and the JavaDoc of legacy and new service callbacks.

Issue: androidx/media#32
PiperOrigin-RevId: 431390454
2022-03-01 09:43:55 +00:00
bachinger
8e8c59031c Drop ads for which we don't have metadata when joining a live stream
When a live stream is joined while ads are already playing, the LOADED event is
missed and we don't have ad information for those ads in the ad group that are
before the ad index at which we joined. This way we can clip the duration when we
receive the LOADED event for the last ad in the group. This fixes the problem of
the playback controls being hidden when content resumes after the ad group.

#minor-release

PiperOrigin-RevId: 431269627
2022-03-01 09:42:24 +00:00
claincly
f3cc75cf58 Add SSIM helper for transcoding quality measurements.
We use SSIM to measure the transcoding quality between. SSIM is a widely used
tool that compares the luma channel between two images, and generates a score
from 0 to 1 that indicates "how similar" the two images are.

In `SsimHelper`, we decode the two videos, extract matching frames and
calculates the mean SSIM (SSIM averaged all matching frames) for both videos.
Matching frames are referred to as "comparisonFrame" in the CL, which is
selected based on the frame number and a user-set comparison interval.
For instance, if the interval is 7, then every seventh frames are compared.

We use MediaCodec/MediaExtractor to decode the video, and use ImageReader to
extract the decoded frame.

The SSIM calculation logic is a inspired by and modified from the CTS
[MSSIMMatcher](https://cs.android.com/android/platform/superproject/+/master:cts/tests/tests/uirendering/src/android/uirendering/cts/bitmapcomparers/MSSIMComparer.java;l=1?q=mssimcom)
that has some errors and extra features we don't need (like handling RGB
images).

Adds TranscodeQualityTest to ensure high quality transcoding.

PiperOrigin-RevId: 430951206
2022-03-01 09:40:52 +00:00
samrobinson
8d852f3a99 Allow the difference Bitmap to be saved to device cache.
When investigating how 'bad' a failure is, it's useful to see the diff
between input and output bitmaps.

PiperOrigin-RevId: 430917732
2022-03-01 09:39:19 +00:00
ibaker
9748695e03 Rollback of 99d2b11329
*** Original commit ***

Rollback of caf62842c4

*** Original commit ***

Rollback of c2cb22a056

*** Original commit ***

Rollback of 1521e50307

*** Original commit ***

PiperOrigin-RevId: 430905772
2022-03-01 09:36:50 +00:00
olly
5a304fdbd9 FMP4: Fix output of mixed v0 and v1 emsg samples
Issue: google/ExoPlayer#9996
#minor-release
PiperOrigin-RevId: 430773329
2022-03-01 09:35:58 +00:00
christosts
4703ac80f6 Remove experimental flag for AsynchronousMediaCodecAdapter
The AsyncronousMediaCodecAdapter should call MediaCodec.start()
on the same thread it calls MediaCodec.flush(), i.e. the playback
thread. This change removes the experimental flag that allowed
calling MediaCodec.start() from the callback thread.

The flag was flipped to true already.

PiperOrigin-RevId: 430689665
2022-03-01 09:35:04 +00:00
ibaker
d5482fe343 Don't call MediaDrm.setLogSessionId in FrameworkMediaDrm
This method throws an UnsupportedOperationException on some Android 12
devices.

PiperOrigin-RevId: 430647264
2022-03-01 09:33:05 +00:00
ibaker
f92ae23dd8 Version bump to exoplayer:2.17.0 and media3:1.0.0-alpha02
#minor-release

PiperOrigin-RevId: 430456963
2022-02-23 16:22:43 +00:00
hschlueter
6779290724 Move bitmap helpers to new BitmapTestUtil class.
These helpers will also be useful for future frame processor tests
outside FrameEditorDataProcessingTest.

PiperOrigin-RevId: 430409172
2022-02-23 16:19:26 +00:00
hschlueter
650f71d022 Clarify instructions for updating expected output bitmaps.
Also replace the bitmaps with bitmaps obtained by following
the instructions.

PiperOrigin-RevId: 430232369
2022-02-23 16:17:57 +00:00
andrewlewis
5867a3a29c Fix typos
PiperOrigin-RevId: 430220416
2022-02-22 17:05:01 +00:00
ibaker
805959df8b Suppress @VisibleForTesting violation in Transformer
#minor-release

PiperOrigin-RevId: 430200331
2022-02-22 17:03:56 +00:00
andrewlewis
0490839fce Suppress framework muxer lint warning
We need to access internal state to work around resources not being released on
old API versions. Add a reference to the bug about this and suppress the lint
warning.

#minor-release

PiperOrigin-RevId: 430190794
2022-02-22 17:03:06 +00:00
ibaker
42340bf5ac Fix DefaultAnalyticsCollectorTest failure when run with JaCoCo
#minor-release

PiperOrigin-RevId: 430189385
2022-02-22 17:01:55 +00:00
hschlueter
e8977d00c5 Split out ExternalCopyFrameProcessor.
All (later customizable) GlFrameProcessors after the
ExternalCopyFrameProcessor receive their input from a normal OpenGL
texture not an external texture, so they won't need to worry about
the textureTransformMatrix.

PiperOrigin-RevId: 430165652
2022-02-22 17:01:04 +00:00
olly
bdc3af1416 Remove deprecated Player track methods
getCurrentTrackGroups and getCurrentTrackSelections are
retained for now, but moved from Player to ExoPlayer, to
ease the transition for some application code that currently
uses these methods.

PiperOrigin-RevId: 430036355
2022-02-22 10:35:04 +00:00
samrobinson
3851ef3d69 Reduce the length of the FrameEditorDataProcessingTest TAG.
As per f2ad8ccd3c, log tags can not be longer than 23 chars.

PiperOrigin-RevId: 430032243
2022-02-22 10:34:16 +00:00
huangdarwin
3e9d45f0ea Transformer: Work around Samsung/OnePlus decoder dequeueBuffer failed.
#mse-bug-week

PiperOrigin-RevId: 430028245
2022-02-22 10:32:46 +00:00
claincly
a196b5ec43 Re-enable RepeatedTranscodeTransformationTest.
There are two major blockers to this test:

- H265 muxing is not available for API<24, so setting video mimeType to H265
  will fail on those devices.
- AMR audio encoding is buggy on some device and it's not a widely used format.

The solution: use a video that is encoded with AVC/MP3, to ensure transcoding
to AVC/AAC.

PiperOrigin-RevId: 429648598
2022-02-22 10:31:07 +00:00
samrobinson
d7adb94669 Add a new sample file to assets, which has increasing timestamps.
Re-enable tests that have no muxer support for timestamps going backwards.

Tests running on the B-frame sample will be added in a future commit.

#mse-bug-week

PiperOrigin-RevId: 429599177
2022-02-22 10:30:18 +00:00
ibaker
ad35995d54 Redefine VERSION_INT to include alpha/beta/rc/stable
#minor-release

PiperOrigin-RevId: 429596966
2022-02-22 10:29:12 +00:00
ibaker
99d2b11329 Rollback of caf62842c4
*** Original commit ***

Rollback of c2cb22a056

*** Original commit ***

Rollback of 1521e50307

*** Original commit ***

Wire up MediaMetricsListener and add configuration to...

***

PiperOrigin-RevId: 429585773
2022-02-22 10:28:20 +00:00
samrobinson
4b72335d51 Add a TestTransformationResult class for additional test values.
This class will contain additional details such as frame count, once implemented.

#mse-bug-week

PiperOrigin-RevId: 429567678
2022-02-18 16:42:07 +00:00
Ian Baker
f3eb6e1376 Merge pull request #36 from ittiam-systems:rtp-h265
PiperOrigin-RevId: 429566102
2022-02-18 16:41:12 +00:00
claincly
99074f703a Improve exception message.
We use the `createForCodec` method that does not take a `MediaFormat` during
transformation, the error message always includes "no configured MediaFormat",
which is false.

PiperOrigin-RevId: 429553573
2022-02-18 16:40:19 +00:00
olly
9238dc758d Add Matroska Extractor Test Sample For Opus
PiperOrigin-RevId: 429386479
2022-02-18 14:56:25 +00:00
olly
c80d30ebce Avoid Clearing Supplemental Data Flag In MatroskExtractor
PiperOrigin-RevId: 429368911
2022-02-18 14:56:25 +00:00
olly
f1e59f8001 Libopus Support For WebM DiscardPadding
PiperOrigin-RevId: 429364728
2022-02-18 14:56:25 +00:00
olly
fdd3973a09 Fix potential NPE in test_utils WebServerDispatcher
PiperOrigin-RevId: 429338648
2022-02-18 14:56:01 +00:00
Ian Baker
38717ce969 Reformat some javadoc 2022-02-18 14:54:02 +00:00
olly
f22025cc5e Simplify TracksInfo API
isTypeSupportedOrEmpty is very specific and a little hard to
understand unless you know the one thing it's useful for. This
commit replaces it with isTypeSupported, which can be used in
conjunction with the recently added containsType method.

PiperOrigin-RevId: 429312712
2022-02-17 16:15:14 +00:00
olly
265dd079e9 Move track type from TrackGroupInfo to TrackGroup
The track type is derived solely from the content. It does
not depend on any runtime properties such as the player's
capabilities of user track selection. Hence it belongs in
TrackGroup rather than TrackGroupInfo.

Note that this avoids TrackSelectionOverride from having to
re-derive the track type internally.

PiperOrigin-RevId: 429303312
2022-02-17 16:14:16 +00:00
aquilescanta
6b606b9987 Depend on llvm-xy bin utils instead of GNU's binutils
NDK 23 removes GNU's bin utils. More info in
https://android.googlesource.com/platform/ndk/+/master/docs/BuildSystemMaintainers.md#binutils.

LLVM bin utils are available in all modern NDK versions.

#minor-release
Issue: google/ExoPlayer#9933
PiperOrigin-RevId: 429299806
2022-02-17 15:08:04 +00:00
samrobinson
7a5b3b3e5c Save the bitmap produced by the FrameEditorDataProcessingTest to cache.
The bitmap can then be retrieved through ADB.

#mse-bug-week

PiperOrigin-RevId: 429293231
2022-02-17 15:02:09 +00:00
olly
09772908b3 Make sure native library loads use correct class loader
Merge of https://github.com/google/ExoPlayer/pull/9934

#minor-release

PiperOrigin-RevId: 429259055
2022-02-17 15:00:31 +00:00
hschlueter
61354497e3 Add enable fallback option to transformer demo.
Also invert disableFallback parameter in DefaultEncoderFactory
to enableFallback. Fallback is still enabled by default.

PiperOrigin-RevId: 429253266
2022-02-17 14:59:32 +00:00
bachinger
15995d3dc5 Use service context in DefaultActionFactory
We need to use a Service to create the pending intents in the
`DefaultActionFactory`.

PiperOrigin-RevId: 429115746
2022-02-17 11:52:24 +00:00
andrewlewis
b96787d374 Avoid attempting to mux out of order pre-API 25
Calling `MediaMuxer.writeSampleData` can block indefinitely on old API versions. It is better not to call this method to fail quickly with an exception rather than getting stuck.

Based on on-device testing media muxer doesn't generally handle out of order samples before API 25. There are a small number of devices where this does succeed but it seems preferable to turn this off everywhere to keep the code simple and have consistent behavior. Once we switch to in-app muxing this limitation will no longer apply.

#mse-bug-week

PiperOrigin-RevId: 429070255
2022-02-17 11:52:24 +00:00
bachinger
6978746f4f Clear ad playback state map when AdsLoader is released
#minor-release

PiperOrigin-RevId: 429067634
2022-02-17 11:52:24 +00:00
bachinger
0842295a88 Make AdsLoader.State implement Bundleable
This allows the AdsLoader.State to be stored in savedInstanceState

#minor-release

PiperOrigin-RevId: 429057697
2022-02-17 11:52:24 +00:00
samrobinson
1af841698f Add exception information to AndroidTest analysis file.
Tested:
  Verified that the additional information is available through
  instrumentation tests, as well as via manual testing.

#mse-bug-week

PiperOrigin-RevId: 429038695
2022-02-17 11:52:23 +00:00
andrewlewis
677c5dc6d4 Skip tests requiring out of order muxing pre API 25
PiperOrigin-RevId: 429029496
2022-02-17 11:52:23 +00:00
christosts
b59869ede3 Create BitmapLoader
Create BitmapLoader component for loading artwork
images. Add the SimpleBitmapLoader which fetches images
from HTTP/HTTPS endpoints. Integrate BitmapLoader in
DefaultMediaNotificationProvider.

PiperOrigin-RevId: 429010249
2022-02-17 11:52:23 +00:00