49 Commits

Author SHA1 Message Date
olly
8a9dcadef3 README updates for misc modules
PiperOrigin-RevId: 402292139
2021-10-12 19:40:44 +01:00
olly
69f2692389 Register modules with common
PiperOrigin-RevId: 402267733
2021-10-11 14:18:37 +01:00
olly
e7c6ed5e7f Mechanical README cleanups
PiperOrigin-RevId: 401767060
2021-10-09 18:14:36 +01:00
ibaker
e4221c3844 Rollback of ed23b2905b
*** Original commit ***

Migrate callers of ExoPlayer.Builder#build() to buildExoPlayer()

An upcoming change will update build() to return Player.

PiperOrigin-RevId: 401468532
2021-10-07 21:53:57 +01:00
huangdarwin
03ff5b6618 Transformer: Add TranscodingTransformer.
Temporary file copy of Transformer, which uses
TransformerTranscodingVideoRenderer instead of
TransformerMuxingVideoRenderer to transform files. This allows devs to test
transcoding more easily using the Transformer demo, while external engineers
continue to see the completely working Muxing-based transformer.

In the future, this will replace the Transformer class.

PiperOrigin-RevId: 401020893
2021-10-05 23:33:55 +01:00
claincly
3eda590c87 Rollback of 9788750ddb
*** Original commit ***

Simplify GL program handling.

***

PiperOrigin-RevId: 400970170
2021-10-05 23:24:48 +01:00
krocard
ac881be2fc Add TracksInfo to the Player API
TracksInfo is very similar to
`MappingTrackSelector.MappedTracksInfo` with some
fields removed to simplify the Player API,
notably it doesn't expose the renderer concept.

A significant difference is the addition of a `selected` boolean
field which avoids having a separate `getCurrentTrackSelection`
API.

This cl is a part of the bigger track selection change,
splitted for ease of review.

In particular, the MediaSession implementation and UI usage
have been slitted in child cls.

Find all cls with the tag:
#player-track-selection

PiperOrigin-RevId: 400937124
2021-10-05 23:15:16 +01:00
claincly
9788750ddb Simplify GL program handling.
PiperOrigin-RevId: 400697945
2021-10-04 15:34:43 +01:00
claincly
c810309775 Validate input format.
The format should have the following fields set (as specified in the javadoc):

- width
- height
- frame rate, and
- averageBitrate.

PiperOrigin-RevId: 400204510
2021-10-04 11:46:23 +01:00
claincly
d4343ed858 Allow configuring encoder.
PiperOrigin-RevId: 400151886
2021-10-01 11:23:17 +01:00
ibaker
ed23b2905b Migrate callers of ExoPlayer.Builder#build() to buildExoPlayer()
An upcoming change will update build() to return Player.

PiperOrigin-RevId: 399382297
2021-09-28 16:38:20 +01:00
kimvde
a82690a533 Use SurfaceTexture.getTimestamp
PiperOrigin-RevId: 399139842
2021-09-28 16:30:12 +01:00
ibaker
ad99a44083 Add empty sdk-version node to all AndroidManifest.xml files
PiperOrigin-RevId: 397772916
2021-09-21 14:17:33 +01:00
kimvde
416ec75b94 Add factory methods to create MediaCodecAdapter.Configuration
#exofixit

PiperOrigin-RevId: 396793873
2021-09-16 12:03:30 +01:00
andrewlewis
469c0e756a Use @C.TrackType more widely
Also add `TYPE_USE` target on the @IntDef (and fix @Targets for other
@IntDefs).

#exofixit

PiperOrigin-RevId: 396333212
2021-09-14 12:04:11 +01:00
kimvde
b6e0ade939 Rename transformer renderer methods to make them match
#exofixit

PiperOrigin-RevId: 395479329
2021-09-08 17:20:25 +01:00
kimvde
9991f14643 Add Open GL step to Transformer
PiperOrigin-RevId: 394708737
2021-09-06 14:58:25 +01:00
kimvde
882957228c Fix errors in Transformer demo
PiperOrigin-RevId: 393951084
2021-09-02 09:36:44 +01:00
kimvde
a1ec56a157 Add basic shaders to Transformer
PiperOrigin-RevId: 393381694
2021-09-02 09:31:09 +01:00
kimvde
9b2cd6a4e9 Fix NPE in TransformerTranscodingVideoRenderer
The NPE was caused by the fact that the encoder surface was passed to
the decoder before configuring the encoder.

