625 Commits

Author SHA1 Message Date
Andrew Lewis
c47c6816e4 Detect frames using first_slice_segment_in_pic_flag. 2015-07-10 11:46:30 +01:00
Oliver Woodman
ead8abf09f Fixed incorrect caption sizes after device orientation change. 2015-06-30 13:50:14 +01:00
Oliver Woodman
35a9f2635c Use Locale.US in calls to String.format.
Issue: #585
2015-06-30 13:49:03 +01:00
Oliver Woodman
588be2bd4b Fix intermittent decoder crash when playing MP3 inside MP4 2015-06-26 16:53:52 +01:00
Oliver Woodman
3bcd9ca6c3 Simplify HLS MP3 support. 2015-06-26 14:44:10 +01:00
Oliver Woodman
0c577ce2ce Merge branch 'tresvecesseis-dev' into dev 2015-06-26 14:41:59 +01:00
Oliver Woodman
7fb5b86579 Merge branch 'dev' of git://github.com/tresvecesseis/ExoPlayer into dev 2015-06-26 14:41:47 +01:00
Oliver Woodman
faff85784b Use the right overload of createAudioFormat in Ac3Util. 2015-06-26 14:40:13 +01:00
Oliver Woodman
a4ff13d7da Set a MIME type based on the esds ObjectTypeIndication.
Issue: #576
2015-06-26 14:37:48 +01:00
Oliver Woodman
a626a5e5d4 Take period start time into account when calculating segment times. 2015-06-26 14:35:57 +01:00
Oliver Woodman
2b27137e9e Fix bug that caused failure when all renderers disabled.
Prior to this change, there was a bug where playback would
fail with the following steps:

1. Start playback.
2. Pause playback.
3. Disable all renderers.
4. Enable at least one renderer.
5. Resume playback.
2015-06-26 14:33:08 +01:00
Oliver Woodman
33d55631ed Fix handling of pixel aspect ratio change.
The new logic assumes that an input format change will be
followed by an output format change, but I think this is
pretty much guaranteed. If this weren't to happen then the
new pixel aspect ratio wont be picked up, but I think it's
extremely unlikely (it would require the format to stay
exactly the same except for the pixel aspect ratio, which
would be bizarre).
2015-06-26 14:31:13 +01:00
Oliver Woodman
c7635c9dbd Add some audio hooks.
This makes it easier to add an extension for adjusting
audio playback rate.
2015-06-26 14:29:45 +01:00
Oliver Woodman
b88012f51f Process final output buffer if it's non-empty.
Issue: #417
2015-06-26 14:28:50 +01:00
Oliver Woodman
a175ecbff3 Update WebVTT test to check we handle comment in header. 2015-06-26 14:27:45 +01:00
Oliver Woodman
fb31fe0fe4 Fix stale comment 2015-06-26 14:27:17 +01:00
Oliver Woodman
b394c46128 Add utility method to query whether device is an AndroidTV. 2015-06-26 14:26:54 +01:00
Oliver Woodman
a1ab1fc2a2 Detect WebVTT file header according to the spec:
1. An optional U+FEFF BYTE ORDER MARK (BOM) character.
2. The string "WEBVTT".
3. Optionally, either a U+0020 SPACE character or a U+0009 CHARACTER
   TABULATION (tab) character followed by any number of characters that
   are not U+000A LINE FEED (LF) or U+000D CARRIAGE RETURN (CR) characters.
4. Exactly one WebVTT line terminators to terminate the line with the file
   magic and separate it from the rest of the body.

Issue: #580
2015-06-26 14:26:31 +01:00
Oliver Woodman
712756c3e8 Cleanup regex in MPD parser 2015-06-26 14:24:37 +01:00
Oliver Woodman
98d446aa6d Allow seeding of RandomEvaluator.
This is useful for reproducibility in playback tests.
2015-06-26 14:24:00 +01:00
Oliver Woodman
c06f844ee1 SUPER! 2015-06-25 20:57:21 +01:00
Oliver Woodman
ed856b2a71 Test 2015-06-25 19:17:00 +01:00
Oliver Woodman
5e65b40864 Merge branch 'dev' of git://github.com/tresvecesseis/ExoPlayer into tresvecesseis-dev 2015-06-25 18:51:20 +01:00
Andrew Lewis
e328546607 Make reusable fakes for extractor+track outputs.
Improve Mp4Extractor test.

Add support for Xiph lacing in Matroska files.

Add support for EBML lacing in Matroska files.

Handle the initial sticky intent for HDMI audio plug.
2015-06-23 17:57:41 +01:00
Oliver Woodman
bc14e87cfb Tighten package visibility 2015-06-22 15:57:06 +01:00
Oliver Woodman
4092e8ca0f Fix GitHub issue #572 2015-06-22 15:50:18 +01:00
Oliver Woodman
91b47cfe6b Tweak 2015-06-22 11:08:00 +01:00
Oliver Woodman
2f268a9962 Fix final issues with HLS 404 handling #537 2015-06-22 11:04:23 +01:00
Oliver Woodman
97aaee6d15 Fix crash introduced by previous change. 2015-06-19 20:05:34 +01:00
Oliver Woodman
b8df8ecb47 Final fixes for correctly handling chunk load failures in HLS.
An accumulation of several fixes:

