Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/migrate media 1.0.2 #10

Merged
merged 10,000 commits into from
Jun 22, 2023
Merged

Chore/migrate media 1.0.2 #10

merged 10,000 commits into from
Jun 22, 2023
This pull request is big! We’re only showing the most recent 250 commits.

Commits on Nov 22, 2022

  1. Reorder some release notes in other sections.

    #minor-release
    
    PiperOrigin-RevId: 490224795
    (cherry picked from commit fa531b7)
    tonihei authored and microkatz committed Nov 22, 2022
    Configuration menu
    Copy the full SHA
    103b7cd View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2022

  1. Fix compilation error in ffmpeg JNI layer

    PiperOrigin-RevId: 490263003
    (cherry picked from commit a9be38a)
    christosts authored and microkatz committed Nov 23, 2022
    Configuration menu
    Copy the full SHA
    6661b75 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c2cbb63 View commit details
    Browse the repository at this point in the history

Commits on Jan 25, 2023

  1. Changed decoder list sort to order by functional support of format

    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 fab66d9)
    microkatz authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    537f8b2 View commit details
    Browse the repository at this point in the history
  2. Update targetSdkVersion of demo session app to appTargetSdkVersion

    PiperOrigin-RevId: 488884403
    (cherry picked from commit cfe36af)
    tianyif authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    bbf7324 View commit details
    Browse the repository at this point in the history
  3. Add bundling exclusions with unit tests

    The exclusion will be used in a follow-up CL when sending PlayerInfo updates.
    
    #minor-release
    
    PiperOrigin-RevId: 488939258
    (cherry picked from commit bae5090)
    marcbaechinger authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    73d40e1 View commit details
    Browse the repository at this point in the history
  4. Fix NPE when listener is not set

    PiperOrigin-RevId: 488970696
    (cherry picked from commit f3ed9e3)
    Googler authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    c11b5cf View commit details
    Browse the repository at this point in the history
  5. Add setPlaybackLooper ExoPlayer builder method

    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 e1fe312)
    Googler authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    9ba059f View commit details
    Browse the repository at this point in the history
  6. Load bitmaps for MediaBrowserCompat.

    * 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 4ce171a)
    tianyif authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    f3268ac View commit details
    Browse the repository at this point in the history
  7. Mark broadcast receivers as not exported

    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 22ccc1a)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    91c51fe View commit details
    Browse the repository at this point in the history
  8. Throw exception if a released player is passed to TestPlayerRunHelper

    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 cba65c8)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    9ac5062 View commit details
    Browse the repository at this point in the history
  9. Add additional codecs to the eosPropagationWorkaround list.

    Issue: google/ExoPlayer#10756
    PiperOrigin-RevId: 489236336
    (cherry picked from commit d1b470e)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    68a1571 View commit details
    Browse the repository at this point in the history
  10. Pass correct frame size for passthrough playback

    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 07d25bf)
    christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    0e628fb View commit details
    Browse the repository at this point in the history
  11. Add remaining state and getters to SimpleBasePlayer

    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 81918d8)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    9e42426 View commit details
    Browse the repository at this point in the history
  12. Do not require package visibility when connecting to a Media3 session

    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 2fd4aac)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    f4f801a View commit details
    Browse the repository at this point in the history
  13. Add set -eu to all shell scripts

    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 45b8fb0)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    3476ca9 View commit details
    Browse the repository at this point in the history
  14. Do not require package visibility when obtaining SessionTokens

    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 c41a5c8)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    fa6b8fe View commit details
    Browse the repository at this point in the history
  15. Add DefaultExtractorsFactory.setTsSubtitleFormats

    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 ff48fae)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    dddb72b View commit details
    Browse the repository at this point in the history
  16. Reorder some release notes in other sections.

    PiperOrigin-RevId: 490224795
    (cherry picked from commit fa531b7)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    5a96fc7 View commit details
    Browse the repository at this point in the history
  17. Load bitmaps for MediaSessionCompat.QueueItem.

    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 8ce1213)
    tianyif authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    d3d99f0 View commit details
    Browse the repository at this point in the history
  18. Migrate BROWSER_ROOT_HINTS_KEY_ROOT_CHILDREN_SUPPORTED_FLAGS to Media3

    PiperOrigin-RevId: 490376734
    (cherry picked from commit 1803d1c)
    marcbaechinger authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    782a69e View commit details
    Browse the repository at this point in the history
  19. Add helper method to convert platform session token to Media3 token

    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 03f0b53)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    9829ff3 View commit details
    Browse the repository at this point in the history
  20. Merge pull request #10786 from TiVo:p-aacutil-test-impl

    PiperOrigin-RevId: 490465182
    (cherry picked from commit a32b82f)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    a98efd8 View commit details
    Browse the repository at this point in the history
  21. Call future listener on the same handler that created the controller

    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 68908be)
    marcbaechinger authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    0ba58cc View commit details
    Browse the repository at this point in the history
  22. Exclude tracks from PlayerInfo if not changed

    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 3d8c52f)
    marcbaechinger authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    8b0c076 View commit details
    Browse the repository at this point in the history
  23. Misc fix in gradle build file

    Issue: androidx/media#209
    
    #minor-release
    
    PiperOrigin-RevId: 490492223
    (cherry picked from commit 2424ee7)
    christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    b495d21 View commit details
    Browse the repository at this point in the history
  24. Handle the bitmap loading result with applicationHandler

    Before this change, the bitmap loading result with mainHandler, in which we set the metadata to `MediaSessionCompat`. However, the `MediaSessionCompat` is not thread safe, all calls should be made from the same thread. In the other calls to `MediaSessionCompat`, we ensure that they are on the application thread (which may be or may not be main thread), so we should do the same for `setMetadata` when bitmap arrives.
    
    Also removes a comment in `DefaultMediaNotificationProvider` as bitmap request caching is already moved to CacheBitmapLoader.
    
    PiperOrigin-RevId: 490524209
    (cherry picked from commit 8092726)
    tianyif authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    d58b4fd View commit details
    Browse the repository at this point in the history
  25. Parse and set peakBitrate for Dolby TrueHD(AC-3) and (E-)AC-3

    #minor-release
    
    PiperOrigin-RevId: 490527831
    (cherry picked from commit 76df06a)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    101a249 View commit details
    Browse the repository at this point in the history
  26. Rollback of androidx/media@76df06a

    *** Original commit ***
    
    Parse and set `peakBitrate` for Dolby TrueHD(AC-3) and (E-)AC-3
    
    #minor-release
    
    ***
    
    PiperOrigin-RevId: 490570517
    (cherry picked from commit 4273291)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    32f7a8b View commit details
    Browse the repository at this point in the history
  27. Rollback of androidx/media@4273291

    *** Original commit ***
    
    Rollback of androidx/media@76df06a
    
    *** Original commit ***
    
    Parse and set `peakBitrate` for Dolby TrueHD(AC-3) and (E-)AC-3
    
    #minor-release
    
    ***
    
    ***
    
    PiperOrigin-RevId: 490707234
    (cherry picked from commit 8271163)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    fda132f View commit details
    Browse the repository at this point in the history
  28. Use ParsableBitArray instead of ParsableByteArray

    To avoid complicated bit shifting and masking. Also makes the code more readable.
    
    PiperOrigin-RevId: 490749482
    (cherry picked from commit 3d31e09)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    5ebbdc5 View commit details
    Browse the repository at this point in the history
  29. Convert bitrates to bps before setting it

    Format expects the values of `averageBitrate` and `peakBitrate` in bps and the value fetched from AC3SpecificBox and EC3SpecificBox is in kbps.
    
    PiperOrigin-RevId: 490756581
    (cherry picked from commit 4066970)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    30dce91 View commit details
    Browse the repository at this point in the history
  30. Remove flakiness from DefaultAnalyticsCollectorTest

    Our FakeClock generally makes sure that playback tests are fully
    deterministic. However, this fails if the test uses blocking waits
    with clock.onThreadBlocked and where relevant Handlers are created
    without using the clock.
    
    To fix the flakiness, we can make the following adjustments:
     - Use TestExoPlayerBuilder instead of legacy ExoPlayerTestRunner
       to avoid onThreadBlocked calls. This also makes the tests more
       readable.
     - Use clock to create Handler for FakeVideoRenderer and
       FakeAudioRenderer. Ideally, this should be passed through
       RenderersFactory, but it's too disruptive given this is a
       public API.
     - Use clock for MediaSourceList and MediaPeriodQueue update
       handler.
    
    PiperOrigin-RevId: 490907495
    (cherry picked from commit 6abc94a)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    8767605 View commit details
    Browse the repository at this point in the history
  31. Clean up javadoc on Metadata.Entry.populateMediaMetadata

    Remove self-links, and remove section that is documenting internal
    ordering behaviour of
    [`SimpleBasePlayer.getCombinedMediaMetadata`](https://github.com/google/ExoPlayer/blob/bb270c62cf2f7a1570fe22f87bb348a2d5e94dcf/library/common/src/main/java/com/google/android/exoplayer2/SimpleBasePlayer.java#L1770)
    rather than anything specifically about this method.
    
    #minor-release
    
    PiperOrigin-RevId: 490923719
    (cherry picked from commit a670328)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    d5815c5 View commit details
    Browse the repository at this point in the history
  32. Ensure messages sent on a dead thread don't block FakeClock execution

    FakeClock keeps an internal list of messages to be executed to
    ensure deterministic serialization. The next message from the list
    is triggered by a separate helper message sent to the real Handler.
    However, if the target HandlerThread is no longer alive (e.g. when
    it quit itself during the message execution), this helper
    message is never executed and the entire message execution chain
    is stuck forever.
    
    This can be solved by checking the return values of Hander.post or
    Handler.sendMessage, which are false if the message won't be
    delivered. If the messages are not delivered, we can unblock the
    chain by marking the message as complete and triggering the next
    one.
    
    PiperOrigin-RevId: 491275031
    (cherry picked from commit 8fcc063)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    f9c6fb4 View commit details
    Browse the repository at this point in the history
  33. Merge pull request #10799 from OxygenCobalt:id3v2-multi-value

    PiperOrigin-RevId: 491289028
    (cherry picked from commit b81d5f3)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    887179f View commit details
    Browse the repository at this point in the history
  34. Split up Id3DecoderTest methods

    It's clearer if each test method follows the Arrange/Act/Assert pattern
    
    PiperOrigin-RevId: 491299379
    (cherry picked from commit fc5d178)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    26f5e9b View commit details
    Browse the repository at this point in the history
  35. Remove impossible UnsupportedEncodingException from Id3Decoder

    The list of charsets is already hard-coded, and using `Charset` types
    ensures they will all be present at run-time, hence we will never
    encounter an 'unsupported' charset.
    
    PiperOrigin-RevId: 491324466
    (cherry picked from commit 5292e40)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    289f0cf View commit details
    Browse the repository at this point in the history
  36. Merge pull request #10776 from dongvanhung:feature/add_support_clear_…

    …download_manager_helpers
    
    PiperOrigin-RevId: 491336828
    (cherry picked from commit 3581ccd)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    3bf9970 View commit details
    Browse the repository at this point in the history
  37. Bump cast sdk version and remove workaround for live duration

    The fix for b/171657375 (internal) has been shipped with 21.1.0 already
    (see https://developers.google.com/cast/docs/release-notes#august-8,-2022).
    
    PiperOrigin-RevId: 491583727
    (cherry picked from commit 835d3c8)
    marcbaechinger authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    1d082ee View commit details
    Browse the repository at this point in the history
  38. Add configuration to support OPUS offload

    To support OPUS offload, we need to provide a few configuration values
    that are currently not set due to the lack of devices supporting
    OPUS offload.
    
    PiperOrigin-RevId: 491613716
    (cherry picked from commit 568fa1e)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    e85e497 View commit details
    Browse the repository at this point in the history
  39. Use audio bitrate to calculate AudioTrack min buffer in passthrough

    Use the bitrate of the audio format (when available) in
    DefaultAudioSink.AudioTrackBufferSizeProvider.getBufferSizeInBytes() to
    calculate accurate buffer sizes for direct (passthrough) playbacks.
    
    #minor-release
    
    PiperOrigin-RevId: 491628530
    (cherry picked from commit d12afe0)
    christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    bb7e632 View commit details
    Browse the repository at this point in the history
  40. Add public constructors to DefaultMediaNotificationProvider

    Issue: androidx/media#213
    
    Without a public constructor, it is not possible to extend this class and override its method.
    
    PiperOrigin-RevId: 491673111
    (cherry picked from commit f3e450e)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    4ecbd77 View commit details
    Browse the repository at this point in the history
  41. Use the artist as the subtitle of the legacy media description

    The Bluetooth AVRCP service expects the metadata of the item currently
    being played to be in sync with the corresponding media description in
    the active item of the queue. The comparison expects the metadata values
    of `METADATA_KEY_TITLE` and `METADATA_KEY_ARTIST` [1] to be equal to the
    `title` and `subtitle` field of the `MediaDescription` [2] of the
    corresponding queue item.
    
    Hence we need to populate the media description accordingly to avoid the
    BT service to delay the update for two seconds and log an exception.
    
    [1] https://cs.android.com/android/platform/superproject/+/master:packages/modules/Bluetooth/android/app/src/com/android/bluetooth/audio_util/helpers/Metadata.java;l=120
    [2] https://cs.android.com/android/platform/superproject/+/master:packages/modules/Bluetooth/android/app/src/com/android/bluetooth/audio_util/MediaPlayerWrapper.java;l=258
    
    Issue: androidx/media#148
    PiperOrigin-RevId: 491877806
    (cherry picked from commit 2a07a0b)
    marcbaechinger authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    665f04d View commit details
    Browse the repository at this point in the history
  42. Rename SimpleBasePlayer.PlaylistItem to MediaItemData

    This better matches the terminology we use elsewhere in the Player
    interface, where items inside the playlist are referred to as
    "media item" and only the entire list is called "playlist".
    
    PiperOrigin-RevId: 491882849
    (cherry picked from commit ff7fe22)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    05f640e View commit details
    Browse the repository at this point in the history
  43. Decomission ControllerInfoProxy in favor of ControllerInfo.

    This CL makes it possible to create a media3 ControllerInfo in test code, which is needed to test several aspects of a media3-based media app. It does this by exposing a test-only static factory method. This is a hacky low-effort approach; a better solution could be to split ControllerInfo up into a public interface that was exposed to client logic, and that they could extend, and a package-private implementation with internal fields like the callback. That's a much bigger change, however.
    
    PiperOrigin-RevId: 491978830
    (cherry picked from commit 69093db)
    Googler authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    93694b2 View commit details
    Browse the repository at this point in the history
  44. Parse and set bitrates in Ac3Reader

    PiperOrigin-RevId: 492003800
    (cherry picked from commit c7aa54c)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    8932c52 View commit details
    Browse the repository at this point in the history
  45. Add media type to MediaMetadata

    This helps to denote what type of content or folder the metadata
    describes.
    
    PiperOrigin-RevId: 492123690
    (cherry picked from commit 32fafef)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    ed38ec7 View commit details
    Browse the repository at this point in the history
  46. Add support for most setters in SimpleBasePlayer

    This adds the forwarding logic for most setters in SimpleExoPlayer
    in the same style as the existing logic for setPlayWhenReady.
    
    This change doesn't implement the setters for modifying media items,
    seeking and releasing yet as they require additional handling that
    goes beyond the repeated implementation pattern in this change.
    
    PiperOrigin-RevId: 492124399
    (cherry picked from commit f007238)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    f8155f1 View commit details
    Browse the repository at this point in the history
  47. Merge pull request #10750 from Stronger197:subrip_utf_16

    PiperOrigin-RevId: 492164739
    (cherry picked from commit a919141)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    6e58ca6 View commit details
    Browse the repository at this point in the history
  48. Split SubripDecoder and ParsableByteArray tests

    In some cases we split a test method, and in other cases we just add
    line breaks to make the separation between arrange/act/assert more
    clear.
    
    PiperOrigin-RevId: 492182769
    (cherry picked from commit e4fb663)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    102873b View commit details
    Browse the repository at this point in the history
  49. Reduce log output for failing bitmap loads

    Do not log the exception stack traces raised by the BitmapLoader when a
    bitmap fails to load, e.g. when the artwork's URI scheme is not
    supported by the SimpleBitmapLoader. The logs are kept in place but only
    a single line is printed.
    
    #minor-release
    
    PiperOrigin-RevId: 492191461
    (cherry picked from commit f768ff9)
    christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    1a9b1c4 View commit details
    Browse the repository at this point in the history
  50. Stop service when app is terminated while the player is paused

    If the service ever has been started but is not in the foreground, the
    service would be terminated without calling onDestroy(). This is because
    when onStartCommand returns START_STICKY [1], the app takes the
    responsibility to stop the service.
    
    Note that this change interrupts the user journey when paused, because the
    notification is removed. Apps can implement playback resumption [2] to give
    the user an option to resume playback after the service has been terminated.
    
    [1] https://developer.android.com/reference/android/app/Service#START_STICKY
    [2] https://developer.android.com/guide/topics/media/media-controls#supporting_playback_resumption
    
    Issue: androidx/media#175
    #minor-release
    PiperOrigin-RevId: 492192690
    (cherry picked from commit 6a5ac19)
    marcbaechinger authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    868e86c View commit details
    Browse the repository at this point in the history
  51. Write media type with a custom key to legacy components.

    This allows legacy media controllers and browsers to access this
    information and legacy sessions and browser services to set this
    information.
    
    PiperOrigin-RevId: 492414716
    (cherry picked from commit ca4c6ef)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    8618263 View commit details
    Browse the repository at this point in the history
  52. Added cancellation check for MediaBrowserFuture in demo session app

    When app is deployed with device's screen being off, MainActivity's onStart is called swiftly by its onStop. The onStop method cancels the browserFuture task which in turn "completes" the task. Upon task "completion", pushRoot() runs and then throws error as it calls get() a cancelled task.
    
    PiperOrigin-RevId: 492416445
    (cherry picked from commit 64603cb)
    microkatz authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    c4f1c04 View commit details
    Browse the repository at this point in the history
  53. Removed ExoPlayer specific states from SimpleBasePlayer

    PiperOrigin-RevId: 492443147
    (cherry picked from commit 2fd38e3)
    microkatz authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    8844b4f View commit details
    Browse the repository at this point in the history
  54. Fix TextRenderer exception when a subtitle file contains no cues

    Discovered while investigating Issue: google/ExoPlayer#10823
    
    Example stack trace with the previous code (I added the index value for
    debugging):
    
    ```
    playerFailed [eventTime=44.07, mediaPos=44.01, window=0, period=0, errorCode=ERROR_CODE_FAILED_RUNTIME_CHECK
      androidx.media3.exoplayer.ExoPlaybackException: Unexpected runtime error
          at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:635)
          at android.os.Handler.dispatchMessage(Handler.java:102)
          at android.os.Looper.loopOnce(Looper.java:202)
          at android.os.Looper.loop(Looper.java:291)
          at android.os.HandlerThread.run(HandlerThread.java:67)
      Caused by: java.lang.IllegalArgumentException: index=-1
          at androidx.media3.common.util.Assertions.checkArgument(Assertions.java:55)
          at androidx.media3.extractor.text.webvtt.WebvttSubtitle.getEventTime(WebvttSubtitle.java:62)
          at androidx.media3.extractor.text.SubtitleOutputBuffer.getEventTime(SubtitleOutputBuffer.java:56)
          at androidx.media3.exoplayer.text.TextRenderer.getCurrentEventTimeUs(TextRenderer.java:435)
          at androidx.media3.exoplayer.text.TextRenderer.render(TextRenderer.java:268)
          at androidx.media3.exoplayer.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:1008)
          at androidx.media3.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:509)
          at android.os.Handler.dispatchMessage(Handler.java:102)
          at android.os.Looper.loopOnce(Looper.java:202)
          at android.os.Looper.loop(Looper.java:291)
          at android.os.HandlerThread.run(HandlerThread.java:67)
    ]
    ```
    
    #minor-release
    
    PiperOrigin-RevId: 492464180
    (cherry picked from commit 33bbb95)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    5612f69 View commit details
    Browse the repository at this point in the history
  55. Fix ExoPlayerTest to use C.TIME_UNSET instead of C.POSITION_UNSET

    This inconsistency was exposed by an upcoming change to deprecate
    `POSITION_UNSET` in favour of `INDEX_UNSET` because position is an
    ambiguous term between 'byte offset' and 'media position', as shown
    here.
    
    PiperOrigin-RevId: 492470241
    (cherry picked from commit 2650654)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    f43cc38 View commit details
    Browse the repository at this point in the history
  56. Fix threading of onFallbackApplied callback

    The callback is currently triggered on the ExoPlayer playback thread
    instead of the app thread that added the listener.
    
    PiperOrigin-RevId: 492474405
    (cherry picked from commit 634c616)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    515b6ac View commit details
    Browse the repository at this point in the history
  57. Add javadoc links to README files

    Fix some other link titles and destinations spotted along the way.
    
    #minor-release
    
    PiperOrigin-RevId: 493276172
    (cherry picked from commit 636a4a8)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    3df6949 View commit details
    Browse the repository at this point in the history
  58. Support release in SimpleBasePlayer

    This adds support for the release handling. To align with the
    established behavior in ExoPlayer, the player can only call
    listeners from within the release methods (and not afterwards)
    and automatically enforces an IDLE state (without listener call)
    in case getters of the player are used after release.
    
    PiperOrigin-RevId: 493543958
    (cherry picked from commit 4895bc4)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    3b55ce2 View commit details
    Browse the repository at this point in the history
  59. Replace MediaMetadata folderType by isBrowsable

    The folder type has a mix of information about the item. It shows
    whether the item is browsable (type != FOLDER_TYPE_NONE) and
    which Bluetooth folder type to set for legacy session information.
    
    It's a lot clearer to split this into a boolean isBrowsable and
    use the existing mediaType to map back to the bluetooth folder type
    where required.
    
    folderType is not marked as deprecated yet as this would be an API
    change, which will be done later.
    
    PiperOrigin-RevId: 493544589
    (cherry picked from commit ae8000a)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    71a1254 View commit details
    Browse the repository at this point in the history
  60. Remove debug timeout multiplier.

    It looks like this was added accidentally in <unknown commit>.
    
    PiperOrigin-RevId: 493834134
    (cherry picked from commit 533f528)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    c32494a View commit details
    Browse the repository at this point in the history
  61. Clarify and correct allowed multi-threading for some Player methods

    Some Player methods like getting the Looper and adding listeners
    were always allowed to be called from any thread, but this is
    undocumented. This change makes the threading rules of these
    methods more explicit.
    
    Removing listeners was never meant to be called from another thread
    and we also don't support it safely because final callbacks may
    be triggered from the wrong thread. To find potential issues, we
    can assert the correct thread when releasing listeners.
    
    Finally, there is a potential race condition when calling addListener
    from a different thread at the same time as release, which may lead to
    a registered listener that could receive callbacks after the player is
    released.
    
    PiperOrigin-RevId: 493843981
    (cherry picked from commit 927b2d6)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    80be30f View commit details
    Browse the repository at this point in the history
  62. Forward seek command details to seekTo method in BasePlayer

    BasePlayer simplifies implementations by handling all the various
    seek methods and forwarding to a single method that can then be
    implemented by subclasses. However, this loses the information about
    the concrete entry point used for seeking, which is relevant when
    the subclass wants to verify or filter by Player.Command. This
    can be improved by adding the command as a new parameter. Since
    we have to change the method anyway, we can also incorporate the
    boolean flag about whether the current item is repeated to avoid
    the separate method.
    
    PiperOrigin-RevId: 494948094
    (cherry picked from commit ab6fc6a)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    cdc07e2 View commit details
    Browse the repository at this point in the history
  63. Reset isLoading when calling SimpleBasePlayer.stop/release

    isLoading is not allowed to be true when IDLE, so we have to set to
    false when stopping in case it was set to true before.
    
    PiperOrigin-RevId: 494975405
    (cherry picked from commit 6e7de58)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    11bd727 View commit details
    Browse the repository at this point in the history
  64. Document the reason for defining private method defaultIfNull

    PiperOrigin-RevId: 495004732
    (cherry picked from commit 610e431)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    1e7480d View commit details
    Browse the repository at this point in the history
  65. Remove parameters with default values from bundle in MediaItem

    This improves the time taken to construct PlayerInfo from bundle from ~600ms to ~450ms.
    
    PiperOrigin-RevId: 495055355
    (cherry picked from commit 395cf4d)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    d91c005 View commit details
    Browse the repository at this point in the history
  66. Fix some release notes typos

    PiperOrigin-RevId: 495262344
    (cherry picked from commit c9e87f0)
    andrewlewis authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    7ebab0e View commit details
    Browse the repository at this point in the history
  67. Clear one-off events from state as soon as they are triggered.

    This ensures they are not accidentally triggered again when
    the state is rebuilt with a buildUpon method.
    
    PiperOrigin-RevId: 495280711
    (cherry picked from commit a123134)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    8e8abda View commit details
    Browse the repository at this point in the history
  68. Allow unset index and position values + remove period index

    This simplifies some position tracking needs for an app implementing
    SimpleBasePlayer.
     - The period index can always be derived from the media item index
       and the position. So there is no need to set it separately.
     - The media item index can be left unset in the State in case the app
       doesn't care about the value or wants to set it the default start
       index (e.g. while the playlist is still empty where UNSET is
       different from zero).
     - Similarly, we should allow to set the content position (and buffered
       position) to C.TIME_UNSET to let the app ignore it or indicate the
       default position explictly.
    
    PiperOrigin-RevId: 495352633
    (cherry picked from commit 545fa59)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    b1e4ac4 View commit details
    Browse the repository at this point in the history
  69. Remove parameters with null values from bundle in MediaMetadata

    Improves the time taken to construct `playerInfo` from its bundle from ~450 ms to ~400 ms. Each `MediaItem` inside `Timeline.Window` contains `MediaMetadata` and hence is a good candidate for bundling optimisations. There already exists a test to check all parameters for null values when unset.
    
    PiperOrigin-RevId: 495614719
    (cherry picked from commit d11e0a3)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    4f8d71e View commit details
    Browse the repository at this point in the history
  70. Use theme when loading drawables on API 21+

    Issue: androidx/media#220
    PiperOrigin-RevId: 495642588
    (cherry picked from commit 22dfd4c)
    marcbaechinger authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    9817c46 View commit details
    Browse the repository at this point in the history
  71. Rename EMPTY_MEDIA_ITEM to PLACEHOLDER_MEDIA_ITEM

    The `MediaItem` instances in the following cases are not actually empty but acts as a placeholder. `EMPTY_MEDIA_ITEM` can also be confused with `MediaItem.EMPTY`.
    
    PiperOrigin-RevId: 495843012
    (cherry picked from commit 3e7f53f)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    44dbeb8 View commit details
    Browse the repository at this point in the history
  72. Clarify behavior for out-of-bounds indices and align implementations

    Some Player methods operate relative to existing indices in the
    playlist (add,remove,move,seek). As these operations may be issued
    from a place with a stale playlist (e.g. a controller that sends
    a command while the playlist is changing), we have to handle out-
    of-bounds indices gracefully. In most cases this is already
    documented and implemented correctly. However, some cases are not
    documented and the existing player implementations don't handle
    these cases consistently (or in some cases not even correctly).
    
    PiperOrigin-RevId: 495856295
    (cherry picked from commit a1954f7)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    097cdde View commit details
    Browse the repository at this point in the history
  73. Check if codec still exists before handling tunneling events

    The tunneling callbacks are sent via Handler messages and may be
    handled after the codec/surface was changed or released.
    
    We already guard against the codec/surface change condition by
    creating a new listener and verifying that the current callback
    happens for the correct listener instance, but we don't guard
    against a released codec yet.
    
    PiperOrigin-RevId: 495882353
    (cherry picked from commit 49ccfd6)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    da6c2df View commit details
    Browse the repository at this point in the history
  74. Avoid sending periodic position updates while paused and not loading

    The period updates were introduced to ensure the buffered position is
    updated regularly and that any playback position drift is corrected.
    
    None of these updates need to happen while the player is paused or
    not loading and we can avoid the constant binder interactions.
    
    PiperOrigin-RevId: 496329800
    (cherry picked from commit 0749b05)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    2186b6d View commit details
    Browse the repository at this point in the history
  75. Add playlist and seek operations to SimpleBasePlayer

    These are the remaining setter operations. They all share the same
    logic that handles playlist and/or position changes. The logic to
    create the placeholder state is mostly copied from ExoPlayerImpl's
    maskTimelineAndPosition and getPeriodPositonUsAfterTimelineChanged.
    
    PiperOrigin-RevId: 496364712
    (cherry picked from commit 5fa1156)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    7768590 View commit details
    Browse the repository at this point in the history
  76. Remove ellipsis from Player javadoc

    PiperOrigin-RevId: 496377192
    (cherry picked from commit f0696f9)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    1126bbb View commit details
    Browse the repository at this point in the history
  77. Fix Dackka error due to param name mismatch

    https://developer.android.com/reference/androidx/leanback/media/PlayerAdapter#seekTo(long)
    
    #minor-release
    
    PiperOrigin-RevId: 496378709
    (cherry picked from commit aae6941)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    79bb53a View commit details
    Browse the repository at this point in the history
  78. Remove TODO from ControllerInfo - the existing approach is fine

    PiperOrigin-RevId: 496398934
    (cherry picked from commit 1494753)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    fdc5930 View commit details
    Browse the repository at this point in the history
  79. Add BitmapLoader injection in MediaController

    Also clean up the strict mode violations of using `BitmapFactory.convertToByteArray` on the main thread.
    
    PiperOrigin-RevId: 496422355
    (cherry picked from commit d848d33)
    tianyif authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    9c81f3b View commit details
    Browse the repository at this point in the history
  80. Clarify some Player command and method javadoc

    #minor-release
    
    PiperOrigin-RevId: 496661152
    (cherry picked from commit 31e875b)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    16a67a4 View commit details
    Browse the repository at this point in the history
  81. Document the relationship between Player methods and available commands

    #minor-release
    
    PiperOrigin-RevId: 496668378
    (cherry picked from commit d8c964c)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    3d9fd60 View commit details
    Browse the repository at this point in the history
  82. Add error messages to correctness assertions in SimpleBasePlayer

    Users of this class may run into these assertions when creating the
    State and they need to check the source code to understand why
    the State is invalid. Adding error messages to all our correctness
    assertions helps to understand the root cause more easily.
    
    PiperOrigin-RevId: 496875109
    (cherry picked from commit 6c98f23)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    bc82969 View commit details
    Browse the repository at this point in the history
  83. Fix recursive loop when registering controller visibility listeners

    There are two overloads of this method due to a type 'rename' from
    `PlayerControlView.VisibilityListener` to
    `PlayerView.ControllerVisibilityListener`. Currently when you call one
    overload it passes `null` to the other one (to clear the other listener).
    Unfortunately this results in it clearing itself, because it receives
    a null call back!
    
    This change tweaks the documentation to clarify that the 'other'
    listener is only cleared if you pass a non-null listener in. This solves
    the recursive problem, and allows the 'legacy' visibility listener to be
    successfully registered.
    
    Issue: androidx/media#229
    
    #minor-release
    
    PiperOrigin-RevId: 496876397
    (cherry picked from commit 4087a01)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    7d3375c View commit details
    Browse the repository at this point in the history
  84. Update migration script

    Issue: google/ExoPlayer#10854
    PiperOrigin-RevId: 496922055
    (cherry picked from commit 50090e3)
    marcbaechinger authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    11b0baa View commit details
    Browse the repository at this point in the history
  85. Bump IMA SDK version to 3.29.0

    Issue: google/ExoPlayer#10845
    PiperOrigin-RevId: 496947392
    (cherry picked from commit 63352e9)
    marcbaechinger authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    13b72c4 View commit details
    Browse the repository at this point in the history
  86. Check MediaMetadata bundle to verify keys are skipped

    Added another check in test to make sure we don't add keys to bundle for fields with `null` values.
    
    PiperOrigin-RevId: 496948705
    (cherry picked from commit 13c93a3)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    e07c887 View commit details
    Browse the repository at this point in the history
  87. Optimise bundling for AdPlaybackState using AdPlaybackState.NONE

    Did not do this optimisation for `AdPlaybackState.AdGroup` as its length is zero for `AdPlaybackState` with no ads.
    
    No need to pass default values while fetching keys, which we always set in `AdPlaybackState.AdGroup.toBundle()`.
    
    PiperOrigin-RevId: 496995048
    (cherry picked from commit 7fc2cdb)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    0f8b861 View commit details
    Browse the repository at this point in the history
  88. Fix order of playback controls in RTL layout

    Issue: androidx/media#227
    
    #minor-release
    
    PiperOrigin-RevId: 497159283
    (cherry picked from commit 8060342)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    a94aa8d View commit details
    Browse the repository at this point in the history
  89. Enable RTL support in the demo app

    We might as well keep this enabled by default, rather than having to
    manually toggle it on to investigate RTL issues like Issue: androidx/media#227.
    
    PiperOrigin-RevId: 497159744
    (cherry picked from commit 69583d0)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    70156dc View commit details
    Browse the repository at this point in the history
  90. Remove player listener on the application thread of the player

    PiperOrigin-RevId: 497183220
    (cherry picked from commit fc22f89)
    marcbaechinger authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    d67df79 View commit details
    Browse the repository at this point in the history
  91. Check bundles in MediaItem to verify keys are skipped

    Added another check in each of these tests to make sure we don't add keys to bundle for fields with default values.
    
    Also fixed comments of similar changes in `AdPlaybackStateTest` and `MediaMetadataTest`.
    
    PiperOrigin-RevId: 499463581
    (cherry picked from commit 0512164)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    7da071a View commit details
    Browse the repository at this point in the history
  92. Optimise bundling for Timeline.Window and Timeline.Period

    Improves the time taken to construct playerInfo from its bundle from ~400 ms to ~300 ms.
    
    Also made `Timeline.Window.toBundle(boolean excludeMediaItem)` public as it was required to assert a condition in tests.
    
    PiperOrigin-RevId: 499512353
    (cherry picked from commit 790e27d)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    21996be View commit details
    Browse the repository at this point in the history
  93. Throw a ParserException instead of a NullPointerException if the samp…

    …le table (stbl) is missing a required sample description (stsd).
    
    As per the javadoc for AtomParsers.parseTrack, ParserException should be "thrown if the trak atom can't be parsed."
    
    PiperOrigin-RevId: 499522748
    (cherry picked from commit d8ea770)
    Googler authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    4e7ccd7 View commit details
    Browse the repository at this point in the history
  94. Fix typo in DefaultTrackSelector.Parameters field

    PiperOrigin-RevId: 499905136
    (cherry picked from commit b63e1da)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    2cfd05f View commit details
    Browse the repository at this point in the history
  95. Initialise fields used for bundling as String directly

    Initialising the fields as Integer and then getting a String on compute
    time is slow. Instead we directly initialise these fields as String.
    Improves the time taken in bundling PlayerInfo further to less than
    200ms from ~300ms.
    
    Also modified a test to improve productive coverage.
    
    PiperOrigin-RevId: 500003935
    (cherry picked from commit 578f2de)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    96eb896 View commit details
    Browse the repository at this point in the history
  96. Update bandwidth meter estimates

    PiperOrigin-RevId: 501010994
    (cherry picked from commit 2c7e9ca)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    b6970c0 View commit details
    Browse the repository at this point in the history
  97. Add focusSkipButtonWhenAvailable to focus UI on ATV

    For TV devices the skip button needs to have the focus to be accessible with
    the remote control. This property makes this configurable while being set to
    true by default.
    
    PiperOrigin-RevId: 501077608
    (cherry picked from commit 9882a20)
    marcbaechinger authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    84545e0 View commit details
    Browse the repository at this point in the history
  98. Use onMediaMetadataChanged for updating the legacy session

    Issue: androidx/media#219
    PiperOrigin-RevId: 501080612
    (cherry picked from commit 375299b)
    marcbaechinger authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    5d84804 View commit details
    Browse the repository at this point in the history
  99. Improve Java doc about how to override notification drawables

    Issue: androidx/media#140
    PiperOrigin-RevId: 501288267
    (cherry picked from commit a2cf222)
    marcbaechinger authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    764daff View commit details
    Browse the repository at this point in the history
  100. Request notification permission in demo app for API 33+

    Starting with API 33 the POST_NOTIFICATION permission needs to be
    requested at runtime or the notification is not shown.
    
    Note that with an app with targetSdkVersion < 33
    but on a device with API 33 the notification permission is automatically
    requested when the app starts for the first time. If the user does not
    grant the permission, requesting the permission at runtime result in
    an empty array of grant results.
    
    Issue: google/ExoPlayer#10884
    PiperOrigin-RevId: 501320632
    (cherry picked from commit 6484c14)
    marcbaechinger authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    1b8608f View commit details
    Browse the repository at this point in the history
  101. Document that DownloadService needs notification permissions

    Starting with Android 13 (API 33) an app needs to request the
    permission to post notifications or notifications are suppressed.
    This change documents this in the class level JavaDoc of the
    `DownloadService`.
    
    Issue: google/ExoPlayer#10884
    PiperOrigin-RevId: 501346908
    (cherry picked from commit 20aa5bd)
    marcbaechinger authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    2c08826 View commit details
    Browse the repository at this point in the history
  102. Add AdsLoader.focusSkipButton()

    This method allows to call through to `StreamManager.focus()` of the currently playing SSAI stream.
    
    PiperOrigin-RevId: 501399144
    (cherry picked from commit 16285ca)
    marcbaechinger authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    b644c67 View commit details
    Browse the repository at this point in the history
  103. Catch FgSStartNotAllowedException when playback resumes

    This fix applies to Android 12 and above.
    
    In this fix, the `MediaSessionService` will try to start in the foreground before the session playback resumes, if ForegroundServiceStartNotAllowedException is thrown, then the app can handle the exception with their customized implementation of MediaSessionService.Listener.onForegroundServiceStartNotAllowedException. If no exception thrown, the a media notification corresponding to paused state will be sent as the consequence of successfully starting in the foreground. And when the player actually resumes, another media notification corresponding to playing state will be sent.
    
    PiperOrigin-RevId: 501803930
    (cherry picked from commit 0d0cd78)
    tianyif authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    a2aaad6 View commit details
    Browse the repository at this point in the history
  104. Correctly map deprecated methods in MediaController to replacement

    This avoids throwing exceptions for correct (but deprecated) Player
    method invocations.
    
    PiperOrigin-RevId: 502341428
    (cherry picked from commit 86a95c2)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    13dc59f View commit details
    Browse the repository at this point in the history
  105. Remove unneccesary parameter taking Player.Command

    The method to dispatch actions in MediaControllerImplBase takes
    a Player.Command, but the value is only used to check if we
    are setting a surface and need to handle the special blocking
    call. This can be cleaned up by removing the parameter and calling
    a dedicated blocking method where needed. This also ensures we
    have to mention the relevant Player.Command only once in each
    method.
    
    PiperOrigin-RevId: 502341862
    (cherry picked from commit 664ab72)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    55903af View commit details
    Browse the repository at this point in the history
  106. Add missing command checks to MediaSessionLegacyStub and PlayerWrapper

    This player didn't fully check all player commands before calling the
    respective methods.
    
    PiperOrigin-RevId: 502353704
    (cherry picked from commit a2a44cd)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    24b0367 View commit details
    Browse the repository at this point in the history
  107. Fix command check in MediaControllerImplBase

    The command check for setDeviceMuted was wrong.
    
    PiperOrigin-RevId: 502355332
    (cherry picked from commit cfcce9a)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    903915d View commit details
    Browse the repository at this point in the history
  108. Clarify what default settings are being used for SSAI AdsLoader

    PiperOrigin-RevId: 502388865
    (cherry picked from commit abe11c8)
    marcbaechinger authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    818ce72 View commit details
    Browse the repository at this point in the history
  109. Post notification for session app when FgS starting exception is caught

    PiperOrigin-RevId: 502407886
    (cherry picked from commit 6ce3421)
    tianyif authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    79fd80f View commit details
    Browse the repository at this point in the history
  110. Filter what PlaybackStateCompat actions are advertised

    PlayerWrapper advertises PlaybackStateCompat actions to the legacy
    MediaSession based on the player's available commands.
    
    PiperOrigin-RevId: 502559162
    (cherry picked from commit 39f4a17)
    christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    dd462e8 View commit details
    Browse the repository at this point in the history
  111. Disables play/pause button when there's nothing to play

    PiperOrigin-RevId: 502571320
    (cherry picked from commit d49a16e)
    Googler authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    d41eede View commit details
    Browse the repository at this point in the history
  112. Make availableCommands known when bundling PlayerInfo

    When bundling PlayerInfo, we remove data when the controller is not
    allowed to access this data via getters. We also remove data for
    performance reasons. In the toBundle() method, it's currently hard to
    make the connection between allowed commands and filtering, because
    the values are checked at a different place. This can be made more
    readable by forwarding the applicable Commands directly.
    
    The only functional fix is to filter the Timeline when sending the
    first PlayerInfo after a connecting a controller if the command to
    get the Timeline is not available. This also allows us to remove a
    path to filter MediaItems from Timelines as it isn't used.
    
    PiperOrigin-RevId: 502607391
    (cherry picked from commit c90ca7b)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    2eab93d View commit details
    Browse the repository at this point in the history
  113. Fix javadoc references to writeSampleData

    PiperOrigin-RevId: 502821506
    (cherry picked from commit 6c14ffc)
    rohitjoins authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    0606ab0 View commit details
    Browse the repository at this point in the history
  114. Correctly filter PlayerInfo by available getter commands.

    When bundling PlayerInfo, we need to remove information if the
    controller is not allowed to access it. This was only partially
    done at the moment.
    
    PiperOrigin-RevId: 502852798
    (cherry picked from commit 69cfba7)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    b8b6ddf View commit details
    Browse the repository at this point in the history
  115. Extend command GET_CURRENT_MEDIA_ITEM to more methods.

    We currently only document it for the getCurrentMediaItem(), but
    the command was always meant to cover all information about the
    current media item and the position therein.
    
    To correctly hide information for controllers, we need to filter
    the Timeline when bundling the PlayerInfo class if only this
    command is available.
    
    PiperOrigin-RevId: 503098124
    (cherry picked from commit f15b752)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    5b18c2d View commit details
    Browse the repository at this point in the history
  116. Update media controller position before pausing.

    We stop estimating new position when pausing until we
    receive a new position from the player. However, this
    means that we will continue to return a possible stale
    previous position. Updating the current position before
    pausing solves this issue.
    
    PiperOrigin-RevId: 503153982
    (cherry picked from commit e961c1b)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    28e3780 View commit details
    Browse the repository at this point in the history
  117. Add command check for metadata in DefaultMediaNotificationProvider

    PiperOrigin-RevId: 503172986
    (cherry picked from commit 052c4b3)
    tonihei authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    43677b9 View commit details
    Browse the repository at this point in the history
  118. Explicitly document most Player.Listener methods in terms of getters

    This makes it implicitly clear that if the value of a getter changes due
    to a change in command availability then the listener will be invoked,
    without needing to explicitly document every command on every listener
    method.
    
    #minor-release
    
    PiperOrigin-RevId: 503178383
    (cherry picked from commit 280889b)
    icbaker authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    967224c View commit details
    Browse the repository at this point in the history
  119. Add the MediaSession as an argument to getMediaButtons()

    Issue: androidx/media#216
    #minor-release
    PiperOrigin-RevId: 503406474
    (cherry picked from commit e690802)
    marcbaechinger authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    107a481 View commit details
    Browse the repository at this point in the history
  120. Add onSetMediaItems listener with access to start index and position

    Added onSetMediaItems callback listener to allow the session to modify/set MediaItem list, starting index and position before call to Player.setMediaItem(s).
    
    Added conditional check in MediaSessionStub.setMediaItem methods to only call player.setMediaItem rather than setMediaItems if player does not support COMMAND_CHANGE_MEDIA_ITEMS
    
    PiperOrigin-RevId: 503427927
    (cherry picked from commit bb11e02)
    microkatz authored and christosts committed Jan 25, 2023
    Configuration menu
    Copy the full SHA
    e266051 View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2023

  1. Add missing # in release notes

    PiperOrigin-RevId: 504013985
    (cherry picked from commit 5147011)
    christosts committed Jan 26, 2023
    Configuration menu
    Copy the full SHA
    2adcfd9 View commit details
    Browse the repository at this point in the history
  2. Deduplicate onSetMediaItem handler logic

    Created unified MediaUtils method to handle various logic for calling Player.setMediaItems from MediaSessionStub and MediaSessionLegacyStub
    
    PiperOrigin-RevId: 504271877
    (cherry picked from commit 7fbdbeb)
    microkatz authored and christosts committed Jan 26, 2023
    Configuration menu
    Copy the full SHA
    846258b View commit details
    Browse the repository at this point in the history
  3. Suppress warnings in ImaUtil

    ImaUtil calls VideoProgressUpdate.equals() which is annotated as hidden,
    which causes lint errors with gradle.
    
    #minor-release
    
    PiperOrigin-RevId: 504306210
    (cherry picked from commit 5f6e172)
    christosts committed Jan 26, 2023
    Configuration menu
    Copy the full SHA
    207d67b View commit details
    Browse the repository at this point in the history
  4. Filter available commands based on PlaybackStateCompat actions

    This allows a MediaController to understand which methods calls
    are available on a legacy session.
    
    PiperOrigin-RevId: 504306806
    (cherry picked from commit 067340c)
    tonihei authored and christosts committed Jan 26, 2023
    Configuration menu
    Copy the full SHA
    c357e67 View commit details
    Browse the repository at this point in the history
  5. Publish gradle attributes for AndroidX compatibility

    These attributes are required when importing our artifacts into
    androidx-main in order to generate reference documentation (JavaDoc and
    KDoc).
    
    #minor-release
    
    PiperOrigin-RevId: 504502555
    (cherry picked from commit 47349b8)
    icbaker authored and christosts committed Jan 26, 2023
    Configuration menu
    Copy the full SHA
    3708e75 View commit details
    Browse the repository at this point in the history
  6. Add missing } to publish.gradle

    This was missed in androidx/media@47349b8
    
    #minor-release
    
    PiperOrigin-RevId: 504548659
    (cherry picked from commit 50beec5)
    icbaker authored and christosts committed Jan 26, 2023
    Configuration menu
    Copy the full SHA
    d6c9fdb View commit details
    Browse the repository at this point in the history
  7. Add missing command checks in UI module

    The commands are partly checked already before enabling
    features or calling player methods, but the checks were
    still missing in many places.
    
    #minor-release
    
    PiperOrigin-RevId: 504589888
    (cherry picked from commit e2ece2f)
    tonihei authored and christosts committed Jan 26, 2023
    Configuration menu
    Copy the full SHA
    55312e1 View commit details
    Browse the repository at this point in the history

Commits on Feb 2, 2023

  1. Tweak UI behavior when commands are missing.

    For most missing commands, we already disable the corresponding
    controls. This change extends this to more UI elements that are
    disabled in case the corresponding action is unavailable.
    
    #minor-release
    
    PiperOrigin-RevId: 505057751
    (cherry picked from commit b3e7696)
    tonihei authored and christosts committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    5e6f79a View commit details
    Browse the repository at this point in the history
  2. Match MergingMediaPeriod track selection by period index in id

    MergingMediaPeriod creates its track groups with ids concatenating position in its periods array and the underlying child track group id. The ids can be used in selectTracks for matching to periods list.
    
    Issue: google/ExoPlayer#10930
    PiperOrigin-RevId: 505074653
    (cherry picked from commit 542a1ef)
    microkatz authored and christosts committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    c37442b View commit details
    Browse the repository at this point in the history
  3. Double tap detection for Bluetooth media button events only

    Issue: androidx/media#233
    #minor-release
    PiperOrigin-RevId: 505078751
    (cherry picked from commit 5c82d6b)
    marcbaechinger authored and christosts committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    bcdedb7 View commit details
    Browse the repository at this point in the history
  4. Fix timestamp comparison for seeks in fMP4

    When seeking in fMP4, we try to extract as little samples as possible
    by only starting at the preceding sync frame. This comparison should
    use <= to allow sync frames at exactly the seek position.
    
    Issue: google/ExoPlayer#10941
    
    PiperOrigin-RevId: 505098172
    (cherry picked from commit 00436a0)
    tonihei authored and christosts committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    631ff80 View commit details
    Browse the repository at this point in the history
  5. Inline method in PlayerService that is used from on call site only

    #cleanup
    #minor-release
    
    PiperOrigin-RevId: 505146915
    (cherry picked from commit d7ef1ab)
    marcbaechinger authored and christosts committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    bfc4ed4 View commit details
    Browse the repository at this point in the history
  6. Do not assume a valid queue in 3rd party sessions

    This change fixes an issue that can be reproduced when
    a controller `onConnect` creates a `QueueTimeline` out
    of the state of a legacy session and then `prepare` is called.
    
    `activeQueueItemId`, `metadata` and the `queue` of the legacy
    session are used when a `QueueTimeline` is created. The change
    adds unit tests to cover the different combinatoric cases these
    properties being set or unset.
    
    PiperOrigin-RevId: 505731288
    (cherry picked from commit 4a9cf7d)
    marcbaechinger authored and christosts committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    5528baa View commit details
    Browse the repository at this point in the history
  7. Fix (another) LeanbackPlayerAdapter param name mismatch

    I missed this when fixing `positionInMs` for Dackka in androidx/media@aae6941
    
    This time I manually verified that all the `@Override` methods have
    parameter names that match [the docs](https://developer.android.com/reference/androidx/leanback/media/PlayerAdapter).
    
    #minor-release
    
    PiperOrigin-RevId: 506017063
    (cherry picked from commit d1a27bf)
    icbaker authored and christosts committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    791c05b View commit details
    Browse the repository at this point in the history
  8. Merge pull request #10793 from fraunhoferfokus:dash-thumbnail-support

    PiperOrigin-RevId: 506261584
    (cherry picked from commit c6569a3)
    christosts committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    d49bd45 View commit details
    Browse the repository at this point in the history
  9. Publish ConcatenatingMediaSource2

    Can be used to combine multiple media items into a single timeline window.
    
    Issue: androidx/media#247
    Issue: google/ExoPlayer#4868
    PiperOrigin-RevId: 506283307
    (cherry picked from commit fcd3af6)
    marcbaechinger authored and christosts committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    065418c View commit details
    Browse the repository at this point in the history
  10. Session: advertise legacy FLAG_HANDLES_QUEUE_COMMANDS

    This change includes 3 things:
    - when the legacy media session is created, FLAG_HANDLES_QUEUE_COMMANDS
      is advertised if the player has the COMMAND_CHANGE_MEDIA_ITEMS
      available.
    - when the player changes its available commands, a new
      PlaybackStateCompat is sent to the remote media controller to
      advertise the updated PlyabackStateCompat actions.
    - when the player changes its available commands, the legacy media
      session flags are sent accoridingly: FLAG_HANDLES_QUEUE_COMMANDS is
      set only if the COMMAND_CHANGE_MEDIA_ITEMS is available.
    
    #minor-release
    
    PiperOrigin-RevId: 506605905
    (cherry picked from commit ebe7ece)
    christosts committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    9bf18db View commit details
    Browse the repository at this point in the history
  11. Fix release note entry

    christosts committed Feb 2, 2023
    Configuration menu
    Copy the full SHA
    f983d91 View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2023

  1. Prepare media3 release notes for rc01

    PiperOrigin-RevId: 509218510
    (cherry picked from commit 7390922)
    christosts committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    3fdaf78 View commit details
    Browse the repository at this point in the history
  2. Minor fixes in release notes

    PiperOrigin-RevId: 509222489
    (cherry picked from commit a90728f)
    christosts committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    9f43249 View commit details
    Browse the repository at this point in the history
  3. Version bump for ExoPlayer 2.18.3 & media3-1.0.0-rc01

    #minor-release
    
    PiperOrigin-RevId: 509501665
    (cherry picked from commit 20eae0e)
    christosts committed Feb 14, 2023
    Configuration menu
    Copy the full SHA
    98bf30d View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2023

  1. Configuration menu
    Copy the full SHA
    f17e846 View commit details
    Browse the repository at this point in the history

Commits on Feb 28, 2023

  1. Detect HEVC HDR10 codec profile more accurately

    In MediaCodecUtil, use Format.colorInfo, besides the codec string,
    to accurately map to a 10bit HEVC profile.
    
    PiperOrigin-RevId: 507500071
    (cherry picked from commit a50ea94)
    christosts authored and tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    bd664ad View commit details
    Browse the repository at this point in the history
  2. Fix AudioTrackPositionTracker logic for playback speed adjustments

    The AudioTrackPositionTracker needs to correct positions by
    the speed set on the AudioTrack itself whenever it makes
    estimations based on real-time (=the real-time playout
    duration is not equal to the media duration played).
    
    This happens for the main playback path already, but not for
    the mode in which the position is estimated from the playback
    head position and also not in the phase after the track has
    been stopped. Both cases are not very noticeable during
    normal playback, but become relevant when playing in offload
    mode.
    
    PiperOrigin-RevId: 507736408
    (cherry picked from commit 01d7bc7)
    tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    ba2b9b3 View commit details
    Browse the repository at this point in the history
  3. Merge pull request #248 from lemondoglol:update-segment-size

    PiperOrigin-RevId: 507784608
    (cherry picked from commit ecd91d8)
    microkatz authored and tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    e89c14a View commit details
    Browse the repository at this point in the history
  4. Merge pull request #10959 from balachandarlinks:handle-sql-exception-…

    …in-cached-content-index
    
    PiperOrigin-RevId: 508323432
    (cherry picked from commit 1249dcd)
    christosts authored and tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    70db687 View commit details
    Browse the repository at this point in the history
  5. Document spatialization behavior constants.

    PiperOrigin-RevId: 508602059
    (cherry picked from commit 6066ce4)
    tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    0ebb8ff View commit details
    Browse the repository at this point in the history
  6. Add null check to ExoPlayerImpl.isTunnelingEnabled

    `TrackSelectorResult.rendererConfigurations` can contain null elements:
    > A null entry indicates the corresponding renderer should be disabled.
    
    This wasn't caught by the nullness checker because `ExoPlayerImpl` is
    currently excluded from analysis.
    
    #minor-release
    
    Issue: google/ExoPlayer#10977
    PiperOrigin-RevId: 508619169
    (cherry picked from commit a6dfcf7)
    icbaker authored and tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    3cc93b1 View commit details
    Browse the repository at this point in the history
  7. AsynchronousMediaCodecAdapter: surface queueing errors sooner

    The AsynchronousMediaCodecAdapter's queuing thread stores any exceptions
    raised by MediaCodec and re-throws them on the next call to
    queueInputBuffer()/queueSecureInputBuffer(). However, if MediaCodec
    raises and error while queueing, it goes into a failed state and does
    not announce available input buffers. If there is no input available
    input buffer, the MediaCodecRenderer will never call
    queueInputBuffer()/queueSecureInputBuffer(), hence playback is stalled.
    
    This change surfaces the queueing error through the adapter's dequeueing
    methods.
    
    PiperOrigin-RevId: 508637346
    (cherry picked from commit 7064310)
    christosts authored and tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    3696076 View commit details
    Browse the repository at this point in the history
  8. Add ad event listeners in the Looper event of the ad manager callback

    #minor-release
    
    PiperOrigin-RevId: 509189206
    (cherry picked from commit 5192962)
    marcbaechinger authored and tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    f2753e2 View commit details
    Browse the repository at this point in the history
  9. Catch IllegalArgumentExceptions in RTSP Response parsing

    In parsing Describe RTSP response messages, IllegalArgumentExceptions are thrown for invalid parameters and values. These exceptions were not caught and crashed the Playback thread. Now these exceptions will be caught and their errors forwarded to the proper error handling listeners.
    
    Issue: google/ExoPlayer#10971
    PiperOrigin-RevId: 509207881
    (cherry picked from commit a8c8745)
    microkatz authored and tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    cfe861e View commit details
    Browse the repository at this point in the history
  10. Add exception cause to thrown exception

    PiperOrigin-RevId: 509473556
    (cherry picked from commit 56803bf)
    Googler authored and tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    6a273a5 View commit details
    Browse the repository at this point in the history
  11. Fix error in documentation string

    The current javadoc refers to the SessionCallback#onConnected, which doesn't exist.
    
    PiperOrigin-RevId: 510261965
    (cherry picked from commit fc642eb)
    Googler authored and tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    3b00561 View commit details
    Browse the repository at this point in the history
  12. Map PLAYER_STATE_LOADING to STATE_BUFFERING

    #minor-release
    Issue: androidx/media#245
    PiperOrigin-RevId: 510456793
    (cherry picked from commit ba49b6b)
    marcbaechinger authored and tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    629a75e View commit details
    Browse the repository at this point in the history
  13. Reduce number of calls to AudioTrack.getPlaybackHeadPosition

    This call may cause performance overhead in some situations,
    for example if the AudioTrack needs to query an offload DSP
    for the current position. We don't need to check this multiple
    times per doSomeWork iteration as the value is unlikely to
    change in any meaningful way.
    
    PiperOrigin-RevId: 510957116
    (cherry picked from commit 9eccf09)
    tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    0e5dad5 View commit details
    Browse the repository at this point in the history
  14. Skip rendering multiple frames on the same vsync

    When rendering frames at a rate higher than the screen refresh rate,
    e.g. playing at 8x, the player is releasing multiple frames at the same
    release time (nanos) which are then dropped by the platform. The output
    buffers are available later and as a result MediaCodec cannot keep up
    decoding fast enough.
    
    This change skips releasing multiple video frames on the same vsync
    period and proactivelly drops the frame. The frame is counted as skipped
    rather than dropped to differentiate with frames dropped due to slow
    decoding.
    
    PiperOrigin-RevId: 510964976
    (cherry picked from commit ab7e84f)
    christosts authored and tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    58a977e View commit details
    Browse the repository at this point in the history
  15. Use ArrayDeque for pending output stream changes.

    The current logic uses manual array operations to keep track of pending
    changes. Modernize this code by using an ArrayDeque and a data class.
    This also allows to extend the output stream information in the future.
    
    This also fixes a bug where a position reset accidentally assigns a pending
    stream offset instead of keeping the current one.
    
    PiperOrigin-RevId: 511787571
    (cherry picked from commit f042012)
    tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    5ab4223 View commit details
    Browse the repository at this point in the history
  16. Do not specify export flags for protected system broadcasts.

    Protected system broadcasts should not specify the export flag.
    Marking them as NOT_EXPORTED breaks sticky broadcasts in some
    cases.
    
    Issue: google/ExoPlayer#10970
    
    PiperOrigin-RevId: 512020154
    (cherry picked from commit 93e1179)
    tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    a09bb70 View commit details
    Browse the repository at this point in the history
  17. Use more realistic time values for MediaCodecVideoRendererTest

    This test became flaky after androidx/media@ab7e84f because some of the
    unrealistic frame times ended up on the same release time.
    
    Using realistic numbers avoids the flakiness.
    
    PiperOrigin-RevId: 512566469
    (cherry picked from commit 0c8ce18)
    tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    abf1eb8 View commit details
    Browse the repository at this point in the history
  18. Correctly update output info if previous stream has been fully rendered

    The output info for a new stream is marked pending until the last
    sample of the previous stream has been processed. However, this fails
    if the previous stream has already been fully processed. We need to
    detect this case explicitly to avoid signalling the output change one
    sample too late.
    
    #minor-release
    
    PiperOrigin-RevId: 512572854
    (cherry picked from commit 7ffcc6f)
    tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    f011cc8 View commit details
    Browse the repository at this point in the history
  19. Add workaround for wrong PerformancePoints on some devices.

    Some devices were reported to have wrong PerformancePoint sets
    that cause 60 fps to be marked as unsupported even though they
    are supported.
    
    Issue: google/ExoPlayer#10898
    
    PiperOrigin-RevId: 512580395
    (cherry picked from commit d0cbf0f)
    tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    512ca60 View commit details
    Browse the repository at this point in the history
  20. Ensure output format is updated in sync with stream changes.

    MediaCodecRenderer currently has two independent paths to trigger
    events at stream changes:
     1. Detection of the last output buffer of the old stream to trigger
        onProcessedStreamChange and setting the new output stream offset.
     2. Detection of the first input buffer of the new stream to trigger
        onOutputFormatChanged.
    Both events are identical for most media. However, there are two
    problematic cases:
      A. (1) happens after (2). This may happen if the declared media
         duration is shorter than the actual last sample timestamp.
      B. (2) is too late and there are output samples between (1) and (2).
         This can happen if the new media outputs samples with a timestamp
         less than the first input timestamp.
    
    This can be made more robust by:
     - Keeping a separate formatQueue for each stream to avoid case A.
     - Force outputting the first format after a stream change to
       avoid case B.
    
    Issue: google/ExoPlayer#8594
    
    PiperOrigin-RevId: 512586838
    (cherry picked from commit 3970343)
    tonihei committed Feb 28, 2023
    Configuration menu
    Copy the full SHA
    5822d68 View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2023

  1. Update notification play/pause button with matching player state

    Issue: androidx/media#192
    PiperOrigin-RevId: 508649684
    (cherry picked from commit e1d12fc)
    tianyif authored and tonihei committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    ad42800 View commit details
    Browse the repository at this point in the history
  2. Fix some playback parameter signalling problems.

    Playback parameter signalling can be quite complex because
     (a) the renderer clock often has a delay before it realizes
         that it doesn't support a previously set speed and
     (b) the speed set on media clock sometimes intentionally
         differs from the one surfaced to the user, e.g. during
         live speed adjustment or when overriding ad playback
         speed to 1.0f.
    
    This change fixes two problems related to this signalling:
     1. When resetting the media clock speed at a period transition,
        we don't currently tell the renderers that this happened.
     2. When a delayed speed change update from the media clock is
        pending and the renderer for this media clock is disabled
        before the change can be handled, the pending update becomes
        stale but it still applied later and overrides any other valid
        speed set in the meantime.
    
    Both edge cases are also covered by extended or new player tests.
    
    Issue: google/ExoPlayer#10882
    
    PiperOrigin-RevId: 512658918
    (cherry picked from commit e79b47c)
    tonihei committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    f690ebd View commit details
    Browse the repository at this point in the history
  3. Ensure getPlaybackHeadPosition isn't called if not needed

    Once the value returned from AudioTimestampPoller advances, we
    only need getPlaybackHeadPosition to sample sync params and
    verify the returned timestamp. Both of these happen less often
    and we can avoid calling getPlaybackHeadPosition if we don't
    actually need it.
    
    PiperOrigin-RevId: 512882170
    (cherry picked from commit 408b444)
    tonihei committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    b44fb57 View commit details
    Browse the repository at this point in the history
  4. Update translations

    #minor-release
    
    PiperOrigin-RevId: 512890813
    (cherry picked from commit a7faa5b)
    tonihei committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    ee4ac61 View commit details
    Browse the repository at this point in the history
  5. Minor change in ForwardingPlayer javadoc

    #minor-release
    
    PiperOrigin-RevId: 512897269
    (cherry picked from commit 42fae15)
    christosts authored and tonihei committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    7d6a359 View commit details
    Browse the repository at this point in the history
  6. Remove @see tags with <a> tags

    These are not supported by Dackka
    
    #minor-release
    
    PiperOrigin-RevId: 513176533
    (cherry picked from commit c07cf3d)
    icbaker authored and tonihei committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    ddd5e9b View commit details
    Browse the repository at this point in the history
  7. Merge pull request #255 from mayurk2:use_edts_offset_if_it_is_for_ent…

    …ire_file
    
    PiperOrigin-RevId: 513213229
    (cherry picked from commit 17499ce)
    tonihei committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    dbf737d View commit details
    Browse the repository at this point in the history
  8. Update release notes for 1.0.0-rc02

    PiperOrigin-RevId: 513483809
    (cherry picked from commit df11545)
    tonihei committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    64c6d8f View commit details
    Browse the repository at this point in the history
  9. Bump version numbers to Media3 1.0.0-rc02 and ExoPlayer 2.18.4

    #minor-release
    
    PiperOrigin-RevId: 513488487
    (cherry picked from commit cd753bd)
    tonihei committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    67fd41a View commit details
    Browse the repository at this point in the history
  10. Fix some JavaDoc in the Media3 session module

    #minor-release
    
    PiperOrigin-RevId: 513501046
    (cherry picked from commit 6042bec)
    marcbaechinger authored and tonihei committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    d47675f View commit details
    Browse the repository at this point in the history
  11. Remove unreleased changed

    tonihei committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    2e6484d View commit details
    Browse the repository at this point in the history
  12. Fix lint-baseline.xml for latest UI translations

    #minor-release
    
    PiperOrigin-RevId: 513533248
    (cherry picked from commit 8498e4b)
    tonihei committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    7958737 View commit details
    Browse the repository at this point in the history
  13. Add missing RELEASENOTES line

    PiperOrigin-RevId: 513556883
    (cherry picked from commit e2cb32f)
    tonihei committed Mar 2, 2023
    Configuration menu
    Copy the full SHA
    af30f00 View commit details
    Browse the repository at this point in the history

Commits on Mar 3, 2023

  1. Configuration menu
    Copy the full SHA
    1ef427f View commit details
    Browse the repository at this point in the history

Commits on Mar 14, 2023

  1. Configuration menu
    Copy the full SHA
    e78332f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    810cb6d View commit details
    Browse the repository at this point in the history
  3. Add missing @param tags

    Dackka generates a warning if a method has at least one `@param` tag,
    but not all of them are documented.
    
    PiperOrigin-RevId: 513873453
    (cherry picked from commit cb7d565)
    icbaker authored and tonihei committed Mar 14, 2023
    Configuration menu
    Copy the full SHA
    14b0dcb View commit details
    Browse the repository at this point in the history
  4. Update templates to more clearly signpost between exoplayer2 and media3

    Issue: google/ExoPlayer#11031
    
    #minor-release
    
    PiperOrigin-RevId: 514366016
    (cherry picked from commit 9c82923)
    icbaker authored and tonihei committed Mar 14, 2023
    Configuration menu
    Copy the full SHA
    e7f49a8 View commit details
    Browse the repository at this point in the history
  5. Document that custom commands can only be sent if they are defined

    Custom commands from controller to session are blocked if they are
    not listed in the available session command list. This isn't well
    documented in the Javadoc currently.
    
    #minor-release
    
    PiperOrigin-RevId: 514733568
    (cherry picked from commit 20669fc)
    tonihei committed Mar 14, 2023
    Configuration menu
    Copy the full SHA
    687362e View commit details
    Browse the repository at this point in the history
  6. Update docs and READMEs for media3 stable release

     - The ExoPlayer docs will link to the media3 ones (for now, we can
       permanently redirect once no further stand-alone ExoPlayer release
       is published).
     - Contibuting issues and PRs should only happen on the media3 repo.
     - The media3 README is updated to remove any pre-release status
       information.
    
    PiperOrigin-RevId: 516234594
    (cherry picked from commit bc87353)
    tonihei committed Mar 14, 2023
    Configuration menu
    Copy the full SHA
    bfdd09b View commit details
    Browse the repository at this point in the history
  7. Update release notes for Media3 1.0.0 / ExoPlayer 2.18.5

    PiperOrigin-RevId: 516478351
    (cherry picked from commit 2fe2161)
    tonihei committed Mar 14, 2023
    Configuration menu
    Copy the full SHA
    7f435f0 View commit details
    Browse the repository at this point in the history
  8. Bump version numbers to Media3 1.0.0 and ExoPlayer 2.18.5

    #minor-release
    
    PiperOrigin-RevId: 516514583
    (cherry picked from commit 137b40b)
    tonihei committed Mar 14, 2023
    Configuration menu
    Copy the full SHA
    dd2008b View commit details
    Browse the repository at this point in the history

Commits on Mar 22, 2023

  1. Configuration menu
    Copy the full SHA
    95f9e8f View commit details
    Browse the repository at this point in the history
  2. Add ExoPlayer versions to GH bug template

    PiperOrigin-RevId: 518523484
    tonihei committed Mar 22, 2023
    Configuration menu
    Copy the full SHA
    7aff476 View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2023

  1. Fix javadoc links in media README files

    Also fixed the javadoc link in devsite and removed javadoc links from decoder extensions as it is not published yet on developer.android.com.
    
    #minor-release
    
    PiperOrigin-RevId: 520636868
    (cherry picked from commit 6a92880)
    rohitjoins committed Mar 31, 2023
    Configuration menu
    Copy the full SHA
    d1d1665 View commit details
    Browse the repository at this point in the history
  2. Add media3 guide entries in README files

    PiperOrigin-RevId: 520650881
    (cherry picked from commit 766e7d7)
    rohitjoins committed Mar 31, 2023
    Configuration menu
    Copy the full SHA
    2ca9050 View commit details
    Browse the repository at this point in the history

Commits on Apr 18, 2023

  1. Ensure ForwardingPlayer users do listener registration correctly

    The `@CallSuper` annotation should help catch cases where subclasses are
    calling `delegate.addListener` instead of `super.addListener` but it
    will also (unintentionally) prevent subclasses from either completely
    no-opping the listener registration, or implementing it themselves in a
    very custom way. I think that's probably OK, since these cases are
    probably unusual, and they should be able to suppress the warning/error.
    
    Issue: androidx/media#258
    
    #minor-release
    
    PiperOrigin-RevId: 513848402
    (cherry picked from commit 5d23a92)
    icbaker authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    4666d57 View commit details
    Browse the repository at this point in the history
  2. Make DefaultDashChunkSource more robust against empty segment timelines

    Segment timelines are technically allowed to be empty, but not all places
    add the necessary checks.
    
    Issue: google/ExoPlayer#11014
    PiperOrigin-RevId: 514722205
    (cherry picked from commit 788132b)
    tonihei authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    a94fb21 View commit details
    Browse the repository at this point in the history
  3. Merge pull request #11061 from cedricxperi:dts-udts-support

    PiperOrigin-RevId: 517067549
    (cherry picked from commit 49d85d6)
    rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    60e0546 View commit details
    Browse the repository at this point in the history
  4. Add support to fetch ColorInfo from hvcc box in AtomParsers

    #minor-release
    
    PiperOrigin-RevId: 517086016
    (cherry picked from commit 8a5fcf8)
    rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    65d4202 View commit details
    Browse the repository at this point in the history
  5. Merge pull request #11064 from haixia-meta:release-v2

    PiperOrigin-RevId: 517128752
    (cherry picked from commit 0e3f407)
    rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    b70b320 View commit details
    Browse the repository at this point in the history
  6. Retry RTSP Setup with TCP if response with UDP is UnsupportedTransport

    If RTSP Setup Request with UDP receives HTTP Error Status 461 UnsupportedTransport, then client will retry with TCP.
    
    Issue: google/ExoPlayer#11069
    PiperOrigin-RevId: 518807829
    (cherry picked from commit ecf4d8b)
    microkatz authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    eea3703 View commit details
    Browse the repository at this point in the history
  7. Merge pull request #11051 from TiVo:p-fix-for-issue-11050

    PiperOrigin-RevId: 518953648
    (cherry picked from commit dc3481f)
    tianyif authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    690ac23 View commit details
    Browse the repository at this point in the history
  8. Handle output format changes for empty sample streams correctly

    When MediaCodecRenderer is given an empty sample stream, it puts
    its output format change tracking in a bad state where we never
    process future stream changes because we are waiting for a sample
    that doesn't exist.
    
    We can fix this by:
     - Looping the pending output stream changes to see if we processed
       more than one change at once (this fixes the tracking for empty
       sample streams that are not the first in the queue).
     - Checking if none of the previous streams queued any samples in
       onStreamChanged to handle this in the same way as the case
       where we already output all samples (this fixes the problem when
       the empty sample stream comes first in the queue).
     - Also calling onProcessedStreamChange for the case above, which
       was missing previously.
    
    #minor-release
    
    PiperOrigin-RevId: 519226637
    (cherry picked from commit b9790e6)
    tonihei authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    56dd0f7 View commit details
    Browse the repository at this point in the history
  9. Post OfflineLicenseHelper interactions to its internal handler thread

    `DefaultDrmSession(Manager)` expect most of their methods to be called
    on the 'playback thread'. There isn't a playback thread in the case of
    `OfflineLicenseHelper`, but in that case it's the thread backing
    `DefaultDrmSessionManager.playbackLooper`, which is `OfflineLicenseHelper.handlerThread`.
    
    PiperOrigin-RevId: 520053006
    (cherry picked from commit 376bdde)
    icbaker authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    66b1282 View commit details
    Browse the repository at this point in the history
  10. Remove remaining references to exoplayer.dev

    PiperOrigin-RevId: 520314781
    (cherry picked from commit 6952771)
    tonihei authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    d07fcc3 View commit details
    Browse the repository at this point in the history
  11. Temporarily use exoplayer2-hosted SVGs in media3 javadoc

    The media3-hosted versions of these SVGs were removed due to a change in
    the way the reference docs are generated. While work on getting them
    hosted on developer.android.com, this change simply links to the
    (identical) exoplayer2 versions in order to fix the media3 docs.
    
    #minor-release
    
    PiperOrigin-RevId: 520647905
    (cherry picked from commit 2e4f49f)
    icbaker authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    1034250 View commit details
    Browse the repository at this point in the history
  12. ...Suppress MissingSuperCall warnings on onBackPressed()...

    PiperOrigin-RevId: 520709134
    (cherry picked from commit 5af28a9)
    Googler authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    3daaad7 View commit details
    Browse the repository at this point in the history
  13. Add warning logs if DefaultDrmSessionManager is used on wrong thread

    Issue: google/ExoPlayer#11008
    PiperOrigin-RevId: 520864579
    (cherry picked from commit 7ca9668)
    icbaker authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    3480a27 View commit details
    Browse the repository at this point in the history
  14. Improve check for invalid connection request

    The check currently relies on the default value of 0 returned if the
    Bundle doesn't define a pid. But in some cases, like Robolectric unit tests,
    0 is a possible pid. The check can be improved by directly asserting that
    the value is defined.
    
    PiperOrigin-RevId: 521414649
    (cherry picked from commit 694d690)
    tonihei authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    654a678 View commit details
    Browse the repository at this point in the history
  15. Remove Javadoc TODO from README of decoder extensions

    As most classes are used via interface only and people depending on it locally can always find the Javadoc in Android Studio directly, we don't plan to add Javadocs for these extensions module in developer.android.com.
    
    PiperOrigin-RevId: 521993756
    (cherry picked from commit e4cb583)
    rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    10e2dfd View commit details
    Browse the repository at this point in the history
  16. Allow duplicated MediaItems in a legacy session

    MediaItems are not meant to be unique in a playlist. If a legacy
    session publishes multiple items that get converted to equal MediaItems,
    the current code fails because we look up queue ids in a Map (that
    doesn't allow duplicate entries).
    
    Fix this by storing a simple list of items with additional data.
    
    Issue: androidx/media#290
    PiperOrigin-RevId: 521993802
    (cherry picked from commit 219967c)
    tonihei authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    86cc916 View commit details
    Browse the repository at this point in the history
  17. Implement missing broadcastCustomCommand to legacy controller

    And also mention a few restrictions regarding legacy components
    in Javadoc.
    
    Issue: androidx/media#293
    PiperOrigin-RevId: 522005562
    (cherry picked from commit 502969a)
    tonihei authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    5d11aa9 View commit details
    Browse the repository at this point in the history
  18. Add missing initial update to the subtitle button in the session demo

    The button gets only updated after an onTracksChanged callback but
    isn't set to the initial state similar to other changes triggered
    by callbacks (e.g. updateRepeatSwitchUI)
    
    PiperOrigin-RevId: 522274800
    (cherry picked from commit 14ba173)
    tonihei authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    8aec88b View commit details
    Browse the repository at this point in the history
  19. Replace deprecated onBackPressed call

    PiperOrigin-RevId: 523361561
    (cherry picked from commit be85684)
    tonihei authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    0690c9b View commit details
    Browse the repository at this point in the history
  20. Change format logged when AudioSink throws InitializationException

    Change what format is logged from MediaCodecAudioRenderer when
    AudioSink throws InitializationException. We printed the
    AudioSink's format, which most of the times is audio/raw (PCM)
    and not the renderer's format. With this change both formats are
    logged.
    
    #minor-release
    
    Issue: google/ExoPlayer#11066
    PiperOrigin-RevId: 523456840
    (cherry picked from commit baf1aa1)
    christosts authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    abc9d8c View commit details
    Browse the repository at this point in the history
  21. Update available commands when setting a new player in MediaSession

    PiperOrigin-RevId: 523633865
    (cherry picked from commit ae87564)
    tonihei authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    9360530 View commit details
    Browse the repository at this point in the history
  22. Precedence for app provided media button receiver

    This change selects the best suited media button receiver
    component and pending intent when creating the legacy
    session. This is important to ensure that a service can
    be started with a media button event from BT headsets
    after the app has been terminated.
    
    The `MediaSessionLegacyStub` selects the best suited
    receiver to be passed to the `MediaSessionCompat`
    constructor.
    
    1. When the app has declared a broadcast receiver for
     `ACTION_MEDIA_BUTTON` in the manifest, this broadcast
     receiver is used.
    2. When the session is housed in a service, the service
     component is used as a fallback.
    3. As a last resort a receiver is created at runtime.
    
    When the `MediaSessionLegacyStub` is released, the media
    button receiver is removed unless the app has provided a
    media button receiver in the manifest. In this case we
    assume the app supports resuming when the BT play intent
    arrives at `MediaSessionService.onStartCommand`.
    
    Issue: androidx/media#167
    Issue: androidx/media#27
    Issue: androidx/media#314
    PiperOrigin-RevId: 523638051
    (cherry picked from commit e54a934)
    marcbaechinger authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    eb322b7 View commit details
    Browse the repository at this point in the history
  23. Enable multidex for demo-gl app

    #minor-release
    
    PiperOrigin-RevId: 523708424
    (cherry picked from commit 81fd9d2)
    rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    1076756 View commit details
    Browse the repository at this point in the history
  24. Bump version numbers to Media3 1.0.1 and ExoPlayer 2.18.6

    #minor-release
    
    PiperOrigin-RevId: 523959161
    (cherry picked from commit e033dba)
    rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    ade8831 View commit details
    Browse the repository at this point in the history
  25. Update colr box values to be overridden by bitstream boxes

    #minor-release
    
    PiperOrigin-RevId: 523983688
    (cherry picked from commit 596a7c7)
    rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    ba6ccee View commit details
    Browse the repository at this point in the history
  26. Ensure TrackSelectionParameters overrides match existing groups

    The overrides specified by a MediaController may not use the exact
    same TrackGroup instances as known to the Player because the groups
    have been bundled to and from the controller. This bundling may
    alter the instance slightly depending on the version used on each
    side of the communication and the fields set (e.g. Format.metadata
    is not supported for bundling).
    
    This issue can be solved by creating unique track group ids for
    each group on the session side before bundling. On the way back,
    the groups in the track selection parameters can be mapped backed
    to their original instances based on this id.
    
    Issue: androidx/media#296
    PiperOrigin-RevId: 523986626
    (cherry picked from commit 1c557e2)
    tonihei authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    3b2b8d5 View commit details
    Browse the repository at this point in the history
  27. Use @link instead of @value

    Dackka doesn't support `@value`
    
    PiperOrigin-RevId: 524309695
    (cherry picked from commit b834e49)
    icbaker authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    d5a81c5 View commit details
    Browse the repository at this point in the history
  28. Document style guide and google-java-format in CONTRIBUTING.md

    Prompted by discussion on this commit: google/ExoPlayer@e811749
    
    #minor-release
    
    PiperOrigin-RevId: 524795901
    (cherry picked from commit f799766)
    icbaker authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    d784857 View commit details
    Browse the repository at this point in the history
  29. Remove unnecessary check for currentMediaItem in legacy session stub

    This check was a leftover from when the metadata was generated from
    the MediaItem only. Since we moved to the actual MediaMetadata fields,
    the check is completely unnecessary and prevents accessing metadata
    when the GET_CURRENT_MEDIA_ITEM command is not available.
    
    PiperOrigin-RevId: 524837587
    (cherry picked from commit e0bb23d)
    tonihei authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    8c5c58e View commit details
    Browse the repository at this point in the history
  30. Fix thread access when creating notifications for media sessions

    The sessions may have different application threads for their players,
    and the service with its notification provider runs on the main thread.
    To ensure everything runs on the correct thread, this change labels
    methods where needed and fixes thread access in some places.
    
    Issue: androidx/media#318
    PiperOrigin-RevId: 524849598
    (cherry picked from commit ffa3743)
    tonihei authored and rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    fa972d9 View commit details
    Browse the repository at this point in the history
  31. Update release notes for Media3 1.0.1 / ExoPlayer 2.18.6

    PiperOrigin-RevId: 525176828
    (cherry picked from commit 07ff3ee)
    rohitjoins committed Apr 18, 2023
    Configuration menu
    Copy the full SHA
    b1e3eac View commit details
    Browse the repository at this point in the history

Commits on Apr 19, 2023

  1. Add com.google.truth.extensions:truth-java8-extension to JAR list

    PiperOrigin-RevId: 525415067
    (cherry picked from commit 3788172)
    rohitjoins committed Apr 19, 2023
    Configuration menu
    Copy the full SHA
    4f0b30b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3c01488 View commit details
    Browse the repository at this point in the history

Commits on May 15, 2023

  1. Render last frame even if have not read BUFFER_FLAG_END_OF_STREAM

    If the limited number of input buffers causes reading of all samples except the last one conveying end of stream, then the last frame will not be rendered.
    
    PiperOrigin-RevId: 525974445
    (cherry picked from commit affbb7c)
    microkatz authored and icbaker committed May 15, 2023
    Configuration menu
    Copy the full SHA
    eee226e View commit details
    Browse the repository at this point in the history
  2. Remove unnecessary Activity method overrides in session demo app

    The PlayerView methods are documented to only be needed for sphrerical
    playbacks, which we are not using in the session demo app.
    
    PiperOrigin-RevId: 525986709
    (cherry picked from commit 2de89ca)
    tonihei authored and icbaker committed May 15, 2023
    Configuration menu
    Copy the full SHA
    58cf3a7 View commit details
    Browse the repository at this point in the history
  3. Update available commands when MediaSessionCompat actions change

    This is a bug currently, where commands are created once but never
    updated again if the actions in MediaSessionCompat are changed.
    
    PiperOrigin-RevId: 525999084
    (cherry picked from commit 79fab67)
    tonihei authored and icbaker committed May 15, 2023
    Configuration menu
    Copy the full SHA
    0f6a1eb View commit details
    Browse the repository at this point in the history
  4. Clarify threading requirement for MediaController.releaseFuture

    And remove unnecessary check for isDone.
    
    Issue: androidx/media#345
    PiperOrigin-RevId: 525999615
    (cherry picked from commit 186f3d5)
    tonihei authored and icbaker committed May 15, 2023
    Configuration menu
    Copy the full SHA
    3f5d777 View commit details
    Browse the repository at this point in the history
  5. Ensure DrmSessionManager.setPlayer() is called before prepare()

    `prepare()` now logs a warning if it's called before `setPlayer()`
    because it's not possible to tell if it's being called on the wrong
    thread (since androidx/media@3480a27).
    
    This change finds all the places one is called immediately after the
    other and flips the order to be more correct.
    
    Issue: androidx/media#350
    
    #minor-release
    
    PiperOrigin-RevId: 526582294
    (cherry picked from commit 6aacbc6)
    icbaker committed May 15, 2023
    Configuration menu
    Copy the full SHA
    2092472 View commit details
    Browse the repository at this point in the history
  6. Merge pull request #313 from pengbins:fix_ts_h265reader_parse_sps

    PiperOrigin-RevId: 527259619
    (cherry picked from commit fab134f)
    icbaker committed May 15, 2023
    Configuration menu
    Copy the full SHA
    3149203 View commit details
    Browse the repository at this point in the history
  7. Allow MediaLibraryService to reject the resumption notification

    To reliably reject the System UI playback resumption notification on
    all API levels (specifically API 30), the backward compatibility layer
    needs to return `null` for the library root.
    
    This is not possible in the Media3 implementation. This change allows
    an app to return a `LibraryResult.ofError(RESULT_ERROR_NOT_SUPPORTED)`
    that then is translated to return null by the backwards compatibility
    layer.
    
    Issue: androidx/media#355
    Issue: androidx/media#167
    Issue: androidx/media#27
    
    See https://developer.android.com/guide/topics/media/media-controls#mediabrowserservice_implementation
    
    PiperOrigin-RevId: 527276529
    (cherry picked from commit 7938978)
    marcbaechinger authored and icbaker committed May 15, 2023
    Configuration menu
    Copy the full SHA
    3406334 View commit details
    Browse the repository at this point in the history
  8. Fix leaks of media session service.

    References to the service are kept from MediaSessionStub
    and from a long-delayed Handler messages in ConnectionTimeoutHandler.
    
    Remove strong references from these places by making the timeout
    handler static and ensuring ConnectedControllersManager only keeps
    a weak reference to the service (as it's part of MediaSessionStub).
    
    Issue: androidx/media#346
    PiperOrigin-RevId: 527543396
    (cherry picked from commit 8c262d6)
    tonihei authored and icbaker committed May 15, 2023
    Configuration menu
    Copy the full SHA
    40ef64a View commit details
    Browse the repository at this point in the history
  9. Add JavaDoc to some undocumented methods and move them

    PiperOrigin-RevId: 527870443
    (cherry picked from commit 336d4b3)
    marcbaechinger authored and icbaker committed May 15, 2023
    Configuration menu
    Copy the full SHA
    179e35b View commit details
    Browse the repository at this point in the history
  10. Add UTF-16 encoded subtitle support to SsaDecoder

    Issue: androidx/media#319
    PiperOrigin-RevId: 527891646
    (cherry picked from commit 06ac2f7)
    microkatz authored and icbaker committed May 15, 2023
    Configuration menu
    Copy the full SHA
    841bdc6 View commit details
    Browse the repository at this point in the history
  11. Update translations

    PiperOrigin-RevId: 529069808
    (cherry picked from commit bba760f)
    tof-tof authored and icbaker committed May 15, 2023
    Configuration menu
    Copy the full SHA
    feb83c2 View commit details
    Browse the repository at this point in the history
  12. Fix demo app UnsafeOptInUsageError lint errors

    This change:
    * Adds missing `@OptIn` annotation to demo app's `ErrorMessageProvider`
    * Switches from `Util.SDK_INT` to `Build.VERSION.SDK_INT` in
      `SampleChooserActivity` (`PlayerActivity` is already using this).
    
    This code hasn't changed recently, and it doesn't fail on the `release`
    branch, but it failed when I checked the `main` branch just now - so I
    assume lint has updated to detect more cases where unstable APIs are
    being used without opt-in. I suspect the difference is due to different
    Android Gradle Plugin versions between the branches.
    
    #minor-release
    
    PiperOrigin-RevId: 529111669
    (cherry picked from commit ebcdd98)
    icbaker committed May 15, 2023
    Configuration menu
    Copy the full SHA
    b0b34de View commit details
    Browse the repository at this point in the history
  13. Use a for-each loop instead of forEach in PlaybackService.kt

    The current code flags a lint error:
    
    ```
    Error: Call requires API level 24 (current min is 16): java.lang.Iterable#forEach [NewApi]
    ```
    
    I think this is a bit confusing because this is calling the Java
    [`Iterable.forEach`](https://developer.android.com/reference/java/lang/Iterable#forEach(java.util.function.Consumer%3C?%20super%20T%3E))
    method which was added in Java 8 (and therefore is only available on
    API 24 and up), but there is **also** a Kotlin
    [`List.forEach`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/for-each.html)
    method which is available in all versions of Kotlin (and therefore all
    Android versions). Since this is a Kotlin file, at first glance you
    would assume this is the Kotlin method - but it's not.
    
    This also doesn't seem to be flagged by Android Studio, but is caught
    by Gradle lint on the command line.
    
    #minor-release
    
    PiperOrigin-RevId: 529112610
    (cherry picked from commit 09b474a)
    icbaker committed May 15, 2023
    Configuration menu
    Copy the full SHA
    375cdb2 View commit details
    Browse the repository at this point in the history
  14. Temporarily suppress missing permission lint in session demo

    #minor-release
    
    PiperOrigin-RevId: 529370535
    (cherry picked from commit 0f398d5)
    icbaker committed May 15, 2023
    Configuration menu
    Copy the full SHA
    7a1d7bf View commit details
    Browse the repository at this point in the history
  15. Javadoc tweaks for MediaSession.MediaItemsWithPosition

    Also change some type parameter names in `MediaSession.BuilderBase`
    because `C` now clashes with the import of `androidx.media3.common.C`.
    
    #minor-release
    
    PiperOrigin-RevId: 529665698
    (cherry picked from commit 78f2025)
    icbaker committed May 15, 2023
    Configuration menu
    Copy the full SHA
    13191ed View commit details
    Browse the repository at this point in the history
  16. Fix value type when unbundling LibraryResult without expected type

    Calling LibraryResult.toBundle() could have caused a CastClassException.
    This was because when unbundled with UNKNOWN_TYPE_CREATOR.fromBundle(Bundle),
    the valueType was set to VALUE_TYPE_ITEM_LIST for all types and the MediaItem
    was attempted to be casted to a list.
    
    PiperOrigin-RevId: 529717688
    (cherry picked from commit f28a588)
    marcbaechinger authored and icbaker committed May 15, 2023
    Configuration menu
    Copy the full SHA
    3064bc9 View commit details
    Browse the repository at this point in the history
  17. Add tests for MediaLibraryInfo version code consistency

    `VERSION_INT` is quite long with several sections, and it's easy to make
    a mistake when updating it - this should help since it checks it against
    `VERSION`, which is more easily human readable/writable.
    
    PiperOrigin-RevId: 529747023
    (cherry picked from commit eb58d20)
    icbaker committed May 15, 2023
    Configuration menu
    Copy the full SHA
    a098f86 View commit details
    Browse the repository at this point in the history
  18. Remove a copybara stripping tag

    #minor-release
    
    PiperOrigin-RevId: 530935437
    (cherry picked from commit 17b183b)
    icbaker committed May 15, 2023
    Configuration menu
    Copy the full SHA
    f71370a View commit details
    Browse the repository at this point in the history
  19. Update the root project name check in publish.gradle

    The name was changed in androidx/media@2558138
    and this check wasn't updated, meaning publishing no longer worked
    (it didn't publish anything, just printed lots of warnings like
    `Skipping task ':test-utils-robolectric:publish' as it has no
    actions.`). This change means the check is now using the same
    source-of-truth as the root project name, so it shouldn't go out of
    sync again.
    
    PiperOrigin-RevId: 531457952
    (cherry picked from commit 4c1eb8a)
    icbaker committed May 15, 2023
    Configuration menu
    Copy the full SHA
    0888dfb View commit details
    Browse the repository at this point in the history

Commits on May 16, 2023

  1. Add consistency check to sending and receiving position updates

    The periodic updates are only meant to happen while we are in the
    same period or ad. This was already guaranteed except for two cases:
    1. The Player in a session has updated its state without yet calling
       its listeners
    2. The session scheduled a PlayerInfo update that hasn't been sent yet
    
    ... and in both cases, the following happened:
     - The change updated the mediaItemIndex to an index that didn't exist
       in a previous Timeline known to the Controller
     - One of the period position updates happened to be sent at exactly
       this time
    
    This problem can be avoided by only scheduling the update if we are
    still in the same period/ad and haven't scheduled a normal PlayerInfo
    update already.
    
    Since new MediaControllers may still connect to old sessons with this
    bug, we need an equivalent change on the controller side to ignore such
    buggy updates.
    
    PiperOrigin-RevId: 532089328
    (cherry picked from commit 96dd0ae)
    tonihei authored and icbaker committed May 16, 2023
    Configuration menu
    Copy the full SHA
    20ba325 View commit details
    Browse the repository at this point in the history

Commits on May 17, 2023

  1. Update release notes for Media3 1.0.2

    PiperOrigin-RevId: 532404001
    (cherry picked from commit 1a38a0c)
    icbaker committed May 17, 2023
    Configuration menu
    Copy the full SHA
    6a7a376 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c484711 View commit details
    Browse the repository at this point in the history
  3. Add Media3 1.0.2 and ExoPlayer 2.18.7 to bug.yml template

    PiperOrigin-RevId: 532765549
    (cherry picked from commit 4ede3d6)
    icbaker committed May 17, 2023
    Configuration menu
    Copy the full SHA
    69879cd View commit details
    Browse the repository at this point in the history
  4. Add main/dev-v2 branch options to bug.yml template

    #minor-release
    
    PiperOrigin-RevId: 532766676
    (cherry picked from commit 84d0206)
    icbaker committed May 17, 2023
    Configuration menu
    Copy the full SHA
    d77e79a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    2fc189d View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2023

  1. Configuration menu
    Copy the full SHA
    e9af41e View commit details
    Browse the repository at this point in the history