1038 Commits

Author SHA1 Message Date
olly
2209947acb Add decoder instantiation tracing
This is just for consistency with our other renderers

PiperOrigin-RevId: 303317443
2020-03-27 23:32:37 +00:00
olly
25e0d30760 Consistency fixes for FFmpeg extension instructions
PiperOrigin-RevId: 303316976
2020-03-27 23:32:29 +00:00
olly
9be4c08459 FFmpeg extension cleanup
PiperOrigin-RevId: 303298804
2020-03-27 23:32:11 +00:00
olly
b314da5f02 Rename FfmpegDecoder to FfmpegAudioDecoder
It looks like the video path will use a separate FfmpegVideoDecoder

Issue: #2159
PiperOrigin-RevId: 303068617
2020-03-27 23:31:03 +00:00
olly
dd54259d47 [ExoV2 + Ambisonic] Adds ambisonic audio support to ExoV2.
Defines a new no_native_gvr build rule in ExoPlayerV2 that doesn't depend on the shared object in the VR sdk.

PiperOrigin-RevId: 302945930
2020-03-27 23:30:55 +00:00
bachinger
d0fc83ed8a Playlist API: move media item based API to Player
This moves the playlist API methods to the Player interface. Implementation is moved from ExoPlayerImpl to BasePlayer where possible.

Further the CastPlayer is changed to implement the Player interface. Proper migration of the Playermanager to not use the ConcatenatingMediaSource anymore follows in a separate, future CL.

PiperOrigin-RevId: 302937779
2020-03-27 23:30:46 +00:00
andrewlewis
7addc23ed4 Remove unused field in ImaAdsLoader
PiperOrigin-RevId: 302684221
2020-03-25 13:05:41 +00:00
olly
dc33c0bdfb Improve logging II
- Show renderers with no tracks in EventLogger track logging
- Log renderer names in EventLogger track logging
- Add useful message to ExoPlaybackException instances (including
  renderer name for renderer errors)

PiperOrigin-RevId: 302421616
2020-03-25 13:03:12 +00:00
olly
429bdfb974 Improve logging
- Make sure logging of UnknownHostException indicates the failure reason
- Indent stack traces inside event blocks in EventLogger
- Don't log media URLs

PiperOrigin-RevId: 302007601
2020-03-20 12:49:20 +00:00
olly
818925d4a7 Add shell for FfmpegVideoRenderer
Issue: #2159
PiperOrigin-RevId: 301705371
2020-03-19 00:50:55 +00:00
olly
0a274946ac Simplify extension video renderers
- This change also adds support for VideoFrameMetadataListener in the
  AV1 renderer
- This is a preliminary step prior to adding FfmpegVideoDecoder

Issue: #2159
PiperOrigin-RevId: 301702460
2020-03-19 00:50:47 +00:00
olly
ee6afe5eb9 Merge AudioDecoderException and VideoDecoderException
This is a necessary step for Decoder implementations to support
audio and video. MediaCodecRenderer.DecoderException is renamed
MediaCodecDecoderException and extends the new DecoderException

Issue: #2159
PiperOrigin-RevId: 301698238
2020-03-19 00:50:39 +00:00
olly
cbe99ec475 Make SimpleDecoderXRenderers work with any Decoder implementation
The restriction that these classes only work with SimpleDecoders
is unnecessary. An FfmpegVideoRenderer will not be able to use a
SimpleDecoder, because the SimpleDecoder assumption that each input
buffer can be decoded immediately into a corresponding output is
not true for all video codecs that Ffmpeg supports (e.g., H264 does
not have this property). Generalizing SimpleDecoderVideoRenderer to
DecoderVideoRenderer will allow FfmpegVideoRenderer to still use
the base class, without having to use a SimpleDecoder.

This is a preliminary change toward being able to merge a version
of https://github.com/google/ExoPlayer/pull/7079.

Issue: #2159
PiperOrigin-RevId: 301412344
2020-03-19 00:49:58 +00:00
ibaker
13ffb9c684 Add a comment explaining the null check in DefaultMediaItemConverter
Follow-up to 42b8fe2681

PiperOrigin-RevId: 301352557
2020-03-19 00:49:02 +00:00
olly
b7a5ace4be Make FfmpegLibrary H264/HEVC aware
Issue: #2159
PiperOrigin-RevId: 301351495
2020-03-19 00:48:46 +00:00
olly
235c631136 FfmpegAudioRenderer should use UNSUPPORTED_TYPE for non-audio formats
Issue: #2159
PiperOrigin-RevId: 301345559
2020-03-19 00:48:38 +00:00
ibaker
42b8fe2681 Fix null-check failure in DefaultMediaItemConverter
PiperOrigin-RevId: 301336818
2020-03-19 00:48:30 +00:00
bachinger
510f5edd1d Remove cast media item
PiperOrigin-RevId: 301224632
2020-03-19 00:48:22 +00:00
olly
2f91c12f56 Drop prefix test- from test methods under v2/extensions
This is one step toward following the google3's test naming convention.
See go/java-testing/getting_started#basic-test-template for details
why prefix test isn't necessary.

