1024 Commits

Author SHA1 Message Date
claincly
16b0cee0b6 Fix Basic authentication header
Issue: google/ExoPlayer#9544

The header must include the word "Basic", but the word is missing.

#minor-release

PiperOrigin-RevId: 443386880
2022-04-26 14:56:38 +01:00
andrewlewis
27c1876c9f Expand Samsung/1+ workaround to API 31 + 32
The issue with decoding getting stuck is still reproducible on `samsung/beyond1lteeea/beyond1:12/SP1A.210812.016/G973FXXUEGULB:user/release-keys`.

PiperOrigin-RevId: 443368546
2022-04-26 14:55:39 +01:00
samrobinson
a29206d891 Align MediaCodec and Decoder AudioRenderer onDisabled logic.
PiperOrigin-RevId: 443156130
2022-04-26 14:54:29 +01:00
hschlueter
6939464f91 Don't use API 26 SurfaceTexture constructor in frame processor tests.
After this change the test will use EGL_NO_SURFACE or a pixel buffer surface if using no surface is not supported.

PiperOrigin-RevId: 443113794
2022-04-26 14:53:31 +01:00
claincly
f903e4a9f8 Apply resolution fix.
Some devices under report their resolution support, like 2144 for 2160 in
H265, 1072 for 1080 in H264. This CL only takes care of these two cases,

- reporting 1920x1080 is supported when the device reports 1920x1072, and
- reporting 3840x2160 is supported when the device reports 3840x2144

PiperOrigin-RevId: 443095042
2022-04-26 14:50:35 +01:00
christosts
63052e1a7c DownloadHelper: propagate errors to callback
When downlading an adaptive asset, if an ExoPlaybackException happens
during track selection, the player raises an
UnsupportedOperationException which is not handled gracefully and can
crash the app main thread.

This change catches the error and forwards it to
DownloadHelper.Callback.onPrepareError() as an IOException.

PiperOrigin-RevId: 443015332
2022-04-26 14:49:38 +01:00
samrobinson
d1f8e96d9c Add 4 different video resolutions for bitrate analysis.
PiperOrigin-RevId: 442844189
2022-04-26 14:48:20 +01:00
huangdarwin
7f7e84bee3 FrameProcessor: Improve PresentationFrameProcessor javadocs.
PiperOrigin-RevId: 442835160
2022-04-26 14:47:21 +01:00
hschlueter
5248bbb882 Add context param to GlFrameProcessor initialize().
PiperOrigin-RevId: 442826391
2022-04-26 14:46:24 +01:00
hschlueter
afa551ab8f Block until FrameProcessorChain is released.
This is safer because it will prevent any future problems with
creating a new FrameProcessorChain before the previous one has
completed its async release.

