1. 11 Jan, 2021 5 commits
    • Fix usage of ParsableByteArray in `PgsDecoder` · 361e80f4
      This is a partial revert of
      https://github.com/google/ExoPlayer/commit/46598a46fd3c13a9be906abd6c673b9487ba5d50
      
      The change from reset(int) to setPosition/Limit() in this file was
      incorrect, the reset(int) call is important because it ensures
      `bitmapData` is large enough for the `buffer.readBytes` call on L188.
      
      Issue: #8417
      PiperOrigin-RevId: 351110038
      ibaker committed
    • Clarify how cookies are handled (or not) in the demo app · ba1ebe78
      1. Remove cookie manager logic from PlayerActivity, since it has
         no effect when Cronet is used (which is now the default)
      2. Add toggle in DemoUtil to use Cronet or the default network
         stack. Configure the cookie manager only when using the default
         network stack
      
      PiperOrigin-RevId: 350922671
      olly committed
    • Improve user-agent configuration · 2a5f6d8f
      - Support setting the user-agent in CronetDataSource
      - Support setting the default user-agent in CronetEngineWrapper
      - Use the underlying network stack's default user-agent by
        default. Many applications will configure the underlying
        CronetEngine or OkHttpClient with a user-agent that they
        expect to be used throughout their app, so always overriding
        this with our own default, on reflection, is not the best
        thing to do!
      
      Issue: #8395
      PiperOrigin-RevId: 350921963
      olly committed
    • Simplify bypass buffer batching · 7e295cbf
      BatchBuffer has three different clear methods (clear, flush,
      batchWasConsumed), and it's not hugely clear what each of them
      does. In general, BatchBuffer owning the sample buffer seems
      more complicated than having the caller own it, particularly
      when it can be "pending" inside of the batch buffer.
      
      This change moves ownership of the sample buffer to the
      caller. BatchBuffer is simplified as a result. There are also
      two behaviour changes:
      
      1. The buffer's timeUs field is now set to the first sample's
         timestamp, rather than the last sample's.
      2. A key-frame in the middle of the batch no longer causes the
         batch buffer to be considered a key-frame. Which seems like
         the right thing to do, because the batched data cannot be
         decoded independently of whatever came before it.
      
      PiperOrigin-RevId: 350921306
      olly committed
    • Rollback of https://github.com/google/ExoPlayer/commit/ff8c8645abb1490fe130a9cd5a4bf4576734d140 · 59aec416
      *** Original commit ***
      
      Merge #8401: Initialize Format.codecs from HEVC SPS NAL unit (#8393)
      
      Imported from GitHub PR https://github.com/google/ExoPlayer/pull/8401
      
      This will allow ExoPlayer to check if video track's profile and level are supported by decoder when playing progressive media sources.
      Merge e582fb91b73c7c95e754167140211d5473c36d14 into 1347d572
      
      Issue: #8393
      
      ***
      
      PiperOrigin-RevId: 350871621
      olly committed
  2. 08 Jan, 2021 18 commits
  3. 07 Jan, 2021 9 commits
    • Deprecate stop(boolean) · 456622a2
      `stop(true)` is almost the same as `clearMediaItems(); stop();`, except that
      any player error isn't cleared. Clearing media items more clearly expresses the
      intent.
      
      PiperOrigin-RevId: 350516748
      andrewlewis committed
    • Fix MIGHT_NOT_USE_FULL_NETWORK_SPEED for VOD DASH streams. · 2c925a41
      The flag compared against the nowTime in the period that is only
      set to a positive value for live streams.
      
      PiperOrigin-RevId: 350514934
      tonihei committed
    • Update surface frame-rate based on fixed frame-rate estimate · 855db95f
      PiperOrigin-RevId: 350442843
      olly committed
    • Clarify parameter Javadoc for playback speed values. · 25ed6b12
      In many cases we just used "playback speed" as a detailed Javadoc
      parameter or return type definition. This doesn't define which scale
      the speed is using.
      
      PlaybackParameters as the main point to set the speed already uses a
      more precise wording to describe the value as a factor by which playback
      will be sped up.
      
      This change replaces other usages of "playback speed" with this wording
      whereever we would usually add a unit, keeping "playback speed" for
      summary statements etc to reference the general concept that doesn't
      usually require a unit.
      
      PiperOrigin-RevId: 350379139
      tonihei committed
    • Propagate audio session ID to MediaCodecVideoRenderer · d1d28a41
      Issue: #8190
      PiperOrigin-RevId: 350357825
      olly committed
    • Turn on parallel video and audio adaptation by default. · aa2beb08
      The experimental setting shows positive results and can be turned
      on by default. To avoid adaptation between HLS audio formats without
      bitrates, we need to ensure that only formats with bitrates are
      considered for adaptation.
      
      Also added tests for these features.
      
      Issue: #5111
      PiperOrigin-RevId: 350315296
      tonihei committed
    • Keep pending output format after multiple flushes · 51d90a40
      The AsynchronousMediaCodecCallback has logic to retain a pending
      output format in case flush() is called. This commit fixes a case where
      calling flush() again while an output format is pending would nullify
      the pending output format.
      
      A unit test is added in AsynchronousMediaCodecCallback but not the
      AsynchronousMediaCodecAdapter. That is because the adapter operates
      directly on top of MediaCodec, but Robolectric's ShadowMediaCodec
      produces an output format on every MediaCodec.start(). This is
      unrealistic when operating MediaCodec in asynchronous mode where we
      need to call MediaCodec.start() after every MediaCodec.flush().
      
      PiperOrigin-RevId: 350176659
      christosts committed
    • Clean up parallel adaptation code. · a4fbc2c9
       - The AdaptiveTrackSelection doesn't need to use the experimental
      terminolgy because the code is always triggered if there are multiple
      adaptive selections.
      
      - It's also confusing to pass the state on the outside after the object
      creation, so moving everything into a simple control flow again where
      the adaptation checkpoints are passed in via the constructor.
      
      - Instead of triple arrays, we can use more readable named structures.
      
      - The calculation of the checkpoints can be cleaned up to be more
      readable by moving things to helper methods.
      
      - The reserved bandwidth from all fixed track selections is really just
      a special case of multiple parallel adaptataions. So this logic doesn't
      need to be separate.
      
      - The whole logic also didn't have test coverage so far. Added tests
      for the actual adaptation using these checkpoints and the builder
      calculating the checkpoints.
      
      Overall this should be a no-op change.
      
      PiperOrigin-RevId: 350162834
      tonihei committed
    • Remove internal renderer audio session ID propagation · 0901fe6e
      Overriding this method will never be necessary or advisable once we
      improve routing of audio session IDs
      
      Issue: #8190
      PiperOrigin-RevId: 350146302
      olly committed
  4. 06 Jan, 2021 4 commits
  5. 05 Jan, 2021 4 commits