14392 Commits

Author SHA1 Message Date
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
andrewlewis
001c6c2dac Remove unnecessary initialization
PiperOrigin-RevId: 437753013
2022-04-07 14:41:24 +01:00
hschlueter
f3c861a6de Check thread name for GL methods.
The thread name is used to verify the thread in both  createOpenGlObjectsAndInitializeFrameProcessors() and processFrame().
Also remove glThread field that was only used for this verification.

PiperOrigin-RevId: 437730804
2022-04-07 14:37:56 +01:00
ibaker
a8896c3996 Switch the demo app from Util.areEqual to Guava's Objects.equals
Util.areEqual will not be part of the stable API.

PiperOrigin-RevId: 437723080
2022-04-07 14:34:32 +01:00
Ian Baker
d76658e6fc Merge pull request #47 from ittiam-systems:rtp-vp8
PiperOrigin-RevId: 437710223
2022-04-07 14:31:07 +01:00
huangdarwin
083aa7b29d Transformer Demo: Add 8k24fps video option.
This can help allow Transformer be more aware of issues in high-res videos.

PiperOrigin-RevId: 437313282
2022-04-07 14:27:43 +01:00
Ian Baker
a4c05fab7d Merge pull request #46 from ittiam-systems:rtp_amr
PiperOrigin-RevId: 437274290
2022-04-07 14:24:15 +01:00
hschlueter
d1394780ec Fix output viewport size of empty FrameProcessorChain.
Since the output size can be overridden, the viewport should be
ouputWidth/Height and NOT the ExternalCopyFrameProcessor's output size
which matches the input size.

PiperOrigin-RevId: 437256635
2022-04-07 14:17:01 +01:00
aquilescanta
202a82a915 Support seeking in un-intearleaved tracks in Mp4Extractor
A client can pass the id of the track on which they want to seek.

PiperOrigin-RevId: 437248055
2022-04-07 14:10:02 +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
huangdarwin
59f87a5134 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-06 11:57:58 +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