From [eglDestroyContext documentation](https://www.khronos.org/registry/EGL/sdk/docs/man/html/eglDestroyContext.xhtml):
"If the EGL rendering context is not current to any thread,
eglDestroyContext destroys it immediately."
The context isn't current to any thread here because GlUtil calls
eglMakeCurrent with EGL_NO_CONTEXT before calling eglDestroyContext.
So everthing should be released once the FrameProcessorChain's
release task terminates.

PiperOrigin-RevId: 442807484
2022-04-26 14:45:31 +01:00
claincly
7a67609561 Add checks for device capability in tests.
PiperOrigin-RevId: 442751310
2022-04-26 14:42:31 +01:00
ibaker
5186798db9 Rename Player.COMMAND_GET_TRACK_INFOS to COMMAND_GET_TRACKS
`Player.getCurrentTracksInfo` was renamed to `Player.getCurrentTracks` in
83daa052cb.

PiperOrigin-RevId: 441825078
2022-04-26 14:41:41 +01:00
huangdarwin
3f4d03e731 FrameProcessor: Add checks to ensure width and height are positive.
Negative and zero values should be disallowed.

PiperOrigin-RevId: 441757246
2022-04-26 14:39:29 +01:00
olly
d9f0c2c071 Tracks.Group/TrackGroup variable naming disambiguation
PiperOrigin-RevId: 441712166
2022-04-26 14:37:35 +01:00
huangdarwin
29e32540de FrameProcessor: Move test bitmaps to a separate directory.
* Group what's now many related test PNGs by moving them to their own directory.
* Move bitmap references to files where they're used, as each bitmap is only
used once each, except the original bitmap.

PiperOrigin-RevId: 441485489
2022-04-26 14:36:31 +01:00
hschlueter
22e016e851 Clarify TransformationRequest setResolution javadoc.
Scaling and rotation using ScaleToFitFrameProcessor may change the
the resolution and aspect ratio, so defaulting to the same as the
input is no longer accurate.

PiperOrigin-RevId: 441463349
2022-04-26 14:35:12 +01:00
hschlueter
f25c912c72 Rename GlFrameProcessor updateProgramAndDraw to drawFrame.
What a minimal implementation should include is now explained in the
interface javadoc while the method name reflects what the method does.

PiperOrigin-RevId: 441432059
2022-04-26 14:34:11 +01:00
Ian Baker
85c09753ef Merge pull request #59 from h6ah4i:fix/cleanup-callbacks-on-media-controller-release
PiperOrigin-RevId: 441253378
2022-04-26 14:32:15 +01:00
huangdarwin
34f014ce5c FrameProcessor: Add aspect ratio changes to Presentation.
PiperOrigin-RevId: 441250773
2022-04-26 14:31:14 +01:00
olly
83daa052cb Rename TracksInfo and TrackGroupInfo
1. TracksInfo is renamed to Tracks
2. TracksInfo.TrackGroupInfo is renamed to Tracks.Group

PiperOrigin-RevId: 441232373
2022-04-26 14:30:14 +01:00
hschlueter
af8435816a Make TransformerEndToEndTest constants private.
PiperOrigin-RevId: 441230941
2022-04-26 14:29:19 +01:00
samrobinson
36c5b9407c Remove transformer from inputValues json.
Transformer resolves to null when wrapped, this is a debug line
that was not removed.

PiperOrigin-RevId: 441200790
2022-04-26 14:28:13 +01:00
huangdarwin
fbcb49e8fd Media: Remove unused test images.
PiperOrigin-RevId: 441142050
2022-04-26 14:27:10 +01:00
hschlueter
9b4aba33a3 Fix FrameProcessorChain method ordering.
signalEndOfInputStream makes more sense before isEnded and
getPendingInputFrameCount is related to registerInputFrame.

PiperOrigin-RevId: 441134418
2022-04-26 14:26:17 +01:00
samrobinson
0a16813f1c Allow suppression of AssertionError in TransformerAndroidTestRunner.
PiperOrigin-RevId: 440952335
2022-04-26 14:25:15 +01:00
samrobinson
8521d48f86 Fix incorrect test id.
PiperOrigin-RevId: 440906834
2022-04-26 14:24:21 +01:00
claincly
803cf64a06 Removing using the test asset that has Mp3 audio track.
The stream with the mp3 track is added because

- We only encode to AAC
- We only encode when the source track is not AAC

Now that we have a way to force encoding, we no longer need the mp3 track.

The test asset is kept for later parameterized testing.

PiperOrigin-RevId: 440876080
2022-04-26 14:23:26 +01:00
olly
c007068ddb Expect PresentationTime Discontinuity During Stream Transitions
PiperOrigin-RevId: 440378974
2022-04-26 14:21:36 +01:00
hschlueter
20547c3392 Add WorkerThread annotation to FrameProcessorChain helpers.
PiperOrigin-RevId: 440347550
2022-04-26 14:20:31 +01:00
huangdarwin
8a7fcb4eae FrameProcessor: Add setCrop to Presentation.
PiperOrigin-RevId: 440325693
2022-04-26 14:19:38 +01:00
claincly
1ca80741e5 Change SSIM transcode MIME type to H264.
The MIME type was set to H265 to force transcoding. Now that we have an encoder
factory that forces encoding, switching back to H264 ensures the quality test
is conducted on more devices (those don't support H265 can be tested now).

However, H265 should be part of the quality test after we have proper mechanism
to skip test based on device capability.

PiperOrigin-RevId: 440132471
2022-04-26 14:18:35 +01:00
christosts
43709c6211 Filter media notification actions
The DefaultMediaNotificationProvider checks if a command is available
before putting the respective action in the notification.

PiperOrigin-RevId: 440114422
2022-04-26 14:17:35 +01:00
huangdarwin
9a7b71b7c2 Media Solutions: Fix misspelling for "roboletric"
roboletric -> robolectric

PiperOrigin-RevId: 440101421
2022-04-26 14:16:37 +01:00
claincly
7d0034748f Add trying 1/3 resolution in fallback.
1/4 is probably unnecessary, as 1/3 of 4k is 720, which should be supported on
all practical encoders.

PiperOrigin-RevId: 440055144
2022-04-26 14:14:33 +01:00
claincly
a2d92ec623 Change SSIM test threshold from .95 to .90.
We don't currently have enough understanding of the correlation between a
specific SSIM score and video quality. Dropping to .90 to make most tests pass.
Especially when there's no discernible difference from the videos with .9 and
.95 SSIM.

PiperOrigin-RevId: 440047551
2022-04-26 14:13:31 +01:00
olly
eb038265f3 Make MediaCodecVideoRenderer.getCodecMaxInputSize public.
PiperOrigin-RevId: 439866306
2022-04-26 14:12:25 +01:00
claincly
1da7fd8956 Add test to query device capabilities.
PiperOrigin-RevId: 439861685
2022-04-26 14:11:27 +01:00
claincly
8bdce6ade6 Preallocate buffer and use byte for Luminance in SSIM.
PiperOrigin-RevId: 439855702
2022-04-26 14:09:52 +01:00
hschlueter
f5792dab92 Add periodic dimming effect to transformer demo.
PeriodicDimmingFrameProcessor is an example of how a custom fragment
shader can be used to apply color changes that change over time.

PiperOrigin-RevId: 439840609
2022-04-26 14:08:55 +01:00
claincly
7c64b1915c Add test skipping for API < 23 for EncoderPerformanceTest.
PiperOrigin-RevId: 439802597
2022-04-26 14:07:48 +01:00
hschlueter
c235e4f447 Add matrix provider for AdvancedFrameProcessor and examples in demo.
The matrix provider allows the transformation matrix to be updated
for each frame based on the timestamp.

The following example effects using this were added to the demo:
* a zoom-in transition for the start of the video,
* cropping a rotating rectangular frame portion,
* rotating the frame around the y-axis in 3D.

PiperOrigin-RevId: 439791592
2022-04-26 14:06:36 +01:00
hschlueter
f75710be93 Fix typo in AdvancedFrameProcessorTest.
PiperOrigin-RevId: 439599201
2022-04-06 12:00:19 +01:00
olly
296efbb395 Reading AV1 initialization data.
We add an entire class like we do for parsing other codec initialization formats; it's currently not doing any parsing though (... initialization data is really simple for AV1 though: just the entire contents of the box).

For testing, we add the sample file, having been re-encoded with ffmpeg (and we also happen to have another av1 file, too).

PiperOrigin-RevId: 439453823
2022-04-06 11:58:54 +01:00
claincly
e780a32de4 Support colon (:) in RTSP timing.
Some RTSP servers use `npt`: notation rather than `npt=`

PiperOrigin-RevId: 439333319
2022-04-06 11:56:55 +01:00
claincly
5b258ef8ab Add javadoc for SSIM helper.
PiperOrigin-RevId: 439332549
2022-04-06 11:56:02 +01:00
hschlueter
8138a9f48f Support android.opengl.Matrix in AdvancedFrameProcessor.
This allows apps to use AdvancedFrameProcessor to apply transformations
in 3D space. This functionality is not used in transformer otherwise.

PiperOrigin-RevId: 439313406
2022-04-06 11:54:59 +01:00
claincly
5b77625582 Add test to evaluate performance related encoding parameters.
PiperOrigin-RevId: 439268235
2022-04-06 11:53:53 +01:00
hschlueter
de00030f98 Merge GlFrameProcessor#setInputSize() and initialize().
PiperOrigin-RevId: 439266087
2022-04-06 11:52:05 +01:00
Ian Baker
ea61511a24 Merge pull request #10047 from LuGO0:9432/added-filtering-for-forced-text-tracks
PiperOrigin-RevId: 439262085
2022-04-06 11:50:35 +01:00
hschlueter
d3931d8b96 Add ExternalCopyFrameProcessor to frameProcessors list.
PiperOrigin-RevId: 438847583
2022-04-06 11:49:31 +01:00