This CL is generated by following command
$ find -name '*Test.java' | xargs -I{} sed -i 's/^\ \ public\ void\ test\([A-Z]\)\(.*\)$/  public void \L\1\E\2/' {}

PiperOrigin-RevId: 300530329
2020-03-19 00:46:24 +00:00
bachinger
527563da31 remove deprecated usage of PlaybackParameter
Removes usage of PlaybackParameters where it seems to be trivial.

PiperOrigin-RevId: 300435199
2020-03-19 00:45:18 +00:00
bachinger
683cb0260e add get/setPlaybackSpeed and listener callback
This change deprecates the PlaybackParameters and remove the skipSilenceField from the PlaybackParameters. This implies that enabling and disabling skipping silences needs to be done on the Player.AudioComponent after this change.

After submission of the change, all Player API changes are done which are required to bring playbackSpeed and skipSilenceEnabled in the converged Player API state.

PiperOrigin-RevId: 300420843
2020-03-19 00:45:01 +00:00
krocard
fdf35776f8 Add support for x86_64 for the ffmpeg extension
Requested by https://github.com/google/ExoPlayer/issues/7058.
Additionally move one of the common option in COMMON_OPTIONS.

PiperOrigin-RevId: 299862479
2020-03-10 10:21:29 +00:00
aquilescanta
47b62e8c02 DataReader: replace InterruptedException with InterruptedIOException
PiperOrigin-RevId: 299092243
2020-03-10 10:19:45 +00:00
tonihei
b5976a55ff Upgrade Kotlin annotations and fix gradle warnings
The new version fixes some warnings in Gradle builds. Also
add missing indirect compileOnly dependencies to fix some more warnings

Issue:issue:#7007
PiperOrigin-RevId: 298855510
2020-03-10 10:19:19 +00:00
tonihei
8b9f7c5628 Add test to ensure AdsLoader is initialized.
This tests explicitly that initialization happens even if the Timeline
is a placeholder.

No other change is needed. While the Timeline is still a placeholder
ImaAdsLoader.getCurrentPeriodPosition will return 0 and trigger
pre-rolls (intended behaviour) and it doesn't matter whether the
actual initial period position may be somewhere else.

PiperOrigin-RevId: 298833867
2020-03-10 10:18:54 +00:00
andrewlewis
470ec9e5d1 Init the ads manager for placeholder timelines
It looks like loading ad cue points would cause a source info refresh
causing the content media period load to be canceled, meaning we would
never get a non-placeholder timeline.

This changes ensures that the ads manager will still be initialized,
avoiding playback getting stuck when playing a ProgressiveMediaPeriod
with a preroll ad.

PiperOrigin-RevId: 298814758
2020-03-10 10:18:13 +00:00
Oliver Woodman
aeea17dd0f Merge pull request #6999 from xufuji456:dev-v2
PiperOrigin-RevId: 298544278
2020-03-10 10:17:13 +00:00
olly
67b29bbe39 Format.Builder: Finish migration
Issue: #5978
PiperOrigin-RevId: 297876336
2020-02-28 18:43:04 +00:00
olly
3730639c95 Don't set decoded bitrate on audio/flac format
PiperOrigin-RevId: 297864386
2020-02-28 18:42:39 +00:00
tonihei
ffdc5805bd Remove dependency on legacy Robolectric Looper mode
The default will soon change to Looper mode PAUSED. Some parts of our code
relies on the legacy behaviour when setting set SystemClock and expecting
pending messages to be delivered. With the new mode, we need to explicitly
request to idle the main looper so that pending messages can be delivered.

PiperOrigin-RevId: 297814964
2020-02-28 18:42:22 +00:00
tonihei
697165ce56 Enable window-period offset in tests by default.
This ensures all player interactions in tests automatically verify that
timestamps calculations are done correctly.

PiperOrigin-RevId: 297813324
2020-02-28 18:41:56 +00:00
tonihei
3b1b2951e4 Clarify/fix position reference points for AdPlaybackState.
The positions were interchangeably used with window and period
positions. This change more clearly ensures that all positions in the
AdPlaybackState are based on periods and that we use the right adjustments
for all usages.

PiperOrigin-RevId: 297811633
2020-02-28 18:41:22 +00:00
olly
c6a6e0d6f3 Migrate various call sites to Format.Builder
PiperOrigin-RevId: 297562889
2020-02-27 17:15:34 +00:00
kimvde
52825a272d Rename FLAC dump files based on output instead of language
PiperOrigin-RevId: 297336461
2020-02-27 17:15:11 +00:00
vigneshv
ba58a5217d Add ReleaseInputBuffer callback
The release_input_buffer callback will be called when the library
is done consuming an "input buffer". The buffer passed into
EnqueueFrame must be kept valid until this callback is called. If
frame parallel is false, then this callback can be nullptr (in
this case the buffer has to be kept valid until the next call to
DequeueFrame). If frame parallel is true, this callback cannot be
nullptr.