PiperOrigin-RevId: 393349794
2021-08-27 16:45:06 +01:00
claincly
58e5ed0afb Fix transcoding drops a few frames.
In the old version, the transcoder uses decoder.isEnded() alone as the criteria
to stop the encoding/muxing process. It's rectified to:

- On decoder ending, signal the encoder of EOS after writing all decoded frames to it.
- On encoder ending, write end track to muxer.

PiperOrigin-RevId: 393322114
2021-08-27 16:43:21 +01:00
kimvde
f574ec952a Make TransformerTranscodingVideoRenderer support API < 23
PiperOrigin-RevId: 393100075
2021-08-27 16:36:09 +01:00
bachinger
1d36083e25 Replace fully qualified link annotation
PiperOrigin-RevId: 393081803
2021-08-26 11:09:06 +01:00
kimvde
b42aa4c8dd Rename TransformerVideoRenderer
The new name indicates the difference with the
TransformerTranscodingVideoRenderer.

PiperOrigin-RevId: 393074749
2021-08-26 11:07:24 +01:00
kimvde
60681b9783 Add onReset implementation to TransformerTranscodingVideoRenderer
PiperOrigin-RevId: 392468554
2021-08-23 22:58:00 +01:00
claincly
4ef0355884 Prototype video transcoding
The prototype is built upon Transformer and took many references from
TransformerAudioRenderer.

Please take a look and we can discuss more details.

PiperOrigin-RevId: 390192487
2021-08-12 16:30:21 +01:00
kimvde
01613a2e55 Remove usages of deprecated SimpleExoPlayer.Builder
PiperOrigin-RevId: 390130681
2021-08-11 17:34:19 +01:00
kimvde
9e798a647e Miscalleneous small fixes in Transformer
PiperOrigin-RevId: 388911857
2021-08-06 15:56:01 +01:00
aquilescanta
a302e34992 Remove ExoPlaybackException factory method that doesn't take errorCode
PiperOrigin-RevId: 383379334
2021-07-09 09:10:19 +01:00
ibaker
0df0df9aee Remove @DoNotInstrument from test classes
This isn't needed now we've updated to Robolectric 4.6

PiperOrigin-RevId: 383109343
2021-07-09 08:58:38 +01:00
aquilescanta
89fe0d0cf9 Make AnalyticsListener.onPlayerError take a PlaybackException
NO_EXTERNAL

PiperOrigin-RevId: 377090819
2021-06-03 13:49:28 +01:00
kimvde
fc47c2fe86 Add missing @DoNotInstrument annotations
PiperOrigin-RevId: 377006047
2021-06-02 18:13:19 +01:00
bachinger
4c1a294b2e Format Java source files
PiperOrigin-RevId: 372127633
2021-05-06 13:32:25 +01:00
olly
32c5ea0643 Adds Format to MediaCodecAdapter.Configuration.
PiperOrigin-RevId: 369444747
2021-04-21 09:48:46 +01:00
olly
7a13163664 MediaCodecAdapter.Factory creates a started Adapter.
This change moves the responsibility of creating, configuring and starting the MediaCodec from the MediaCodecRender to the MediaCodecAdapter.Factory.

This move allows ExoPlayer's client to decide how and when codecs are created and/or reused.

To allow the move, this CL replaces MediaCodecRenderer.ConfigureCodec with MediaCodecRenderer.getCodecConfiguration

PiperOrigin-RevId: 369273887
2021-04-20 00:10:36 +01:00
olly
2d9177b7c2 SampleStream/SampleQueue: Introduce read flags
- SampleQueue.peek is replaced with SampleQueue.read with
  FLAG_PEEK. This also exposes peek functionality through
  SampleStream.
