1. 19 Jul, 2022 5 commits
    • Don't include case statement if it falls through to default. · 8dbf6f9f
      PiperOrigin-RevId: 461888238
      (cherry picked from commit 21016eaa)
      samrobinson committed
    • Only apply a MediaFormat-generated ColorInfo if it's valid. · 82e1eda4
      Otherwise, invalid ColorInfo instances generated using faulty
      MediaFormat#getInteger values could cause exceptions.
      
      Confirmed that b/239435670 reproduces without this CL, and does not reproduce
      with this CL.
      
      PiperOrigin-RevId: 461862191
      (cherry picked from commit 87198fe7)
      huangdarwin committed
    • Add fail-fast null checks to the stable Player API · d5e0c759
      This will help developers self-diagnose issues like Issue: google/ExoPlayer#10392
      where the NPE occurs far from the original null value because a field
      gets assigned to null.
      
      This change aims to ensure that every stable method on Player,
      ExoPlayer and ExoPlayer.Builder that takes a non-null type will fail
      with an NPE before returning.
      
      #minor-release
      
      PiperOrigin-RevId: 461846580
      (cherry picked from commit e1fde5d5)
      ibaker committed
    • Remove unused argument · c37c6812
      PiperOrigin-RevId: 461830378
      (cherry picked from commit e8b5aad3)
      bachinger committed
    • Use Futures for MediaSession command queue instead of Runnables · 481205a8
      Some commands may be asynchronous and subsequent commands need to
      wait for them to complete before running. This change updates the
      queue to use (and listen to) Futures instead of calling Runnables
      directly. The commands are currently still added as Runanbles
      though, so this change is a no-op.
      
      Also moves the permission check in MediaSessionImpl to before
      queueing the command because the permission should be check at
      the time of calling the method.
      
      When executing the comamnds in the queue, we need to be careful
      to avoid recursion in the same thread (which happens when both
      the Future is immediate and running on the correct thread already).
      To avoid recursion, we detect this case and loop the commands
      instead.
      
      Issue: androidx/media#85
      PiperOrigin-RevId: 461827264
      (cherry picked from commit dee80788)
      tonihei committed
  2. 18 Jul, 2022 6 commits
    • HDR: Use FP16 color representation for texture processors. · 54cdec46
      * Introduced `useHdr` for `GlEffect#toGlTextureProcessor`, so
        `TextureProcessor` implementations can decide how to handle HDR.
      * Creating FP16 color textures for HDR input.
      
      Tested via manual testing, adding a no-op GlEffectWrapper to the transformation to
      force use of intermediate textures, adding a linear ramp to the fragment shader,
      and trying to ascertain that there's a real reduction in posterization when
      switching from 4-bit to 8-bit unsigned bytes, and again from 8-bit unsigned bytes
      to 16-bit floating point.
      
      PiperOrigin-RevId: 461613117
      (cherry picked from commit ba9c9bb9)
      huangdarwin committed
    • HDR: Throw when unexpected color transfer encountered. · add44470
      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 9f7a159b)
      huangdarwin committed
    • Implement getCurrentTracks in MediaController · 24bfe3a5
      After this change the current tracks are sent to the controller as part of
      `PlayerInfo` and call `Listener.onTracksChanged()` in case of a change in tracks.
      
      PiperOrigin-RevId: 461578695
      (cherry picked from commit 9a895cd1)
      bachinger committed
    • Use the current overrides of the player as preset · db25954d
      Issue: google/ExoPlayer#10429
      PiperOrigin-RevId: 461577039
      (cherry picked from commit 5c2aabca)
      bachinger committed
    • Make minor fixes to HDR handling · 04fa2fda
      - Update profile selection logic to pick an HDR-compatible profile when doing HDR editing on H.264/AVC videos.
      - Handle doing the capabilities check for all MIME types that support HDR (not just H.265/HEVC).
      - Fix a bug where we would pass an HDR input color format to the encoder when using tone-mapping.
      - Tweak how `EncoderWrapper` works so decisions at made at construction time.
      
      Manually tested cases:
      - Transformation of an SDR video.
      - Transformation of an HDR video to AVC (which triggers fallback/tone-mapping on a device that doesn't support HDR editing for AVC).
      - Transformation of an HDR video with HDR editing.
      
      PiperOrigin-RevId: 461572973
      (cherry picked from commit 604ab7fc)
      andrewlewis committed
    • Update demo HDR10 video URL · c4e64c3d
      The old URL doesn't correctly signal the HDR10 color info in the container.
      
      The new URL signals ST2084 (PQ) transfer function and BT.2020 color space as expected.
      
      PiperOrigin-RevId: 461560107
      (cherry picked from commit 794e366b)
      andrewlewis committed
  3. 15 Jul, 2022 1 commit
  4. 14 Jul, 2022 1 commit
  5. 13 Jul, 2022 5 commits
  6. 12 Jul, 2022 7 commits
  7. 11 Jul, 2022 2 commits
  8. 07 Jul, 2022 1 commit
  9. 06 Jul, 2022 2 commits
  10. 05 Jul, 2022 1 commit
  11. 04 Jul, 2022 1 commit
  12. 01 Jul, 2022 6 commits
    • Fallback to SDR if encoder doesn't support HDR (HLG only). · 3bdecf2a
      If the input is HDR (HLG), check encoder capabilities for HDR support
      and request tone-mapping to SDR during decoder configuration otherwise.
      Capabilities are only checked for API 31 and above, as HDR editing is
      not supported before.
      
      As the encoder capabilities check needs to happen before selecting the
      encoder to use (as this may depend on the resolution output by the
      effects chain), the EncoderWrapper checks all candidate encoders
      for the MIME type for HDR capabilities and only requests fallback to
      SDR if none of them support it.
      
      When the actual encoder is selected, the wrapper checks that it matches
      one of the encoders is checked capabilities for.
      
      PiperOrigin-RevId: 458511599
      (cherry picked from commit 9c8dcb40)
      hschlueter committed
    • HDR: Configure GL shaders and encoder. · 28cf112e
      Configure the GL shaders and encoder to take in HDR metadata.
      
      This mostly just consists of passing the Format.colorInfo through
      the VideoTranscodingSamplePipeline down to the encoder, rather than passing
      the PQ-ness down to the GL step.
      
      Due to b/237674316, this will remove HDR10+ support temporarily to introduce
      support for HLG10.
      
      Manually tested to confirm that HLG10 operations that don't affect color display
      correctly after this CL with "HDR editing" in the demo checked, and continue to display incorrectly (as before this CL) without the option unchecked.
      
      PiperOrigin-RevId: 458490810
      (cherry picked from commit a0870a42)
      huangdarwin committed
    • Fix error in frame rate handling. · 379ecd19
      The old getString() will throw because FRAME_RATE can only be float or int.
      
      PiperOrigin-RevId: 458481251
      (cherry picked from commit deea5c92)
      claincly committed
    • Find only REGULAR_CODECS in EncoderUtil. · e0752a3a
      We used "ALL_COOECS" previously, and it is not necessary because "ALL_CODECS"
      additionally the codecs that support tunneling/secure decoding, which there
      is no use case in Transformer.
      
      PiperOrigin-RevId: 458470278
      (cherry picked from commit 3df4f3eb)
      claincly committed
    • Round the frame rate in MediaFormat · f2b4701e
      Although MediaCodec claims supporting float frame rate, encoder init failed on
      API21 Nexus 5. Since it's just a performance hint to the codec, it's OK to
      generalize it to other API versions.
      
      PiperOrigin-RevId: 458434650
      (cherry picked from commit 1f47fa83)
      claincly committed
    • Fix MIDI command timestamp calculations and synthesization duration. · 8b0fe168
      - 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 da0a208b)
      hmzh committed
  13. 30 Jun, 2022 1 commit
  14. 29 Jun, 2022 1 commit