13370 Commits

Author SHA1 Message Date
hschlueter
4c5e266829 Make transformer demo configuration options scrollable.
On devices with a smaller screen / low resolution not all
options fit, so scrolling is needed.

PiperOrigin-RevId: 425635224
2022-02-02 10:40:13 +00:00
olly
319ef63510 Use ImmutableMap.Builder.buildOrThrow() instead of deprecated build().
More info: ​go/immutable-map-buildorthrow-lsc

NOTE: if the source of truth for this code is *NOT* `third_party`, please let me know and I'll revert this CL (and please consider upstreaming this change yourself).

#inlineme

Tested:
    TAP for global presubmit queue passed after automated deflaking of failures: http://mondo/deflaker/run/530857d2-45cb-4069-a234-48c5efe945f1 http://mondo/deflaker/run/0dce4296-e6bb-42d2-8b64-b393f45b6ad3
    http://test/OCL:425453729:BASE:425451020:1643699365244:811c1a24
PiperOrigin-RevId: 425616165
2022-02-02 10:36:25 +00:00
claincly
d767be4ca6 Add format fallback ranking.
Introduce an interface EncoderSelector for developers to filter out unwanted
encoders.

PiperOrigin-RevId: 425611421
2022-02-02 10:32:50 +00:00
tonihei
fc528ebed7 Avoid creating empty playback metrics
In some cases we create empty playback metrics with no corresponding
events (e.g. when an app seeks to a new media item and immediately
releases the player). There is no benefit in having completely empty
metrics entries, so it's cleaner to not report them in such cases.

#minor-release

PiperOrigin-RevId: 425609010
2022-02-02 10:29:12 +00:00
huangdarwin
2848240a8c Update gradle wrapper
To fix transformer demo + Nexus emulator bug.

#minor-release

PiperOrigin-RevId: 425603703
2022-02-02 10:25:43 +00:00
olly
29a6280b1b Rewrite EventLogger to use new track APIs
PiperOrigin-RevId: 425595951
2022-02-02 10:22:05 +00:00
bachinger
30feb077a0 Update gradle and gradle plugin
#minor-release

PiperOrigin-RevId: 425589448
2022-02-02 10:18:17 +00:00
andrewlewis
7c8f6d5d69 Add support for experimenting with HDR
- Add a checkbox in the demo app to enable experimental HDR editing.
- Add an `experimental_` method to `TransformationRequest` to enable HDR editing.
- Add fragment/vertex shaders for the experimental HDR pipeline. The main difference compared to the existing shaders is that we sample from the decoder in YUV rather than RGB (because the YUV -> RGB conversion in the graphics driver is not precisely defined, so we need to do this to get consistent results), which requires the use of ES 3, and then do a crude YUV -> RGB conversion in the shader (ignoring the input color primaries for now).
- When HDR editing is enabled, we force using `FrameEditor` (no passthrough) to avoid the need to select another edit operation, and use the new shaders. The `EGLContext` and `EGLSurface` also need to be set up differently for this path.

PiperOrigin-RevId: 425570639
2022-02-02 10:04:32 +00:00
kimvde
327df95f6f Add SpeedChangingAudioProcessor
PiperOrigin-RevId: 425562875
2022-02-02 10:04:32 +00:00
ibaker
4020f69596 Publish the ImaServerSideAdInsertionMediaSource
Issue: google/ExoPlayer#8213

#minor-release

PiperOrigin-RevId: 425381474
2022-02-02 10:04:32 +00:00
huangdarwin
ab0cbbea47 Transformer Demo: Remove unneeded external storage permission
Tested by confirming transformations still work and write to a output file in a
scoped-storage directory on a:
* Nexus 6P API 23 emulator
* Google Pixel 4 API 31 physical device

PiperOrigin-RevId: 425644266
2022-02-01 18:23:39 +00:00
hschlueter
aec92606a8 Make transformer demo configuration options scrollable.
On devices with a smaller screen / low resolution not all
options fit, so scrolling is needed.

PiperOrigin-RevId: 425635224
2022-02-01 18:22:27 +00:00
olly
cb81b04dab Use ImmutableMap.Builder.buildOrThrow() instead of deprecated build().
More info: ​go/immutable-map-buildorthrow-lsc

NOTE: if the source of truth for this code is *NOT* `third_party`, please let me know and I'll revert this CL (and please consider upstreaming this change yourself).

#inlineme

Tested:
    TAP for global presubmit queue passed after automated deflaking of failures: http://mondo/deflaker/run/530857d2-45cb-4069-a234-48c5efe945f1 http://mondo/deflaker/run/0dce4296-e6bb-42d2-8b64-b393f45b6ad3
    http://test/OCL:425453729:BASE:425451020:1643699365244:811c1a24
PiperOrigin-RevId: 425616165
2022-02-01 18:21:37 +00:00
tonihei
c5b7e7b258 Fix session demo gradle build when used with a prefix
#minor-release

PiperOrigin-RevId: 425613253
2022-02-01 18:20:19 +00:00
claincly
279b4fc5dd Add format fallback ranking.
Introduce an interface EncoderSelector for developers to filter out unwanted
encoders.

