9031 Commits

Author SHA1 Message Date
ibaker
938728ce00 Add DefaultMediaSourceFactory.{set,clear}LocalAdInsertionConfig
Deprecate the setAdsLoaderProvider and setAdViewProvider methods these
replace.

PiperOrigin-RevId: 448251423
2022-05-24 10:59:01 +01:00
samrobinson
800e533014 Increase test timeout for 4k60 regression test.
Pixel 5 was occasionally reaching the 2 minute limit.

PiperOrigin-RevId: 448244803
2022-05-24 10:55:20 +01:00
tonihei
3eb6f0e806 Remove network type test restrictions for API 29/30
Network type detection on these API levels couldn't be tested
yet because of a missing Robolectric feature. This was fixed by
the recent Robolectric upgrade and the restrictions can be removed.

This also requires to replicate the platform hack we rely on on
these API levels.

PiperOrigin-RevId: 448240431
2022-05-24 10:51:54 +01:00
claincly
010a00e458 Add support for static RTP payload types.
Some RTP foramts are statically assigned, so they don't have the rtpmap
attribute. Create the missing rtpmap attribute in this case.

PiperOrigin-RevId: 448239724
2022-05-24 10:48:29 +01:00
huangdarwin
dd365cbeb8 Transformer GL: Update test name reference.
The prior test does not exist, and is not a pixel test.

PiperOrigin-RevId: 448224929
2022-05-24 10:44:55 +01:00
hmzh
0948fd1cd8 Adds key functionality for basic MIDI synthesization
- Add a MidiRenderer skeleton with basic playback
- Add MidiDecoder with placeholder synthesizer (JSyn) impl
- Make MidiExtractor feed placeholder data
- Add Renderer extension loaders for MIDI

PiperOrigin-RevId: 448212797
2022-05-24 10:41:20 +01:00
hmzh
dce0db35f1 Refactor MIDI and Flac extractor loaders for deduplication
Add MIDI filetype information for use in the ExtractorsFactory

PiperOrigin-RevId: 447976272
2022-05-24 10:37:39 +01:00
samrobinson
d254967a85 Expose decoder name to analysis files.
PiperOrigin-RevId: 447950623
2022-05-24 10:34:20 +01:00
samrobinson
271cdbed35 Force encoding for the on-device regression tests.
transformWithDecodeEncode is now transformWithoutDecodeEncode,
to test the passthrough path.

PiperOrigin-RevId: 447796892
2022-05-24 10:30:55 +01:00
samrobinson
6ac1306ec2 Expose the codec name to the analysis files.
PiperOrigin-RevId: 447724152
2022-05-10 15:08:51 +01:00
ibaker
06d73e93e6 Don't implement Player.Listener from SubtitleView
We never register SubtitleView as a Player.Listener directly, it's
always done via PlayerView.

PiperOrigin-RevId: 447467037
2022-05-09 15:45:54 +01:00
hschlueter
f08fdf6ab2 Add listener for FrameProcessingExceptions.
This listener replaces
FrameProcessorChain#getAndRethrowBackgroundExceptions.
The listener uses a new exception type FrameProcessingException
separate from TransformationException as the frame processing
components will be made reusable outside of transformer soon.

PiperOrigin-RevId: 447455746
2022-05-09 14:46:53 +01:00
hschlueter
e89189e35f Fix GlUtil vector size constant name.
This constant is used for https://docs.gl/es2/glVertexAttribPointer
which takes the number of components per generic vertex attribute
(meaning the size of the individual coordinate vectors here) not the
number of attributes (the number of vertices that the old constant
name referred to).

PiperOrigin-RevId: 447427241
2022-05-10 18:02:20 +01:00
samrobinson
5df6a5815a Match the suggested bitrate to the actual Kush Gauge formula.
As defined in Kush Amerasinghe's paper 'H.264 For the rest of us'.

PiperOrigin-RevId: 446988272
2022-05-06 16:03:18 +01:00
aquilescanta
521e067807 Disable transcoding when reading content URIs
Before this change, we list the formats for which we don't
want transcoding. This change disables transcoding altogether.

This was tested by checking that transcoding takes place on a
short camera recording only when the added flag is not present
(and AndroidManifest does not declare support for HEVC).

PiperOrigin-RevId: 446986580
2022-05-06 15:54:21 +01:00
huangdarwin
7cf59642d5 Transformer GL: Remove obsolete TODOs.
We won't try to provide/rethrow helpful error messages that are already
provided by GL, as this sort of task would expand into writing a GL verifier.
A Gl verifier is unnecessarily complex for minimal payoff, especially as Apps
expected to read GL error messages would mostly be those writing custom
GlFrameProcessors, who should be already be familiar with reading GL error
messages anyways.

