299 Commits

Author SHA1 Message Date
christosts
76e87406bb Merge pull request #10793 from fraunhoferfokus:dash-thumbnail-support
PiperOrigin-RevId: 506261584
(cherry picked from commit 107e0c6e42c6fd080b1be19e5305597cf880a9dd)
2023-02-02 16:47:22 +00:00
tonihei
284bf97007 Fix timestamp comparison for seeks in fMP4
When seeking in fMP4, we try to extract as little samples as possible
by only starting at the preceding sync frame. This comparison should
use <= to allow sync frames at exactly the seek position.

Issue: google/ExoPlayer#10941

#minor-release

PiperOrigin-RevId: 505098172
(cherry picked from commit ac3017b5805cb98b4292e4bbe1f7181f47684b88)
2023-02-02 13:18:47 +00:00
Ian Baker
eb51ad57f9 Merge pull request #10750 from Stronger197:subrip_utf_16
PiperOrigin-RevId: 492164739
(cherry picked from commit 496cfa420d7dd23fb5913c9ecf7b0b1e04cc65ff)
2023-01-25 17:39:48 +00:00
rohks
8246587b00 Parse and set bitrates in Ac3Reader
PiperOrigin-RevId: 492003800
(cherry picked from commit 5f73984823b943d750f41519d431ad3b12dada65)
2023-01-25 17:39:48 +00:00
Rohit Singh
cbc2547043 Merge pull request #10799 from OxygenCobalt:id3v2-multi-value
PiperOrigin-RevId: 491289028
(cherry picked from commit c827e46c3db2691b1b5fed57fa5b67890331aa85)
2023-01-25 17:39:48 +00:00
rohks
7e733aa2df 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
(cherry picked from commit 67955e0ce331481bcb3fd94c9ffb9632f27eae6e)
2023-01-25 17:39:47 +00:00
rohks
b4a88d63b7 Rollback of ea3552c1a0
*** Original commit ***

Rollback of 01eddb34f5

*** Original commit ***

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

#minor-release

***

***

PiperOrigin-RevId: 490707234
(cherry picked from commit 8c91a31ced401ce14911fbfdf58dda3c7ee8e643)
2023-01-25 17:39:47 +00:00
rohks
2910117ec1 Rollback of 01eddb34f5
*** Original commit ***

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

#minor-release

***

PiperOrigin-RevId: 490570517
(cherry picked from commit ea3552c1a030d8b14c0cd0093f7eaa6242f969eb)
2023-01-25 17:39:47 +00:00
rohks
35a900a6e6 Parse and set peakBitrate for Dolby TrueHD(AC-3) and (E-)AC-3
#minor-release

PiperOrigin-RevId: 490527831
(cherry picked from commit 01eddb34f555903c576c79b02a7b34a53e0272cb)
2023-01-25 17:39:47 +00:00
tianyifeng
61b1cfc05d 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
(cherry picked from commit 624238c6b6e621deed585cb19b63f117ae3f7e76)
2022-11-01 18:43:26 +00:00
Rohit Singh
23b070d151 Merge pull request #162 from ittiam-systems:rtp-mp4a-latm
PiperOrigin-RevId: 482490230
(cherry picked from commit fd2ba37b1d67576313aec0512d630331b7c99f4b)
2022-10-24 10:55:19 +00:00
bachinger
6f94b8efe5 Map lib-effect from androidx to exoplayer2
PiperOrigin-RevId: 482179761
(cherry picked from commit 28c4be2f6bd56205e3b8128bf710c34b3b3d65e9)
2022-10-19 12:38:14 +00:00
kimvde
66d56be3aa Remove deprecated setOutputMimeType
This is to prepare Muxer to become public

PiperOrigin-RevId: 481893842
(cherry picked from commit bd9181e6ba5daf865f9c2f4338f1238b108dafd8)
2022-10-18 12:26:36 +00:00
leonwind
55d3c5ac0c Add HSL Adjustments to the effects module.
PiperOrigin-RevId: 476144167
(cherry picked from commit 2c27cd82f1e97d14f609ea5bb6924398a9dddfd6)
2022-09-22 17:56:54 +00:00
leonwind
a534f60f56 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
(cherry picked from commit afd829e5db17c48abccea30842eec20b702aa330)
2022-09-22 16:45:28 +00:00
leonwind
b23c966c5a Use golden bitmaps in contrast pixel tests.
PiperOrigin-RevId: 475805421
(cherry picked from commit 06c0040ab43820164bc048d85556727aaa9fa4f8)
2022-09-21 12:53:42 +00:00
leonwind
0a811bd4a1 Fix outdated command in bitmap/README.md.
* The command changed after creating a custom effects module.

PiperOrigin-RevId: 474777823
(cherry picked from commit fd6b0d1551af6db9de49dd17c30937a4b292357d)
2022-09-16 10:40:19 +00:00
leonwind
eb6cf356bb Add LUT functionalities to transformer.
* Adds SDR 3D LUT functionalities with OpenGL 2.0 support.