PiperOrigin-RevId: 296276083
2020-02-25 21:22:56 +00:00
olly
47133f46cb Keep method signature together when overriding
Not important, but when overriding a method that can return null,
it seems preferable to put @Override first, followed by what it's
overriding (which includes the @Nullable).

Also remove explicit @NonNull use in the core library. @NonNull is
propagated by default, so this is redundant.

PiperOrigin-RevId: 296188379
2020-02-25 21:22:10 +00:00
olly
c95ed7d18c Change libgav1's frame buffer callback API.
1. Have frame buffer callbacks return Libgav1StatusCode instead of int.
The 0 (success), -1 (failure) return value convention is less obvious.
Note: The callers of frame buffer callbacks,
BufferPool::OnFrameBufferSizeChanged() and YuvBuffer::Realloc(),
currently return bool, so more work is needed to propagate the frame
buffer callbacks' Libgav1StatusCode return value to the Decoder API.

2. Allow the FrameBufferSizeChangedCallback to be omitted if the frame
buffer size information is not useful to the application.

3. Remove the old (version 1) frame buffer callback API. Remove the
frame buffer callback adaptor.

frame_buffer2.h is renamed frame_buffer.h.
Libgav1FrameBuffer2 is renamed Libgav1FrameBuffer.
GetFrameBufferCallback2 and ReleaseFrameBufferCallback2 are renamed
GetFrameBufferCallback and ReleaseFrameBufferCallback.

PiperOrigin-RevId: 295971183
2020-02-25 21:21:37 +00:00
tonihei
a6fb22c67f Add missing package-info.java
All packages that are not in a test directory (or a demo app) should have
the non-null-by-default annotation. Add the remaining ones.

PiperOrigin-RevId: 295938504
2020-02-25 21:21:13 +00:00
xufulong
6d14c168e2 use swresample instead of avresample, since avresample module has been deprecated. 2020-02-19 22:09:01 +08:00
aquilescanta
5c3c803460 Remove DRM management from Renderers
PiperOrigin-RevId: 295569075
2020-02-17 17:40:30 +00:00
olly
faff66e9df Use &id_ as buffer_private_data for libgav1.
This avoids the issue of whether it is defined behaviour to cast an
arbitrary int (or even intptr_t) value to a void* pointer. This is the
original approach used before commit 0915998add5918214fa0282a69b50a159168a6d5.

PiperOrigin-RevId: 295552115
2020-02-17 17:14:40 +00:00
olly
2eb6e814eb Use libgav1 frame buffer callback helper functions
Libgav1 recently added the ComputeFrameBufferInfo() and SetFrameBuffer()
helper functions for writing frame buffer callbacks. Using them
simplifies the Libgav1GetFrameBuffer() function.

Also resurrect the AlignTo16() function.

PiperOrigin-RevId: 295548330
2020-02-17 17:14:17 +00:00
olly
2a012f8687 gav1_jni: fix pointer->int conversion warnings
fixes:
gav1_jni.cc:446:25: error: cast from pointer to smaller type 'int' loses information
  const int buffer_id = reinterpret_cast<int>(buffer_private_data);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gav1_jni.cc:730:9: error: cast from pointer to smaller type 'int' loses information
        reinterpret_cast<int>(decoder_buffer->buffer_private_data);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

after 0915998add

PiperOrigin-RevId: 295211245
2020-02-17 17:13:19 +00:00
bachinger
68398b708e remove pitch field from PlaybackParameters
PiperOrigin-RevId: 294936851
2020-02-17 17:12:19 +00:00
kimvde
f5025bfce4 Share seek tests between FLAC extractors
PiperOrigin-RevId: 294893303
2020-02-13 15:46:05 +00:00
andrewlewis
3d95f9a939 Add an overview of ad insertion
PiperOrigin-RevId: 294689274
2020-02-13 15:45:30 +00:00
kimvde
bdfd24290f Share FLAC extractor tests between both extractors
PiperOrigin-RevId: 294614958
2020-02-13 15:44:29 +00:00
olly
1cbe3f72e6 DataSpec: Deprecate most constructors
Keeping (Uri) and (Uri, position, length) to avoid needing
Builder for the trivial case.

PiperOrigin-RevId: 294530226
2020-02-13 15:43:54 +00:00
olly
14d3ed09d5 Add DataSpec.Builder
PiperOrigin-RevId: 294518763
2020-02-13 15:43:35 +00:00
bachinger
016bacd178 remove deprecated usage of onPlayerStateChanged
PiperOrigin-RevId: 294181886
2020-02-11 17:10:56 +00:00