231 Commits

Author SHA1 Message Date
ibaker
1327ecad24 Use CapturingRenderersFactory in Vp9PlaybackTest
PiperOrigin-RevId: 348017841
2020-12-23 22:50:25 +00:00
ibaker
27e290e701 Use CapturingRenderersFactory in TsPlaybackTest
PiperOrigin-RevId: 348017268
2020-12-23 22:50:16 +00:00
ibaker
fe5176c009 Use CapturingRenderersFactory in OggPlaybackTest
PiperOrigin-RevId: 348016819
2020-12-23 22:49:58 +00:00
ibaker
6a89027f56 Use CapturingRenderersFactory in Mp3PlaybackTest
PiperOrigin-RevId: 348016339
2020-12-23 22:49:49 +00:00
ibaker
56d30205ba Use CapturingRenderersFactory in MkvPlaybackTest
PiperOrigin-RevId: 348015859
2020-12-23 22:49:40 +00:00
ibaker
237766548c Use CapturingRenderersFactory in MkaPlaybackTest
PiperOrigin-RevId: 348015304
2020-12-23 22:49:32 +00:00
ibaker
5bfa818533 Use CapturingRenderersFactory in FlvPlaybackTest
PiperOrigin-RevId: 348014814
2020-12-23 22:49:23 +00:00
ibaker
3bf5e6b0e4 Use CapturingRenderersFactory in FlacPlaybackTest
PiperOrigin-RevId: 348014322
2020-12-23 22:49:14 +00:00
ibaker
1a00da4c19 Add CapturingRenderersFactory and use it in Mp4PlaybackTest
I decided not to migrate all the tests in one CL to keep the diff
manageable. I'll make follow-up CLs to migrate the tests, and eventually
delete TeeCodec and all associated logic.

I couldn't completely remove the dump diff because
ShadowMediaCodec.getCodecInfo() (which would give me access to the MIME
type) doesn't seem to work properly - it returned video/avc when
name=exotest.audio.aac, and looking into the code it looks like there's
some native methods that are missing shadow implementations.
PiperOrigin-RevId: 347991956
2020-12-23 22:48:20 +00:00
kimvde
3a17dd5fec Slomo flattening: get metadata from smta box
Retrieve the capture frame rate and the SVC temporal layer count from
the smta box instead of the meta box because this is what Samsung do. It
is not guaranteed that the meta box will be present and will contain all
the necessary info in all slomo files.

PiperOrigin-RevId: 345639680
2020-12-14 10:14:14 +00:00
ibaker
74bbd5367e Gracefully handle null-terminated subtitle content in MKV containers
This was reported for SSA/ASS in PR #8265, but it seems to me the
SubRip part of the Matroska spec is similarly loose, so this change
handles null-terminated strings in both.

#minor-release

PiperOrigin-RevId: 345452667
2020-12-03 17:13:12 +00:00
ibaker
0278949262 Set subtitle track to default in sample_with_srt.mkv
This will mean the track is automatically used when running in a
playback test.

Command used to change the flag:
```
$ mkvpropedit sample_with_srt.mkv --edit track:3 --set flag-default=1
```

PiperOrigin-RevId: 345436666
2020-12-03 17:12:33 +00:00
ibaker
374ba12738 Disable subtitle output in the playback tests
This is currently flaky, so it's better to disable it than end up with
flaky tests.

PiperOrigin-RevId: 345436319
2020-12-03 17:12:25 +00:00
ibaker
10b9de8342 Add an MKV asset with SSA subtitles for extractor and playback tests
Asset generated using a temporary SSA file and:
```
$ mkvmerge -o sample_with_ssa_subtitles.mkv sample.mkv input.ssa
```

PiperOrigin-RevId: 345217628
2020-12-03 17:11:13 +00:00
kimvde
7a7d3d1b07 Add FMP4 extractor test with sideloaded track
#exofixit

