1. 17 Nov, 2022 2 commits
  2. 10 Nov, 2022 13 commits
    • Ensure listener invocations use final state variable. · 7f17ff6d
      The MediaControllerImplBase listener invocations currently use the
      class member state that can change if one of the listener method
      implementations changes the state recursively.
      
      Updating the listener invocations to use a final local variable
      ensures all listeners get consistent updates.
      
      PiperOrigin-RevId: 487503373
      (cherry picked from commit 33bea391)
      tonihei committed
    • Split test methods more clearly in arrange, act, assert. · a9eb1211
      The tests in MediaControllerCompatCallbackWithMediaSessionTest
      don't follow this pattern very consistently at the moment.
      
      PiperOrigin-RevId: 487501913
      (cherry picked from commit c6a0ba25)
      tonihei committed
    • Align PlaybackStateCompat states with logic in MediaSessionConnector · 58d670d9
      Creating the PlaybackStateCompat from a media3 Player state is done
      already by the MediaSessionConnector (and used widely). The media3
      session module should set the same states under the same circumstances
      to ensure compatiblity and consistency.
      
      PlaybackStateCompat changes made in media3 session:
       - Use STATE_STOPPED when player is ended instead of STATE_PAUSED
       - Use STATE_PLAYING when playback is suppressed temporarily.
       - Set the playback speed to 0 if the player is not playing.
       - Add extras for mediaId and user-set playback speed.
      
      Part of the problem was that Player.isPlaying() was used to check
      the state. Unfortunately, MockPlayer.isPlaying() is implemented in
      a way that makes it hard to test these changes, because the value
      is set independently of playbackState, playWhenReady and suppression
      reason. To be able to write consistent, logical tests, this change
      also removes the independent setting of isPlaying in MockPlayer to
      align it better with a real player. This requires to update some
      other tests to use alternative methods.
      
      PiperOrigin-RevId: 487500859
      (cherry picked from commit c5e071e5)
      tonihei committed
    • Configure Dackka to generate javadoc for protected methods · d0d6cbd5
      #minor-release
      
      PiperOrigin-RevId: 487497923
      (cherry picked from commit a4029551)
      ibaker committed
    • Fix parameter name mismatch in MappingTrackSelector.selectTracks · 2826a553
      It's not clear to me why presubmit didn't catch this, I briefly
      investigated but couldn't work it out - so I'm just going to fix
      it and move on.
      
      #minor-release
      
      PiperOrigin-RevId: 487497827
      (cherry picked from commit 4fcc019b)
      ibaker committed
    • Avoid notifying connection twice from MediaControllerImplLegacy. · 824cbf40
      The connection to a legacy MediaSession may receive additional
      onSessionReady callbacks that are treated as additional state updates.
      We currently also set the "notifyConnected" flag for these updates
      even though we are connected already, causing an IllegalStateException.
      
      Fix the exception by not setting this flag.
      
      We can also remove the wording about "locked" updates since this class
      operates everything on a single application thread.
      
      Issue: androidx/media#49
      PiperOrigin-RevId: 487487286
      (cherry picked from commit b24161a6)
      tonihei committed
    • Set targetSdkVersion of main demo app to 29 · afb0f12f
      #minor-release
      
      PiperOrigin-RevId: 487479366
      (cherry picked from commit 40c6c431)
      christosts committed
    • Fix Dackka parameter name error in `Gav1Decoder` and `VpxDecoder` · cfbcf2c8
      These aren't caught by presubmit because the classes are annotated
      `@VisibleForTesting` and are therefore stripped out by Metalava. However
      Metalava doesn't run when we're generating javadoc for real.
      
      #minor-release
      
      PiperOrigin-RevId: 487476260
      (cherry picked from commit 742da7f4)
      ibaker committed
    • Fix Dackka/Metalava errors in test_utils module · ba0466b1
      This involves reducing the visibility of methods/constructors that
      are already unusable outside the `androidx.media3.test.utils` package.
      
      #minor-release
      
      PiperOrigin-RevId: 487473005
      (cherry picked from commit 3ab88135)
      ibaker committed
    • Fix Dackka/Metalava errors in av1, flac, ffmpeg, midi, and opus modules · 65d923c0
      This uses `@hide` on `protected final` methods to hide them from Dackka
      javadoc generation, since these methods are inaccessible to developers
      anyway. These symbols will still (currently) be included in artefacts
      distributed on Maven (because we don't run Metalava as part of
      generating these artefacts).
      
      In some cases I had to change the visibility/finality of methods to make
      them `protected final` before adding the `@hide` annotation (but
      the impact should be very low, since most of these methods were either
      already unusable by app developers, or they shouldn't have been used).
      
      #minor-release
      
      PiperOrigin-RevId: 487472907
      (cherry picked from commit e9ddfa53)
      ibaker committed
    • Fix Dackka/Metalava errors in the HLS and RTSP modules · 937c4639
      This makes two fixes:
      1. Remove `HlsSampleStreamWrapper.Callback` (package-private) from the
         list of interfaces implemented by `HlsMediaPeriod` (`public`) and
         move the implementation to a private inner class instead. This avoids
         Metalava complaining about a public class that inherits from a
         package-private type.
      2. Reduce the visibility of
         `RtpPayloadFormat.isFormatSupported(MediaDescription)` from `public`
         to package-private. The `MediaDescription` type is already
         package-private, so this method was already unusable outside the
         package.
      
      #minor-release
      
      PiperOrigin-RevId: 487472781
      (cherry picked from commit dbfc0cc7)
      ibaker committed
    • Fix Dackka/Metalava errors in the ExoPlayer module · c2c9febd
      This makes two types of fix:
      1. Align parameter names on overridden methods where the superclass
         has `@param` javadoc.
      2. Use `@hide` on `protected final` methods that refer to package-private
         types. This will hide these symbols from Dackka javadoc generation
         but not (currently) from the artefacts distributed on Maven. These
         methods are currently unusable outside their package anyway (e.g. by
         external developers) because of the dependency on a package-private
         type.
      
      This also changes some HLS, SmoothStreaming, and IMA code where I've renamed
      parameters of overridden methods to be consistent across the type
      hierarchy.
      
      #minor-release
      
      PiperOrigin-RevId: 487472665
      (cherry picked from commit 7905744a)
      ibaker committed
  3. 09 Nov, 2022 8 commits
    • HDR: Implement ForceInterpretHdrVideoAsSdr · 45f6c24b
      Also, document that we tone map when no HDR features are explicitly set
      
      PiperOrigin-RevId: 487310971
      (cherry picked from commit 2ff5dab0)
      huangdarwin committed
    • Set HDR color info on FrameworkMuxer · e57838d7
      Not setting the color info results in a missing "colr" box in the produced
      container, under file/moov/trak/mdia/minf/stbl/stsd/hvc1. This means extractors
      will not be able to find out the transcoded file is HDR.
      
      In `Transformer`, this means it can't transcode this transcoded file, because
      it currently relies on the container bearing HDR info to construct the
      transcoding sample pipeline.
      
      PiperOrigin-RevId: 487276712
      (cherry picked from commit 3c74e076)
      claincly committed
    • Wait with PlayerInfo updates until all pending operations are done · dddc6026
      Accepting a PlayerInfo while the MediaController is masking its state
      means we are reverting all masking changes we've made earlier. This
      only makes sense if the update already contains the masked operation.
      If multiple operations are in flight (or are sent from the session
      while they are in flight), we need to wait until all of them are
      handled before accepting new updates.
      
      In cases where a new update from the session excludes the Timeline
      and the masked state is incompatible with the new update, we also
      risk an exception if we accept the update too early.
      
      PiperOrigin-RevId: 487266899
      (cherry picked from commit 0b4ba3e3)
      tonihei committed
    • Change UnsupportedEncodingException to IllegalArgumentException · bc3aef08
      In startTransformation method we were throwing UnsupportedEncodingException (IOException) when mediaItem with unsupported arguments is passed.
      Changed this to IllegalArgumentException which seems more logical here.
      
      PiperOrigin-RevId: 487259296
      (cherry picked from commit 818bf4a2)
      sheenachhabra committed
    • MediaController: Add missing event flags (2/2) · 707c2d89
      This is the follow-up commit where the onEvents callback
      raised by MediaController contains the missing events, for the
      case where MediaController is connected to a legacy MediaSession.
      
      #minor-release
      
      PiperOrigin-RevId: 487231996
      (cherry picked from commit c403b4ce)
      christosts committed
    • Add ExoPlayerAssetLoader · c89ceb87
      Just move some code around for now, to start setting up the overall
      structure.
      
      PiperOrigin-RevId: 487229329
      (cherry picked from commit 95f37b4d)
      kimvde committed
    • Merge Issue: google/ExoPlayer#10762: Fix ffmpeg jni wrapper returning invalid result codes · d262f760
      Imported from GitHub PR Issue: google/ExoPlayer#10762
      
      This ensure that ffmpeg error code are properly translated to values that the ExoPlayer decoder understand.
      The main gain is that it allows the decoder to properly ignore more cases of invalid data and recover.
      The second gain is that the other errors are now proper ExoPlayer errors and no more obscure buffer ones.
      
      Fixes: Issue: google/ExoPlayer#10760
      Merge 82ceeb77d6df71f5ffb0474db66a36fd6eb8e51a into 972e169b
      COPYBARA_INTEGRATE_REVIEW=go/exoghi/10762 from Tolriq:ffmpeg_error_code 82ceeb77d6df71f5ffb0474db66a36fd6eb8e51a
      PiperOrigin-RevId: 487189910
      
      (cherry picked from commit a1c04cd4)
      Tolriq committed
    • Move slow mo logic to sample pipelines · 59769552
      This is to avoid having this logic in TransformerInternal once it is
      added.
      
      PiperOrigin-RevId: 487159941
      (cherry picked from commit 714e5565)
      kimvde committed
  4. 08 Nov, 2022 2 commits
  5. 07 Nov, 2022 6 commits
    • Move muxer initialization off application thread · 64c87a5f
      Problem: We are initialising muxer as soon as we start the transformation. Now the startTransformation() method can be called from main thread, but muxer creation is an I/O operation and should be not be done on main thread.
      
      Solution: Added lazy initialisation of muxer object. The actual transformation happens on background thread so the muxer will be initialised lazily from background thread only.
      
      Another way was to provide an initialize() method on MuxerWrapper which will explicitly initialise muxer object but with this approach the caller need to call the initialise method before calling anything else. With current implementation the renderers are calling MuxerWrapper methods on various callbacks (Not sequentially) and also we are sharing same muxer with multiple renderers so It might become confusing for the caller on when to call the initialise() method. Also there are few methods on MuxerWrapper which dont really need muxer object. So in short it might make MuxerWrapper APIs more confusing.
      
      Validation: Verified the transformation from demo app.
      PiperOrigin-RevId: 486735787
      (cherry picked from commit eb357654)
      sheenachhabra committed
    • HDR: Set decoder codec profile and level if available. · a42050f4
      This should be necessary to ensure decoders see fewer errors.
      
      Setting this resulted in removing native_dequeueOutputBuffer errors on OMX.MTK decoders for in-app tone mapping prototyping.
      
      PiperOrigin-RevId: 486715941
      (cherry picked from commit e510d990)
      huangdarwin committed
    • HDR: Update test FileUtil to handle null ColorInfo. · b770eb86
      PiperOrigin-RevId: 486706595
      (cherry picked from commit 23e724a0)
      huangdarwin committed
    • Set matching folder type in Session demo app. · 13a4089e
      The folder type is useful metadata to understand programmatically
      what criterion was used to create the folder.
      
      PiperOrigin-RevId: 486653317
      (cherry picked from commit ab9f0608)
      tonihei committed
    • MediaControllerListenerWithMediaSessionCompatTest: clean imports · 3bad1f32
      Remove static imports to Player constants to make the code more readable.
      
      #minor-release
      
      PiperOrigin-RevId: 486619911
      (cherry picked from commit 09651ed2)
      christosts committed
    • Changed MediaController to return last estimated position while paused · 8270dd45
      The method getCurrentPosition() may return a lesser position during pause than the previous retrieved value due to ipc call delay in playerInfo update. Users see track position jump backwards at pause. Fixed to return last estimated position while paused if have not received updated playerInfo. Code is deduped to point getContentPosition() to getCurrentPosition() when !isPlayingAd.
      
      PiperOrigin-RevId: 486617341
      (cherry picked from commit 9336b95b)
      michaelkatz committed
  6. 04 Nov, 2022 1 commit
  7. 03 Nov, 2022 5 commits
  8. 02 Nov, 2022 2 commits
  9. 01 Nov, 2022 1 commit