media/libraries
yschimke 80928e730c Workaround for OkHttp Interrupt issues.
Relates to https://github.com/square/okhttp/issues/3146. This was from https://github.com/androidx/media/pull/71.

There is a draft PR https://github.com/square/okhttp/pull/7185/files which documents OkHttp's ideal handling of cancellation including interrupts.

But a few key points

1) This is a target state, and OkHttp does not currently handle interrupts correctly.  In the past this has been identified, and the advice is to avoid interrupts on Http threads, see discussion on https://github.com/square/okhttp/issues/1902. Also an attempt at a fix here https://github.com/square/okhttp/pull/7023 which wasn't in a form to land.

2) Even with this fixed, it is likely to never be optimal, because of OkHttp sharing a socket connection for multiple inflight requests.

From https://github.com/square/okhttp/pull/7185

```
Thread.interrupt() is Clumsy
----------------------------

`Thread.interrupt()` is Java's built-in mechanism to cancel an in-flight `Thread`, regardless of
what work it's currently performing.

We recommend against using `Thread.interrupt()` with OkHttp because it may disrupt shared resources
including HTTP/2 connections and cache files. In particular, calling `Thread.interrupt()` may cause
unrelated threads' call to fail with an `IOException`.
```

This PR leaves the Loader/DataSource thread parked on a countdown latch, while this may seem wasteful and an additional context switch. However in practice the response isn't returned until the Http2Connection and Http2Reader have a response from the server and these means effectively parking in a `wait()` statement here 9e039e9412/okhttp/src/jvmMain/kotlin/okhttp3/internal/http2/Http2Stream.kt (L140)

PiperOrigin-RevId: 446652468
2022-05-09 10:59:41 +01:00
..
cast Rename Player.COMMAND_GET_TRACK_INFOS to COMMAND_GET_TRACKS 2022-04-26 14:41:41 +01:00
common GL: Update exoplayer to use bindTexture. 2022-05-09 10:57:54 +01:00
database Mark all non-public IntDefs as only TYPE_USE 2022-02-21 16:56:36 +00:00
datasource Stabilise HttpDataSource and its nested exceptions 2022-04-06 11:36:53 +01:00
datasource_cronet Remove references to deprecated DefaultDataSourceFactory from dev guide 2022-03-24 15:13:09 +00:00
datasource_okhttp Workaround for OkHttp Interrupt issues. 2022-05-09 10:59:41 +01:00
datasource_rtmp Remove references to deprecated DefaultDataSourceFactory from dev guide 2022-03-24 15:13:09 +00:00
decoder Expect PresentationTime Discontinuity During Stream Transitions 2022-04-26 14:21:36 +01:00
decoder_av1 Make sure native library loads use correct class loader 2022-02-22 11:25:44 +00:00
decoder_ffmpeg Force CMake version 3.21.0+ for the FFMPEG extension 2022-03-14 13:42:31 +00:00
decoder_flac Make sure native library loads use correct class loader 2022-02-22 11:25:44 +00:00
decoder_opus Make sure native library loads use correct class loader 2022-02-22 11:25:44 +00:00
decoder_vp9 Make sure native library loads use correct class loader 2022-02-22 11:25:44 +00:00
exoplayer GL: Update exoplayer to use bindTexture. 2022-05-09 10:57:54 +01:00
exoplayer_dash Migrate usages from C.TYPE_* to C.CONTENT_TYPE_* 2022-05-09 10:46:04 +01:00
exoplayer_hls Migrate usages from C.TYPE_* to C.CONTENT_TYPE_* 2022-05-09 10:46:04 +01:00
exoplayer_ima Misc fix on parameter comment 2022-05-09 10:50:31 +01:00
exoplayer_rtsp Migrate usages from C.TYPE_* to C.CONTENT_TYPE_* 2022-05-09 10:46:04 +01:00
exoplayer_smoothstreaming Migrate usages from C.TYPE_* to C.CONTENT_TYPE_* 2022-05-09 10:46:04 +01:00
exoplayer_workmanager Reformat some javadoc 2022-02-18 14:54:02 +00:00
extractor Remove empty <p> tag from WebvttDecoder 2022-05-09 10:32:48 +01:00
session Use Media 3 command constants instead of legacy constants 2022-05-09 10:54:26 +01:00
test_data Reading AV1 initialization data. 2022-05-09 10:24:18 +01:00
test_exoplayer_playback Move TrackGroupArray back to ExoPlayer 2022-03-17 13:08:56 +00:00
test_session_common Update error state of legacy playback state if authentication fails 2022-04-06 11:25:27 +01:00
test_session_current Migrate usages of the deprecated TrackSelectionParameters.CREATOR 2022-05-09 10:52:11 +01:00
test_utils Migrate usages from C.TYPE_* to C.CONTENT_TYPE_* 2022-05-09 10:46:04 +01:00
test_utils_robolectric Fix the position of IntDefs to match TYPE_USE 2022-02-21 17:04:12 +00:00
transformer Use MatrixTransformation instead of wrapping its GlFrameProcssor. 2022-05-09 10:58:56 +01:00
ui Allow stable API users to register PlayerView listeners 2022-05-09 10:41:49 +01:00
ui_leanback Fixes for some minor misc issues 2021-11-19 14:44:25 +00:00