media/libraries
claincly 7fc1e4a674 Fix ExternalTextureManager: repeated queueing input frame in preview
TL;DR: we should check if there are new frames available to queue to the
ExternalTextureProcessor before actually queueing a frame.

The overall flow on the external texture processor:

- `SurfaceTexture.onFrameAvailable` is called on `ExtTexMgr`, and
  - it calls `updateTexImage()`, and sets `frame`
  - it calls `maybeQueueFrameToExtTexProc()`
    - the frame is queued to `ExtTexProc` if `frame` is set

  - From `ExtTexProc.queueInputFrame()`:
    - notifies the `frameProcessorListener` of available frame
    - notifies the `inputListener` of `onReadyToAcceptInputFrame`
      - (`ExtTexMgr` is the listener), it calls `maybeQueueFrameToExtTexProc()`
       again

-- Parallelly --
- `ExtTexProc` calls `inputListener.onInputFrameProcessed`, when the frame is
released
  - (`ExtTexMgr` is the listener), sets `frame` to `null`

*Problem*

This logic relies on `frame` to be cleared at the right time.

In transformer, it's OK b/c `ExtTexProc` release the frame immediately in
`queueInputFrame()` and calls `onInputFrameProcessed` which also reset `frame`

But in previewing, the frame is not released for a while, up to 10 ms.
In this case, `frame` will not reset in this 10 ms, and
`maybeQueueFrameToExtTexProc()` is repeatedly queueing the same input frame.

PiperOrigin-RevId: 470211620
(cherry picked from commit 91709831ed)
2022-08-26 11:03:54 +00:00
..
cast Add device info to CastPlayer 2022-08-19 10:45:11 +00:00
common HDR: Add PQ support. 2022-08-24 15:44:22 +00:00
database Mark all non-public IntDefs as only TYPE_USE 2022-02-21 16:56:36 +00:00
datasource Switch incorrectly configured native multidex to legacy 2022-08-25 16:07:42 +00:00
datasource_cronet Switch incorrectly configured native multidex to legacy 2022-08-25 16:07:42 +00:00
datasource_okhttp Annotate methods that always return this with @CanIgnoreReturnValue 2022-07-21 15:24:07 +00:00
datasource_rtmp Annotate methods that always return this with @CanIgnoreReturnValue 2022-07-21 15:24:07 +00:00
decoder Expect PresentationTime Discontinuity During Stream Transitions 2022-04-26 14:21:36 +01:00
decoder_av1 Update CMake version for AV1 extension 2022-08-15 10:49:44 +00:00
decoder_ffmpeg Replace usage of android_binary with build_test for libraries 2022-08-23 10:24:29 +00:00
decoder_flac Switch incorrectly configured native multidex to legacy 2022-08-25 16:07:42 +00:00
decoder_opus Switch incorrectly configured native multidex to legacy 2022-08-25 16:07:42 +00:00
decoder_vp9 Switch incorrectly configured native multidex to legacy 2022-08-25 16:07:42 +00:00
effect Fix ExternalTextureManager: repeated queueing input frame in preview 2022-08-26 11:03:54 +00:00
exoplayer Switch incorrectly configured native multidex to legacy 2022-08-25 16:07:42 +00:00
exoplayer_dash DASH: Parse and use EventStream.presentationTimeOffset 2022-07-25 20:28:20 +00:00
exoplayer_hls Annotate methods that always return this with @CanIgnoreReturnValue 2022-07-21 15:24:07 +00:00
exoplayer_ima Switch incorrectly configured native multidex to legacy 2022-08-25 16:07:42 +00:00
exoplayer_rtsp Fix outdated RtpDataLoadable javadoc 2022-08-23 13:41:49 +00:00
exoplayer_smoothstreaming Annotate methods that always return this with @CanIgnoreReturnValue 2022-07-21 15:24:07 +00:00
exoplayer_workmanager Reformat some javadoc 2022-02-18 14:54:02 +00:00
extractor Annotate methods that always return this with @CanIgnoreReturnValue 2022-07-21 15:24:07 +00:00
session Switch incorrectly configured native multidex to legacy 2022-08-25 16:07:42 +00:00
test_data Fix the command sample size given to trackOutput. 2022-08-18 20:44:21 +00:00
test_exoplayer_playback Switch incorrectly configured native multidex to legacy 2022-08-25 16:07:42 +00:00
test_session_common Run MediaSessionStub commands in order 2022-07-20 10:34:22 +00:00
test_session_current Define CueGroup.EMPTY_TIME_ZERO for convenience 2022-08-16 16:27:56 +00:00
test_utils ExtractorAsserts: add comments on method arguments 2022-07-26 13:23:36 +00:00
test_utils_robolectric Add timestamp to Metadata 2022-06-27 11:31:10 +00:00
transformer Change onOutputFrameAvailable timestamp from nanos to micros. 2022-08-19 09:47:28 +00:00
ui Use the current overrides of the player as preset 2022-07-18 10:36:01 +00:00
ui_leanback Listen to playWhenReady changes in LeanbackPlayerAdapter 2022-07-11 15:49:33 +00:00