PiperOrigin-RevId: 425611421
2022-02-01 18:19:09 +00:00
hschlueter
7df544d6cd Rename TransformerTest to TransformerEndToEndTest.
TransformerTest sounds like a unit test for Transformer but these
tests test behaviour that involves multiple stages of the pipeline.

PiperOrigin-RevId: 425378369
2022-02-01 14:40:54 +00:00
kimvde
75d370d97b Clarify Javadoc of AudioProcessor.queueInput
PiperOrigin-RevId: 425341138
2022-02-01 14:37:05 +00:00
tonihei
aef808cb91 Avoid creating empty playback metrics
In some cases we create empty playback metrics with no corresponding
events (e.g. when an app seeks to a new media item and immediately
releases the player). There is no benefit in having completely empty
metrics entries, so it's cleaner to not report them in such cases.

#minor-release

PiperOrigin-RevId: 425609010
2022-02-01 14:36:36 +00:00
huangdarwin
45cbfd2977 Update gradle wrapper
To fix transformer demo + Nexus emulator bug.

#minor-release

PiperOrigin-RevId: 425603703
2022-02-01 14:35:50 +00:00
olly
f28de9de60 Rewrite EventLogger to use new track APIs
PiperOrigin-RevId: 425595951
2022-02-01 14:35:06 +00:00
olly
3871396070 Update session translations
PiperOrigin-RevId: 425589473
2022-02-01 14:34:19 +00:00
bachinger
e4cfb925cb Update gradle and gradle plugin
#minor-release

PiperOrigin-RevId: 425589448
2022-02-01 14:33:36 +00:00
krocard
dc83de997a Make DRM code removable from ProgressiveMediaSource
Add a constructor that takes a DrmSessionManagerProvider.
This allows R8 to strip the default implementation.

#minor-release

PiperOrigin-RevId: 425330083
2022-02-01 14:33:19 +00:00
andrewlewis
dd83eca7d4 Add support for experimenting with HDR
- Add a checkbox in the demo app to enable experimental HDR editing.
- Add an `experimental_` method to `TransformationRequest` to enable HDR editing.
- Add fragment/vertex shaders for the experimental HDR pipeline. The main difference compared to the existing shaders is that we sample from the decoder in YUV rather than RGB (because the YUV -> RGB conversion in the graphics driver is not precisely defined, so we need to do this to get consistent results), which requires the use of ES 3, and then do a crude YUV -> RGB conversion in the shader (ignoring the input color primaries for now).
- When HDR editing is enabled, we force using `FrameEditor` (no passthrough) to avoid the need to select another edit operation, and use the new shaders. The `EGLContext` and `EGLSurface` also need to be set up differently for this path.

PiperOrigin-RevId: 425570639
2022-02-01 14:30:16 +00:00
kimvde
d6d1a7d485 Add SpeedChangingAudioProcessor
PiperOrigin-RevId: 425562875
2022-02-01 14:30:16 +00:00
ibaker
80c786beee Publish the ImaServerSideAdInsertionMediaSource
Issue: google/ExoPlayer#8213

#minor-release

PiperOrigin-RevId: 425381474
2022-02-01 14:30:16 +00:00
krocard
82ee82635b Retry AudioTrack with smaller buffer if > 1M
Some phone with limited memory can't allocate bigger
shared memory buffers.
This might or might not be related to Binder's 1M
transaction limit.

Tested on Pixel 4 by setting the minimum buffer size to
1h.

https://github.com/google/ExoPlayer/issues/9712

#minor-release

PiperOrigin-RevId: 425324536
2022-02-01 14:29:36 +00:00
bachinger
bdd64ce6a1 Setup VOD cue points to fill them when loaded
This makes sure the number of ads in an ad group matches to the number of periods representing an ad group in a multi-period timeline. This makes it easier to accurately mark ads as played in multi-period windows which is needed to correctly prevent seeking over unplayed ads.

PiperOrigin-RevId: 425317085
2022-02-01 14:26:06 +00:00
hschlueter
3ec41e2b71 Fix processing remaining FrameEditor input after decoder has ended.
If
  a) the end of stream buffer arrives with a frame rather than an
     empty buffer or
  b) processDataV29() renders several decoder output buffers to the
     FrameEditor's input Surface immediately before encountering the
     EOS flag
these frames were previously stuck in the FrameEditor's input Surface
and never fed to the encoder.

PiperOrigin-RevId: 424898820
2022-02-01 14:22:39 +00:00
hschlueter
107ffdf56f Add emulator video transcoding test that counts frames.
This test tests that all frames are processed when transcoding
video to a different sample MIME type (and that the transformation
completes successfully).

PiperOrigin-RevId: 424896014
2022-02-01 14:18:58 +00:00
hschlueter
81b194b28b Rename TransformerTest to TransformerEndToEndTest.
TransformerTest sounds like a unit test for Transformer but these
tests test behaviour that involves multiple stages of the pipeline.

PiperOrigin-RevId: 425378369
2022-02-01 14:16:32 +00:00
christosts
a26d7b821c Rename MediaNotificationHandler to MediaNotificationManager
PiperOrigin-RevId: 425359015
2022-02-01 14:15:22 +00:00
andrewlewis
3023385574 Switch from valueOf to parse methods
This fixes some warnings that show up in Android Studio (due to using methods
that autobox unnecessarily).

