14449 Commits

Author SHA1 Message Date
samrobinson
97331a612a Rename expected to reference in SsimHelper.
Reference is clearer when used in conjunction with actual, and matches
other SSIM documentation.

PiperOrigin-RevId: 449486177
2022-05-24 11:51:41 +01:00
ibaker
cfaf39c82c Clarify the priority of live config values in the dev guide
PiperOrigin-RevId: 449485592
2022-05-24 11:48:16 +01:00
ibaker
aef2f154a7 Remove all null-tolerant methods from BundleableUtil.
In most cases it's clearer to in-line these null-checks with ternary
operators.

PiperOrigin-RevId: 449474621
2022-05-24 11:44:55 +01:00
tonihei
e9d5381b54 Add missing equals to MergingMediaPeriod.ForwardingTrackSelection
This causes a bug where the forwarded selections are no longer
assumed equal and the child MediaPeriods will think they need
to reset streams even though the selection stayed the same.

Issue: Issue: google/ExoPlayer#10248
PiperOrigin-RevId: 449454038
2022-05-24 11:41:34 +01:00
andrewlewis
b3dc32d7fb Tidy releasing FrameProcessorChain
PiperOrigin-RevId: 449238525
2022-05-24 11:37:08 +01:00
andrewlewis
bea17b4357 Attempt to load OpenCV when loading MediaPipe
PiperOrigin-RevId: 449227706
2022-05-24 11:33:49 +01:00
andrewlewis
d6dc3c5351 Fix initialization of media pipe processors with assets
PiperOrigin-RevId: 449221156
2022-05-24 11:30:29 +01:00
rohks
a27b5398a8 Create new class to store cues and timestamp.
We need to pass timestamp for the list of cues so we are defining a new class CueGroup which will store both cues and timestamp.

PiperOrigin-RevId: 449212054
2022-05-24 11:27:01 +01:00
andrewlewis
b2f46fabf7 Update stale bug reference.
The old reference was just for prototyping HDR. The new reference is for planned work to use the correct formats for input and output for HDR editing in GL.

PiperOrigin-RevId: 449211792
2022-05-24 11:23:33 +01:00
andrewlewis
578afa883d Fix demo app crash when media pipe isn't loaded
The toast message about media pipe not loading needs to be shown on the main
(UI) thread.

PiperOrigin-RevId: 449199285
2022-05-24 11:20:08 +01:00
tonihei
463603049e Add replacement for deprecated network type override constant
The MMWAVE constant was deprecated in favour of a new constant
with a better name. Thus, we need to check for both constants now.

PiperOrigin-RevId: 449018959
2022-05-24 11:16:39 +01:00
Ian Baker
f28f8026ff Merge pull request #64 from ittiam-systems:rtp-vp9
PiperOrigin-RevId: 448978892
2022-05-24 11:13:17 +01:00
tonihei
daa4c1c0a6 Add language normalization for "arb" (Standard Arabic)
This is an individual language (ISO 639-3) part of the Arabic
macrolanguage ("ar" in ISO 639-1). Add this mapping to our
existing list similar to other individual to macrolanguage
mappings we have already.

Issue: Issue: google/ExoPlayer#10255
PiperOrigin-RevId: 448911950
2022-05-24 11:09:21 +01:00
hschlueter
df1b733d50 Combine multiple matrix transformations in one shader.
When using a MatrixTransformationFrameProcessor per transformation
matrix, each frame processor's shader applies the matrix to the
vertices and clips the result to the NDC range when drawing the
output frame.
This change combines consecutive MatrixTransformations into a single
MatrixTransformationFrameProcessor by multiplying the individual
matrices while updating and clipping the visible polygon after
each matrix and mapping the resulting visible polygon back to the
input space so that its vertices and the combined transformation
matrix can be used in the shader.

PiperOrigin-RevId: 448521068
2022-05-24 11:05:59 +01:00
ibaker
b9f1cb4b15 Fix warning about ambiguous @EnsuresNonNull annotation
```
[expression.parameter.name.shadows.field] The postcondition
EnsuresNonNull on the declaration of method 'setContentTimeline'
contains ambiguous identifier 'contentTimeline'. Use
"this.contentTimeline" for the field, or "#1" for the formal parameter.
  private void setContentTimeline(Timeline contentTimeline) {
               ^
```

PiperOrigin-RevId: 448285571
2022-05-24 11:02:32 +01:00
ibaker
938728ce00 Add DefaultMediaSourceFactory.{set,clear}LocalAdInsertionConfig
Deprecate the setAdsLoaderProvider and setAdViewProvider methods these
replace.

