971 Commits

Author SHA1 Message Date
olly
69ca534935 Parse opus gain correctly as a signed value
Issue: #7046
PiperOrigin-RevId: 303354941
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
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
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
e2a6775ea4 Merge pull request #6999 from xufuji456:dev-v2
PiperOrigin-RevId: 298544278
2020-03-30 14:25:03 +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
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
kimvde
67a748f47d FLAC extension: remove sample rate check
This check is not needed because the FLAC specification does not
restrict the sample rate value and because the extension reads files
with other sample rates properly.

PiperOrigin-RevId: 292909391
2020-02-13 15:50:20 +00:00
bachinger
ee2ad943d7 annotate nullabilty of CommandReceiver
Issue: #6938
PiperOrigin-RevId: 292415853
2020-02-01 19:39:43 +00:00
olly
fbe840e880 Upgrade OkHttp dependency to 3.12.8
OkHttp 3.12.7 introduced a regression, which was fixed in 3.12.8.

PiperOrigin-RevId: 291695577
2020-01-27 19:08:45 +00:00
olly
7aefaa7d68 extensions/av1: use -O2 for release builds
+ force arm (over thumb) mode for 32-bit builds

-O2 improves performance ~30-40% over the default -Oz depending on the
resolution; this is similar to what is done for vp9 which uses -O3.

PiperOrigin-RevId: 290318121
2020-01-27 19:06:17 +00:00
olly
dfa4d55f50 Fix DownloadService resumption
- DownloadManagerHelper now passes all downloads to the
  DownloadService when the service is attached (and once
  the downloads are known). The service then starts the
  foreground notification updater if necessary. This fixes
  the ref'd issue.
- Don't call getScheduler() if the service is background
  only. This was already documented to be the case on the
  DownloadService constructor.
- If the service is started in the foreground on SDK level
  26 and higher, satisfy the condition to move the service
  to the foreground in onStartCommand rather than in stop().
  It's much more obviously correct, and should produce the
  same end result.

Issue: #6798
PiperOrigin-RevId: 290050024
2020-01-17 14:01:38 +00:00
olly
ca11e56fe6 Add tests to validate FLAC decoder output
PiperOrigin-RevId: 289091494
2020-01-17 13:57:41 +00:00
olly
4e767faa1c Fix extension FLAC decoder to correctly handle non-16-bit depths
PiperOrigin-RevId: 288860159
2020-01-17 13:56:35 +00:00
kimvde
7fe55cd468 Use FlacLibrary.isAvailable in FlacExtractor selection
PiperOrigin-RevId: 288667790
2020-01-17 13:55:40 +00:00
olly
bf9a61d62f Upgrade OkHttp library to fix HTTP2 issue
Issue: #4078
PiperOrigin-RevId: 288651166
2020-01-17 13:55:24 +00:00
kimvde
d1839f141a Add comment explaining FlacBinarySearchSeeker output
PiperOrigin-RevId: 288464154
2020-01-17 13:54:58 +00:00
olly
97be06529c Use MIME types rather than PCM encodings for ALAW and MLAW
PiperOrigin-RevId: 287999703
2020-01-17 13:52:47 +00:00
andrewlewis
3cf88bb48b Fix typos
PiperOrigin-RevId: 287810018
2020-01-17 13:52:06 +00:00
kimvde
910bd8bdc5 Implement binary search seeking for FLAC extractor
PiperOrigin-RevId: 284814594
2020-01-17 13:42:07 +00:00
kimvde
54413c26d4 Make metadata field nullable in FlacStreamMetadata
This makes the format metadata null (instead of an empty Metadata
object) when it is not provided, and is therefore consistent with the
other extractors behavior.

PiperOrigin-RevId: 284171148
2020-01-17 13:37:58 +00:00
andrewlewis
023e141be8 Verify metadata in extractor tests
PiperOrigin-RevId: 283960017
2020-01-17 13:36:40 +00:00
kimvde
630992d05b Allow no output frame holder BinarySearchSeeker
PiperOrigin-RevId: 283544187
2020-01-17 13:29:44 +00:00
kimvde
f09f62da4f Expose metadata in FLAC extractor
PiperOrigin-RevId: 281538423
2020-01-17 13:20:54 +00:00
kimvde
dcebf93ab4 Add Java FLAC extractor
Seeking, live streams support and exposure of vorbis and ID3 data
are not part of this commit.