PiperOrigin-RevId: 474561060
(cherry picked from commit 702419dd227cec4b23cd6e723a6a15908313f7c9)
2022-09-15 14:49:19 +00:00
leonwind
8e90496df5 Add static Grayscale and Inverted RGB Filter.
PiperOrigin-RevId: 471017440
(cherry picked from commit 9f67ce4e4c1d6e26a0920bf9bed89c38cecbdaeb)
2022-08-30 16:47:02 +00:00
huangdarwin
2e4ec7a681 Update first frame instructions.
PiperOrigin-RevId: 471008623
(cherry picked from commit cb60f506d1f6283e2790ee631c01c5c4128967a2)
2022-08-30 16:08:16 +00:00
hmzh
5c95b41d3c 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
(cherry picked from commit 53218b50d465939b74a64fdc87ecaca5f1a95b57)
2022-08-18 20:44:21 +00:00
leonwind
a4175b8607 Compact a RGB Matrix chain into a singular RGB Matrix.
PiperOrigin-RevId: 468013019
(cherry picked from commit 977370e9db8fda16388a56f8979df9f6f6737b60)
2022-08-16 20:39:42 +00:00
hmzh
fb85488d75 Add a custom MIME type for MIDI
PiperOrigin-RevId: 466032455
(cherry picked from commit 3aa99d5efbd87a410dd8177539e54185c6b17176)
2022-08-08 14:02:08 +00:00
hmzh
98dd4f88e2 Add support for multiple mid-track tempo changes
PiperOrigin-RevId: 466018462
(cherry picked from commit 4725cff70e3293f43bd11866f305041c6c18792e)
2022-08-08 12:35:28 +00:00
leonwind
e8a4cceb12 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
(cherry picked from commit 6502fce634913420af77ec78c275f97a61b8fac4)
2022-08-05 12:56:26 +00:00
leonwind
5668c8a6a9 Implement RGBA color matrices processor
* Transform frame colors using a defined RGBA Matrix to apply filters.

PiperOrigin-RevId: 464523581
(cherry picked from commit 23f34f8d08855645b342a75b0adfc6c0d600c0ab)
2022-08-01 13:47:21 +00:00
hmzh
976efb3e9c Add seeking to arbitrary time points
PiperOrigin-RevId: 463328405
(cherry picked from commit 3c2b54b5e36faf6f0eb359b35724f8d087739104)
2022-07-26 14:12:07 +00:00
olly
023bea5f99 DASH: Parse and use EventStream.presentationTimeOffset
Issue: google/ExoPlayer#10460
#minor-release
PiperOrigin-RevId: 463163839
(cherry picked from commit 628818211394d3783bec4398c8c9b9dbf335c486)
2022-07-25 21:28:20 +01:00
olly
8a848db2fb Add ContrastProcessor for contrast adjustments.
PiperOrigin-RevId: 462232813
(cherry picked from commit 7ef41c73218ec70ee9a5c372369d308273fddd8b)
2022-07-20 21:38:10 +00:00
huangdarwin
7d14750948 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
(cherry picked from commit fd046bd2f63888f8a47c37a426c10212a56be6e0)
2022-07-18 11:20:31 +00:00
hmzh
d03fb39469 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
(cherry picked from commit bce59b1ac20725f34362caeebfd337d565790f32)
2022-07-01 10:18:50 +00:00
rohks
583c12f843 Make MetadataRenderer configurable to output metadata early.
PiperOrigin-RevId: 457974611
(cherry picked from commit 14f75c162f85ac083c8b19b74790b4a6f921c68f)
2022-06-29 14:47:12 +00:00
rohks
76310ad40c Add timestamp to Metadata
`MetadataRenderer` is updated to output `Metadata` with its presentation time, in microseconds.

PiperOrigin-RevId: 457444718
(cherry picked from commit 6e9275c13d7c6e0fc8b6568662929c186395a33a)
2022-06-27 11:31:10 +00:00
rohks
1bc316dee1 Add timestamp to CueGroup
`TextRenderer` is updated to output `CueGroup`, which contains the presentation time of the cues, in microseconds.

PiperOrigin-RevId: 456531399
(cherry picked from commit bf11a8a83148f0d68c82cf22a5f978b1e6a5e299)
2022-06-22 17:19:55 +01:00
hschlueter
5f142c4bbe 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
(cherry picked from commit d20f68498666ddf1f1946799cf002a9edb573a40)
2022-06-15 13:14:56 +00:00
hmzh
5a3454c8b0 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
(cherry picked from commit e5260beea75b88f7b697f52ad75e891091ba2391)
2022-06-15 12:42:05 +00:00
huangdarwin
a4ed533eb5 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
(cherry picked from commit b33dc5e57b96d81f9c246a369a09fb7a23a119e2)
2022-06-08 12:51:28 +00:00
rohks
43eb3d0fc8 Add tests for extracting MP4 with large bitrates
Also added the test to `MP4PlaybackTest`.

PiperOrigin-RevId: 459492188
(cherry picked from commit a1665841fc90e979af427f9da0b8398d56cc6632)
2022-07-07 13:04:29 +00:00
Rohit Singh
ef96641558 Merge pull request #10260 from sr1990:clearkey_parse_licenseurl
PiperOrigin-RevId: 459215225
(cherry picked from commit 9521807681840f530ed4af17c4ab5c68dedaa13e)
2022-07-07 18:12:15 +00:00
Marc Baechinger
a785fbe014 Merge pull request #9915 from dburckh:avi
PiperOrigin-RevId: 455094147
(cherry picked from commit 1ca382d138b30ecebe3d1ceab2442e0e53bdd388)
2022-06-15 16:51:04 +00:00
ibaker
27e0c80792 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
(cherry picked from commit b6b282672c45263d0f9e2b6ece4f6de1083812cb)
2022-05-31 14:06:59 +00:00
hschlueter
6b521b2952 Use video passthrough if clipping starts at key frame.
PiperOrigin-RevId: 451380267
2022-05-30 17:22:16 +00:00
hschlueter
52ad75c0a4 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 13:00:27 +00:00
hschlueter
df1b733d50 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 11:05:59 +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
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
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
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
andrewlewis
6443d5b840 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 16:37:44 +01:00
huangdarwin
e077c76684 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 15:17:20 +01:00