PiperOrigin-RevId: 448251423
2022-05-24 10:59:01 +01:00
samrobinson
800e533014 Increase test timeout for 4k60 regression test.
Pixel 5 was occasionally reaching the 2 minute limit.

PiperOrigin-RevId: 448244803
2022-05-24 10:55:20 +01:00
tonihei
3eb6f0e806 Remove network type test restrictions for API 29/30
Network type detection on these API levels couldn't be tested
yet because of a missing Robolectric feature. This was fixed by
the recent Robolectric upgrade and the restrictions can be removed.

This also requires to replicate the platform hack we rely on on
these API levels.

PiperOrigin-RevId: 448240431
2022-05-24 10:51:54 +01:00
claincly
010a00e458 Add support for static RTP payload types.
Some RTP foramts are statically assigned, so they don't have the rtpmap
attribute. Create the missing rtpmap attribute in this case.

PiperOrigin-RevId: 448239724
2022-05-24 10:48:29 +01:00
huangdarwin
dd365cbeb8 Transformer GL: Update test name reference.
The prior test does not exist, and is not a pixel test.

PiperOrigin-RevId: 448224929
2022-05-24 10:44:55 +01:00
hmzh
0948fd1cd8 Adds key functionality for basic MIDI synthesization
- Add a MidiRenderer skeleton with basic playback
- Add MidiDecoder with placeholder synthesizer (JSyn) impl
- Make MidiExtractor feed placeholder data
- Add Renderer extension loaders for MIDI

PiperOrigin-RevId: 448212797
2022-05-24 10:41:20 +01:00
hmzh
dce0db35f1 Refactor MIDI and Flac extractor loaders for deduplication
Add MIDI filetype information for use in the ExtractorsFactory

PiperOrigin-RevId: 447976272
2022-05-24 10:37:39 +01:00
samrobinson
d254967a85 Expose decoder name to analysis files.
PiperOrigin-RevId: 447950623
2022-05-24 10:34:20 +01:00
samrobinson
271cdbed35 Force encoding for the on-device regression tests.
transformWithDecodeEncode is now transformWithoutDecodeEncode,
to test the passthrough path.

PiperOrigin-RevId: 447796892
2022-05-24 10:30:55 +01:00
samrobinson
6ac1306ec2 Expose the codec name to the analysis files.
PiperOrigin-RevId: 447724152
2022-05-10 15:08:51 +01:00
ibaker
06d73e93e6 Don't implement Player.Listener from SubtitleView
We never register SubtitleView as a Player.Listener directly, it's
always done via PlayerView.

PiperOrigin-RevId: 447467037
2022-05-09 15:45:54 +01:00
hschlueter
f08fdf6ab2 Add listener for FrameProcessingExceptions.
This listener replaces
FrameProcessorChain#getAndRethrowBackgroundExceptions.
The listener uses a new exception type FrameProcessingException
separate from TransformationException as the frame processing
components will be made reusable outside of transformer soon.

PiperOrigin-RevId: 447455746
2022-05-09 14:46:53 +01:00
hschlueter
e89189e35f Fix GlUtil vector size constant name.
This constant is used for https://docs.gl/es2/glVertexAttribPointer
which takes the number of components per generic vertex attribute
(meaning the size of the individual coordinate vectors here) not the
number of attributes (the number of vertices that the old constant
name referred to).

PiperOrigin-RevId: 447427241
2022-05-10 18:02:20 +01:00
Rakesh Kumar
432ae9d38c
Merge branch 'main' into rtp-vp9 2022-05-09 13:27:46 +05:30
Rakesh Kumar
a1cff9af0d Fix review comment in RTPVp9Reader
Change-Id: I7e2d36eb3d69fb09e0d0bbc283d41165c69d4076
2022-05-09 13:20:26 +05:30
samrobinson
5df6a5815a Match the suggested bitrate to the actual Kush Gauge formula.
As defined in Kush Amerasinghe's paper 'H.264 For the rest of us'.

PiperOrigin-RevId: 446988272
2022-05-06 16:03:18 +01:00
aquilescanta
521e067807 Disable transcoding when reading content URIs
Before this change, we list the formats for which we don't
want transcoding. This change disables transcoding altogether.

This was tested by checking that transcoding takes place on a
short camera recording only when the added flag is not present
(and AndroidManifest does not declare support for HEVC).

