88 Commits

Author SHA1 Message Date
rohks
82711630ed Rollback of 427329175e
*** Original commit ***

Rollback of 76df06a7a3

*** Original commit ***

Parse and set `peakBitrate` for Dolby TrueHD(AC-3) and (E-)AC-3

#minor-release

***

***

PiperOrigin-RevId: 490707234
2022-11-24 14:55:08 +00:00
rohks
427329175e Rollback of 76df06a7a3
*** Original commit ***

Parse and set `peakBitrate` for Dolby TrueHD(AC-3) and (E-)AC-3

#minor-release

***

PiperOrigin-RevId: 490570517
2022-11-24 14:53:04 +00:00
rohks
76df06a7a3 Parse and set peakBitrate for Dolby TrueHD(AC-3) and (E-)AC-3
#minor-release

PiperOrigin-RevId: 490527831
2022-11-24 14:49:50 +00:00
tofunmi
779b042845 Update effect test results bitmaps following emulator update.
Ran all the [effects instrumentation tests](https://source.corp.google.com/piper///depot/google3/third_party/java_src/android_libs/media/libraries/effect/src/androidTest/java/androidx/media3/effect/;bpv=1;bpt=0) and replaced the [bitmaps](https://source.corp.google.com/piper///depot/google3/third_party/java_src/android_libs/media/libraries/test_data/src/test/assets/media/bitmap/;bpv=0;bpt=0) for the tests that were failing due to a small difference over the targeted 0.1 [threshold](https://source.corp.google.com/piper///depot/google3/third_party/java_src/android_libs/media/libraries/effect/src/androidTest/java/androidx/media3/effect/BitmapTestUtil.java;rcl=477974779;l=64) whose new bitmaps could be generated from the` crow --device generic_phone --api_level 31 --arch=arm64
` emulator.

PiperOrigin-RevId: 490261228
2022-11-22 17:44:53 +00:00
huangdarwin
f38a5a4963 Docs: Update broken bitmap test README link.
Also, update API level per the test now using API 31

PiperOrigin-RevId: 488359535
2022-11-14 17:53:47 +00:00
tianyifeng
77fedd8d7d Load bitmaps for MediaMetadataCompat and handle the metadata updates.
* Add `Listener` in `MediaSession` with method `onNotificationRefreshRequired(MediaSession)`.
* Add `MediaSessionService` as the listener of the `MediaSession` when `MediaSession` is added to `MediaSessionService`
* Load bitmap when update metadata in `MediaSessionLegacyStub` and call `onNotificationRefreshRequired` when bitmap asynchronously arrives.

PiperOrigin-RevId: 485376145
2022-11-08 11:19:04 +00:00
Rohit Singh
d21c9488df Merge pull request #162 from ittiam-systems:rtp-mp4a-latm
PiperOrigin-RevId: 482490230
2022-10-24 10:49:25 +00:00
kimvde
9221b1251c Remove deprecated setOutputMimeType
This is to prepare Muxer to become public

PiperOrigin-RevId: 481893842
2022-10-24 10:32:43 +00:00
leonwind
dc9fa4f463 Add HSL Adjustments to the effects module.
PiperOrigin-RevId: 476144167
2022-09-30 18:09:26 +00:00
leonwind
3433758c3b Add OETF and EOTF ES2 fragment shaders for non-HDR frames.
* Transform the intermediate color space to linear SDR by applying the SMPTE 170M EOTF and OETF.
* Use linear colors for the color filter pixel tests and update all golden bitmaps.

PiperOrigin-RevId: 476124592
2022-09-30 18:08:30 +00:00
leonwind
f00e43cf81 Use golden bitmaps in contrast pixel tests.
PiperOrigin-RevId: 475805421
2022-09-30 18:04:10 +00:00
leonwind
75141f3016 Fix outdated command in bitmap/README.md.
* The command changed after creating a custom effects module.

PiperOrigin-RevId: 474777823
2022-09-30 18:02:08 +00:00
leonwind
f55a5146e0 Add LUT functionalities to transformer.
* Adds SDR 3D LUT functionalities with OpenGL 2.0 support.

PiperOrigin-RevId: 474561060
2022-09-30 17:59:58 +00:00
leonwind
8595042302 Add static Grayscale and Inverted RGB Filter.
PiperOrigin-RevId: 471017440
2022-09-30 17:12:33 +00:00
huangdarwin
3ba8bb71f9 Update first frame instructions.
PiperOrigin-RevId: 471008623
2022-09-30 17:11:21 +00:00
hmzh
30257c767b Fix the command sample size given to trackOutput.
Remove the manual overwriting of Note ON events that have 0 velocity with Note OFF. JSyn handles this already.

- The implementation of "running status" means that the amount of bytes read from the file differ from the size of the sample that ends up in the decoder. The decoder sample contains the applied running status (status of previous event), which the file bytes don't contain.

PiperOrigin-RevId: 468537659
2022-09-30 16:50:17 +00:00
leonwind
045a396167 Compact a RGB Matrix chain into a singular RGB Matrix.
PiperOrigin-RevId: 468013019
2022-09-30 16:44:22 +00:00
hmzh
579f25802a Add a custom MIME type for MIDI
PiperOrigin-RevId: 466032455
2022-09-30 16:20:02 +00:00
hmzh
22b00d0e00 Add support for multiple mid-track tempo changes
PiperOrigin-RevId: 466018462
2022-09-30 16:17:58 +00:00
leonwind
a76dbfd363 Add RgbAdjustment class to build RgbaMatrices
* Add RgbaMatrix interface implementation.
* Add Builder class for easy adjustments.
* Adjust existing RgbaMatrixPixelTests to use new RgbAdjustment class.

PiperOrigin-RevId: 465545429
2022-08-05 12:56:26 +00:00
leonwind
d15f2ed388 Implement RGBA color matrices processor
* Transform frame colors using a defined RGBA Matrix to apply filters.

PiperOrigin-RevId: 464523581
2022-08-08 08:36:03 +00:00
hmzh
9c33b47f15 Add seeking to arbitrary time points
PiperOrigin-RevId: 463328405
2022-08-08 08:06:57 +00:00
olly
3786b64217 DASH: Parse and use EventStream.presentationTimeOffset
Issue: google/ExoPlayer#10460
#minor-release
PiperOrigin-RevId: 463163839
2022-08-08 08:02:36 +00:00
olly
714edc93be Add ContrastProcessor for contrast adjustments.
PiperOrigin-RevId: 462232813
2022-07-21 12:57:07 +00:00
huangdarwin
9f7a159bc4 HDR: Throw when unexpected color transfer encountered.
This may happen when a containers' color transfer incorrectly does not match
the video's color transfer.

An example of a file with such a mismatch is the current Transformer demo HDR10
sample file.

Manually tested by confirming that no errors are emitted for SDR and HLG sample
files, and that errors are emitted for our incorrect HDR10 sample file.

PiperOrigin-RevId: 461583532
2022-07-21 12:41:33 +00:00
rohks
05e728a31e Add tests for extracting MP4 with large bitrates
Also added the test to `MP4PlaybackTest`.

PiperOrigin-RevId: 459492188
2022-07-07 16:49:08 +00:00
Rohit Singh
f00f93a96e Merge pull request #10260 from sr1990:clearkey_parse_licenseurl
PiperOrigin-RevId: 459215225
2022-07-07 16:43:14 +00:00
hmzh
da0a208b89 Fix MIDI command timestamp calculations and synthesization duration.
- Improve variable naming to include time units for clarity
- Fix existing timestamp calculations to respect time units as well as track tempo (default values for now)
- Ensure the synthesizer produces PCM for the correct amount of time (including gaps between commands).

PiperOrigin-RevId: 458428243
2022-07-04 19:48:43 +00:00
rohks
621617f981 Make MetadataRenderer configurable to output metadata early.
PiperOrigin-RevId: 457974611
2022-07-04 19:42:59 +00:00
rohks
b2831d8559 Add timestamp to Metadata
`MetadataRenderer` is updated to output `Metadata` with its presentation time, in microseconds.

PiperOrigin-RevId: 457444718
2022-07-04 19:36:57 +00:00
hmzh
638c758721 Fix MIDI event array traversal in TrackChunk.java and TrackEvent.java
- Corrected trackEventBytes traversal in TrackChunk where the array position marker was not incremented properly, leading to duplicate sample output.
- Amended TrackEvent "Meta Event" parsing to account for the length of variable length bytes.
- Fixed a bug with TrackEvent message parsing where message data was parsed incorrectly due to miscalculated length.

PiperOrigin-RevId: 456967968
2022-06-27 10:42:42 +01:00
rohks
74d61bbffb Add timestamp to CueGroup
`TextRenderer` is updated to output `CueGroup`, which contains the presentation time of the cues, in microseconds.

PiperOrigin-RevId: 456531399
2022-06-27 10:38:20 +01:00
hschlueter
ea7f1ca1e3 Use FrameProcessorChain#SurfaceProvider for encoder compat transform.
This change adds a SurfaceProvider interface which is necessary to
allow for texture processors whose output size becomes available
asynchronously in follow-ups.
VTSP's implementation of this interface wraps the encoder and provides
its input surface together with the output frame width, height, and
orientation as used for encoder configuration.
The FrameProcessorChain converts the output frames to the provided
orientation and resolution using a ScaleToFitTransformation and
Presentation replacing EncoderCompatibilityTransformation.

PiperOrigin-RevId: 455112598
2022-06-15 15:30:48 +00:00
hmzh
84c43f855f Implement seeking to the start of a MIDI file
- Fixed MidiExtractor state issues which caused seeking to behave unexpectedly. Ensures the extractor is now always in the file loading state after returning RESULT_END_OF_INPUT.
- Fixed an infinite loop in MidiExtractor caused by the file data array having an initial size of 0. The extractor attempted to increase the capacity of the array by using this size of 0 in it's calculations.

PiperOrigin-RevId: 455107511
2022-06-15 15:29:06 +00:00
Marc Baechinger
ad3348cc69 Merge pull request #9915 from dburckh:avi
PiperOrigin-RevId: 455094147
2022-06-15 15:28:22 +00:00
huangdarwin
c5b881e089 Transformer GL: Split Presentation and Crop.
This removes the prior restriction of needing to remember not to crop and set aspect ratio in the same Presentation.Builder, and makes each class a bit more targeted.

This is partially made feasible by the past work to merge consecutive
MatrixTransformations into a single MatrixTransformationFrameProcessor, which
ensures that there's no loss in quality between successive MatrixTransformations.

PiperOrigin-RevId: 453660582
2022-06-09 17:44:04 +00:00
ibaker
1282175808 Permit duplicate Opus headers
This reinstates the permissive behaviour removed by
fe7e5b8181

Test file created by opening bear.opus in a hex editor and naively
duplicating the two header packets, starting at (and including) the
first `OggS` in the file and ending just before the third `OggS`.

#minor-release

Issue: google/ExoPlayer#10038
PiperOrigin-RevId: 452015662
2022-05-31 13:55:14 +00:00
hschlueter
9649411a4f Use video passthrough if clipping starts at key frame.
PiperOrigin-RevId: 451380267
2022-05-30 16:37:19 +00:00
hschlueter
678b6c0438 Replace 640x360 H264 test video with 320x240 H264 video.
Decoding and encoding 320x240 H264 video should be supported
on all devices from Android 5.0 based on CDD requirements.
https://source.android.com/compatibility/5.0/android-5.0-cdd#5_2_video_encoding

640x360 encoding doesn't seem to be supported on Nexus 5.

PiperOrigin-RevId: 450901715
2022-05-26 11:55:21 +00:00
hschlueter
d59186e53c Combine multiple matrix transformations in one shader.
When using a MatrixTransformationFrameProcessor per transformation
matrix, each frame processor's shader applies the matrix to the
vertices and clips the result to the NDC range when drawing the
output frame.
This change combines consecutive MatrixTransformations into a single
MatrixTransformationFrameProcessor by multiplying the individual
matrices while updating and clipping the visible polygon after
each matrix and mapping the resulting visible polygon back to the
input space so that its vertices and the combined transformation
matrix can be used in the shader.

PiperOrigin-RevId: 448521068
2022-05-24 10:44:15 +01:00
ibaker
4f616d6003 Remove ExoPlayer's RawCcExtractor
RawCC is a Google-internal subtitle format, and is no longer used with
ExoPlayer.

PiperOrigin-RevId: 446950691
2022-05-09 11:02:25 +01:00
olly
a16c0b3068 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:24:18 +01:00
Ian Baker
9369348d6f Merge pull request #10150 from egor-n:dev-v2-8435-outlinecolour
PiperOrigin-RevId: 444787307
2022-05-09 10:15:05 +01:00
huangdarwin
f269963e89 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-05-09 10:11:18 +01:00
andrewlewis
c8744ee9bd Add an SSIM test with 360p input
This test should run on all devices from API 21 (the media uses Baseline
profile level 3.0 H.264) to give us coverage of the full pipeline (forcing
re-encoding) and SSIM calculation on all devices.

PiperOrigin-RevId: 443650002
2022-04-26 15:00:34 +01:00
huangdarwin
29e32540de FrameProcessor: Move test bitmaps to a separate directory.
* Group what's now many related test PNGs by moving them to their own directory.
* Move bitmap references to files where they're used, as each bitmap is only
used once each, except the original bitmap.

PiperOrigin-RevId: 441485489
2022-04-26 14:36:31 +01:00
huangdarwin
34f014ce5c FrameProcessor: Add aspect ratio changes to Presentation.
PiperOrigin-RevId: 441250773
2022-04-26 14:31:14 +01:00
huangdarwin
fbcb49e8fd Media: Remove unused test images.
PiperOrigin-RevId: 441142050
2022-04-26 14:27:10 +01:00
olly
c007068ddb Expect PresentationTime Discontinuity During Stream Transitions
PiperOrigin-RevId: 440378974
2022-04-26 14:21:36 +01:00
huangdarwin
8a7fcb4eae FrameProcessor: Add setCrop to Presentation.
PiperOrigin-RevId: 440325693
2022-04-26 14:19:38 +01:00