PiperOrigin-RevId: 344052500
2020-11-24 16:03:46 +00:00
tonihei
a6b53d24af Add OGG playback tests
PiperOrigin-RevId: 343467276
2020-11-20 17:09:56 +00:00
christosts
cbd91999b4 Add Robolectric playback tests for existing VP9 assets
PiperOrigin-RevId: 342660971
2020-11-17 13:50:35 +00:00
christosts
c87f95e153 Add Robolectric playback tests for existing MKV assets
PiperOrigin-RevId: 342618706
2020-11-16 16:50:46 +00:00
christosts
7fd78666d1 Add Robolectric playback tests for existing MKA assets
PiperOrigin-RevId: 342060794
2020-11-13 14:55:20 +00:00
bachinger
e3c725aa38 Create chunks from parts in HlsChunkSource
Issue: #5011
PiperOrigin-RevId: 342022947
2020-11-13 14:54:41 +00:00
ibaker
363693d8ec Add multi-channel audio samples to Mp4PlaybackTest
Robolectric now supports multi-channel audio:
https://github.com/robolectric/robolectric/commit/9d84ceb6d588d5f53be29b

PiperOrigin-RevId: 341574417
2020-11-11 09:50:40 +00:00
ibaker
337c412d2b Add multi-channel audio samples to TsPlaybackTest
Multi-channel audio is now supported by Robolectric:
https://github.com/robolectric/robolectric/commit/9d84ceb6d588d5f53be29b

PiperOrigin-RevId: 341573838
2020-11-11 09:50:21 +00:00
ibaker
f13058942a Add Robolectric playback tests for existing FLV assets
PiperOrigin-RevId: 341573808
2020-11-11 09:50:11 +00:00
kimvde
d94943f014 Add SEF super slomo test sample
PiperOrigin-RevId: 341019272
2020-11-06 16:34:48 +00:00
bachinger
7f49b33fea Block HLS playlist requests at part level
Issue: #5011
PiperOrigin-RevId: 340625816
2020-11-06 16:33:15 +00:00
bachinger
c04dd8b328 Use blocking HLS media playlist reload for segments
Issue: #5011
PiperOrigin-RevId: 340477795
2020-11-06 16:32:40 +00:00
andrewlewis
57c53c5ac4 Fix ImaPlaybackTest
This test is not run in presubmit as it was too flaky, and is currently broken
due to assets moving.

Also migrate off ImaPlaybackTest off deprecated APIs.

#minor-release

PiperOrigin-RevId: 340405666
2020-11-06 16:32:11 +00:00
Oliver Woodman
e1211f9254 Merge pull request #8133 from xufuji456:dev-v2
PiperOrigin-RevId: 340254878
2020-11-02 23:01:45 +00:00
kimvde
6a5b53355b Add SVC extension to SEF test sample
PiperOrigin-RevId: 339858492
2020-11-02 23:00:01 +00:00
kimvde
cb1afa4b1a Add mdta metadata to SEF slow mo test sample
PiperOrigin-RevId: 339655069
2020-11-02 22:59:33 +00:00
samrobinson
47fbfa1c57 Correct naming of SEF slow motion mp4 sample.
PiperOrigin-RevId: 339649762
2020-11-02 22:59:24 +00:00
samrobinson
e962d7172e Add an MP4 sample for SEF slow motion to the test assests
PiperOrigin-RevId: 339648625
2020-11-02 22:59:15 +00:00
tonihei
aab6aef443 Set min/max supported live offset in DashMediaSource.
In order to ensure we can update the values for new manifests but still use
the user provided override, we need to save the original and the updated MediaItem
seperately.

And in order to incorporate the existing logic for the min/max supported live
offset, which we already use to correct the target offset, also move both places
together so that all the adjustment happens in one place.

Logical adjustments to the previous min/max supported live offset:
 - Use the user-provided MediaItem values if set
 - Use the newly parsed ServiceDescription values if available.
 - Limit the minimum to 0 if the current time is in the window and we can
   assume to have low-latency stream.
 - Add minBufferTime from the manifest to ensure we don't reduce the live
   offset below this value.

Issue: #4904
PiperOrigin-RevId: 339452816
2020-11-02 22:58:34 +00:00
tonihei
aee7e6087c Parse min/max live offset from ServiceDescription.
Issue: #4904
PiperOrigin-RevId: 339215091
2020-11-02 22:57:28 +00:00
bachinger
949e26d1ba Support delta updates for media playlists
Issue: #5011
PiperOrigin-RevId: 339093145
2020-11-02 22:56:49 +00:00
kimvde
521a220728 Avoid throwing for still photo metadata retrieval
PiperOrigin-RevId: 338497163
2020-10-23 13:54:31 +01:00
kimvde
175b8eb69e Read Google Photos motion photo metadata
PiperOrigin-RevId: 338436906
2020-10-22 12:37:41 +01:00
tonihei
057771aeec Fix calculation for isSegmentAvailableAtFullNetworkSpeed.
The current caluclation was comparing Unix time with period time.
Fix it by always comparing against period time.