PiperOrigin-RevId: 446950837
2022-05-06 12:06:40 +01:00
ibaker
a0ac261873 Remove ExoPlayer's RawCcExtractor
RawCC is a Google-internal subtitle format, and is no longer used with
ExoPlayer.

PiperOrigin-RevId: 446950691
2022-05-06 12:05:37 +01:00
hschlueter
ff1305cd19 Remove redundant attribute from matrix transformation vertex shader.
The texture coordinates can be derived from the frame coordinates.

PiperOrigin-RevId: 446770538
2022-05-05 19:24:44 +01:00
hschlueter
3701e80587 Use MatrixTransformation instead of wrapping its GlFrameProcssor.
ScaleToFitFrameProcessor, PresentationFrameProcessor,
and EncoderCompatibilityFrameProcessor now each implement
MatrixTransformation instead of wrapping
MatrixTransformationFrameProcessor.

PiperOrigin-RevId: 446480286
2022-05-04 17:40:33 +01:00
huangdarwin
3730c1e4d4 GL: Update exoplayer to use bindTexture.
Refactoring change only.

PiperOrigin-RevId: 446475708
2022-05-04 17:20:41 +01:00
christosts
e62338e871 Add TrackSelector.release()
The TrackSelector is released when the player is released. The
TrackSelector can be reused if TrackSelector.init() is called again.

PiperOrigin-RevId: 446439717
2022-05-04 14:33:50 +01:00
ibaker
8bb11f3f2b Migrate usages of the deprecated TrackSelectionParameters.CREATOR
PiperOrigin-RevId: 446400192
2022-05-04 10:13:35 +01:00
hschlueter
0bba5c6329 Separate matrix effect specification and implementation.
This change splits AdvancedFrameProcessor into 4 files:
- MatrixTransformationFrameProcessor for the GlFrameProcessor
  implementation
- MatrixTransformation and GlMatrixTransformation for the GlEffect
  specification
- MatrixUtils for the static matrix helpers

PiperOrigin-RevId: 446236384
2022-05-03 18:58:59 +01:00
christosts
3830d02590 Use Android 12L APIs directly
Some APIs from Android 12L were used either via reflection or
constants values were hard-coded. We can now use these APIs directly
since we upgraded the compile SDK version to 32.

PiperOrigin-RevId: 446167543
2022-05-03 13:10:04 +01:00
ibaker
33b049c104 Allow stable API users to bundle/unbundle TrackSelectionParameters
It's reasonable to serialize this type to support backgrounding
use-cases, as demonstrated by the main demo app.

PiperOrigin-RevId: 446161300
2022-05-09 12:03:58 +01:00
ibaker
1809a0b9f9 Migrate usages from C.TYPE_* to C.CONTENT_TYPE_*
PiperOrigin-RevId: 446156308
2022-05-09 12:00:38 +01:00
hschlueter
76627d7138 Introduce GlEffect interface for effect specification.
PiperOrigin-RevId: 446143537
2022-05-09 11:53:52 +01:00
olly
2283b9425e Add AV1 support to the getCodecMaxInputSize function.
PiperOrigin-RevId: 445973162
2022-05-09 11:50:42 +01:00
olly
ad25c2a8c3 Add MIDI mime types to decoder_midi and api.txt
PiperOrigin-RevId: 445445952
2022-05-09 11:47:28 +01:00
ibaker
b9a8da4e3e Allow stable API users to use DebugTextViewHelper
This is used from the main demo app.

PiperOrigin-RevId: 445420580
2022-05-09 11:41:07 +01:00
hschlueter
75c72f3b6d Return recommended output size for FrameProcessorChain.
Also add warning for what can happen if this is ignored.

Previously the return value was overridden by setOutputSurface, now
setOutputSurface only overrides the values using internally.

PiperOrigin-RevId: 445377036
2022-05-09 11:30:58 +01:00
ibaker
a840f9732f Add copies of PlayerControlView's public listeners to PlayerView
Developers are expected to (eventually) only use methods on
PlayerView (and not PlayerControlView) to interact with the UI
controller.

