15047 Commits

Author SHA1 Message Date
andrewlewis
f8aaed1ac7 Avoid encoder default color info when tone-mapping
The encoder color info [defaults](https://cs.android.com/android/platform/superproject/+/master:frameworks/av/media/libstagefright/foundation/ColorUtils.cpp;l=377;drc=891c19ccfa4953b5e5f7b87118e007b994d8074c) to a value that depends on the input resolution, but when tone-mapping is enabled we should always get BT.709 color space. Hard-code this constant for now to avoid behavior depending on the resolution. A future change should use the decoder output media format to populate the color info.

PiperOrigin-RevId: 465070378
(cherry picked from commit 3c4ee51e10fe0a2ea495f00a3fcd98d6cb83b561)
2022-08-03 16:06:45 +00:00
hschlueter
110c442758 Fix saving previous debugSurfaceView in FinalMatrixTPWrapper.
PiperOrigin-RevId: 465067306
(cherry picked from commit a28a508d2dd10ac2858c334a1a0fe0ff1350e98c)
2022-08-03 15:52:24 +00:00
claincly
076218be9d Clean up NOP constructor lines in RTP readers
PiperOrigin-RevId: 465067191
(cherry picked from commit ed60c885f2c09bcc8484eeeb340a96559c7ad918)
2022-08-03 15:51:48 +00:00
hschlueter
89edfbc12b Clean up FrameProcessor TODOs.
PiperOrigin-RevId: 465044342
(cherry picked from commit c5d1940fbab430ede4b158300bbb381c032498bf)
2022-08-03 13:53:53 +00:00
hschlueter
8b9203a3ea Move effects functionality out of transformer to effects module.
PiperOrigin-RevId: 465038852
(cherry picked from commit 22725ddfa8f5c39c83b792a176339700364b724e)
2022-08-03 13:19:15 +00:00
hschlueter
93bb191cb1 Create effect module.
PiperOrigin-RevId: 464767396
(cherry picked from commit 4d09ca66986a3c862b09f42a06a5bb031dce46f8)
2022-08-02 12:36:47 +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
leonwind
1ef01adc74 Migrate Contrast asset to emulator generated one.
PiperOrigin-RevId: 464519030
(cherry picked from commit ae1915ea1acea1181198b71ae654830c7512337b)
2022-08-01 13:14:49 +00:00
huangdarwin
c34e41950b HDR: Have @C.ColorTransfer check consider NO_VALUE as SDR.
Format.NO_VALUE is a placeholder value for an invalid @C.ColorTransfer, used
for example when the decoder doesn't support this transfer function.

When encountering this invalid value, interpret this as COLOR_TRANSFER_SDR.

Confirmed locally that an exception is thrown when transcoding on p4head, and no exception is thrown when transcoding with this CL.

PiperOrigin-RevId: 464135080
(cherry picked from commit 687a50e9b313e5db37a0b32f5f40559252ab6031)
2022-07-29 19:33:44 +00:00
hschlueter
de4c2e08e1 Move FrameProcessor and related interfaces to common.
This will allow effects preview in ExoPlayer to use the
Effect and FrameProcessor interface (and the interfaces
they depend on) without depending on transformer or the
future effects module.

PiperOrigin-RevId: 464060047
(cherry picked from commit 480c129c54777780f298d7e5dbd9fa23a371f660)
2022-07-29 12:54:30 +00:00
bachinger
1bee4f86fb Add interface version of MediaSessionStub
PiperOrigin-RevId: 464052708
(cherry picked from commit a28b3ef77843bb75938b2ca738ebedf0c29c1129)
2022-07-29 11:52:06 +00:00
leonwind
1b5e3ceb32 Add slider option for contrast in demo app
PiperOrigin-RevId: 464050072
(cherry picked from commit 3fae9df8a9a1ab844d65a2336fc75a57e53d78d2)
2022-07-29 11:30:44 +00:00
tonihei
7411a31e7b Merge pull request #109 from tzugen:patch-1
PiperOrigin-RevId: 464045351
(cherry picked from commit 61e4f92310091737b7107662d52ef8e13319f6e5)
2022-08-08 08:28:35 +00:00
huangdarwin
071f0a5a0d Transformer: Improve misc javadocs and exception logs.
PiperOrigin-RevId: 463971447
(cherry picked from commit 534740fd46f5ec9465215eaaa03a764eebab4ac4)
2022-07-29 01:16:26 +00:00
bachinger
8c560d2115 Add interface version of MediaControllerStub
PiperOrigin-RevId: 463930162
(cherry picked from commit c8089ead42d940c550955f7786447ad87784b9df)
2022-07-28 21:45:49 +00:00
huangdarwin
db1cad911c HDR: Centralize getting Colorinfo from MediaFormat
* Sets KEY_HDR_STATIC_INFO from MediaFormat in the DefaultCodec.
* Adds checks in mediaparser to ensure color space, range, and transfer are valid
  values.

PiperOrigin-RevId: 463921325
(cherry picked from commit 65a2a3a0a073c6dd8b47a044609f4be1abdd19c9)
2022-07-28 21:07:43 +00:00
tonihei
0c634543ce Merge pull request #115 from ittiam-systems:rtp_vp9fix
PiperOrigin-RevId: 463852948
(cherry picked from commit 92816023f16ac580a038e970b41aba7ae18f6055)
2022-08-08 08:23:56 +00:00
christosts
60b334cd01 Minor: Change URL in test
Use a URL with a `.test` tld (RFC 2606) to make it clear
it's an testing URL.

PiperOrigin-RevId: 463852174
(cherry picked from commit 4713c7fea835a8b73b41f6e4723f141828814e44)
2022-07-28 16:12:28 +00:00
tonihei
05658504d6 Ignore stale events in StreamEventCallbackV29.
Despite unregistering the callback and clearing pending Handler
messages, the callback may still receive pending calls if they
are already triggered by the AudioTrack. Instead of asserting
that the track is correct, we should gracefully ignore stale
events.

PiperOrigin-RevId: 463851393
(cherry picked from commit e331bf2c53c2ff7a3c998ccd3a58eb4b7c948fcc)
2022-07-28 16:08:21 +00:00
claincly
d20a1c7f29 Fix VP8 reader fragment packet size
Merging c37a767fdf

PiperOrigin-RevId: 463826373
(cherry picked from commit e848352a3e590de740bd88d816c22e05cca9cc07)
2022-07-28 13:50:54 +00:00
christosts
8779078088 Support ApplicationVersion = 1 for HDR10+
MediaCodecRenderer allows passing HDR10+ out-of-bound metadata
with ApplicationVersion = 1.

PiperOrigin-RevId: 463822315
(cherry picked from commit 95becec1e2e664f360bad731f750dcd05f3d79b0)
2022-07-28 13:24:08 +00:00
tonihei
561b83e282 Delay unbinding the controller until pending commands are handled.
Once a controller bound to a MediaSessionService unbinds, this service
may be destroyed immediately if this was the last bound controller and
the service isn't started in the foreground.

At the time of releasing the controller, there may still be pending
commands that need to be handled by the session service. These commands
may cause the session service to post a foreground notification to
keep it alive. So to avoid the destruction of the service while these
commands are still handled, we need to keep the controller bound.

We also add a timeout in case the session tasks are never completed
by the session implementation. In case the controller is destroyed,
the unbinding happens automatically by the system.

PiperOrigin-RevId: 463802220
(cherry picked from commit ac42b593cc3280b866d42cdc11d57bb031b39757)
2022-07-28 11:10:36 +00:00
tonihei
4eff5e5172 Merge pull request #126 from stoyicker:cap_concurrent_remove_tasks
PiperOrigin-RevId: 463792127
(cherry picked from commit 7f08ab729ad571247d2e65870eee06166b3bfdef)
2022-08-08 08:18:45 +00:00
hschlueter
427a7a1ff9 Generalize frame processing error codes.
TransformationException error codes were previously tied to OpenGL
but other FrameProcessor implementations are possible. So this CL
renames the error codes.
Also, remove GL_INIT_FAILED error code, as FrameProcessor
implemenations may initialize resources on a background thread
after the factory method returns, so it's not obvious how to
distinguish between initialization failures and processing failures.

PiperOrigin-RevId: 463704902
(cherry picked from commit 0f96d8615d28cf50f3efa0c34fb31e01fa0d491c)
2022-07-27 23:21:31 +00:00
hschlueter
6e390771a0 Add Effect marker interface.
This allows non-GL effects to be passed to custom FrameProcessor
implementations.

PiperOrigin-RevId: 463696384
(cherry picked from commit 580e44fc47ec5b62da5a133d12048a20d716e94f)
2022-07-27 22:40:20 +00:00
hschlueter
49a6511696 Remove redundant interface from FinalMatrixTPWrapper.
PiperOrigin-RevId: 463646211
(cherry picked from commit b28fb139988f54d1446df7426d508de34695299f)
2022-07-27 19:08:58 +00:00
hschlueter
309fd907b1 Make FrameInfo and SurfaceInfo public.
Both are used in the public FrameProcessor interface, so they
should be public too.

PiperOrigin-RevId: 463454859
(cherry picked from commit b1b9ba825f83030c5d5b0617796176f21526dc2e)
2022-07-26 23:34:30 +00:00
samrobinson
8aa4281dfa Add 8 new videos, representing lower resolutions.
Downsampled from 3840x2160 resolution videos using ffmpeg:

`ffmpeg -i <inputFilename> -filter:v scale=<width>:<height> -c:a copy <outputFilename>`

PiperOrigin-RevId: 463454628
(cherry picked from commit 56e50b63ec30ed514f8b2fc62f54251dd4df61dc)
2022-07-26 23:33:10 +00:00
samrobinson
6ccf46d40e Add H265 as a parameter to SsimMapperTest.
PiperOrigin-RevId: 463452893
(cherry picked from commit 60d6654b8d2932dcadb49f77d726f05b377f828e)
2022-07-26 23:24:03 +00:00
leonwind
6cf0737e00 Rename ContrastProcessorPixelTest and make contexts final
PiperOrigin-RevId: 463450395
(cherry picked from commit 302a742c944b002379759ed05f121aaeab8af396)
2022-07-26 23:10:33 +00:00
samrobinson
b68412a1f7 Add an SsimMapperTest, which binary searches for 95% ssim.
This is possible because SSIM increases monotonically with bitrate.

PiperOrigin-RevId: 463434373
(cherry picked from commit 4a0b07b4f7e577d02b6d36f49da2c9f5d0b2e485)
2022-07-26 21:56:33 +00:00
huangdarwin
df741a8baa Rename findEncoderWithClosestFormatSupport.
Just a misc nit, since I found the name a bit confusing, and figured
findEncoderWithClosestSupportedFormat might be more descriptive.

PiperOrigin-RevId: 463433646
(cherry picked from commit a7a17dc2bb8bd76988ae32867ff1b8109fcccdb5)
2022-07-26 21:53:18 +00:00
hschlueter
dfe60dad87 Allow FrameProcessor.Factory to be set on Transformer.Builder.
Extract a FrameProcessor.Factory interface from GlEffectsFrameProcessor
and allow it to  be customized using a setter on Transformer.Builder.

PiperOrigin-RevId: 463433438
(cherry picked from commit 22822d8e194cedb89bd01fac89a131f145c5042b)
2022-07-26 21:52:30 +00:00
bachinger
38a133b23a Clean up hashCode/equals of SessionTokenImplBase
#minor-release

PiperOrigin-RevId: 463338680
(cherry picked from commit 2bde3f1e31f2d74cb75213eb07811fced38e9072)
2022-07-26 15:10:46 +00:00
bachinger
5a4e244d94 Normalize constructors of SessionTokenImplBase/SessionTokenImplLegacy
#minor-release

PiperOrigin-RevId: 463328436
(cherry picked from commit 428fc896355828e11bf352c9b2c70abf2f13dc2d)
2022-07-26 14:12:19 +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
christosts
3739e12b5d ExtractorAsserts: add comments on method arguments
PiperOrigin-RevId: 463320634
(cherry picked from commit 3aa5f259a54e6308a25616b090a931db263ded59)
2022-07-26 13:23:36 +00:00
olly
4a89538116 DownloadService: Attempt to clarify the static map
PiperOrigin-RevId: 463315188
(cherry picked from commit ac8d80a044dce4d5897730433b8f6417b0209b7a)
2022-07-26 12:49:34 +00:00
hschlueter
4001e699a1 Replace Size with Pair in effects.
Size requires API 21. Using Pair instead will allow effects to be
used from API 18 during previewing once they are moved out of
transformer.

PiperOrigin-RevId: 463206474
(cherry picked from commit 4adf19939839baa3eaf018fef0d1b58049fd3b91)
2022-07-25 23:39:59 +00:00
hschlueter
bb7db5a13c Only recreate output EGLSurface when Surface changed.
PiperOrigin-RevId: 463193768
(cherry picked from commit 5db7778ca322676a6e6445c473184dc1055d4c22)
2022-07-25 22:38:28 +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
tonihei
c4ce6b7511 Merge pull request #119 from ittiam-systems:rtp_h263_test_and_fix
PiperOrigin-RevId: 463146426
(cherry picked from commit e54d2f56584d2f62d9bc26edf057408a9be84228)
2022-08-08 08:01:44 +00:00
bachinger
b4172b3490 Exclude Metadata from Format when bundling from TrackGroup
#minor-release

PiperOrigin-RevId: 463062454
(cherry picked from commit 8ce3d4dc729f53c3f44649ae790d7f6b3a63d5da)
2022-07-25 12:29:44 +00:00
hschlueter
9eeb4bc272 Allow stream offset passed to GlEffectsFrameProcessor to change.
This is needed for applying effects to a playlist.

The effects are applied based on the presentation time of the
frame in its corresponding media item and the offset is added
back before encoding.

Each time the offset changes, end of input stream is signalled
to the texture processors. This is needed because the texture
processors can expect monotonically increasing timestamp within
the same input stream but when the offset changes, the timstamps
jump back to 0.

PiperOrigin-RevId: 462714966
(cherry picked from commit 30e5bc9837e2423cd2bb426c5797211e0f6ad76b)
2022-07-22 22:18:55 +00:00
Rohit Kumar Singh
ca6835bf0a
Merge pull request #120 from androidx/release-1.0
r1.0.0 beta02
2022-07-22 09:31:34 +00:00
christosts
faf1f35feb DefaultMediaNotificationProvider: limit requests to load same bitmap
The DefaultMediaNotificationProvider caches the last loaded artwork
bitmap so that the bitmap isn't loaded again when the notification is
updated, e.g., the player is transiting from playing to paused. However,
loading bitmap requests for bitmaps that are already being loaded are
not suppressed. For example, if the notification is updated while the
artwork is still downloading, the same artwork might be downloaded
multiple times.

This change suppresses a bitmap load request if the same artwork is
still being loaded, to avoid additional artwork downloads.

#minor-release

PiperOrigin-RevId: 462572221
(cherry picked from commit dd2c16bc459af50c126b9666d3134595ba58e4cb)
2022-07-22 09:05:10 +00:00
rohks
5880fdd515 Refactor unreleased changes in RELEASENOTES.md
#minor-release

PiperOrigin-RevId: 462395554
(cherry picked from commit 2312c185af22ab5f035538209a8b1acd4193dd4d)
2022-07-21 15:56:10 +00:00
rohks
c77d701e3d Move release notes for Issue: google/ExoPlayer#10429 to unreleased changes
#minor-release

PiperOrigin-RevId: 462391856
(cherry picked from commit 5c41b5a2709d9ea084a4e5802e12020820e4d817)
2022-07-21 15:38:38 +00:00
bachinger
9cf85c5574 Enable subtitle selection in session demo app
Issue: androidx/media#102
#minor-release
PiperOrigin-RevId: 462391045
(cherry picked from commit 7fa3f99304b3cfbfaf35acd2017eb71db68faafa)
2022-07-21 15:34:46 +00:00
ibaker
878279425b Annotate methods that always return this with @CanIgnoreReturnValue
It's always safe to ignore the result of these methods, because the
caller already has a reference to the returned value.

PiperOrigin-RevId: 462388947
(cherry picked from commit 2deb435625c7569cb0bd250848adaa846884dc50)
2022-07-21 15:24:07 +00:00