91 Commits

Author SHA1 Message Date
christosts
d49bd456b6 Merge pull request #10793 from fraunhoferfokus:dash-thumbnail-support
PiperOrigin-RevId: 506261584
(cherry picked from commit c6569a36fbce6fc3ece55c9a904508bd4a4c45da)
2023-02-02 16:47:09 +00:00
tonihei
631ff809f5 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

PiperOrigin-RevId: 505098172
(cherry picked from commit 00436a04a4f0fec8ee9154fc1568ca4013ca5c7d)
2023-02-02 13:22:33 +00:00
Ian Baker
6e58ca6baa Merge pull request #10750 from Stronger197:subrip_utf_16
PiperOrigin-RevId: 492164739
(cherry picked from commit a9191418051a19681ddf884163ac5553871ec658)
2023-01-25 17:50:39 +00:00
rohks
8932c52122 Parse and set bitrates in Ac3Reader
PiperOrigin-RevId: 492003800
(cherry picked from commit c7aa54cb411e485c2c17e630779d9e27d758a550)
2023-01-25 17:49:34 +00:00
Rohit Singh
887179f50a Merge pull request #10799 from OxygenCobalt:id3v2-multi-value
PiperOrigin-RevId: 491289028
(cherry picked from commit b81d5f304e2f5fc55577e31c31ff6df5ce7d0ef5)
2023-01-25 17:41:39 +00:00
rohks
30dce91fc0 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 4066970ce7292642794f4a3954f8d0fde78dd310)
2023-01-25 17:41:00 +00:00
rohks
fda132f926 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
(cherry picked from commit 82711630ed1afbe7417aad95244a91135e24c27f)
2023-01-25 17:41:00 +00:00
rohks
32f7a8b807 Rollback of 76df06a7a3
*** Original commit ***

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

#minor-release

***

PiperOrigin-RevId: 490570517
(cherry picked from commit 427329175e87a7f3173791c59e6c2d4c4ed8dea4)
2023-01-25 17:41:00 +00:00
rohks
101a2498a0 Parse and set peakBitrate for Dolby TrueHD(AC-3) and (E-)AC-3
#minor-release

PiperOrigin-RevId: 490527831
(cherry picked from commit 76df06a7a364c580dfe07d9f069237cd77c5174c)
2023-01-25 17:41:00 +00:00
tianyifeng
f5afec955a 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 77fedd8d7d511ff97b0441aa9136d0f1aaecef4b)
2022-11-01 18:43:26 +00:00
Rohit Singh
a2096b6f4a Merge pull request #162 from ittiam-systems:rtp-mp4a-latm
PiperOrigin-RevId: 482490230
(cherry picked from commit d21c9488dfe807cf119fcaabbaf4127759835cb4)
2022-10-24 10:49:25 +00:00
kimvde
b5af908e53 Remove deprecated setOutputMimeType
This is to prepare Muxer to become public

PiperOrigin-RevId: 481893842
(cherry picked from commit 9221b1251cc1c614e4edc421c847f8fa2ce329a6)
2022-10-18 12:26:36 +00:00
leonwind
25a5fdfdac Add HSL Adjustments to the effects module.
PiperOrigin-RevId: 476144167
(cherry picked from commit dc9fa4f463a20a39984ea9d041ced0c4aed53291)
2022-09-22 17:56:54 +00:00
leonwind
63f9df5b1a 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 3433758c3b1f02c0ec28b86a8c3b659171f6f92b)
2022-09-22 16:45:28 +00:00
leonwind
ae18b30782 Use golden bitmaps in contrast pixel tests.
PiperOrigin-RevId: 475805421
(cherry picked from commit f00e43cf814df6bf71348a32d65b01ffada9d311)
2022-09-21 12:53:42 +00:00
leonwind
85f9ce3e74 Fix outdated command in bitmap/README.md.
* The command changed after creating a custom effects module.

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

