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
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
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
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
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
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
Tested:
Verified that the additional information is available through
instrumentation tests, as well as via manual testing.
#mse-bug-week
PiperOrigin-RevId: 429038695
- The resources were released twice before, which is not necessary since
the MSG_RELEASE message is already in the internal player queue.
- The demo app was failing because the stop watch was stopped in
onTransformationError after being reset.
#minor-release
#mse-bug-week
PiperOrigin-RevId: 428794426
The GlFrameProcessor handles everything related to the GLSL program,
the FrameEditor manages the GL context and the data flow including
the input SurfaceTexture and output EGLSurface.
This will be split up further in follow-up CLs so that
GlFrameProcessors can be chained. At this CL, there are no
functional changes intended.
PiperOrigin-RevId: 428779179
We have seen devices running on API21/23 fail transcoding because of setting
encoding profile/level.
Some devices (ale-123/nexus 7) on API21 returns ENOSYS (Function not
implemented) when being configured with a profile setting. (although API21
introduced the capability of setting encoding profile)
Some devices (nexus 5) on API23 fails configuration with a specific parameter
set, despite advertising support for it.
Not setting the baseline profile has no effect on encoding, because when not
set, the encoding will pick a suitable profile to use. Since baseline is
the lowest possible profile, the auto-picked value can't be worse than
baseline.
Ref: b/218696352
PiperOrigin-RevId: 427792124
On some Android devices, the return value of
```
MediaCodecInfo.getCapabilitiesForType(mimeType).profileLevels
```
contains one entry for each encoding profile, like <profile, maxSupportedLevel>
but on some other devices, there are multiple entries for the same profile,
like <HIGH_PROFILE, LEVEL1>, <HIGH_PROFILE, LEVEL2>, <HIGH_PROFILE, LEVEL3>,
where we need to iterate through all the entries and find the max.
PiperOrigin-RevId: 427727030
On some old devices, the encoding level needs to be set with the encoding
profile, but not on newer devices.
The profile/level override is applied by following
https://developer.android.com/guide/topics/media/sharing-video
PiperOrigin-RevId: 427008536
This is a breaking change if the annotation itself is in use in Kotlin
code. It's judged that the IntDefs in this commit are unlikely to be
referred to often in Kotlin code. This is because they're either:
- Related to esoteric parts of the library, or
- In a common part of the library but only returned from methods (and
never passed to callback methods).
A follow-up change will fix the positions of existing usages to match
this new config.
#minor-release
PiperOrigin-RevId: 426410237
Fallback is only disabled for robolectric and instrumentation tests.
For MH tests, fallback is not disabled, as it may be needed due to
the broad range of devices available.
PiperOrigin-RevId: 426403167
Reason for not rolling back the rollback d68b790077: file name changed and
file content moved, the automated tool is unable to correctly apply the change.
Apply suggested AVC profile depending on the API version.
Use `AVCProfileHigh` only when there's encoder support.
PiperOrigin-RevId: 426363780
This change makes GlUtil.Program an outer class named GlProgram,
and also moves private static helpers as well as the inner classes
Attribute and Uniform which were only used by GlUtil.Program to
GlProgram. Other static utility methods remain in GlUtil.
No functional changes intended.
PiperOrigin-RevId: 426119299
The longer list of targets is only necessary for backwards
compatibility with existing Kotlin code that will stop compiling
if the position of the annotation becomes 'wrong' by marking it only
TYPE_USE. Since none of these IntDefs have been released (except in
media3 alpha1) we don't need to maintain this compatibility.
Also add a comment to all the places that *do* need the longer list of
targets, in order to explain why it's there and discourage copy-pasting
when defining new IntDefs in future.
Also fix some single-element arrays to remove the array notation.
#minor-release
PiperOrigin-RevId: 426108537
- The MIME type should ideally default to HEVC if there is an encoder for it.
- Next, check if AVC is supported.
- If there is no encoder for AVC, then we should pick an encoder in the list of
existing encoders instead of abandoning the transformation.
PiperOrigin-RevId: 425900638