305 Commits

Author SHA1 Message Date
kimvde
98bc817fe7 Fix sample interleaving
Whether to write a sample or not was based on the timestamp of the
previous sample, rather than the current sample.

PiperOrigin-RevId: 500195279
2023-01-10 18:35:11 +00:00
tofunmi
18f58d1790 Add TextureOverlay.configure() to configure overlay before frame processing
This change allows an overlay to be sized with respect to the video dimensions.

PiperOrigin-RevId: 497337734
2023-01-04 21:43:33 +00:00
tofunmi
65dcfbd727 Add support for customizing overlay anchor point.
PiperOrigin-RevId: 496956035
2023-01-04 21:32:10 +00:00
huangdarwin
b8f88a8bae HDR: Use local instead of remote file for testing.
This should allow us to focus on HDR failures instead of network buffering
failures when debugging HDR issues.

These files are each used on several files, so it should be more worth the
test binary impact to move these files to local first.

Locally, tests did take less time after this diff

PiperOrigin-RevId: 496398130
2022-12-21 15:20:29 +00:00
tofunmi
3708a4f13e Create dynamically created shaders for multiple overlays.
PiperOrigin-RevId: 496379904
2022-12-21 15:18:26 +00:00
huangdarwin
a66dae8bfa HDR: Implement GlEffectsFrameProcessor HLG to SDR tone-mapping.
Adds COLOR_TRANSFER_GAMMA_2_2, to match behavior in other HDR to SDR tone mapping
implementations.

PiperOrigin-RevId: 495371736
2022-12-15 16:11:42 +00:00
andrewlewis
beee4732fb Generate complete silent audio frames
`SilentAudioGenerator` could output a fractional audio frame, and this could cause downstream components to throw because of trying to read a complete audio frame but only seeing a partial one.

Calculate the output buffer size based on the frame size (which is a no-op for stereo 16-bit audio) and calculate a total number of frames to output then multiple by the frame size.

PiperOrigin-RevId: 494992941
2022-12-15 15:58:50 +00:00
tofunmi
feb3b0b919 Add support for changing translucency of overlays through alpha values
Implements milestone 1.3 of the [overlays implementation plan](https://docs.google.com/document/d/1EcP2GN8k8N74hHZyD0KTqm9oQo5-W1dZMqIVyqVGtlo/edit#bookmark=id.76uzcie1dg9d)

PiperOrigin-RevId: 493290147
2022-12-12 11:22:33 +00:00
tofunmi
e6cb502bc6 Implement text and drawable overlays
Implements milestone 1.2 of the [overlays implementation plan](https://docs.google.com/document/d/1EcP2GN8k8N74hHZyD0KTqm9oQo5-W1dZMqIVyqVGtlo/edit#bookmark=id.76uzcie1dg9d)

PiperOrigin-RevId: 493282868
2022-12-12 11:21:27 +00:00
kimvde
85c48c481e Make sure that the sample pipeline data is processed regularly.
This is necessary to move video decoding to the AssetLoader. Otherwise,
if the decoder max pending frame count is reached, the AssetLoader will
stop queuing frames to the pipeline, and process data will not be called
anymore.

PiperOrigin-RevId: 492392621
2022-12-12 11:01:36 +00:00
Ian Baker
a919141805 Merge pull request #10750 from Stronger197:subrip_utf_16
PiperOrigin-RevId: 492164739
2022-12-12 10:55:15 +00:00
samrobinson
e5727a2cc7 Add an E2E test for changing sample rate with AudioProcessor.
PiperOrigin-RevId: 492160193
2022-12-12 10:54:06 +00:00
samrobinson
0993479efe Add an option to force a silent audio track.
PiperOrigin-RevId: 492154544
2022-12-12 10:53:06 +00:00
rohks
c7aa54cb41 Parse and set bitrates in Ac3Reader
PiperOrigin-RevId: 492003800
2022-12-12 10:47:12 +00:00
tofunmi
c5a763e150 Add the processor, GLEffect, texture and bitmap overlays
Implements milestone 1.1 of the [overlays implementation plan](https://docs.google.com/document/d/1EcP2GN8k8N74hHZyD0KTqm9oQo5-W1dZMqIVyqVGtlo/edit#bookmark=id.76uzcie1dg9d)

PiperOrigin-RevId: 491696361
2022-12-12 10:38:59 +00:00
Rohit Singh
b81d5f304e Merge pull request #10799 from OxygenCobalt:id3v2-multi-value
PiperOrigin-RevId: 491289028
2022-11-29 18:35:59 +00:00
rohks
4066970ce7 Convert bitrates to bps before setting it
Format expects the values of `averageBitrate` and `peakBitrate` in bps and the value fetched from AC3SpecificBox and EC3SpecificBox is in kbps.

PiperOrigin-RevId: 490756581
2022-11-29 18:28:49 +00:00
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