1. Change to HlsExtractorWrapper is just a move + documentating
   things that were already true + adding a precondition in the
   configureSpliceTo method.

2. Change in HlsSampleSource.readData ensures that configureSpliceTo
   and hasSamples aren't called on an extractor that isn't prepared.

3. The other change in HlsSampleSource ensures the correct "previous"
   TsChunk is used. If a TsChunk fails to load and is replaced, the
   previous chunk should be the one before that whose load completed
   successfully.

4. Determine switchingVariantSpliced based on the actual format of the
   previous chunk, so it's set correctly in the case of a TsChunk load
   failure and subsequent replacement.
2015-06-19 19:55:12 +01:00
Oliver Woodman
203f3ab732 Get the current extractor properly.
This fixes the case where we need to switch from one variant to
another during preparation, having loaded zero samples, because
the first chunk for that variant gave us a 404 error. In this
case the first extractor will have no samples, and there will
be a second extractor that does.
2015-06-19 13:31:16 +01:00
Oliver Woodman
55862a77b1 Remove dead code 2015-06-18 18:53:22 +01:00
Oliver Woodman
51a8635ba2 Make HlsChunkSource sane again.
There was a mess where we were indexing into both a list of variants
and a (differently ordered and possibly of differing length) list of
formats. This sanitises everything.
2015-06-18 18:01:47 +01:00
Oliver Woodman
e0316d1c16 Refine TTML parsing logic + setup for adding styling information.
1. Refine the way TtmlNode handles whitespace collapsing when constructing
   the output text. Can of worms.
2. Start using SpannableStringBuilder. This will allow attaching of spans
   in getText as nodes are encountered, which is how we'll be incorporating
   styling information into the result.
2015-06-18 17:31:14 +01:00
Oliver Woodman
efa92ac168 Tiny cleanup 2015-06-18 14:30:08 +01:00
Oliver Woodman
773a69ddf9 Remove redundant types 2015-06-18 14:29:28 +01:00
Oliver Woodman
160a88baf9 Steps toward enabling seeking in DASH live 2015-06-18 14:28:54 +01:00
Oliver Woodman
8e58a3f5f5 Steps toward full multi-track support.
1. Remove requirement for TrackRenderer implementations to report
   current position, unless they are time sources.
2. Expose whether renderers have media to play. The immediate benefit
   of this is to solve the referenced GitHub issue, and also to only
   display the appropriate Audio/Video/Text buttons in the demo app
   for the media being played. This is also a natural step toward
   multi-track support.

Github issue: #541
2015-06-18 14:27:24 +01:00
Oliver Woodman
2c29d88330 Remove unnecessary call to seekTo. 2015-06-18 14:22:17 +01:00
Oliver Woodman
0ee8c07fe5 Better handle duration + disabled renderers
- Fix bug where duration of initially disabled tracks wasn't correctly
  incorporated into the overall duration reported by the player.
- Don't transition to STATE_ENDED unless the position has reached the
  duration, if the duration is known. This allows for "playback" to
  continue when all renderers are disabled, rather than jumping straight
  to STATE_ENDED.
2015-06-18 14:21:32 +01:00
Oliver Woodman
072c63c33e Handle stbl atoms with no samples.
Github issue: #554
2015-06-18 14:18:09 +01:00
Oliver Woodman
8c98c588e8 Add support for fixed-size lacing in Matroska streams. 2015-06-18 14:17:32 +01:00
Oliver Woodman
4c4782c72d Pass whole PSSH box to MediaDrm (except in the WV+L case).
This fixes SmoothStreaming on AndroidTV, and also removes a
warning that gets logged when using Widevine/FMP4.
2015-06-18 14:16:37 +01:00
Oliver Woodman
d0ba265290 Fix some MPD parsing issues.
- contentType can be defined on an AdaptationSet.
- language can be defined either in AdaptationSet or in a contained
  ContentComponent.
- The id from the AdaptationSet should come from the AdaptationSet.
2015-06-18 14:13:54 +01:00
Oliver Woodman
54d207f3ce Default caption parsers to non-strict parsing. 2015-06-18 14:12:33 +01:00
Oliver Woodman
39adcabf7d Blacklist variants if media or encryption loads fail, in addition
to if the playlist load fails.

NB - I'm aware the casting is a bit messy, but I don't want a common
interface because I'm hopeful that TsChunk will go away at some point.

Issue: #537
2015-06-18 14:11:33 +01:00
Sergio Moreno Mozota
dd3a4a9139 fix audio channels CodecSpecificDataUtil bugs
* fix channel number encoding using the AUDIO_SPECIFIC_CONFIG_CHANNEL_COUNT_TABLE
  * allocate the correct number of bits (4) int the CodecSpecificDataUtil struct
2015-06-17 23:00:31 +02:00
Oliver Woodman
ecf7d1be9e Fix HLS track selection 2015-06-16 13:50:22 +01:00
Oliver Woodman
eea57d0d76 Enhance WebM extractor tests 2015-06-15 18:02:53 +01:00
Oliver Woodman
854fa928fb Fix read H.264 in WebM when the NAL unit length field length is not 4. 2015-06-15 18:01:46 +01:00