7900 Commits

Author SHA1 Message Date
samrobinson
b8e6e98430 Simplify WakeLockManager and WifiLockManager logic.
Disabling reference counting allows some checks to be removed.

This is a no-op.

PiperOrigin-RevId: 299829600
2020-04-03 22:52:40 +01:00
samrobinson
83c2ca5902 Add WifiLock management to SimpleExoPlayer.
Issue:#6914
PiperOrigin-RevId: 297598910
2020-04-03 22:52:35 +01:00
samrobinson
e4e56fac09 Clean WakeLockManager.updateWakeLock logic.
PiperOrigin-RevId: 284552723
2020-04-03 22:49:03 +01:00
olly
a5420a0b65 Fix release notes
PiperOrigin-RevId: 304196424
2020-04-01 23:04:58 +01:00
kimvde
d921491e7d Remove thread checks in player constructor
SimpleExoPlayer instances don't have to be created from the application
thread.

PiperOrigin-RevId: 304190901
2020-04-01 23:04:51 +01:00
olly
38f282800c Fix ADTS extraction with mid-stream ID3
PiperOrigin-RevId: 304184650
2020-04-01 23:04:36 +01:00
ibaker
d466b8c5d5 Make javadoc links point to Android docs for java.* classes
Before:
https://docs.oracle.com/javase/7/docs/api/index.html?java/lang/String.html

After:
https://developer.android.com/reference/java/lang/String.html
PiperOrigin-RevId: 304137011
2020-04-01 22:58:56 +01:00
ibaker
a9c4d2f9cf Ensure javadoc fix applies to Android links with anchors
This means is-external=true is removed and target=_top is
set on the <a> tag.

Without this, javadoc links to framework docs with anchors are
currently broken when viewed in the "frame view" on
exoplayer.dev/doc/reference/

Before this change:
https://developer.android.com/reference/android/media/MediaDrm.html?is-external=true#getKeyRequest-byte:A-byte:A-java.lang.String-int-java.util.HashMap-

With this change:
https://developer.android.com/reference/android/media/MediaDrm.html#getKeyRequest-byte:A-byte:A-java.lang.String-int-java.util.HashMap-

PiperOrigin-RevId: 304136858
2020-04-01 22:58:48 +01:00
Oliver Woodman
c75f3f77ff Merge pull request #7099 from matamegger:feature/fix_pssh_v1_on_firetv
PiperOrigin-RevId: 303937576
2020-04-01 22:58:03 +01:00
olly
1f44a4db4b Bump version to 2.11.4
PiperOrigin-RevId: 303776645
2020-03-30 19:27:23 +01:00
andrewlewis
fea0acd41a Fix PlaybackStatsListener behavior when not keeping history
issue:#7160
PiperOrigin-RevId: 303747338
2020-03-30 18:36:10 +01:00
jaewan
94ca84ff29 Allow developers to specify CharSequence for Notification strings
CharSequence is used by Notification builders and allows to set Spannable text.
It's the base interface of the String class, so apps wouldn't be break after
the update.

PiperOrigin-RevId: 303731890
2020-03-30 18:36:10 +01:00
olly
f0e734d33e Workaround C2 AAC decoder flush problem on Android 10
Issue: #6671
PiperOrigin-RevId: 303364788
2020-03-30 18:36:07 +01:00
olly
69ca534935 Parse opus gain correctly as a signed value
Issue: #7046
PiperOrigin-RevId: 303354941
2020-03-30 18:31:24 +01:00
olly
a9cbbf91c3 Skip aliases of other codecs
- They are always listed with their canonical names
- Considering aliases means that blacklisting a decoder can end up
  not actually blacklisting it, since it may still be accessible
  via an alias. It also means that our decoder fallback logic can
  end up falling back to a decoder that we've already tried!

PiperOrigin-RevId: 303348297
2020-03-30 18:31:24 +01:00
olly
0a5a3cbf46 Handle orientation changes in GL demo
Issue: #7141
PiperOrigin-RevId: 303334072
2020-03-30 18:31:24 +01:00
olly
3fd7d214cd Consistency fixes for FFmpeg extension instructions
PiperOrigin-RevId: 303316976
2020-03-30 18:31:24 +01:00
ibaker
c9f28086db Make milliseconds optional in SubRip (SRT) subtitles
issue:#7122
PiperOrigin-RevId: 303154493
2020-03-30 18:31:24 +01:00
olly
a038346ecc Resample float audio to 16-bit by default to enable audio processing
This is less confusing than having audio processing functionality (e.g., playback
speed adjustment) just "not work" for some pieces of media.

If this change is merged, I will update #6749 to also track making DefaultAudioSink
intelligently enable/disable float output depending on how the audio processors are
configured.

Issue: #7134
PiperOrigin-RevId: 302871568
2020-03-30 18:31:24 +01:00
olly
ddc98334e0 DefaultAudioSink: Fix issue if last processor is not active
It's incorrect to use an AudioFormat returned from AudioProcessor.configure
unless the AudioProcessor is active.

Issue: #7134
PiperOrigin-RevId: 302674132
2020-03-30 18:31:24 +01:00
olly
54c608481b Support 32-bit FP to 16-bit Int audio resampling
This is a no-op for DefaultAudioSink for now, because DefaultAudioSink
currently disables processing anyway if the input uses ENCODING_PCM_FLOAT.

Issue: #7134
PiperOrigin-RevId: 302670534
2020-03-30 18:31:24 +01:00
olly
2094c7491b WAV: Don't read past data end position
Issue: #7129
PiperOrigin-RevId: 302660343
2020-03-30 18:31:24 +01:00
olly
1d6bd0de15 MP4 edit lists: Use floor rather than ceil to find first sample
If the start time of the edit falls within a sample, start from that
sample rather than the next one. This ensures playback can start from
the correct point if the sample is a keyframe, rather than having to
start from the next one.

