14306 Commits

Author SHA1 Message Date
claincly
8709b1ef02 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-07 17:48:55 +01:00
olly
9fd75ac129 Make MediaCodecVideoRenderer.getCodecMaxInputSize public.
PiperOrigin-RevId: 439866306
2022-04-07 17:45:35 +01:00
claincly
61a20d5f68 Add test to query device capabilities.
PiperOrigin-RevId: 439861685
2022-04-07 17:41:32 +01:00
claincly
b5eba24e1f Preallocate buffer and use byte for Luminance in SSIM.
PiperOrigin-RevId: 439855702
2022-04-07 17:38:12 +01:00
hschlueter
7bd650b315 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-07 17:34:45 +01:00
claincly
1ea4fbb720 Add test skipping for API < 23 for EncoderPerformanceTest.
PiperOrigin-RevId: 439802597
2022-04-07 17:30:42 +01:00
hschlueter
09f9a44d0f 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-07 17:27:17 +01:00
hschlueter
c1b3e992b2 Fix typo in AdvancedFrameProcessorTest.
PiperOrigin-RevId: 439599201
2022-04-07 17:23:31 +01:00
olly
020e3ea5e2 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-07 17:20:04 +01:00
huangdarwin
188e0c70f1 Transformer Demo: Disable SDR button for API <31.
This makes it more clear to users of the demo that this is only available under API 31.

PiperOrigin-RevId: 439358674
2022-04-07 17:16:46 +01:00
claincly
4938028703 Support colon (:) in RTSP timing.
Some RTSP servers use `npt`: notation rather than `npt=`

PiperOrigin-RevId: 439333319
2022-04-07 17:13:25 +01:00
claincly
055c10d7b8 Add javadoc for SSIM helper.
PiperOrigin-RevId: 439332549
2022-04-07 17:09:21 +01:00
hschlueter
1cbdad34a2 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-07 17:06:00 +01:00
claincly
3d93484402 Add test to evaluate performance related encoding parameters.
PiperOrigin-RevId: 439268235
2022-04-07 17:01:55 +01:00
huangdarwin
ffeff69236 Transformer Demo: Open source previously-internal demo video files.
PiperOrigin-RevId: 439267827
2022-04-07 16:58:35 +01:00
hschlueter
a5180432ae Merge GlFrameProcessor#setInputSize() and initialize().
PiperOrigin-RevId: 439266087
2022-04-07 16:54:36 +01:00
Ian Baker
9f7abd4f42 Merge pull request #10047 from LuGO0:9432/added-filtering-for-forced-text-tracks
PiperOrigin-RevId: 439262085
2022-04-07 16:50:35 +01:00
hschlueter
bba102a467 Add ExternalCopyFrameProcessor to frameProcessors list.
PiperOrigin-RevId: 438847583
2022-04-07 16:47:08 +01:00
hschlueter
61ceae67e3 Move FrameProcessorChain OpenGL setup to factory method.
The encoder surface is no longer needed for the OpenGL setup and frame
processor initialization, as a placeholder surface is used instead. So
all of the setup can now be done in the factory method.

PiperOrigin-RevId: 438844450
2022-04-07 16:43:49 +01:00
olly
2611b49558 Exclude TrackGroup fields/methods from the stable API
App code should get all of this information from TrackGroupInfo,
and should only need TrackGroup as a key to use for overrides.

PiperOrigin-RevId: 438840925
2022-04-07 16:40:24 +01:00
samrobinson
6455f6e92f Add the frame count to TransformationResult.
Calculate throughputFps for TransformationTestResult.

PiperOrigin-RevId: 438817440
2022-04-07 16:37:04 +01:00
ibaker
7a08f73ee4 Add @OptIn annotations to dev guide snippets
These cover developer journeys that we don't plan to stabilise in 1.0.0

PiperOrigin-RevId: 438812300
2022-04-07 16:33:02 +01:00
samrobinson
9fca474027 Add file logging for skipping instrumentation tests.
PiperOrigin-RevId: 438808231
2022-04-07 16:28:58 +01:00
ibaker
80ff26b6fa Add @ContentType IntDef to Util.getAdaptiveMimeTypeForContentType
Also add a case for RTSP, otherwise lint complains.

PiperOrigin-RevId: 438805903
2022-04-07 16:25:38 +01:00
hschlueter
0370e05395 Add FrameProcessorChain factory method and make constructor private.
PiperOrigin-RevId: 438804850
2022-04-07 16:21:44 +01:00
hschlueter
63c42b79d4 Store max timestamp rather than last written timestamp per track.
This allows the MuxerWrapper to keep using trackTypeToTimeUs for
calculating the video duration but slightly changes the meaning of
its interleaving constraints.

PiperOrigin-RevId: 438780686
2022-04-07 16:18:24 +01:00
olly
200ee68479 Reading average and peak bitrates from esds boxes.
This provides better compatibility with MediaExtractor, which does read these fields; we also need them for being able to mux file contents into another mp4 file.

Also, there is a minor refactor included so that we have an actual type for esds box contents instead of a pair.

PiperOrigin-RevId: 438673825
2022-04-07 16:14:43 +01:00
olly
72846c4ff9 Decrease polling rate for IMA Video Ads from 100ms to 200ms
PiperOrigin-RevId: 438634901
2022-04-07 16:11:13 +01:00
claincly
30189f70df Move a commonly used encoder factory mode to util.
The encoder factory will be used in other tests.

