1. 13 Jun, 2022 2 commits
    • Combine all native GL errors in a GlException instead of logging. · 92c2a304
      The native GL errors are in an arbitrary order according to
      https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glGetError.xml
      This means any of them could contain the most useful message
      so it's better to use all for the GlException's message rather than
      picking the last message and logging all others.
      
      PiperOrigin-RevId: 454130460
      hschlueter committed
    • Ensure `DRAIN_ACTION_FLUSH_AND_UPDATE_DRM_SESSION` is always executed · c736a72c
      `codecDrainAction` is set to `DRAIN_ACTION_NONE` in 3 places in
      `MediaCodecRenderer`:
      * The constructor (so there's no prior state to worry about)
      * `updateDrmSessionV23()`: Where `mediaCrypto` is reconfigured based
        on `sourceDrmSession` and `codecDrmSession` is also updated to
        `sourceDrmSession`.
      * `resetCodecStateForFlush()`: Where (before this change) the action
        is unconditionally set back to `DRAIN_ACTION_NONE` and so any
        required updated implied by
        `DRAIN_ACTION_FLUSH_AND_UPDATE_DRM_SESSION` is not done.
      
      This change ensures that `flushOrReleaseCodec()` handles
      `DRAIN_ACTION_FLUSH_AND_UPDATE_DRM_SESSION` before calling .
      
      This probably also resolves Issue: google/ExoPlayer#10274
      
      #minor-release
      
      PiperOrigin-RevId: 454114428
      ibaker committed
  2. 09 Jun, 2022 15 commits
  3. 07 Jun, 2022 6 commits
    • Use a shared `keyForField` implementation in track selection parameters · a056f08a
      The current setup with distinct, private `keyForField` implementations,
      leaves open the (theoretical) possibility of a clash in the `Bundle`
      keys used by the superclass and subclass. This change brings
      consistency with our only other extensible `Bundleable` type
      (`PlaybackException`).
      
      #minor-release
      
      PiperOrigin-RevId: 453385875
      ibaker committed
    • Rename `DefaultTrackSelector.ParametersBuilder` to `Parameters.Builder` · 88162238
      We generally nest the `Builder` for `Foo` inside `Foo`. In this case,
      there's already a `DefaultTrackSelector.Parameters.Builder` type visible
      to a developer, it just happens to be the 'common'
      `TrackSelectorParameters.Builder`, so using it is a bit weird. For
      example this code snippet doesn't compile because
      `DefaultTrackSelector.Parameters.Builder#build()` returns
      `TrackSelectionParameters`. This CL fixes that problem and the code
      snippet now compiles.
      
      ```java
      DefaultTrackSelector.Parameters params =
         new DefaultTrackSelector.Parameters.Builder(context).build()
      ```
      
      #minor-release
      
      PiperOrigin-RevId: 453215702
      ibaker committed
    • Add interface for async texture processors. · 023d19c8
      Implementations of this interface will be able to drop or add frames,
      change timestamps, accept multiple input frames before producing
      output, and process frames on their own background thread.
      
      A default implementation of this interface will be added to SingleFrameGlTextureProcessor in a follow-up.
      
      PiperOrigin-RevId: 453159835
      hschlueter committed
    • Filter bogus AndroidX Media jar file when creating javadoc · 2441bc69
      #minor-release
      
      PiperOrigin-RevId: 452282128
      bachinger committed
    • Fix `HiddenTypedefConstant` Metalava error on `PlaybackException` · 97210b5a
      This is done by removing the `@FieldNumber` IntDef completely. It's not
      really adding much value anyway, because it's `open` so there's no real
      enforcement to prevent passing 'incorrect' values.
      
      #minor-release
      
      PiperOrigin-RevId: 452108972
      ibaker committed
    • Add async error listener to transformer to avoid exception wrapping. · 960422e3
      This internal listener avoids wrapping the TransformationExceptions
      in PlaybackExceptions that are handled via the Player.Listener and
      is also used for FrameProcessingExceptions which already avoided
      the PlaybackException layer previously.
      
      This listener will also be useful in follow-ups for encoder-related
      TransformationExceptions that are thrown in the SurfaceProvider that
      will be called on the GL thread.
      
      PiperOrigin-RevId: 452074575
      hschlueter committed
  4. 31 May, 2022 8 commits
  5. 30 May, 2022 9 commits
    • Update the Gradle Wrapper and Android Gradle Plugin · 7fc9bb9c
      The current verion of AGP warns it doesn't support Android API 32 [1].
      
      The wrapper was upgraded with ([instructions](https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:upgrading_wrapper)):
      ```shell
      $ ./gradlew wrapper --gradle-version 7.4.2 --distribution-type all
      ```
      
      [1]
      ```
      WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 32
      
      This Android Gradle plugin (7.0.3) was tested up to compileSdk = 31
      
      This warning can be suppressed by adding
          android.suppressUnsupportedCompileSdk=32
          to this project's gradle.properties
      
          The build will continue, but you are strongly encouraged to update your project to
          use a newer Android Gradle Plugin that has been tested with compileSdk = 32
      ```
      
      #minor-release
      
      PiperOrigin-RevId: 451893214
      ibaker committed
    • Use fluent assertions · d1c3b051
      Gives a bit more information upon failures
      
      PiperOrigin-RevId: 451882968
      aquilescanta committed
    • Skip BitrateAnalysisTest if device is incapable. · d411461d
      Add bitrate check to the "can encode" criteria.
      
      PiperOrigin-RevId: 451868042
      claincly committed
    • Remove MediaMetadata.mediaUrl · 8e015c4f
      This value only existed to allow setting media URLs from external sources
      (e.g. in a MediaController) so that a player can start playing this item.
      Now that we have MediaItem.RequestMetadata.mediaUrl we can remove this value
      from MediaMetadata because it's request metadata, not media metadata.
      
      PiperOrigin-RevId: 451857413
      tonihei committed
    • Add RequestMetadata to MediaItem · 38248af5
      These fields can be used to transport additional request properties
      when the requester doesn't know the details needed for the actual
      playback (i.e. the LocalConfiguration).
      
      PiperOrigin-RevId: 451857093
      tonihei committed
    • Retain stream time offsets through codecs · 84efc5e8
      ExoPlayer applies a large time offset to buffers so that, if the input has negative timestamps, generally buffers seen by the decoders should have positive timestamps. Modify how the offset is handled in `Transformer` so that decoders and encoders generally see positive timestamps, by leaving the offset on samples when reading them in the base renderer (remove the code that removed the offset), and then removing the offset when muxing. Also update the frame processor chain and slow motion flattening code to retain the existing behavior after this change (these both need original media presentation timestamps)
      
      Tested via existing end-to-end tests and manually verified that the overlay frame processor shows the expected original media timestamps.
      
      Aside: we don't need the same logic as ExoPlayer to track stream offsets across the decoder yet, because we don't try to handle stream changes during playback in single asset editing. (There is an edge case of multi-period DASH that may not work but I doubt anyone will use that as input to `Transformer` before we change the code to handle multi-asset properly.) In future we should try to refactor interaction with the decoder to use the same code for Transformer and ExoPlayer.
      PiperOrigin-RevId: 451846055
      andrewlewis committed
    • Wrap framework AudioAttributes in new AudioAttributesV21 class · 6dd065a1
      PiperOrigin-RevId: 451831531
      ibaker committed
    • Treat pixels as unsigned and correct pixel count division. · 38720a6b
      PiperOrigin-RevId: 451428202
      samrobinson committed
    • Transformer: Add 8k24fps transform test. · 983e074f
      Most devices won't support 8k decoding, so they'll skip this test entirely.
      
      As the video is quite short, this test shouldn't be any longer than the nearby,
      long-running 4k60 test.
      
      PiperOrigin-RevId: 451423368
      huangdarwin committed