1. 25 Jan, 2023 22 commits
    • Exclude tracks from `PlayerInfo` if not changed · 8b0c0761
      This change includes a change in the `IMediaController.aidl` file and needs
      to provide backwards compatibility for when a client connects that is of an older or
      newer version of the current service implementation.
      
      This CL proposes to create a new AIDL method `onPlayerInfoChangedWithExtensions`
      that is easier to extend in the future because it does use an `Bundle` rather than
      primitives. A `Bundle` can be changed in a backward/forwards compatible way
      in case we need further changes.
      
      The compatibility handling is provided in `MediaSessionStub` and `MediaControllerStub`. The approach is not based on specific AIDL/Binder features but implemented fully in application code.
      
      Issue: androidx/media#102
      #minor-release
      PiperOrigin-RevId: 490483068
      (cherry picked from commit 3d8c52f2)
      bachinger committed
    • Call future listener on the same handler that created the controller · 0ba58cc6
      The direct executor is not the proper way to determine on what thread to run the
      `Future.Listener` and the `MediaControllerCreationListener` because the listener
      may call the controller passed as argument which must happen on the same thread
      that built the controller. This change makes sure this is the case.
      
      PiperOrigin-RevId: 490478587
      (cherry picked from commit 68908be1)
      bachinger committed
    • Merge pull request #10786 from TiVo:p-aacutil-test-impl · a98efd8b
      PiperOrigin-RevId: 490465182
      (cherry picked from commit a32b82f7)
      Ian Baker committed
    • Add helper method to convert platform session token to Media3 token · 9829ff3d
      This avoids that apps have to depend on the legacy compat support
      library when they want to make this conversion.
      
      Also add a version to both helper methods that takes a Looper to
      give apps the option to use an existing Looper, which should be
      much faster than spinning up a new thread for every method call.
      
      Issue: androidx/media#171
      PiperOrigin-RevId: 490441913
      (cherry picked from commit 03f0b53c)
      tonihei committed
    • Migrate BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_SUPPORTED_FLAGS to Media3 · 782a69e3
      PiperOrigin-RevId: 490376734
      (cherry picked from commit 1803d1cd)
      bachinger committed
    • Load bitmaps for `MediaSessionCompat.QueueItem`. · d3d99f01
      When receiving the `onTimelineChanged` callback, we convert the timeline to the list of `QueueItem`s, where decoding a bitmap is needed for building each of the `QueueItem`s. The strategy is similar to what we did in <unknown commit> for list of `MediaBrowserCompat.MediaItem` - set the queue item list until the bitmaps decoding for all the `MediaItem`s are completed.
      
      PiperOrigin-RevId: 490283587
      (cherry picked from commit 8ce1213d)
      tianyifeng committed
    • Reorder some release notes in other sections. · 5a96fc79
      PiperOrigin-RevId: 490224795
      (cherry picked from commit fa531b79)
      tonihei committed
    • Add `DefaultExtractorsFactory.setTsSubtitleFormats` · dddb72b2
      ExoPlayer is unable to detect the presence of subtitle tracks in some
      MPEG-TS files that don't fully declare them. It's possible for a
      developer to provide the list instead, but doing so is quite awkward
      without this helper method. This is consistent for how
      `DefaultExtractorsFactory` allows other aspects of the delegate
      `Extractor` implementations to be customised.
      
      * Issue: google/ExoPlayer#10175
      * Issue: google/ExoPlayer#10505
      
      #minor-release
      
      PiperOrigin-RevId: 490214619
      (cherry picked from commit ff48faec)
      ibaker committed
    • Do not require package visibility when obtaining SessionTokens · fa6b8fe0
      The only reason this is required at the moment is to set the
      process UID field in the token, that is supposed to make it easier
      for controller apps to identify the session. However, if this
      visibility is not provided, it shouldn't stop us from creating
      the controller for this session.
      
      Also docuement more clearly what UID means in this context.
      
      PiperOrigin-RevId: 490184508
      (cherry picked from commit c41a5c84)
      tonihei committed
    • Add `set -eu` to all shell scripts · 3476ca92
      These flags ensure that any errors cause the script to exit (instead of
      just carrying on) (`-e`) and that any unrecognised substitution variables
      cause an error instead of silently resolving to an empty string (`-u`).
      
      Issues like Issue: google/ExoPlayer#10791 should be more quickly resolved with
      `set -e` because the script will clearly fail with an error like
      `make: command not found` which would give the user a clear pointer
      towards the cause of the problem.
      
      #minor-release
      
      PiperOrigin-RevId: 490001419
      (cherry picked from commit 45b8fb0a)
      ibaker committed
    • Do not require package visibility when connecting to a Media3 session · f4f801a8
      When we currently call SessionToken.createSessionToken with a legacy
      token, we call the package manager to get the process UID. This
      requires visiblity to the target package, which may not be available
      unless the target runs a service known to the controller app.
      
      However, when connecting to a Media3, this UID doesn't have to be
      known, so we can move the call closer to where it's needed to
      avoid the unncessary visibility check.
      
      In addition, a legacy session may reply with unknown result code
      to the session token request, which we should handle as well.
      
      One of the constructor can be removed since it was only used from
      a test.
      
      PiperOrigin-RevId: 489917706
      (cherry picked from commit 2fd4aac3)
      tonihei committed
    • Add remaining state and getters to SimpleBasePlayer · 9e424266
      This adds the full Builders and State representation needed to
      implement all Player getter methods and listener invocations.
      
      PiperOrigin-RevId: 489503319
      (cherry picked from commit 81918d8d)
      tonihei committed
    • Pass correct frame size for passthrough playback · 0e628fb4
      When estimating the AudioTrack min buffer size, we must use a PCM
      frame of 1 when doing direct playback (passthrough). The code was
      passing -1 (C.LENGTH_UNSET).
      
      PiperOrigin-RevId: 489238392
      (cherry picked from commit 07d25bf4)
      christosts committed
    • Add additional codecs to the eosPropagationWorkaround list. · 68a1571c
      Issue: google/ExoPlayer#10756
      PiperOrigin-RevId: 489236336
      (cherry picked from commit d1b470e4)
      tonihei committed
    • Throw exception if a released player is passed to TestPlayerRunHelper · 9ac50620
      I considered moving this enforcement inside the ExoPlayerImpl
      implementation, but it might lead to app crashes in cases that apps
      (incorrectly) call a released player, but it wasn't actually causing a
      problem.
      
      PiperOrigin-RevId: 489233917
      (cherry picked from commit cba65c8c)
      ibaker committed
    • Mark broadcast receivers as not exported · 91c51fe9
      They are called from the system only and don't need to be exported
      to be visible to other apps.
      
      PiperOrigin-RevId: 489210264
      (cherry picked from commit 22ccc1a1)
      tonihei committed
    • Load bitmaps for `MediaBrowserCompat`. · f3268ac8
      * Transforms the `ListenableFuture<LibraryResult<MediaItem>>` and `ListenableFuture<LibraryResult<List<MediaItem>>>` to `ListenableFuture<MediaBrowserCompat.MediaItem>` and `ListenableFuture<List<MediaBrowserCompat.MediaItem>>`, and the result will be sent out when `ListenableFuture` the `MediaBrowserCompat.MediaItem` (or the list of it) is fulfilled.
      * Add `artworkData` to the tests in `MediaBrowserCompatWithMediaLibraryServiceTest`.
      
      PiperOrigin-RevId: 489205547
      (cherry picked from commit 4ce171a3)
      tianyifeng committed
    • Add setPlaybackLooper ExoPlayer builder method · 9ba059f7
      The method allows clients to specify a pre-existing thread
      to use for playback. This can be used to run multiple ExoPlayer
      instances on the same playback thread.
      
      PiperOrigin-RevId: 488980749
      (cherry picked from commit e1fe3120)
      Googler committed
    • Fix NPE when listener is not set · c11b5cf9
      PiperOrigin-RevId: 488970696
      (cherry picked from commit f3ed9e35)
      Googler committed
    • Add bundling exclusions with unit tests · 73d40e1c
      The exclusion will be used in a follow-up CL when sending PlayerInfo updates.
      
      #minor-release
      
      PiperOrigin-RevId: 488939258
      (cherry picked from commit bae50900)
      bachinger committed
    • Update targetSdkVersion of demo session app to appTargetSdkVersion · bbf73244
      PiperOrigin-RevId: 488884403
      (cherry picked from commit cfe36af8)
      tianyifeng committed
    • Changed decoder list sort to order by functional support of format · 537f8b26
      Added new method to check if codec just functionally supports a format.
      Changed getDecoderInfosSortedByFormatSupport to use new function to
      order by functional support. This allows decoders that only support
      functionally and are more preferred by the MediaCodecSelector to keep
      their preferred position in the sorted list.
      
      Unit tests included
      -Two MediaCodecVideoRenderer tests that verify hw vs sw does not have an
      effect on sort of the decoder list, it is only based on functional
      support.
      
      Issue: google/ExoPlayer#10604
      PiperOrigin-RevId: 487779284
      (cherry picked from commit fab66d97)
      michaelkatz committed
  2. 23 Nov, 2022 2 commits
  3. 22 Nov, 2022 4 commits
  4. 17 Nov, 2022 9 commits
  5. 10 Nov, 2022 3 commits
    • Ensure listener invocations use final state variable. · 7f17ff6d
      The MediaControllerImplBase listener invocations currently use the
      class member state that can change if one of the listener method
      implementations changes the state recursively.
      
      Updating the listener invocations to use a final local variable
      ensures all listeners get consistent updates.
      
      PiperOrigin-RevId: 487503373
      (cherry picked from commit 33bea391)
      tonihei committed
    • Split test methods more clearly in arrange, act, assert. · a9eb1211
      The tests in MediaControllerCompatCallbackWithMediaSessionTest
      don't follow this pattern very consistently at the moment.
      
      PiperOrigin-RevId: 487501913
      (cherry picked from commit c6a0ba25)
      tonihei committed
    • Align PlaybackStateCompat states with logic in MediaSessionConnector · 58d670d9
      Creating the PlaybackStateCompat from a media3 Player state is done
      already by the MediaSessionConnector (and used widely). The media3
      session module should set the same states under the same circumstances
      to ensure compatiblity and consistency.
      
      PlaybackStateCompat changes made in media3 session:
       - Use STATE_STOPPED when player is ended instead of STATE_PAUSED
       - Use STATE_PLAYING when playback is suppressed temporarily.
       - Set the playback speed to 0 if the player is not playing.
       - Add extras for mediaId and user-set playback speed.
      
      Part of the problem was that Player.isPlaying() was used to check
      the state. Unfortunately, MockPlayer.isPlaying() is implemented in
      a way that makes it hard to test these changes, because the value
      is set independently of playbackState, playWhenReady and suppression
      reason. To be able to write consistent, logical tests, this change
      also removes the independent setting of isPlaying in MockPlayer to
      align it better with a real player. This requires to update some
      other tests to use alternative methods.
      
      PiperOrigin-RevId: 487500859
      (cherry picked from commit c5e071e5)
      tonihei committed