PiperOrigin-RevId: 474561060
(cherry picked from commit f55a5146e01d0e5496ca97a5cfa7f47426d0932c)
2022-09-15 14:49:19 +00:00
leonwind
fb43ce2005 Add static Grayscale and Inverted RGB Filter.
PiperOrigin-RevId: 471017440
(cherry picked from commit 859504230240eacd3255cdf6be987412a4ff6c69)
2022-08-30 16:47:02 +00:00
huangdarwin
2490a7873c Update first frame instructions.
PiperOrigin-RevId: 471008623
(cherry picked from commit 3ba8bb71f924bf5d4ff6b3a414c0a16e698ae6b9)
2022-08-30 16:08:16 +00:00
hmzh
d7523d03bc 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 30257c767be211b39d2576ddce89c7473092bf74)
2022-08-18 20:44:21 +00:00
leonwind
ec9948e9f2 Compact a RGB Matrix chain into a singular RGB Matrix.
PiperOrigin-RevId: 468013019
(cherry picked from commit 045a396167e9cfc7faf35a94d1f63971bec3d290)
2022-08-16 20:39:42 +00:00
hmzh
dc29b44f05 Add a custom MIME type for MIDI
PiperOrigin-RevId: 466032455
(cherry picked from commit 579f25802a7d51b712c80e2045a76697be0a72e8)
2022-08-08 14:02:08 +00:00
hmzh
dbf32af099 Add support for multiple mid-track tempo changes
PiperOrigin-RevId: 466018462
(cherry picked from commit 22b00d0e00d695960fa609fee8a6cb3986bb3e61)
2022-08-08 12:35:28 +00:00
leonwind
d34ed7a5e1 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 a76dbfd363e2d167b13d2bcd978979bcfd69b071)
2022-08-05 12:56:26 +00:00
leonwind
2c4e946f71 Implement RGBA color matrices processor
* Transform frame colors using a defined RGBA Matrix to apply filters.

PiperOrigin-RevId: 464523581
(cherry picked from commit d15f2ed388e59e1b378440470347ee6f7f00ed94)
2022-08-01 13:47:21 +00:00
hmzh
959043cca3 Add seeking to arbitrary time points
PiperOrigin-RevId: 463328405
(cherry picked from commit 9c33b47f15778ce5b0c05bbc059df0fdff2c15c3)
2022-07-26 14:12:07 +00:00
olly
7b969e8df0 DASH: Parse and use EventStream.presentationTimeOffset
Issue: google/ExoPlayer#10460
#minor-release
PiperOrigin-RevId: 463163839
(cherry picked from commit 3786b64217a5044ed505c2e3939f07bece0605a6)
2022-07-25 20:28:20 +00:00
olly
e959af40f1 Add ContrastProcessor for contrast adjustments.
PiperOrigin-RevId: 462232813
(cherry picked from commit 714edc93be549f93194ad0a1d7e187c32b49d1e8)
2022-07-20 21:38:10 +00:00
huangdarwin
add44470cf 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 9f7a159bc4c8a82653fdbb6d62e4f79b020cff06)
2022-07-18 11:20:31 +00:00
hmzh
8b0fe16821 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 da0a208b89a7914dae577900c990b0f36c23df14)
2022-07-01 10:18:50 +00:00
rohks
5ac982b9d0 Make MetadataRenderer configurable to output metadata early.
PiperOrigin-RevId: 457974611
(cherry picked from commit 621617f98103f67082e47bf585460d90c00ea32f)
2022-06-29 14:47:12 +00:00
rohks
87d91ed19e Add timestamp to Metadata
`MetadataRenderer` is updated to output `Metadata` with its presentation time, in microseconds.

PiperOrigin-RevId: 457444718
(cherry picked from commit b2831d8559713b757feb3f15a2c828db0e5ecd7c)
2022-06-27 11:31:10 +00:00
rohks
49f4c9342d 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 74d61bbffb834cdb50d003a8de66af0e094ef702)
2022-06-22 17:19:55 +01:00
hschlueter
b7118486dc 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 ea7f1ca1e32f19131cec690c6934d82c81a2d6d0)
2022-06-15 13:14:56 +00:00
hmzh
f5f95a8f40 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 84c43f855fd60f96b5f415dc316c1333cfdec704)
2022-06-15 12:42:05 +00:00
huangdarwin
5349312f50 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 c5b881e0899e713a7c632da48f1cd64b1394a221)
2022-06-08 12:51:28 +00:00
rohks
c40d669c51 Add tests for extracting MP4 with large bitrates
Also added the test to `MP4PlaybackTest`.

PiperOrigin-RevId: 459492188
(cherry picked from commit 05e728a31eb85b82610a5eb83622ee2670582a26)
2022-07-07 13:04:29 +00:00
Rohit Singh
bc47036993 Merge pull request #10260 from sr1990:clearkey_parse_licenseurl
PiperOrigin-RevId: 459215225
(cherry picked from commit f00f93a96e0c7fa4f37e32e280b073d1cef2649e)
2022-07-07 16:43:14 +00:00
Marc Baechinger
080b1862c2 Merge pull request #9915 from dburckh:avi
PiperOrigin-RevId: 455094147
(cherry picked from commit ad3348cc69d240ed3a1248496938fda57e20368e)
2022-06-15 16:52:51 +00:00
ibaker
f6f4bf5e6b 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 1282175808210f0496a4b18ae4e02312dbdf4553)
2022-05-31 14:07:20 +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