PiperOrigin-RevId: 446986580
2022-05-06 15:54:21 +01:00
huangdarwin
7cf59642d5 Transformer GL: Remove obsolete TODOs.
We won't try to provide/rethrow helpful error messages that are already
provided by GL, as this sort of task would expand into writing a GL verifier.
A Gl verifier is unnecessarily complex for minimal payoff, especially as Apps
expected to read GL error messages would mostly be those writing custom
GlFrameProcessors, who should be already be familiar with reading GL error
messages anyways.

PiperOrigin-RevId: 446950837
2022-05-06 12:06:40 +01:00
ibaker
a0ac261873 Remove ExoPlayer's RawCcExtractor
RawCC is a Google-internal subtitle format, and is no longer used with
ExoPlayer.

PiperOrigin-RevId: 446950691
2022-05-06 12:05:37 +01:00
hschlueter
ff1305cd19 Remove redundant attribute from matrix transformation vertex shader.
The texture coordinates can be derived from the frame coordinates.

PiperOrigin-RevId: 446770538
2022-05-05 19:24:44 +01:00
yschimke
0f502b2a0e 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-05 09:15:06 +01:00
hschlueter
3701e80587 Use MatrixTransformation instead of wrapping its GlFrameProcssor.
ScaleToFitFrameProcessor, PresentationFrameProcessor,
and EncoderCompatibilityFrameProcessor now each implement
MatrixTransformation instead of wrapping
MatrixTransformationFrameProcessor.

PiperOrigin-RevId: 446480286
2022-05-04 17:40:33 +01:00
huangdarwin
3730c1e4d4 GL: Update exoplayer to use bindTexture.
Refactoring change only.

PiperOrigin-RevId: 446475708
2022-05-04 17:20:41 +01:00
christosts
e62338e871 Add TrackSelector.release()
The TrackSelector is released when the player is released. The
TrackSelector can be reused if TrackSelector.init() is called again.

PiperOrigin-RevId: 446439717
2022-05-04 14:33:50 +01:00
andrewlewis
ee3a183041 Add frame processor based on MediaPipe to demo
PiperOrigin-RevId: 446432695
2022-05-04 13:48:56 +01:00
olly
dec1d37618 Upgrade Robolectric dependency to 4.8.1
PiperOrigin-RevId: 446423017
2022-05-04 12:41:00 +01:00
ibaker
8bb11f3f2b Migrate usages of the deprecated TrackSelectionParameters.CREATOR
PiperOrigin-RevId: 446400192
2022-05-04 10:13:35 +01:00
hschlueter
0bba5c6329 Separate matrix effect specification and implementation.
This change splits AdvancedFrameProcessor into 4 files:
- MatrixTransformationFrameProcessor for the GlFrameProcessor
  implementation
- MatrixTransformation and GlMatrixTransformation for the GlEffect
  specification
- MatrixUtils for the static matrix helpers

PiperOrigin-RevId: 446236384
2022-05-03 18:58:59 +01:00
christosts
02d847f451 Misc fix on parameter comment
PiperOrigin-RevId: 446181877
2022-05-03 14:48:16 +01:00
christosts
c517d9ac7b Rollback of 8da8c5e781
*** Original commit ***

Upgrade Robolectric dependency to 4.8

***

PiperOrigin-RevId: 446175705
2022-05-03 14:09:37 +01:00
christosts
3830d02590 Use Android 12L APIs directly
Some APIs from Android 12L were used either via reflection or
constants values were hard-coded. We can now use these APIs directly
since we upgraded the compile SDK version to 32.

PiperOrigin-RevId: 446167543
2022-05-03 13:10:04 +01:00
ibaker
eb1dc508a5 Opt some more bits of the main demo app into the unstable API
PiperOrigin-RevId: 446161354
2022-05-09 13:30:13 +01:00
ibaker
33b049c104 Allow stable API users to bundle/unbundle TrackSelectionParameters
It's reasonable to serialize this type to support backgrounding
use-cases, as demonstrated by the main demo app.

PiperOrigin-RevId: 446161300
2022-05-09 12:03:58 +01:00
ibaker
1809a0b9f9 Migrate usages from C.TYPE_* to C.CONTENT_TYPE_*
PiperOrigin-RevId: 446156308
2022-05-09 12:00:38 +01:00
hschlueter
76627d7138 Introduce GlEffect interface for effect specification.
PiperOrigin-RevId: 446143537
2022-05-09 11:53:52 +01:00