Issue: #6406
PiperOrigin-RevId: 281083332
2020-01-17 13:17:53 +00:00
andrewlewis
72ff4504d3 Add troubleshooting instructions for decoding extensions
PiperOrigin-RevId: 286585978
2019-12-20 16:59:52 +00:00
olly
739517bd5e Fix FLAC seeking when the last seek point is a placeholder
PiperOrigin-RevId: 285449865
2019-12-18 19:28:31 +00:00
tonihei
e97b8347eb Add IntDefs for renderer capabilities.
This simplifies documentation and adds compiler checks that the correct values
are used.

PiperOrigin-RevId: 283754163
2019-12-06 23:23:42 +00:00
bachinger
9e238eb6d3 MediaSessionConnector: Support ACTION_SET_CAPTIONING_ENABLED
PiperOrigin-RevId: 283546707
2019-12-06 22:47:15 +00:00
andrewlewis
78e72abbc4 Remove row VP9 multi-threading option
PiperOrigin-RevId: 283319944
2019-12-06 22:39:34 +00:00
olly
8e44e3b795 Remove LibvpxVideoRenderer from nullness blacklist
PiperOrigin-RevId: 283310946
2019-12-06 22:39:21 +00:00
olly
815ec8afab Provide instructions for building extensions using Windows PowerShell
PiperOrigin-RevId: 283296427
2019-12-06 22:38:51 +00:00
andrewlewis
5f465f770b Remove AdsManager listeners on release
Issue: #6687
PiperOrigin-RevId: 283023548
2019-12-06 22:37:35 +00:00
andrewlewis
d30b0285a3 Fix audio processor draining for reconfiguration
When transitioning to a new stream in a different format, the audio
processors are reconfigured. After this, they are drained and then
flushed so that they are ready to handle data in updated formats for the
new stream.

Before this change, some audio processors made the assumption that after
reconfiguration no more input would be queued in their old input format,
but this assumption is not correct: during draining more input may be
queued. Fix this behavior so that the new configuration is not referred
to while draining and only becomes active once flushed.

Issue: #6601
PiperOrigin-RevId: 282515359
2019-11-27 22:40:13 +00:00
andrewlewis
07b3cbc361 Add AudioProcessor.AudioFormat
Issue: #6601
PiperOrigin-RevId: 282515179
2019-11-27 22:34:12 +00:00
andrewlewis
a2b3ad863d Always drain/flush AudioProcessors after configuration
This simplifies the contract of configure and is in preparation for
fixing a bug where more input can't be queued when draining audio
processors for a configuration change.

Issue: #6601
PiperOrigin-RevId: 282514367
2019-11-27 22:34:05 +00:00
andrewlewis
9be09b35e2 Add AV1 to supported formats
PiperOrigin-RevId: 281724630
2019-11-22 15:38:53 +00:00
aquilescanta
b5d9935361 Deprecate public renderer constructors that take a DrmSessionManager
PiperOrigin-RevId: 281086336
2019-11-19 15:10:42 +00:00
andrewlewis
8c848a2a53 Remove option to disable loop filter for VP9
PiperOrigin-RevId: 281039634
2019-11-19 15:08:53 +00:00
bachinger
07bfab8e4c document media button handling prior to API level 21
ISSUE: #6545
PiperOrigin-RevId: 281032120
2019-11-19 15:07:30 +00:00
olly
6df92fdd3f Update VP9 extension README to ref NDK r20
PiperOrigin-RevId: 279899984
2019-11-15 05:14:19 +00:00
aquilescanta
53283ecb52 Add CastPlayer tests for repeatMode masking
PiperOrigin-RevId: 279091742
2019-11-15 05:12:42 +00:00
kimvde
d1da3d925b Fix FLAC bit rate computation
PiperOrigin-RevId: 279088193
2019-11-15 05:12:34 +00:00
kimvde
a226bd0d69 Fix extractor sniffing in FLAC extension
Assuming that a flac stream starts with bytes
['f', 'L', 'a', 'C', 0, 0, 0, 0x22] is not always correct as it could
also start with ['f', 'L', 'a', 'C', 0x80, 0, 0, 0x22]
(see https://xiph.org/flac/format.html#metadata_block_streaminfo).

PiperOrigin-RevId: 279080562
2019-11-15 05:12:25 +00:00
olly
355ed11a3c Suppress warnings emitted by Checker Framework version 2.11.1
More information:
https://docs.google.com/document/d/16tpK6aXqN68PvTyvt4siM-m7f0NXi_8xEeitLDzr8xY/edit?usp=sharing

Tested:
    TAP --sample ran all affected tests and none failed
    http://test/OCL:278915274:BASE:278884711:1573074344615:a6701677
PiperOrigin-RevId: 279080514
2019-11-15 05:12:17 +00:00