14392 Commits

Author SHA1 Message Date
huangdarwin
f6808c9645 Transformer Demo: Open source previously-internal demo video files.
PiperOrigin-RevId: 439267827
2022-04-06 11:52:58 +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
hschlueter
2a66c7b8f5 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-06 11:47:45 +01:00
olly
f8f8b75500 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-06 11:46:49 +01:00
ibaker
166f04d5e9 Switch Media3's bug template to a form
This is based on the ExoPlayer form:
https://github.com/google/ExoPlayer/issues/new?assignees=&labels=bug%2Cneeds+triage&template=bug.yml

Also force people to use one of the templates.

PiperOrigin-RevId: 438840002
2022-04-06 11:45:53 +01:00
samrobinson
af5386cbc1 Add the frame count to TransformationResult.
Calculate throughputFps for TransformationTestResult.

PiperOrigin-RevId: 438817440
2022-04-06 11:44:16 +01:00
samrobinson
0c6882867b Add file logging for skipping instrumentation tests.
PiperOrigin-RevId: 438808231
2022-04-06 11:43:16 +01:00
ibaker
ad387378b2 Add @ContentType IntDef to Util.getAdaptiveMimeTypeForContentType
Also add a case for RTSP, otherwise lint complains.

PiperOrigin-RevId: 438805903
2022-04-06 11:42:01 +01:00
hschlueter
fa47233628 Add FrameProcessorChain factory method and make constructor private.
PiperOrigin-RevId: 438804850
2022-04-06 11:41:04 +01:00
hschlueter
6d753afc4c 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-06 11:40:06 +01:00
olly
21d085f8a9 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-06 11:39:05 +01:00
olly
7bbcf1c4c1 Decrease polling rate for IMA Video Ads from 100ms to 200ms
PiperOrigin-RevId: 438634901
2022-04-06 11:38:05 +01:00
ibaker
89c4bbec5b Stabilise HttpDataSource and its nested exceptions
PiperOrigin-RevId: 438558981
2022-04-06 11:36:53 +01:00
claincly
12fc9d1070 Move a commonly used encoder factory mode to util.
The encoder factory will be used in other tests.

PiperOrigin-RevId: 438552381
2022-04-06 11:35:43 +01:00
hschlueter
70cffd8cca 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-06 11:34:34 +01:00
samrobinson
d8e5e2de7a Re-use test runner in each loop of RepeatedTranscodeTransformationTest
PiperOrigin-RevId: 438542239
2022-04-06 11:33:38 +01:00
hschlueter
839f342e55 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-06 11:32:38 +01:00
ibaker
bd257d24ed Suppress spurious unchecked cast warning in LibraryResult
PiperOrigin-RevId: 438534391
2022-04-06 11:31:30 +01:00
hschlueter
aadbf3d59b 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-06 11:30:23 +01:00
ibaker
22ca225fa3 Stabilise MIME types that can be passed to MediaItem.Builder
This is basically 'container' and 'subtitle' MIME types

I previously avoided stabilising any 'custom' MIME types (those
containing '/x-') but it certainly seems reasonable to expect
developers to use APPLICATION_M3U8 and so then it also makes sense
to stabilise other 'similar' custom MIME types too.

PiperOrigin-RevId: 438501642
2022-04-06 11:29:22 +01:00
hschlueter
81ab6c730d Fix non-inclusive language in class names.
https://source.android.com/setup/contribute/respectful-code#term-examples

PiperOrigin-RevId: 438335305
2022-04-06 11:28:30 +01:00
christosts
bd5ca15af6 Fallback to chunkful preparation if CODECS does not contain audio
Issue: google/ExoPlayer#10065

#minor-release