- Use of DecoderInputBuffer.isFlagsOnly is replaced with
  FLAG_OMIT_SAMPLE_DATA. This flag can be used with or
  without FLAG_PEEK, where-as previously the read position
  would never be advanced for an isFlagsOnly buffer.
- formatRequired is replaced with FLAG_FORMAT_REQUIRED.

PiperOrigin-RevId: 363460105
2021-03-24 18:03:28 +00:00
tonihei
31f65f63ff Remove AutoAdvancingFakeClock.
The class is just an empty shell around the super class and can be
removed.

PiperOrigin-RevId: 363386440
2021-03-24 18:03:18 +00:00
aquilescanta
f8505204cc Move MediaFormatUtil into common
Also move out of the mediacodec package into the util package.

PiperOrigin-RevId: 356949401
2021-02-12 16:39:28 +00:00
kimvde
d21a47c4f1 Transformer: remove SpeedProvider interface from Javadoc
#minor-release

PiperOrigin-RevId: 356221487
2021-02-09 13:59:07 +00:00
kimvde
da52de669c Avoid skipping the first decoder output buffers after speed change
#minor-release

PiperOrigin-RevId: 355652144
2021-02-04 18:14:35 +00:00
kimvde
46b8b069ca Transformer: set audio decoder max input size
#minor-release

PiperOrigin-RevId: 354949992
2021-02-01 18:12:14 +00:00
kimvde
1ec326438f Merge MuxerWrapper stop() and release() methods
#minor-release

PiperOrigin-RevId: 354938190
2021-02-01 18:12:05 +00:00
andrewlewis
b9065e8dfa Simplify output buffer handling in transformer
We can dequeue as part of getting output buffers (or output buffer info) in
`MediaCodecAdapterWrapper`, which simplifies the caller slightly.

Also try to make minor clarifications in method naming in
`TransformerAudioRenderer`.

#minor-release

PiperOrigin-RevId: 354890796
2021-02-01 18:11:42 +00:00
andrewlewis
91dcf39db5 Simplify feeding codec input in transformer
The caller knows whether it's queued end-of-stream, so we can remove the return
value of the method.

#minor-release

PiperOrigin-RevId: 354888298
2021-02-01 18:11:33 +00:00
andrewlewis
c3bce234ca Improve format propagation in transformer
- Store output format in `MediaCodecAdapterWrapper` when we get a format from
  the codec, instead of creating it on demand.
- Make format building code not audio-specific.
- Remove `MediaCodecAdapterWrapper.getConfigFormat` and instead keep track of
  the input/output formats in the renderer. This will mean that the code still
  works if an audio processor changes the audio format in future.
- Make exceptions thrown during audio rendering use the same (input) renderer
  format.
- Misc other minor cleanup.

#minor-release

PiperOrigin-RevId: 354556619
2021-02-01 18:11:04 +00:00
andrewlewis
afb41123c2 Switch transformer tests to use dump files
Add an interface to muxers to allow tests to pass a dumpable muxer.

#minor-release

PiperOrigin-RevId: 354543388
2021-02-01 18:10:55 +00:00
tonihei
2e52c0b8d8 Make FakeClock fully deterministic.
This is achieved by only triggering one message at a time. After
triggering a message we send another to ourselves to know when the
following message can be triggered.

Other required changes:
 - The messages need to be sorted correctly (by time and creation order)
 - To prevent deadlocks when one thread is waiting for another,
   we need to add new method to Clock to indicate that the current
   thread is about to wait. This then allows us to trigger messages
   from other threads in FakeClock.
 - AnalyticsCollectorTest needed some adjustments:
   - onTimelineChanged now deterministically arrives after the initial
     timline is already known, so some of the period information changes
     from window only to full period info.
   - The playlistOperations test suffers from a bug that the first frame
     is rendered too early and that's why we now get additional events.

PiperOrigin-RevId: 353877832
2021-01-26 17:13:35 +00:00
andrewlewis
b1df2f4e4b Elaborate method comments in transformer audio renderer
#minor-release

PiperOrigin-RevId: 353856211
2021-01-26 15:59:06 +00:00
kimvde
abccbcf247 Publish transformer module
PiperOrigin-RevId: 353254249
2021-01-22 17:13:47 +00:00