Issue: #7133
PiperOrigin-RevId: 302639115
2020-03-30 18:31:24 +01:00
ibaker
d18292c9c9 Allow missing hours in SubRip (.srt) subtitle timecodes
Add a test for this case, and extend the existing tests to ensure the
hour is parsed when it's present.

issue:#7122
PiperOrigin-RevId: 302472213
2020-03-30 18:31:23 +01:00
krocard
cac36be6eb Conserve ByteOrder when growingDecoderInputBuffer
#exo-offload

PiperOrigin-RevId: 302403507
2020-03-30 18:31:23 +01:00
olly
b67d79d775 Request storage permission if missing
PiperOrigin-RevId: 302345647
2020-03-30 18:31:20 +01:00
olly
a39715d323 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-30 18:27:14 +01:00
Oliver Woodman
dd4a732303 Merge pull request #7098 from matamegger:feature/webvtt_negative_media_timestamp
PiperOrigin-RevId: 301996778
2020-03-30 18:27:14 +01:00
andrewlewis
4750785f5a Add option for sensor rotation in 360 playbacks
Issue: #6761
PiperOrigin-RevId: 300715682
2020-03-30 18:27:07 +01:00
Oliver Woodman
b2849fde3d Merge pull request #7057 from Chimerapps:dash_assetidentifier
PiperOrigin-RevId: 300313753
2020-03-30 14:32:35 +01:00
Oliver Woodman
dca68b2198 Merge pull request #7064 from davibe:enhancement/6907
PiperOrigin-RevId: 300330109
2020-03-30 14:30:33 +01:00
krocard
40d5db0460 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-30 14:26:33 +01:00
Oliver Woodman
4e6383aeae Merge pull request #7051 from Cizor:dev-v2
PiperOrigin-RevId: 299357049
2020-03-30 14:25:27 +01:00
Oliver Woodman
e2a6775ea4 Merge pull request #6999 from xufuji456:dev-v2
PiperOrigin-RevId: 298544278
2020-03-30 14:25:03 +01:00
Oliver Woodman
c3f9f0e5fe Merge pull request #7010 from dbrain:fix_nullability
PiperOrigin-RevId: 297187116
2020-03-30 13:47:20 +01:00
vigneshv
265670cf93 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-03-30 13:46:50 +01:00
Oliver Woodman
8591e69b6a Remove duplicate SCTE-35 format and add sample to TsExtractorTest
It's not clear why we're currently outputting the format in both init()
and consume() - it seems likely that this was accidentally introduced
in <unknown commit>
when we started outputting the format in consume() but didn't remove it
from init().
2020-03-30 13:46:24 +01:00
olly
908a76e851 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-03-30 13:44:13 +01:00
olly
75bd4ebc18 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-03-30 13:44:05 +01:00
olly
766b383d27 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-03-30 13:43:58 +01:00
olly
b73f6b6ef0 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-03-30 13:43:47 +01:00
olly
0acc95cfbb Cast void* to JniContext* using static_cast.
static_cast is more appropriate than reinrerpret_cast for casting from
void* to JniContext*. See Section 7.2.1 (page 173) in The C++
Programming Language, 4th Edition and
https://stackoverflow.com/questions/310451/should-i-use-static-cast-or-reinterpret-cast-when-casting-a-void-to-whatever

PiperOrigin-RevId: 293812940
2020-03-30 13:43:39 +01:00
olly
11635191a6 Switch to new libgav1 frame buffer callback API.
The new code in Libgav1GetFrameBuffer is copied from
libgav1/src/frame_buffer_callback_adaptor.cc. It may become libgav1
utility functions available to libgav1 clients in the future.

The Libgav1FrameBuffer struct in the old frame buffer callback API is
defined as follows:

  typedef struct Libgav1FrameBuffer {
    uint8_t* data[3];
    size_t size[3];
    void* private_data;
  } Libgav1FrameBuffer;

Copy these three fields to the JniFrameBuffer class as private data
members and add the RawBuffer() and Id() getter methods.

The existing AlignTo16 function is replaced by the copied Align template
function.

PiperOrigin-RevId: 293709205
2020-03-30 13:43:27 +01:00
ibaker
1818921a20 Catch-and-log all subtitle decode errors
issue:#6885
PiperOrigin-RevId: 295931197
2020-03-30 13:41:41 +01:00
andrewlewis
ed1eade980 Update stale comment in TrimmingAudioProcessor
The part about leaving the pending trim start byte count unmodified
if the processor was just configured is not correct.

PiperOrigin-RevId: 295745371
2020-03-30 13:40:36 +01:00
olly
23e4236227 Add missing IntDef to switch
PiperOrigin-RevId: 295692163
2020-03-30 13:39:30 +01:00
Oliver Woodman
49910fe725
Merge pull request #6989 from google/dev-v2-r2.11.3
r2.11.3
2020-02-18 15:02:33 +00:00
Oliver Woodman
b14d879947 Tweak Javadoc 2020-02-18 14:47:58 +00:00
olly
5f1c6b650d Fix SmoothStreaming
Issue: #6981
PiperOrigin-RevId: 295579872
2020-02-18 12:15:13 +00:00
olly
d93b57c009 Zero out trailing bytes in CryptoInfo.iv
CryptoInfo.iv length is always 16. When the actual initialization vector
is shorter, zero out the trailing bytes.

Issue: #6982
PiperOrigin-RevId: 295575845
2020-02-18 12:14:34 +00:00