1. 21 Jul, 2022 7 commits
    • Only apply a MediaFormat-generated ColorInfo if it's valid. · 5533ad17
      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
      huangdarwin committed
    • Add fail-fast null checks to the stable Player API · 080db2a0
      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
      ibaker committed
    • HDR: Use FP16 color representation for texture processors. · f67c1a73
      * 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
      huangdarwin committed
    • HDR: Throw when unexpected color transfer encountered. · fd046bd2
      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
      huangdarwin committed
    • Use the current overrides of the player as preset · f828130c
      Issue: google/ExoPlayer#10429
      PiperOrigin-RevId: 461577039
      bachinger committed
    • Make minor fixes to HDR handling · 0db07c67
      - 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
      andrewlewis committed
    • Update demo HDR10 video URL · 405be80f
      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
      andrewlewis committed
  2. 15 Jul, 2022 4 commits
  3. 13 Jul, 2022 15 commits
  4. 12 Jul, 2022 8 commits
  5. 07 Jul, 2022 6 commits
    • Add missing imports in `Metadata` · 320dcadf
      PiperOrigin-RevId: 459533055
      rohks committed
    • Add tests for extracting MP4 with large bitrates · a1665841
      Also added the test to `MP4PlaybackTest`.
      
      PiperOrigin-RevId: 459492188
      rohks committed
    • Move Encoder quality API to VideoEncoderSettings. · a36967c1
      Some other minor nits and adjustments to the API logic.
      
      PiperOrigin-RevId: 459490431
      samrobinson committed
    • Add missing Nullable annotation · 752e82df
      PiperOrigin-RevId: 459485334
      christosts committed
    • Don't block AudioTrack when waiting for previous release · a80dd604
      We wait until a previous AudioTrack has been released before
      creating a new one. This is currently done with a thread
      block operation, which may cause ANRs in the extreme case
      when someone attempts to release the player while this is
      still blocked.
      
      The problem can be avoided by just returning false from
      DefaultAudioSink.handleBuffer to try again until the previous
      AudioTrack is released.
      
      Reproduction steps to force the issue:
      1. Add Thread.sleep(10000); to the AudioTrack release thread.
      2. Add this to the demo app:
          private int positionMs = 0;
      
          Handler handler = new Handler();
          handler.post(new Runnable() {
            @Override
            public void run() {
              player.seekTo(positionMs++);
              if (positionMs == 10) {
                player.release();
              } else {
                handler.postDelayed(this, 1000);
              }
            }
      3. Observe Player release timeout exception.
      
      These steps can't be easily captured in a unit test as we can't
      artifically delay the AudioTrack release from the test.
      
      Issue: google/ExoPlayer#10057
      PiperOrigin-RevId: 459468912
      tonihei committed
    • HDR: Remove ColorInfo.SDR constant · 4230ea94
      The SDR constant also specified a color space and range, in addition to
      C.COLOR_TRANSFER_SDR. However, it turns out that SDR videos may use different color
      space and range values, so following prior ExoPlayer conventions to have `null`
      mean "generic SDR" is preferable here.
      
      PiperOrigin-RevId: 459296746
      huangdarwin committed