PiperOrigin-RevId: 424892352
2022-02-01 14:15:21 +00:00
kimvde
23ef7b111e Clarify Javadoc of AudioProcessor.queueInput
PiperOrigin-RevId: 425341138
2022-02-01 14:14:32 +00:00
krocard
d4eb1edff6 Make DRM code removable from ProgressiveMediaSource
Add a constructor that takes a DrmSessionManagerProvider.
This allows R8 to strip the default implementation.

#minor-release

PiperOrigin-RevId: 425330083
2022-02-01 14:13:41 +00:00
krocard
40517200fc Retry AudioTrack with smaller buffer if > 1M
Some phone with limited memory can't allocate bigger
shared memory buffers.
This might or might not be related to Binder's 1M
transaction limit.

Tested on Pixel 4 by setting the minimum buffer size to
1h.

https://github.com/google/ExoPlayer/issues/9712

#minor-release

PiperOrigin-RevId: 425324536
2022-02-01 14:12:37 +00:00
tonihei
022b5144b1 Add getRenderer method to ExoPlayer.
This allows access to custom renderers, for example to send messages
or to access custom fields and methods.

PiperOrigin-RevId: 424878963
2022-02-01 14:11:36 +00:00
bachinger
afc3a79e10 Setup VOD cue points to fill them when loaded
This makes sure the number of ads in an ad group matches to the number of periods representing an ad group in a multi-period timeline. This makes it easier to accurately mark ads as played in multi-period windows which is needed to correctly prevent seeking over unplayed ads.

PiperOrigin-RevId: 425317085
2022-02-01 14:11:35 +00:00
hschlueter
a49a7d72e1 Fix processing remaining FrameEditor input after decoder has ended.
If
  a) the end of stream buffer arrives with a frame rather than an
     empty buffer or
  b) processDataV29() renders several decoder output buffers to the
     FrameEditor's input Surface immediately before encountering the
     EOS flag
these frames were previously stuck in the FrameEditor's input Surface
and never fed to the encoder.

PiperOrigin-RevId: 424898820
2022-02-01 14:10:45 +00:00
hschlueter
afc10c79eb Add emulator video transcoding test that counts frames.
This test tests that all frames are processed when transcoding
video to a different sample MIME type (and that the transformation
completes successfully).

PiperOrigin-RevId: 424896014
2022-02-01 14:09:43 +00:00
andrewlewis
195d05dabd Switch from valueOf to parse methods
This fixes some warnings that show up in Android Studio (due to using methods
that autobox unnecessarily).

PiperOrigin-RevId: 424892352
2022-02-01 14:08:57 +00:00
Haruki Hasegawa
1074078d2b
Fix build error when androidxMediaModulePrefix is specified
When the media3 modules are referred from an external project and
gradle.ext.androidxMediaModulePrefix is specified, build error occurs
like the following.

> gradle.ext.androidxMediaModulePrefix = "media-"

> A problem occurred evaluating project ':media-lib-common'.
> > Project with path ':media-media-lib-cast' could not be found in project ':media-lib-common'.

As you can see, the build script of the common module is trying to
use an incorrect named project which has duplicated prefixes.
2022-01-30 17:42:32 +09:00
tonihei
2521ee6d9f Add getRenderer method to ExoPlayer.
This allows access to custom renderers, for example to send messages
or to access custom fields and methods.

PiperOrigin-RevId: 424878963
2022-01-28 16:52:10 +00:00
olly
596d98a048 Shorten logging tag to required length
PiperOrigin-RevId: 424858504
2022-01-28 16:51:06 +00:00
claincly
d68b790077 Rollback of 2ed1deb52d
*** Original commit ***

Apply suggested AVC profile depending on the API version.

***

PiperOrigin-RevId: 424856077
2022-01-28 16:49:54 +00:00
andrewlewis
ce4a028829 Publish the transformer demo app
PiperOrigin-RevId: 424850283
2022-01-28 16:48:06 +00:00
tonihei
857c18b2e9 Remove opt-out for suppressing wrong thread usage error.
Enforcing the correct thread usage has been enabled since 2.13.0.
Opting-out of this enforement is dangerous as it can hide very hard
to debug bugs.

PiperOrigin-RevId: 424815808
2022-01-28 16:29:20 +00:00
claincly
9151103968 Rollback of 651fa0dbb7
*** Original commit ***

Apply suggested AVC profile depending on the API version.

***

PiperOrigin-RevId: 424856077
2022-01-28 14:43:54 +00:00
andrewlewis
b81568f836 Publish the transformer demo app
PiperOrigin-RevId: 424850283
2022-01-28 14:37:15 +00:00
tonihei
174d99481a Remove opt-out for suppressing wrong thread usage error.
Enforcing the correct thread usage has been enabled since 2.13.0.
Opting-out of this enforement is dangerous as it can hide very hard
to debug bugs.

PiperOrigin-RevId: 424815808
2022-01-28 14:33:43 +00:00