PiperOrigin-RevId: 438552381
2022-04-07 16:04:28 +01:00
ibaker
57a937d72a Deduplicate the network-stacks and customization dev guide pages
PiperOrigin-RevId: 438547078
2022-04-07 16:00:58 +01:00
hschlueter
36376eb941 Split configureOutputSize into setInputSize and getOutputSize.
This makes it easier (smaller CL diff) to merge output size
configuration and initialize() in a follow-up.

PiperOrigin-RevId: 438543247
2022-04-07 15:57:30 +01:00
samrobinson
ef99d28a48 Re-use test runner in each loop of RepeatedTranscodeTransformationTest
PiperOrigin-RevId: 438542239
2022-04-07 15:54:04 +01:00
hschlueter
491de6991a Use placeholder surface to configure OpenGL and frame processors.
The placeholder surface is either EGL_NO_SURFACE or a 1x1 pbuffer
depending on whether the device supports EGL_KHR_surfaceless_context.

PiperOrigin-RevId: 438541846
2022-04-07 15:50:44 +01:00
hschlueter
775681c4eb glClear in FrameProcessorChain so the GlFrameProcessors don't have to.
Since the output textures and surfaces are managed by the
FrameProcessorChain, clearing them there makes sense.
This is also less error-prone as it might not be obvious to
someone implementing a GlFrameProcessor that they need to
glClear. (Clearing twice won't cause any problems.)

PiperOrigin-RevId: 438532247
2022-04-07 15:47:15 +01:00
hschlueter
33373d0d0a Fix non-inclusive language in class names.
https://source.android.com/setup/contribute/respectful-code#term-examples

PiperOrigin-RevId: 438335305
2022-04-07 15:40:24 +01:00
christosts
8038a53a64 Fallback to chunkful preparation if CODECS does not contain audio
Issue: google/ExoPlayer#10065

#minor-release

PiperOrigin-RevId: 438281023
2022-04-07 15:37:05 +01:00
samrobinson
5a43263782 Move Json helper methods to AndroidTestUtil.
PiperOrigin-RevId: 438253138
2022-04-07 15:33:39 +01:00
samrobinson
082c039b50 Add support for analyzing bitrates across devices.
Allows for input values to be propagated to the analysis file.

PiperOrigin-RevId: 438030322
2022-04-07 15:30:09 +01:00
hschlueter
d4a9e3d966 Use microseconds not nanoseconds for GlFrameProcessor.
This requires an additional nanos to micros conversion because
the SurfaceTexture uses nanos. But as the timestamps from the
MediaCodec decoder (propagated in DefaultCodec#releaseOutputBuffer) are
in microseconds no precision is lost here.

Also add test that checks output video duration.

PiperOrigin-RevId: 438010490
2022-04-07 15:23:24 +01:00
christosts
d0d0935f3f Fix NPE in PlayerActivity
PiperOrigin-RevId: 438010395
2022-04-07 15:19:59 +01:00
hschlueter
d609a7ffda Reword MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE javadoc.
MAXIMUM_AVERAGE_PIXEL_ABSOLUTE_DIFFERENCE was copied from a test
class, but BitmapTestUtil isn't a test. So the javadoc needs
rewording to reflect that.

PiperOrigin-RevId: 438001833
2022-04-07 15:16:32 +01:00
Ian Baker
349c72aba7 Merge pull request #35 from ittiam-systems:rtp-mpeg4
PiperOrigin-RevId: 438000682
2022-04-07 15:13:10 +01:00
hschlueter
990d5ccf4d Use @linkplain for link text that doesn't match symbol name.
PiperOrigin-RevId: 437992927
2022-04-07 15:09:42 +01:00
ibaker
479e8ea36e Remove IntDef warning suppression from DefaultTrackSelector
The problem is not the IntDef array, it's the fact the lint tool
is unable to correctly infer the annotations on the lambda parameters
without them being explicitly annotated. It seems explicitly annotating
is better than suppressing all IntDef warnings in the whole method.

PiperOrigin-RevId: 437969271
2022-04-07 15:06:16 +01:00
Ian Baker
930709e592 Merge pull request #56 from ittiam-systems:rtp_wav
PiperOrigin-RevId: 437783926
2022-04-07 15:02:40 +01:00
ibaker
544bb8546c More demo app unstable API opt-in and reshuffling
Follow-up to <unknown commit>

PiperOrigin-RevId: 437777871
2022-04-07 14:59:09 +01:00
ibaker
1168c419d1 Replace Util.SDK_INT with Build.VERSION.SDK_INT in the demo app
Util.SDK_INT will not be part of the stable API. This change only
touches those parts of the main demo app that will not be opted-in to
the unstable API for other reasons (e.g. download use-cases).

PiperOrigin-RevId: 437777687
2022-04-07 14:55:40 +01:00
ibaker
1d4f99cc86 Add PlayerView to the stable API
PiperOrigin-RevId: 437777445
2022-04-07 14:52:12 +01:00
hschlueter
ad6396a3e5 Check if there is a current context before generating textures/FBOs.
This avoids silent failures where the generated identifiers are 0.

PiperOrigin-RevId: 437775689
2022-04-07 14:48:41 +01:00
andrewlewis
35528fd1bf Add support for requesting color transfer to SDR
From Android T onwards `MediaCodec` supports requesting tone-mapping down to
SDR. Add an option to request this behavior and document that it isn't
supported before T. Also add an option in the demo app to try it out.

Tested manually on a prerelease build.

PiperOrigin-RevId: 437765325
2022-04-07 14:44:59 +01:00