Issue: #4904
PiperOrigin-RevId: 338235754
2020-10-21 22:26:15 +01:00
ibaker
7ea1201bc2 Add playback tests for existing MP4 assets
Skip assets with >2 audio channels - this isn't
currently supported by ShadowAudioSystem. I'll add these when support is
available.

Also skip sample_ac4_protected.mp4 because DRM isn't supported in this
test environment either.

PiperOrigin-RevId: 338023738
2020-10-20 14:51:50 +01:00
ibaker
57e884b671 Add support for AC-3, AC-4, E-AC-3 and E-AC-3-JOC to playback tests
I added the TS playback tests for these assets without adding support
for the relevant MIME types to ShadowMediaCodec.

Also remove test assets with more than 2 audio channels - this isn't
currently supported by ShadowAudioSystem. I'll re-add these when support
is available.

PiperOrigin-RevId: 338023290
2020-10-20 14:51:41 +01:00
ibaker
d97dd8d5eb Add playback tests for existing FLAC assets
PiperOrigin-RevId: 337280116
2020-10-17 01:35:11 +01:00
ibaker
74ac915124 Add playback tests for existing MP3 assets
PiperOrigin-RevId: 337279583
2020-10-17 01:35:01 +01:00
christosts
41b58d503a Use low latency properties in DashMediaSource
Issue: #4904
PiperOrigin-RevId: 337046645
2020-10-17 01:33:19 +01:00
kim-vde
2e5f2f12ad Merge pull request #7378 from shenwill:dev-v2
PiperOrigin-RevId: 336875300
2020-10-13 16:30:01 +01:00
christosts
ed873322d3 Parse ServiceDescription from DASH manifest
Issue: #4904
PiperOrigin-RevId: 336838559
2020-10-13 16:28:35 +01:00
ibaker
7b8895d655 Use Mp4WebvttDecoder for WebVTT content in DASH MP4 containers
This was broken by 74a9d8f680
because DashManifestParser switched to setting Format.sampleMimeType to
text/vtt while SubtitleDecoderFactory was still expecting
application/x-mp4-vtt. This change teaches SubtitleDecoderFactory to
check both Format.containerMimeType and Format.sampleMimeType.

I'll investigate a follow-up change to remove
MimeTypes.APPLICATION_MP4VTT completely (it's currently still used in
AtomParsers).

Issue: #7985
PiperOrigin-RevId: 334771672
2020-10-06 14:30:29 +01:00
claincly
4d3a781ca4 End to end playback test for gapless playback
In the test, a real instance of SimpleExoplayer plays two identical Mp3 files.
The GaplessMp3Decoder will write randomized data to decoder output on receiving
input. The test compares the bytes written by the decoder with the bytes
received by the AudioTrack, to verify that the trimming of encoder delay/
padding is correctly carried out.

Test mp3 has delay 576 frames and padding 1404 frames. File generated from:
ffmpeg -f lavfi -i "sine=frequency=1000:duration=1" test.mp3

This change needs robolectric version 4.5, which is not currently released (2020 Sep 30).

PiperOrigin-RevId: 334648486
2020-10-06 14:30:19 +01:00
ibaker
ae0d9b1359 Preserve limit when resetting ParsableByteArray in OggPacket#populate
When I moved ParsableByteArray#data behind a getter I replaced some
assignments with calls to reset(byte[]):
ce2e6e2fd6

reset(byte[]) deliberately sets `limit` to `data.length`, in order to
handle cases that were reassigning `data` but not updating `limit`.
However OggPacket was already using `limit` to track where to write
'new' data into the array, so changing `limit` to `data.length` caused
us to try and write new data beyond the end of the array.

I looked at other uses of reset(byte[]) in ce2e6e2fd6
and condluded the only other usage in MatroskaExtractor is legit and
shouldn't be updated like this (because MatroskaExtractor previously
*wasn't* correctly updating/maintaining `limit`).

Issue: #7992
PiperOrigin-RevId: 334601586
2020-10-06 14:30:01 +01:00
ibaker
88999da3be Add playback tests for more TS assets
PiperOrigin-RevId: 334549894
2020-09-30 11:55:35 +01:00
Will
34ef9b2042 Add tests for the FlvExtractor seek map. Fix an EOF seeking issue. 2020-09-26 15:30:58 +08:00