PiperOrigin-RevId: 438281023
2022-04-06 11:27:22 +01:00
samrobinson
01c24e4de8 Move Json helper methods to AndroidTestUtil.
PiperOrigin-RevId: 438253138
2022-04-06 11:26:29 +01:00
bachinger
3ac7e0e84e Update error state of legacy playback state if authentication fails
This change adds the ability to update the error code of the PlaybackStateCompat in
cases we need this for backwards compatibility. It is applied in the least
intrusive way because normally, return values of a service method should not change
the state of the `PlaybackStateCompat`, just because it has nothing to do with the
playback state but rather with the state of the `MediaLibrarySession`.

For this reason only the error code `RESULT_ERROR_SESSION_AUTHENTICATION_EXPIRED`
is taken into account while all other error codes are not mapped to the
`PlaybackStateCompat'.

PiperOrigin-RevId: 438038852
2022-04-06 11:25:27 +01:00
samrobinson
e699765df5 Add support for analyzing bitrates across devices.
Allows for input values to be propagated to the analysis file.

PiperOrigin-RevId: 438030322
2022-04-06 11:24:26 +01:00
bachinger
8c0e8898fb Publish session test modules for the media3 repo
Issue: androidx/media#60
PiperOrigin-RevId: 438028148
2022-04-06 11:23:18 +01:00
hschlueter
d97de5b9f0 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-06 11:22:22 +01:00
christosts
2adf0f67d8 Fix NPE in PlayerActivity
PiperOrigin-RevId: 438010395
2022-04-06 11:21:21 +01:00
hschlueter
bd6eaab6b4 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-06 11:20:17 +01:00
Ian Baker
f48babb4ed Merge pull request #35 from ittiam-systems:rtp-mpeg4
PiperOrigin-RevId: 438000682
2022-04-06 11:19:08 +01:00
hschlueter
808909289c Use @linkplain for link text that doesn't match symbol name.
PiperOrigin-RevId: 437992927
2022-04-06 11:18:03 +01:00
ibaker
9d48cff9ff 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-06 11:17:06 +01:00
ibaker
f722114fc0 Add a Kotlin example for opting-in to the unstable API
PiperOrigin-RevId: 437962027
2022-04-06 11:16:07 +01:00
Ian Baker
e3a9ed6581 Merge pull request #56 from ittiam-systems:rtp_wav
PiperOrigin-RevId: 437783926
2022-04-06 11:14:43 +01:00
ibaker
0096b40b75 More demo app unstable API opt-in and reshuffling
Follow-up to a5330d43d4

PiperOrigin-RevId: 437777871
2022-04-06 11:13:42 +01:00
ibaker
e4556d76a9 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-06 11:12:44 +01:00
ibaker
2a2873840d Add PlayerView to the stable API
PiperOrigin-RevId: 437777445
2022-04-06 11:11:54 +01:00
hschlueter
0724e2b99f 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-06 11:10:56 +01:00
andrewlewis
d2a9419ad3 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-06 11:10:06 +01:00
andrewlewis
79db98e733 Remove unnecessary initialization
PiperOrigin-RevId: 437753013
2022-04-06 11:09:03 +01:00
hschlueter
827cf51dc9 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-06 11:07:45 +01:00
ibaker
1b52739dfb 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-06 11:06:45 +01:00
Ian Baker
9f29d22659 Merge pull request #47 from ittiam-systems:rtp-vp8
PiperOrigin-RevId: 437710223
2022-04-06 11:05:54 +01:00
huangdarwin
6858fe9116 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-06 11:04:52 +01:00
Ian Baker
a11c22b67e Merge pull request #46 from ittiam-systems:rtp_amr
PiperOrigin-RevId: 437274290
2022-04-06 11:03:43 +01:00
ibaker
a5330d43d4 Opt uncontroversial bits of the main demo app into unstable APIs
None of these components/features are planned to be part of the initial
stable API, so these suppressions will need to be in place when we
enable the warnings.

PiperOrigin-RevId: 437256731
2022-04-06 11:02:47 +01:00
hschlueter
92eb09fa6f 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-06 11:01:43 +01:00
aquilescanta
67acfc67de 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-06 10:59:41 +01:00