PiperOrigin-RevId: 445361488
2022-05-09 11:21:14 +01:00
ibaker
a433163b51 Prefix @ContentType values with CONTENT_
PiperOrigin-RevId: 445356625
2022-05-09 11:17:50 +01:00
ibaker
07d08ba85b Rename CONTENT_TYPE_ @AudioContentType values to AUDIO_CONTENT_TYPE_*
This is consistent with the IntDef name, and frees up the CONTENT_TYPE_
prefix for the @ContentType values (which are currently just TYPE_*,
and therefore ambiguous with lots of other 'type' values in C).

PiperOrigin-RevId: 445356476
2022-05-09 11:14:41 +01:00
ibaker
c5ad28a96c Remove empty <p> tag from WebvttDecoder
PiperOrigin-RevId: 445217294
2022-05-09 11:10:58 +01:00
ibaker
bec9431856 Fix Util.inferContentTypeForExtension to handle .ism (smooth streaming)
This method was introduced in 754eb1527a
as a replacement for Util.inferContentType(String) but it incorrectly
didn't return TYPE_SS when passed "ism" or "isml".

PiperOrigin-RevId: 445217167
2022-05-09 11:07:46 +01:00
huangdarwin
c67d69100d Transformer: Misc nits
* Add a /* paramName= */ comment
* Remove an unnecessary comma.
* Remove extra "internal " for a b/### link

PiperOrigin-RevId: 445169649
2022-05-09 11:01:12 +01:00
ibaker
d71140527b Remove unneeded warning suppression from FrameworkMediaDrm
PiperOrigin-RevId: 445162900
2022-05-09 10:57:47 +01:00
claincly
be634bfb19 Change video asset used in TranscodeQualityTest
The old video has a `irregular' resolution of 1080x720. Change to a 1920x1080
video.

PiperOrigin-RevId: 445124065
2022-05-09 10:54:32 +01:00
huangdarwin
404192e4bd Transformer: Restrict frame buffer size for all omx decoders API >= 29.
PiperOrigin-RevId: 445119411
2022-05-09 10:51:18 +01:00
claincly
a161482ca8 Add device capability based test skipping.
Change test name prefix from `transform` to `transcode` for consistency.

PiperOrigin-RevId: 445106224
2022-05-09 10:47:32 +01:00
olly
825976c987 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: 444890282
2022-05-09 10:40:44 +01:00
ibaker
91b0d55fb3 Fix calculations that may lose precision compared to their target type
PiperOrigin-RevId: 444861268
2022-05-09 10:30:39 +01:00
claincly
5d1af64605 Ignore mandatory SDP fields as ExoPlayer doesn't use them
Issue: google/ExoPlayer#10049
PiperOrigin-RevId: 444833508
2022-05-09 10:27:25 +01:00
ibaker
754eb1527a Clean up Util.inferContentType methods
This fixes some small niggles:
1. `inferContentType(String)` is documented to take a path, but in the
   tests we're passing full URIs.
2. A `String` parameter is usually a path, but also a MIME type or an
   extension. In the new methods, the meaning of a `String` parameter
   is always clear from the name of the method.
3. `inferContentType(String)` is always passed an extension in
   'production' code (which has to be manually prefixed with a dot).
4. `inferContentType(Uri, @Nullable String)` always ignores the Uri if
   the String is non-null. IMO this logic is clearer to a reader if it's
   just in-lined at the call-site.

These methods are used from the demo apps, so will be part of the stable
API.

PiperOrigin-RevId: 444826053
2022-05-09 10:23:38 +01:00
Ian Baker
925a907c5f Merge pull request #9967 from jruesga:cea708-handle-multiple-service-blocks
PiperOrigin-RevId: 444816821
2022-05-09 10:20:22 +01:00
Ian Baker
a8c0a1bdfd Merge pull request #10150 from egor-n:dev-v2-8435-outlinecolour
PiperOrigin-RevId: 444787307
2022-05-09 10:12:53 +01:00
Oliver Woodman
c25a3af009 Merge pull request #10214 from cedricxperi:dev-v2
PiperOrigin-RevId: 444585404
2022-04-26 18:28:38 +01:00
huangdarwin
1eadde528c Transformer GL: Add support for pixelWidthHeightRatio.
To ensure frame processor operations operate on square pixels,
make the frame taller or wider for non-square input pixels.

In addition to automated tests, this was tested by changing the
inputFormat.pixelWidthHeightRatio in the TransformerVideoRenderer.

PiperOrigin-RevId: 444553517
2022-04-26 18:24:46 +01:00
huangdarwin
b29d49637e Transformer: remove unused bitmap test option.
Remove unused saveTestBitmapToCacheDirectory throwOnFailure option.

#cleanup

PiperOrigin-RevId: 444516857
2022-04-26 12:05:30 +01:00