Commit graph

5911 commits

Author SHA1 Message Date
Oliver Woodman
066334dad7 Continue TsExtractor refactor.
- Remove TsExtractor's knowledge of Sample.
- Push handling of Sample objects into SampleQueue as much
  as possible. This is a precursor to replacing Sample objects
  with a different type of backing memory. Ideally, the
  individual readers shouldn't know how the sample data is
  stored. This is true after this CL, with the except of the
  TODO in H264Reader.
- Avoid double-scanning every H264 sample for NAL units, by
  moving the scan for SEI units from SeiReader into H264Reader.

Issue: #278
2015-02-12 17:24:23 +00:00
Oliver Woodman
61a86295fd Fix for video-only playbacks transitioning straight to STATE_ENDED.
The complexity around not enabling the video renderer before it
has a valid surface is because MediaCodecTrackRenderer supports
a "discard" mode where it pulls through and discards samples
without a decoder. This mode means that if the demo app were to
enable the renderer before supplying the surface, the renderer
could discard the first few frames prior to getting the surface,
meaning video rendering wouldn't happen until the following sync
frame.

To get a handle on complexity, I think we're better off just removing
support for this mode, which nicely decouples how the demo app
handles surfaces v.s. how it handles enabling/disabling renderers.
2015-02-12 17:02:34 +00:00
Oliver Woodman
784431f3e0 Move EIA reordering back to the renderer (sorry for churn).
Reordering in the extractor isn't going to work well with the
optimizations I'm making there. This change moves sorting back
to the renderer, although keeps all of the renderer
simplifications. It's basically just moving where the sort
happens from one place to another.
2015-02-12 12:48:27 +00:00
Oliver Woodman
f7fb4d4c35 Optimize NAL unit search.
I'm not really a fan of micro-optimizations, but given this method
scans through every H264 frame in the HLS case, it seems worthwhile.
The trick here is to examine the first 7 bits of the third byte
first. If they're not all 0s, then we know that we haven't found a
NAL unit, and also that we wont find one at the next two positions.
This allows the loop to increment 3 bytes at a time.

Speedup is around 60% on Art according to some ad-hoc benchmarking.
2015-02-12 12:46:58 +00:00
Oliver Woodman
3568ecaf00 Split TsExtractor into multiple files.
There's no code change here at all, except for how TsExtractor's
getLargestSampleTimestamp method works.
2015-02-12 12:09:57 +00:00
Oliver Woodman
92f085bc58 Remove intermediate copy steps in TsExtractor.
1. AdtsReader would previously copy all data through an intermediate
adtsBuffer. This change eliminates the additional copy step, and
instead copies directly into Sample objects.

2. PesReader would previously accumulate a whole packet by copying
multiple TS packets into an intermediate buffer. This change
eliminates this copy step. After the change, TS packet buffers
are propagated directly to PesPayloadReaders, which are required
to handle partial payload data correctly. The copy steps in the
extractor are simplified from:

DataSource->Ts_BitArray->Pes_BitArray->Sample->SampleHolder

To:

DataSource->Ts_BitArray->Sample->SampleHolder

Issue: #278
2015-02-11 14:57:07 +00:00
Oliver Woodman
797fa7f872 Make TsExtractor use ParsableByteArray where possible.
- TsExtractor is now based on ParsableByteArray rather than BitArray.
  This makes is much clearer that, for the most part, data is byte
  aligned. It will allow us to optimize TsExtractor without worrying
  about arbitrary bit offsets.
- BitArray is renamed ParsableBitArray for consistency, and is now
  exclusively for bit-stream level reading.
- There are some temporary methods in ParsableByteArray that should be
  cleared up once the optimizations are in place.

Issue: #278
2015-02-10 22:13:01 +00:00
Oliver Woodman
7c66b6ed3b HLS optimization #1 (refactor).
This is the start of a sequence of changes to fix the ref'd
github issue. Currently TsExtractor involves multiple memory
copy steps:

DataSource->Ts_BitArray->Pes_BitArray->Sample->SampleHolder

This is inefficient, but more importantly, the copy into
Sample is problematic, because Samples are of dynamically
varying size. The way we end up expanding Sample objects to
be large enough to hold the data being written means that we
end up gradually expanding all Sample objects in the pool
(which wastes memory), and that we generate a lot of GC churn,
particularly when switching to a higher quality which can
trigger all Sample objects to expand.

The fix will be to reduce the copy steps to:

DataSource->TsPacket->SampleHolder

We will track Pes and Sample data with lists of pointers into
TsPackets, rather than actually copying the data. We will
recycle these pointers.

The following steps are approximately how the refactor will
progress:

1. Start reducing use of BitArray. It's going to be way too
complicated to track bit-granularity offsets into multiple packets,
and allow reading across packet boundaries. In practice reads
from Ts packets are all byte aligned except for small sections,
so we'll move over to using ParsableByteArray instead, so we
only need to track byte offsets.

2. Move TsExtractor to use ParsableByteArray except for small
sections where we really need bit-granularity offsets.

3. Do the actual optimization.

Issue: #278
2015-02-10 12:25:13 +00:00
Oliver Woodman
b0a3c30a90 Improve EIA608 caption support.
- Also make text renderers respect the decodeOnly flag.
- Also fix AC3 passthrough to always allocate direct buffers.
2015-02-09 17:28:07 +00:00
Oliver Woodman
32f0eb1278 Enhance mp4 parsing. 2015-02-09 17:25:39 +00:00
Oliver Woodman
bfa1de68d8 Move common MP4 parsing code to CommonMp4AtomParsers and Mp4Util.
Also add parseMp4vFromParent and return the track's duration in parseTrak.

This is in preparation for adding a non-fragmented MP4 extractor.
2015-02-06 11:43:37 +00:00
Oliver Woodman
a968e5535b Continue playback of tracks with longer duration than the timesource.
If the timesource track renderer ends, but other track renderers
haven't finished, the player would get stuck in a pending state.
This change enables automatic switching to the media clock in the
case that the timesource renderer has ended, which allows other
renderers to continue to play.
2015-02-06 11:32:46 +00:00
Oliver Woodman
03ef3d148f Add MP4V mimetype. 2015-02-06 11:32:08 +00:00
Oliver Woodman
fbf75e1263 Fix SubtitleView to redraw if text changes but bounds stay the same. 2015-02-06 11:31:13 +00:00
Oliver Woodman
7505944497 Separate leaf/container children in ContainerAtom.
Add a utility for converting named atom types to integers.

Add atom types for non-fragmented MP4 parsing.
2015-02-03 12:44:18 +00:00
Oliver Woodman
5bfc5f373b Bug fixes for ByteArrayDataSource. 2015-02-03 12:43:09 +00:00
Oliver Woodman
0ef28abbec Modified Webvtt parser to handle cue identifiers and tags.
Issue: #268
2015-02-03 12:41:49 +00:00
Oliver Woodman
c1a2f3d0c2 Add AOSP header. 2015-02-02 19:54:56 +00:00
Oliver Woodman
7b9b7c6e3b Handle non-indexed representations.
These may occur in VOD streams where a representation's data
is small enough not to require segmentation or an index. For
example subtitle files.

Issue: #268
2015-02-02 19:54:08 +00:00
Oliver Woodman
d1fe33cdf8 Add DefaultSampleSource and SampleExtractor interface.
SampleExtractor will initially only be implemented by FrameworkSampleExtractor
which delegates to a MediaExtractor, but eventually it will also be implemented
by additional extractors.

The sample extractor can be used as a source of samples via DefaultSampleSource.
2015-02-02 14:59:30 +00:00
Oliver Woodman
6f3ccc3615 Handle byte-order-mark prefix to WebVTT file.
Issue: #268
2015-02-02 14:56:33 +00:00
Martin Bonnin
e33e1d7922 cleaner test 2015-01-27 18:37:27 +01:00
Martin Bonnin
c228017fe4 rename hasQueuedOneInputBuffer to hasQueuedInputBuffer 2015-01-27 18:35:40 +01:00
Oliver Woodman
ed0b02d09b Package restructuring to accommodate incoming features (sorry).
This may be painful in terms of applications having to change their
imports. Sorry about that.
2015-01-27 17:00:46 +00:00
Oliver Woodman
b7be7bc01b Fix handling of PTS wraparound. 2015-01-27 15:12:33 +00:00
Oliver Woodman
ee83468084 Blacklist playlists that 404/410. 2015-01-27 15:11:44 +00:00
ojw28
c6c6f2d83e Merge pull request #266 from google/dev
dev -> dev-hls
2015-01-27 15:10:34 +00:00
Martin Bonnin
424b29f996 remove REINIT_STATE_DO_REINIT_NOW state, reinit directly when needed. 2015-01-27 10:44:02 +01:00
Oliver Woodman
f1a7784eb1 Fix DASH Live edge calculation.
Also added clamping to getSegmentNum in one case where
it was not already implemented, and defined this behavior
property in the getSegmentNum javadoc.

Issue: #262
2015-01-26 14:49:33 +00:00
Oliver Woodman
a64df69f85 Refine last segment calculation.
This makes the calculation correct for the case where periodDurationMs
does not divide exactly into durationMs.
2015-01-26 14:08:38 +00:00
Ihor Zakhozhyi
1a363849e2 Fixed wrong calculation of last segment number when using segment template without segment timeline. 2015-01-25 18:49:53 +02:00
ojw28
95341440da Merge pull request #263 from google/dev
dev -> dev-hls
2015-01-23 14:32:21 -08:00
Oliver Woodman
14d1317ce0 Replace tabs with spaces. 2015-01-23 22:25:39 +00:00
Oliver Woodman
4f65e94e93 Add Javadoc to ParsableByteArray. 2015-01-23 22:23:59 +00:00
Oliver Woodman
59b04df4c3 Fix incorrect max height calculation. 2015-01-23 22:18:54 +00:00
Oliver Woodman
6520557dc0 Add (not technically necessary 0xFF guard for clarity).
Without this, the byte is cast as follows (in bits) if the top
byte is set:

10000010 -> 1000000000000000000000000000010

This works because we then always shift at least one bit left,
and only look at the bottom 8 bits of the result. It's confusing
though. It's clearer if the cast to int gives just adds zeros to
the front, like:

10000010 -> 0000000000000000000000010000010
2015-01-23 09:08:41 -08:00
Lei YU
80602b1684 Make BitArray.readUnsignedByte() a bit more clear by using int value instead of byte to prevent unnecessary convert from int to byte. 2015-01-23 23:52:46 +08:00
Lei YU
a9b2120fc9 Fix an issue in BitArray.readUnsignedByte() returns incorrect value when bitOffset is not zero and data[byteOffset + 1] starts with bit 1.
This is caused by signed right shift, the fix is simply to make it unsigned right shift.
2015-01-23 16:44:23 +08:00
Andrey Udovenko
b30f55f147 Process only type == 0 captions. #156 2015-01-22 12:53:33 -05:00
Martin Bonnin
79708f43f8 handle the case when flushCodec() is called while reiniting the decoders 2015-01-22 10:24:51 +01:00
ojw28
ef396933f8 Merge pull request #255 from google/dev
dev -> dev-hls
2015-01-21 15:52:31 -08:00
Oliver Woodman
e246970a20 Minor style tweaks. 2015-01-21 15:51:02 -08:00
Oliver Woodman
bb9e34f512 Minor style tweaks. 2015-01-21 15:47:17 -08:00
Andrey Udovenko
4158ede6e3 Move Closed Captions processing to Eia608TrackRenderer. Use TextRenderer interface for captions. Sort captions based on video frames DTS. Add better control characters and special characters in basic North American character set support. Fixes #156 2015-01-21 11:54:23 -05:00
Nezz
8547f0c05d Replaced tabs with spaces 2015-01-21 17:44:48 +01:00
Nezz
796e5bc7d6 FrameworkSampleSource with FileDescriptor #246 2015-01-21 04:23:13 +01:00
Oliver Woodman
fe43377104 Increase retry count to 3 2015-01-12 17:44:42 +00:00
ojw28
06e9e5d3ea Merge pull request #234 from google/dev
dev -> dev-hls
2015-01-12 17:43:44 +00:00
Oliver Woodman
a879819dd3 Force callers into MediaCodecUtil to catch any exceptions that occur.
Issue: #217
Issue: #228
2015-01-12 17:40:55 +00:00
Oliver Woodman
286365ada8 Use Long.SIZE. 2015-01-12 17:38:21 +00:00
Oliver Woodman
3ca12d0c39 Update min retry count to 3.
Empirical testing in shows increased robustness.
2015-01-12 17:37:25 +00:00
Oliver Woodman
e8d2c00cf7 Add trace to chunk fetches. 2015-01-12 17:37:07 +00:00
Oliver Woodman
f65a093596 AudioTrack enhancements.
- Workaround issue where video may freeze whilst audio continues
  on some devices that have entered bad states.
- Fix wrap-around for playbacks lasting more than 27 hours.
2015-01-12 17:35:43 +00:00
Oliver Woodman
224fc2eef8 Omit range header if the range is 0-.
Apparently some servers don't like it, and in general it's
unnecessary to set the header for this case.
2015-01-12 17:34:00 +00:00
ojw28
a6e94af267 Merge pull request #226 from google/dev
Refine logic for determining AudioTrack size.
2015-01-06 20:15:42 +00:00
Oliver Woodman
1613c9c7a8 Refine logic for determining AudioTrack size.
- Target 4x the minimum specified by the framework.
- Impose a minimum duration (250ms).
- Impose a maximum duration (750ms, or the minimum
  specified by the framework if that's larger).

I've removed the ability to specify the multiplication
factor, since the underlying implementation is getting more
complicated, and we should really be able to figure this out
internally.
2015-01-06 20:13:50 +00:00
ojw28
869ecbfcf3 Merge pull request #225 from google/dev
dev -> dev-hls
2015-01-02 17:38:59 +00:00
Oliver Woodman
d906e405a1 Propagate AudioTrack errors. 2015-01-02 17:35:57 +00:00
Martin Bonnin
e8a8c49a97 better handling of input format change for non-adaptive codecs
* this fixes a bug when switching from HE-AAC 22050Hz to AAC 44100Hz (the AudioTrack was not reset and we were trying to send a bad number of bytes, triggering a "AudioTrack.write() called with invalid size" error)
* this also improves quality switches, making it almost seamless
2014-12-23 13:47:50 +01:00
ojw28
f745be8978 Merge pull request #219 from google/dev
Include gradle plugin 1.0.0
2014-12-23 10:53:58 +00:00
ojw28
a96a7fe782 Merge pull request #218 from google/master
Include gradle plugin 1.0.0
2014-12-23 10:53:29 +00:00
Sebastian Roth
e4ea9c1056 Include gradle plugin 1.0.0 2014-12-22 10:34:46 +08:00
ojw28
f39d83cf75 Merge pull request #215 from google/dev
dev -> dev-hls
2014-12-20 12:00:41 +00:00
Oliver Woodman
4c0554d0d7 Start adding support for more formats in WebM container. 2014-12-20 11:59:19 +00:00
Oliver Woodman
ed6fcb638e Fix reading single byte from DataSourceInputStream. 2014-12-20 11:57:49 +00:00
Oliver Woodman
0414b0d2f6 Fix assertion fail on seek.
Issue: #214
2014-12-20 11:57:05 +00:00
Oliver Woodman
c497b78ffe Fix memory leak in TsExtractor when not all tracks are enabled.
Previously samples belonging to disabled tracks would just
accumulate in an arbitrarily long queue in TsExtractor. We
need to actively throw samples away from disabled tracks up
to the current playback position, so as to prevent this.

Issue: #174
2014-12-19 12:14:06 +00:00
Oliver Woodman
1fce55f6fe HLS: Consider all programs.
I'm not sure exactly what the implications of this change are,
but I'd really hope that only one program in each stream is carrying
audio/video. For GoPro cameras, they expose the video stream in
the second program, for some reason.

Issue: #116
2014-12-19 12:12:04 +00:00
Oliver Woodman
0756c3d28c Relax assertion.
We've seen a few streams where this assertion fails. If you
just skip the packet, things appear to recover correctly in
all cases I've seen, so replacing failure with a warning.
2014-12-19 12:11:17 +00:00
ojw28
5cf781ab9f Merge pull request #211 from google/dev
dev -> dev-hls
2014-12-19 12:09:06 +00:00
Oliver Woodman
99b438e4c4 Don't request that the server use DEFLATE compression.
If the server actually gives us a DEFLATE response, we
fail to handle it properly!
2014-12-19 12:06:00 +00:00
Oliver Woodman
4d6c9f27c2 Minor cleanup of AudioTrack. 2014-12-19 12:05:03 +00:00
ojw28
83e80f98fb Merge pull request #207 from google/dev
dev -> dev-hls
2014-12-17 19:25:12 +00:00
Oliver Woodman
3a9d08edb5 Misc performance/correctness tweaks. 2014-12-17 19:18:33 +00:00
Oliver Woodman
f1fe109bfa Fix AC3Passthrough
- Handle read returning NOTHING_READ for AC-3 streams.
- Remove extra checks for the audio track being initialized.
- Call isInitialized() instead of checking audioTrack != null.
2014-12-17 19:16:02 +00:00
ojw28
1face38709 Merge pull request #204 from google/dev
dev -> dev-hls
2014-12-15 15:12:21 +00:00
Oliver Woodman
11eb1c222b Identify AC-3 tracks by codecs="ac-3", not the MIME type. 2014-12-15 15:04:38 +00:00
Oliver Woodman
595147de9b Enforce sliding window of available segments for DASH DVB. 2014-12-15 15:03:10 +00:00
Oliver Woodman
978a4d857a Handle getting the audio track's position before the first AC-3 buffer.
ac3Bitrate is set only after the first buffer is handled, which meant that
getting the playback position would cause a divide by zero before then.

When playing back AC-3 content, the ac3Bitrate will always be set after the
first buffer is handled, so return a 0 position if it is not set.
2014-12-15 15:02:29 +00:00
Oliver Woodman
b80569237b Correctly propagate fatal load error. 2014-12-12 14:25:48 +00:00
Oliver Woodman
0cb8169323 Merge branch 'dev-hls' into dev 2014-12-12 14:23:43 +00:00
Oliver Woodman
5a3340d638 Add initial AC3 passthrough support. 2014-12-12 14:18:54 +00:00
Oliver Woodman
81bf68b1cb Minor doc fixes. 2014-12-12 14:13:58 +00:00
Oliver Woodman
9d4e177347 Support DASH Live TTML subtitles.
Also add missing file.
2014-12-12 14:12:00 +00:00
Oliver Woodman
bb024fda08 Partial support for DASH DVB Live streams.
- Adds support for dash manifests that define SegmentTemplate
  but no SegmentTimeline.
- Assumes that the device clock is correct when calculating which
  segments to load. The final step here is to use the Utc timing
  element in the DASH manifest to obtain an accurate client clock.
- Doesn't yet enforce that the client shouldn't load segments that
  are in the future or behind the live window.
2014-12-12 14:07:48 +00:00
Oliver Woodman
1554db1673 Skip bad PES packets
Issue: #200
2014-12-11 10:26:50 +00:00
ojw28
035671b722 Merge pull request #198 from google/dev
dev -> dev-hls
2014-12-10 14:08:10 +00:00
Oliver Woodman
f15e3973e0 Fix discovery of secure decoders on some L devices. 2014-12-10 14:05:51 +00:00
Oliver Woodman
86b2209ad0 Bump version to 1.1.0.
Also update gradle files.
2014-12-10 14:04:58 +00:00
Oliver Woodman
a254218891 No-op format changes. 2014-12-08 20:19:24 +00:00
Oliver Woodman
87ca1b3465 Skip previously loaded HLS data after an error occurs.
Github issue: #183
2014-12-08 20:18:10 +00:00
ojw28
1344b36da9 Merge pull request #194 from google/dev
dev -> dev-hls
2014-12-08 20:17:17 +00:00
Oliver Woodman
c4b2a01212 Allow out-of-band pssh data for DASH playbacks.
This fixes the referenced issue, except that the MPD parser
needs to actually parse out UUID and binary data for schemes
that we wish to support. Alternatively, it's easy to applications
to do this themselves by extending the parser and overriding
the parseContentProtection and buildContentProtection methods.

Github Issue: #119
2014-12-08 20:15:06 +00:00
Oliver Woodman
2f0a1779e2 Stop piping PSSH information through the extractor.
It's cleaner to not inject data into the extractor only
so that it can be read out as though it were parsed from
the stream. This is also an incremental step towards
fixing Github issue #119.
2014-12-08 20:13:52 +00:00
Oliver Woodman
cf80c4d9cb Allow passing of optional parameters in MediaDrm key requests. 2014-12-08 20:12:04 +00:00
Oliver Woodman
01151c9c65 Don't append base uri if chunkUrl is absolute. 2014-12-08 20:10:52 +00:00
Oliver Woodman
7ca1de2275 Experiment to add SPS/PPS to the media format. 2014-12-08 11:36:51 +00:00
ojw28
5d7820542c Merge pull request #189 from google/dev
dev -> dev-hls
2014-12-05 17:58:56 +00:00
Oliver Woodman
c8e5988e6d Fix handling of unknown duration in FMP4.
Issue: 186
2014-12-05 17:53:24 +00:00
Oliver Woodman
6f1832fb66 Support negative-fronted xs:duration values.
Issue: 186
2014-12-05 17:52:30 +00:00
Oliver Woodman
fc8c08d240 Fix #187 2014-12-05 17:51:52 +00:00
Oliver Woodman
3d775c1641 Use C constants + minor cleanup. 2014-12-03 18:50:31 +00:00
Oliver Woodman
511dd9435a Merge branch 'dev' into dev-hls 2014-12-03 18:48:20 +00:00
Oliver Woodman
4efc0abde9 Implement DASH Live.
Note: This adds support for the majority of DASH live streams,
however we do not yet correctly support live streams that rely
on UtcTimingElements in their manifests.

Issue: #52
2014-12-03 18:45:13 +00:00
Oliver Woodman
6652f864bd Audio improvements. 2014-12-03 18:33:36 +00:00
Oliver Woodman
2e1f9897e7 Fixed issue in which setting a representation duration to unknown wasn't handled correctly. 2014-12-03 18:30:56 +00:00
Oliver Woodman
dc644ae86d Make single MICROS_PER_SECOND constant + use it everywhere. 2014-12-03 18:30:15 +00:00
Oliver Woodman
656fc0b0ca Make sure SmoothStreaming manifest durations are -1 for Live.
Plus start to properly document the SmoothStreaming package.
Note that where the documentation is a little vague, this is
because the original SmoothStreaming documentation is equally
vague!
2014-12-03 18:26:48 +00:00
Oliver Woodman
c2d55acab5 Get Exo+HLS memory usage more under control.
- Split sample pools for video/audio/misc, since the typical
  required sample sizes are very different (and so it becomes
  inefficient to use a sample sized for video to hold audio).
- Add TODO for further improvements.

Issue: #174
2014-12-03 18:10:30 +00:00
ojw28
b9f3253924 Merge pull request #176 from google/dev
dev -> dev-hls
2014-11-27 18:18:02 +00:00
Oliver Woodman
165562d880 Add VSYNC aligning smooth frame release helper. 2014-11-27 18:15:16 +00:00
Oliver Woodman
2969bba60f Fix timestamp rollover issue for DASH live.
The timestamp scaling in SegmentBase.getSegmentTimeUs was
overflowing for some streams. Apply a similar trick to that
applied in the SmoothStreaming case to fix it.
2014-11-27 18:14:19 +00:00
Oliver Woodman
c534263032 Enhance parsing of xs:duration to support year/month/day. 2014-11-27 18:12:46 +00:00
Oliver Woodman
1a557a06c1 Support SmoothStreaming repeated chunk tags. 2014-11-27 18:11:43 +00:00
Oliver Woodman
40f3172237 HLS: More control over buffering + tweak caption impl.
- Move all three buffering constants to a single class (the
  chunk source).
- Increase the target buffer to 40s for increased robustness
  against temporary network blips.
- Make values configurable via the chunk source constructor.
- Treat captions as a text track for HLS. This allows them to
  be enabled/disabled through the demo app UI.

Issue: #165
2014-11-26 17:21:41 +00:00
Oliver Woodman
8e2801ce9b Improve HLS ABR.
- Add options to switch abruptly at segment boundaries. Third
  parties who guarantee keyframes at the start of segments will
  want this, because it makes switching more efficient and hence
  rebuffering less likely.
- Switch quality faster when performing a splicing switch (when
  we detect that we need to switch variant, we now immediately
  request the same segment as we did last time for the new variant,
  rather than requesting one more segment for the old variant
  before doing this.
2014-11-26 12:08:46 +00:00
Oliver Woodman
410fcdeb87 Merge HLS playlist parsers, make a single parser identify the
playlist type (master or media).

Issue: #155
2014-11-26 12:01:36 +00:00
ojw28
f9f3b82d93 Merge pull request #172 from google/dev
dev -> dev-hls
2014-11-26 11:26:39 +00:00
Oliver Woodman
ab00a4da03 Allow non-strict webvtt parsing. 2014-11-26 11:23:15 +00:00
Oliver Woodman
7dfebc2e11 Make default retry count public. 2014-11-26 11:22:54 +00:00
ojw28
f034ee7d40 Merge pull request #169 from google/dev
Correctly handle redirection when requesting manifests.
2014-11-21 17:55:38 +00:00
Oliver Woodman
69c7cb09c8 Correctly handle redirection when requesting manifests. 2014-11-21 17:54:55 +00:00
ojw28
52b95c1f83 Merge pull request #166 from google/dev
dev -> dev-hls
2014-11-21 00:32:12 +00:00
ojw28
8c980c8892 Merge pull request #164 from talklittle/dev
gradle plugin 0.14.4 fixes
2014-11-21 00:30:48 +00:00
Andrew Shu
66c48a1151 gradle: compileSdkVersion 21
fixes broken import statements
2014-11-20 12:18:54 -08:00
Andrew Shu
0ce3e6e8a6 fix compatibility with android gradle plugin 0.14 2014-11-20 12:05:45 -08:00
Oliver Woodman
03e859d774 Fix handling of encrypted media if IV changes.
1. Correctly replace the AES data source if IV changes.
2. Check the largest timestamp for being equal to MIN_VALUE, and
   handle this case properly.
3. Clean up AES data source a little.

Issue: #162
2014-11-20 17:11:02 +00:00
Oliver Woodman
81e2c9f0d3 Fix https://github.com/google/ExoPlayer/issues/159.
The actual fix here is to not call discardExtractors in HlsSampleSource
whilst the loading thread that's pushing data into it is still running.
It's required to wait for that thread to have exited before doing this.

Issue: #159
2014-11-20 14:59:22 +00:00
Oliver Woodman
8c07847b00 Properly propagate errors that occur during preparation. 2014-11-20 14:58:06 +00:00
Oliver Woodman
2798b430ca Delete spurious file. 2014-11-20 12:23:29 +00:00
ojw28
b501f8ab39 Merge pull request #160 from google/dev
dev -> dev-hls
2014-11-20 11:12:06 +00:00
Oliver Woodman
33c37ebc82 Fix AudioTrack position reporting whilst paused.
Issue: #158
2014-11-20 11:04:38 +00:00
Oliver Woodman
2a832fd3c4 Minor stylistic tweaks. 2014-11-20 11:03:47 +00:00
ojw28
faf196a581 Merge pull request #154 from google/dev
Merge dev -> dev-hls
2014-11-19 16:10:17 +00:00
ojw28
d506d7660d Merge pull request #147 from jonasl/dev-gc
MediaCodecTrackRenderer: Avoid excessive garbage generation
2014-11-19 16:08:38 +00:00
ojw28
25ddeab57d Merge pull request #146 from jonasl/dev-hls-crop
TsExtractor: Account for frame cropping when parsing SPS
2014-11-19 16:08:27 +00:00
Oliver Woodman
127bcd18c3 Bring internal/external branches closer.
- Unredact internal error ids.
- Move images.
2014-11-19 15:58:26 +00:00
Oliver Woodman
4280511a33 Seamless splicing for adaptive HLS. 2014-11-19 10:34:49 +00:00
ojw28
87d0be252e Merge pull request #149 from google/dev
dev -> dev-hls
2014-11-19 10:10:53 +00:00
Andrey Udovenko
3cfe894b93 Additional IV fix. Trim sign bit from BigInteger.toByteArray() output, if it creates a 17th byte for it. #145 2014-11-18 19:36:44 -05:00
Jonas Larsson
255c3b27f6 MediaCodecTrackRenderer: Avoid excessive garbage generation
Looking up a long in a HashSet<Long> auto boxes the long and leaves
it for the GC. As decodeOnly is relatively infrequent it's much
better to do a simple linear search in a List<Long>. That way
we can avoid boxing every incoming time stamp value. In the general
case this will be linear searching in an empty list, a very fast
operation.

Signed-off-by: Jonas Larsson <jonas@hallerud.se>
2014-11-18 15:41:16 -08:00
Andrey Udovenko
15d3df6a58 Add EIA-608 (CEA-608) Closed Captioning support for HLS #68 2014-11-18 14:48:40 -05:00
Andrey Udovenko
c57484f90a Fix for IV bigger than 32 bits #145 2014-11-18 14:11:02 -05:00
Andrey Udovenko
3abcefa00c Add EXT-X-BYTERANGE support #139 2014-11-18 14:05:34 -05:00
Oliver Woodman
bc303b730a Factor out AudioTrack from MediaCodecAudioTrackRenderer.
AudioTrack contains the portions of MediaCodecAudioTrackRenderer that handle the
platform AudioTrack instance, including synchronization (playback position
smoothing), non-blocking writes and releasing.

This refactoring should not affect the behavior of audio playback, and is in
preparation for adding an Ac3PassthroughAudioTrackRenderer that will use the
AudioTrack.
2014-11-18 19:04:14 +00:00
Oliver Woodman
44bc01b28d Add receiver for HDMI plugged-in configuration changes. 2014-11-18 19:02:32 +00:00
Oliver Woodman
7cd201c28b Add missing class. 2014-11-18 19:02:20 +00:00
Oliver Woodman
2472637264 Add support for extracting Vorbis audio in WebM Extractor. 2014-11-18 19:00:30 +00:00
Oliver Woodman
6a544da2f8 Use new MediaCodecList APIs on L. 2014-11-18 18:58:04 +00:00
Oliver Woodman
685e1d1f06 Minimize memory leak risks.
Remove implicit back-reference from playback thread to player.
2014-11-18 18:54:45 +00:00
Jonas Larsson
467f19568b TsExtractor: Account for frame cropping when parsing SPS
Passing uncropped dimensions to certain decoders will make them
output frames without proper cropping set.

Signed-off-by: Jonas Larsson <jonas@hallerud.se>
2014-11-18 08:53:54 -08:00
Oliver Woodman
360d452dad Avoid seeking if seekPosition==currentPosition 2014-11-14 18:32:22 +00:00
Oliver Woodman
eb1210d410 Make sampleQueue thread safe 2014-11-14 18:31:55 +00:00
Oliver Woodman
6b123590ca Correctly propagate errors 2014-11-14 16:31:47 +00:00
Oliver Woodman
643f33f7e9 Properly handle different profiles (skipping SPS data as needed). 2014-11-14 16:31:23 +00:00
Oliver Woodman
fd51901620 Big HLS update. Add start of adaptive support, but leave disabled for now. 2014-11-13 16:32:10 +00:00
Oliver Woodman
6c6ba900a9 Fix the build. 2014-11-13 16:23:44 +00:00
ojw28
0005f41fe9 Merge pull request #138 from google/dev
dev -> dev-hls
2014-11-13 16:20:13 +00:00
Oliver Woodman
d14e11c507 Additional extraction for AC3 2014-11-13 16:13:55 +00:00
Oliver Woodman
456d53e178 Minor cleanup. 2014-11-13 16:13:02 +00:00
Oliver Woodman
2d97d31a9e Add ability to make fine-grained frame release timestamp adjustments 2014-11-13 16:11:52 +00:00
Oliver Woodman
f1c646b793 Add diagnostic info to decoder exceptions + minor cleanup 2014-11-13 16:10:21 +00:00
Oliver Woodman
59688397fa Suppress deprecation warnings 2014-11-13 16:08:43 +00:00
Oliver Woodman
bc871c94a6 Add bitrate to MediaFormat 2014-11-13 16:08:16 +00:00
Oliver Woodman
4460b7c626 Fix typo 2014-11-13 16:06:49 +00:00
ojw28
7b5c4d705f Merge pull request #131 from google/dev-l
Merge dev-l into dev-hls, now L SDK is released.
2014-11-10 08:49:20 +00:00
ojw28
5abb413f4e Merge pull request #127 from google/dev
dev -> dev-l
2014-11-06 19:30:47 +00:00
ojw28
e9dacb08df Merge pull request #126 from google/dev
dev -> dev-hls
2014-11-06 19:30:24 +00:00
Oliver Woodman
1653e81687 Add configurable retry count to ChunkSampleSource 2014-11-06 19:28:21 +00:00
Oliver Woodman
eccf8d7924 Minor Webvtt parsing tweaks 2014-11-06 19:27:28 +00:00
Oliver Woodman
d2e73dd566 Add brackets to make expression clearer. 2014-11-06 19:26:41 +00:00
Oliver Woodman
aeb17e6a88 HLS improvements + steps towards ABR. 2014-11-06 19:22:14 +00:00
Oliver Woodman
9790430a62 Trim whitespace from codecs 2014-11-06 19:17:22 +00:00
Oliver Woodman
55b4272a46 Pro-actively parse the final PES packet. 2014-11-05 17:25:02 +00:00
ojw28
e6c7e29647 Merge pull request #121 from google/dev
dev -> dev-l
2014-11-05 17:15:39 +00:00
Andrey Udovenko
71f918c01b ID3 refactoring to match apple's player behavior #67 2014-11-05 11:54:45 -05:00
Andrey Udovenko
c781fcd13d Merge pull request #117 from google/dev
Add cookies support and use the same UserAgent in ManifestFetcher and in...
2014-11-04 14:20:36 -05:00
Andrey Udovenko
712e46085d Add cookies support and use the same UserAgent in ManifestFetcher and in HttpDataSource. 2014-11-04 14:06:37 -05:00
Andrey Udovenko
a76addba5d Add AES-128 encryption support for HLS #69 and parsing logic for CODECS and RESOLUTION attributes. 2014-11-04 13:38:22 -05:00
ojw28
059835e357 Merge pull request #113 from google/dev
dev -> dev-l
2014-11-03 12:21:45 +00:00
ojw28
f4a5cd637f Merge pull request #112 from google/dev
dev -> dev-hls
2014-11-03 12:21:04 +00:00
Oliver Woodman
19eb7795fe Fix default startNumber.
Issue: #108
2014-11-03 12:01:53 +00:00
Oliver Woodman
4c146ee28d Neaten TsExtractor a little.
- Add a readBit method to BitsArray for reading a boolean flag.
- Make things accessed from inner classes package visibility to avoid
  the compiler generating thunk methods.
2014-10-28 19:48:54 +00:00
ojw28
d71b9b7ca1 Merge pull request #100 from google/dev
dev -> dev-l
2014-10-28 19:30:00 +00:00
ojw28
b6bbf50c0e Merge pull request #99 from google/dev
dev -> dev-hls
2014-10-28 19:29:29 +00:00
Oliver Woodman
2422912be8 Refactor HLS support.
- The HlsSampleSource now owns the extractor. TsChunk is more or less dumb.
  The previous model was weird, because you'd end up "reading" samples from
  TsChunk objects that were actually parsed from the previous chunk (due to
  the way the extractor was shared and maintained internal queues).
- Split out consuming and reading in the extractor.
- Make it so we consume 5s ahead. This is a window we allow for uneven
  interleaving, whilst preventing huge read-ahead (e.g. in the case of sparse
  ID3 samples).
- Avoid flushing the extractor for a discontinuity until it has been fully
  drained of previously parsed samples. This avoids skipping media shortly
  before discontinuities.
- Also made start-up faster by avoiding double-loading the first segment.

Issue: #3
2014-10-28 19:25:44 +00:00
Oliver Woodman
78f34cf480 Add svg source for diagrams. 2014-10-28 18:22:26 +00:00
Oliver Woodman
11cbe2819e Clean up project files. 2014-10-28 17:55:21 +00:00
Andrey Udovenko
d3a05c9a44 Add ID3 Timed Metadata support for HLS #67 2014-10-28 13:24:12 -04:00
ojw28
dd2921f9b2 Merge pull request #97 from google/dev
dev
2014-10-28 14:19:18 +00:00
ojw28
3bee259de9 Merge pull request #96 from google/dev
dev -> dev-hls
2014-10-28 14:18:56 +00:00
Oliver Woodman
c34f7368ae Minor tweak to UriDataSource. 2014-10-28 14:12:55 +00:00
Oliver Woodman
5ba3f1eea3 Fix build. 2014-10-28 10:08:49 +00:00
ojw28
119eb6712a Merge pull request #93 from google/dev
Dev -> Dev-hls
2014-10-27 11:06:31 +00:00
ojw28
1057a45812 Merge pull request #92 from google/dev
Dev -> Dev-l
2014-10-27 11:06:10 +00:00
Oliver Woodman
192cdc66a2 Ignore secure decoders. They shouldn't be explicitly listed. 2014-10-27 11:00:04 +00:00
Oliver Woodman
067422a491 Cleanup TextTrackRenderer. 2014-10-27 10:59:37 +00:00
Oliver Woodman
5f6b197355 Allow direct and indirect buffer replacement.
Also tweak ManifestFetcher.
2014-10-27 10:58:43 +00:00
Oliver Woodman
ae6e082d2f Add a UriDataSource for reading from file or network. 2014-10-27 10:54:51 +00:00
Oliver Woodman
6aeb989327 Add some MimeTypes that will be useful in the future. 2014-10-27 10:54:20 +00:00
Oliver Woodman
f859205438 Let FileDataSource report to a TransferListener. 2014-10-27 10:52:45 +00:00
Oliver Woodman
b8415dba59 Parse all UUID boxes, not just the first one. 2014-10-27 10:51:45 +00:00
ojw28
4c348d8aa6 Merge pull request #83 from google/dev
Pull dev -> dev-l
2014-10-20 16:59:46 +01:00
ojw28
c2c7a75681 Merge pull request #82 from google/dev
Pull dev -> dev-hls
2014-10-20 16:59:18 +01:00
Oliver Woodman
1f0d411886 Make mpd parser more ameanable for extension. 2014-10-20 16:55:38 +01:00
Oliver Woodman
5a87133219 Add case for 7.1 audio. 2014-10-20 16:54:51 +01:00
Oliver Woodman
5f0be427a4 Update HlsSampleSource + correctly propagate error from prepare.
Issue: #81
2014-10-20 16:53:43 +01:00
Oliver Woodman
4853611803 Remove additional "/" from merged URLs.
Issue: #81
2014-10-20 16:45:56 +01:00
Oliver Woodman
60d162df18 Fix overflow when comparing HLS Segments for long videos. 2014-10-15 20:42:26 +01:00
Oliver Woodman
fcd9ec6c23 Tweak audio renderer to match dev/dev-hls. 2014-10-09 21:55:10 +01:00
Oliver Woodman
fd3016cd13 Use setVolume on API level 21 devices, plus minor naming cleanup. 2014-10-09 17:54:30 +01:00
ojw28
d2e480f01b Merge pull request #75 from google/dev
Merge dev -> dev-hls
2014-10-09 17:31:36 +01:00
ojw28
989bbef24e Merge pull request #74 from google/dev
Merge dev -> dev-l
2014-10-09 17:31:05 +01:00
Oliver Woodman
759431048d Treat "no chunk to load yet" in the same way as finished.
The key change here is that nextLoadPositionUs is set to -1
if we're not loading but don't have a next chunk ready to
load. This ensures that "missing chunks" in one stream don't
prevent chunks in another stream from loading. This occurs
in SmoothStreaming with TTML subtitles, where the chunks are
sparse.
2014-10-09 17:27:20 +01:00
Oliver Woodman
027d9eefbd Smoother playback #1.
Propagate elapsedRealtimeUs to the video renderer. This allows
the renderer to calculate and adjust for the elapsed time since
the start of the current rendering loop. Typically this is <2ms,
but there situations where it can go higher (normally when the
video renderer ends up processing more than 1 output buffer in
a single loop).

Also made variable naming more consistent throughout the package.
2014-10-09 17:26:01 +01:00
Oliver Woodman
3b4409ae0b Allow relaxation of TTML validity requirement when parsing subtitles. 2014-10-09 17:19:14 +01:00
Oliver Woodman
d4e824634c Throw a checked exception rather than unchecked one.
So that we actually catch it, rather than having the process crash!
2014-10-09 17:17:43 +01:00
Oliver Woodman
43712ce41c Cap AudioTrack latencies at 10 seconds and log a warning if too large. 2014-10-09 17:16:13 +01:00
Oliver Woodman
ac18ac087b Fix missing ->IN_SYNC transition. 2014-10-09 17:13:14 +01:00
Oliver Woodman
be721943c6 Fix incorrect condition. 2014-10-02 12:23:08 +01:00
ojw28
1c92b28b16 Merge pull request #65 from google/dev
Add file missing from "Improve subtitle handling" change.
2014-10-01 22:17:32 +01:00
ojw28
7794df7bd8 Merge pull request #64 from google/dev
Add file missing from "Improve subtitle handling" change.
2014-10-01 22:17:11 +01:00
Oliver Woodman
dec40bcbd3 Add file missing from "Improve subtitle handling" change. 2014-10-01 22:14:44 +01:00
ojw28
f4d3079bba Merge pull request #63 from google/dev
Update dev-l
2014-10-01 22:10:16 +01:00
ojw28
422f23aceb Merge pull request #62 from google/dev
Update dev-hls
2014-10-01 22:09:48 +01:00
Andrey Udovenko
d64036c5ed Add basic HLS support (VOD and Live) with EXT-X-DISCONTINUITY. 2014-10-01 17:03:07 -04:00
ojw28
8c665e3dd2 Improve subtitle handling.
- Move parsing onto a background thread. This is analogous
  to how frame decoding is pushed to MediaCodec, and should
  prevent possible jank when new subtitle samples are parsed.
  This is more important for out-of-band subtitles, which can
  take a second or two to parse fully.

- Add Useful DataSpec method.
2014-10-01 21:27:25 +01:00
ojw28
ea1ab674a4 Strip trailing newline from WebVTT subtitles. 2014-10-01 21:26:12 +01:00
ojw28
9fc963acc6 Add missing param documentation. 2014-10-01 21:25:02 +01:00
ojw28
8ea3f9805c Add class to enable loading of out-of-band subtitle files. 2014-10-01 21:23:50 +01:00
ojw28
e99aaa4d67 Update CaptionStyleCompat for L. 2014-09-29 16:59:08 +01:00
ojw28
9cfe5fcf44 API level 21 enhancements for ExoPlayer playbacks.
- Use native frame release timing in video renderer for
  smoother video playback.
- Avoid unnecessary memory copy steps in audio renderer.
- Use non-blocking AudioTrack API.
2014-09-25 20:29:44 +01:00
ojw28
dd30632aa1 SmoothStreaming Live support.
Issue: #12
2014-09-25 20:16:30 +01:00
ojw28
4adf8f77f4 Tweak stop/disable cycles. 2014-09-25 20:13:40 +01:00
Oliver Woodman
fc230733ae Ignore blockingSendMessage calls after release.
Previously we'd end up blocking forever in this case, which
is the worst thing we could do :). We could either throw an
exception or just print a warning. Printing a warning is more
in line with what other methods do (Handler prints a "sending
message to dead thread" warning).
2014-09-23 11:21:44 +01:00
Oliver Woodman
da125bb5cc Merge DashLiveMpdFetcher logic into generic ManifestFetcher.
This allows ManifestFetcher to both execute the initial
manifest load and be plugged into an ExoPlayer ChunkSource,
where it can be used for repeated manfiest refreshes during
live playback.
2014-09-23 11:17:36 +01:00
Oliver Woodman
f82a331728 Fix StreamingDrmSessionmanager.
Use locally bound variable instead of class variable.
2014-09-23 11:14:16 +01:00
Oliver Woodman
1ed048dba8 Clean up TTML timestamp parsing. 2014-09-23 11:13:54 +01:00
Oliver Woodman
7cb55e23f6 Correctly handle zero length fragmentRun. 2014-09-23 11:13:31 +01:00
Oliver Woodman
4fdd68facf Fix SmoothStreamingManifest to handle large timestamps. 2014-09-23 11:13:09 +01:00
Oliver Woodman
c4e1c3543c Enhance Loader API. 2014-09-19 18:36:12 +01:00
Oliver Woodman
ce5eea72d2 Auto-infer character encoding. 2014-09-19 18:34:46 +01:00
Oliver Woodman
4344675098 Add WebVTT parser. 2014-09-19 18:34:05 +01:00
Oliver Woodman
525b309764 SmoothStreaming - Parse last chunk duration. 2014-09-19 18:33:23 +01:00
Oliver Woodman
f52742b100 Ensure that we try and call release on a renderer
Do this even if stop/disable fails.
2014-09-19 18:32:21 +01:00
Oliver Woodman
4e96caa623 Resolve reference Uris correctly.
Ignore the path of the base Uri if the reference starts with "/".
Spec - http://tools.ietf.org/html/rfc3986#section-5.2.2
2014-09-19 18:31:17 +01:00
Oliver Woodman
bf95592b2c Remove unused import. Tweak documentation. 2014-09-19 18:30:21 +01:00
Oliver Woodman
8378019839 Fix SmoothStreaming where audio FourCC is missing. 2014-09-19 18:29:34 +01:00
Oliver Woodman
b2fc944af1 Remove getLoadedData API from ExoPlayer components.
This API wasn't particularly nice. Best to remove it whilst
hopefully no-one is using it. Leaving the ReadHead abstraction
in place, since it might well prove useful in the future.
2014-09-19 18:26:04 +01:00
Oliver Woodman
c19faa63cd A few tiny bug fixes. 2014-09-11 18:03:11 +01:00
Oliver Woodman
ec90eac301 Support anamorphic video content. 2014-09-11 16:34:35 +01:00
Oliver Woodman
6c3ae7f175 Add SubtitleView and CaptionStyleCompat to ExoPlayer. 2014-09-11 16:30:39 +01:00
Oliver Woodman
e4b35e884a Transition ExoPlayer to use longs for ms timestamps. 2014-09-11 16:26:43 +01:00
Oliver Woodman
d85f4abb2b Support negative media timestamps (if people *really* want to send us them!). 2014-09-11 16:23:50 +01:00
Oliver Woodman
6b2b6ca479 Prevent device provisioning when another device provisioning request is already under process. 2014-09-11 16:23:13 +01:00
Oliver Woodman
bc01a4f48d Relax MediaCodecVideoTrackRenderer.canReconfigureCodec().
Allow non-H264 adaptive decoders.
2014-09-11 16:22:40 +01:00
Oliver Woodman
bf5ee6ff23 1. Parse live attributes from SmoothStreaming manifest.
2. Common interface for manifest parsers.
- This effectively moves the common interface from the Fetcher level
  (i.e. ManifestFetcher) to the Parser level (i.e. ManifestParser).
- The motivation here is to allow the implementation of components that
  can work with a generic ManifestParser implementation.
2014-09-11 16:22:01 +01:00
Oliver Woodman
d4e35358a1 Fix bad assertion. It doesn't hold for TTML subtitle chunks. 2014-09-11 16:09:52 +01:00
Oliver Woodman
6e9ba9ba47 Bump version to 1.0.13. 2014-09-08 11:38:20 +01:00
Oliver Woodman
ddd2d004f0 Make SmoothStreaming manifest more robust.
- Skips unrecognized elements rather than crashing.
- FourCC treated as required for video and optional elsewhere,
  as per the SmoothStreaming spec.
- Only parse initData text when we're actually in the ProtectionHeader element
2014-09-08 11:35:39 +01:00
Oliver Woodman
181eceaf4b Fixed MPD date/time parsing issue. 2014-09-08 11:34:06 +01:00
Oliver Woodman
52a300f1fd Merge fMP4/H264 and WebM/VP9 DASH implementations. 2014-09-08 11:33:12 +01:00
Oliver Woodman
1ddd5c6e16 Parse some DASH manifest components for DVB LIVE. 2014-09-08 11:30:21 +01:00
Oliver Woodman
5d35698d8f Make MediaCodecTrackRenderer discard non-keyframes after seek.
This means that after a decoder flush, the renderer will avoid
feeding non-keyframes into the decoder until it has received and
fed the first keyframe. The decoder has no way of correctly
decoding non-keyframes that arrive before a keyframe.
2014-09-08 11:30:20 +01:00
Oliver Woodman
5b2f0566a7 Fix potential cause of infinite-spinner-without-failure.
It looks like for the case of self-contained media segments,
it's possible to get stuck without failure in the case that
the load fails having loaded less than the length of the init
data.
2014-09-08 11:30:19 +01:00
Oliver Woodman
92e3208121 Don't try and read a trackEncryptionBox unless we actually have a saiz atom to parse.
Issue: #35
2014-09-08 11:30:18 +01:00
Oliver Woodman
14048b013a Add disclaimer to stop people getting confused by the minSdkVersion.
Issue: #31
2014-09-08 11:30:17 +01:00
Oliver Woodman
d465ab7029 Call FormatHolder what it really is.
Since we have a Format class as well, it's very confusing that
FormatHolder actually holds a MediaFormat. I think it's quite
likely that Format will need promoting into the root package as
part of the HLS work, which will make this even more confusing
(although it is possible that for HLS we'll define yet another
Format class, if it turns out we need significantly different
fields).

Note - I deliberately avoided renaming the formatHolder
args/params, because they're not particularly ambiguous and
because it introduces some ugly line breaks.
2014-09-08 11:30:16 +01:00
Oliver Woodman
3b25928a13 Make audio renderer more robust to bad getTimestamp values. 2014-09-08 11:30:15 +01:00
Oliver Woodman
a7b88cd6a9 Tighten isReady() up again.
- Bring back requirement for the first video frame to be rendered
  before isReady returns true, *unless* we've deduced that the
  upstream source is serving multiple renderers.
- Ditto for requiring that the audio track has some buffered data.
2014-09-08 11:30:14 +01:00
Oliver Woodman
98a7573812 Minor changes to fix Javadoc.
- cache ref didn't work because it referred to a private variable
  (which isn't documented) from a public interface definition
  (which is). Meaning the Javadoc generator was trying to link
  to documentation that didn't exist.
2014-09-08 11:30:12 +01:00
Oliver Woodman
5b9c92cb83 Bump version to 1.0.12. 2014-08-14 15:45:33 +01:00
Oliver Woodman
4e7b333aee Support chunked requests. 2014-08-14 15:44:09 +01:00
Oliver Woodman
af6e144adc Fix bug introduced supporting self-contained media chunks.
The equals check we perform needs to ignore the max dimensions.
This tended to work in practice because formats would be the
same object, but in the case where different format objects
are used, things can break.
2014-08-12 21:35:13 +01:00
Oliver Woodman
5cfa9adacc Add missing C file. 2014-08-12 14:16:28 +01:00
Oliver Woodman
58e9e61688 Remove unnecessary SuppressWarning annotations. 2014-08-12 14:13:43 +01:00
Oliver Woodman
e0a29c841e Don't release AudioTrack unless we have to. 2014-08-12 14:12:05 +01:00
Oliver Woodman
4a745b1cd8 Optimize out quite a few allocations in FragmentedMp4Parser. 2014-08-12 13:55:38 +01:00
Oliver Woodman
005e98fc34 Simplify parsing of encryption data + support SENC boxes.
Issue: #4
2014-08-11 19:42:04 +01:00
Oliver Woodman
8ec8840261 Minor cleanup.
- Add constants class. Currently housing a single lonely variable,
which is used generally throughout the library, and so no longer
nicely fits into a specific class.

- Rename a few other constants to add clear units.

- Made minor tweak to ExoPlayer documentation.
2014-08-11 18:38:39 +01:00
Oliver Woodman
25a532656c Optimize some CodecCounter inefficiency.
1. Use ints rather than longs.
2. Remove some counters that dont seem hugely useful.
3. Replace use of volatile with explicit method calls that
   cause a memory barrier. This is a lot more efficient than
   using volatile because it can be invoked only once per
   doSomeWork.
2014-08-11 17:42:08 +01:00
Oliver Woodman
9a124120ff Changes around renderer readiness and extraction.
- Make MediaCodecTrackRenderer.isReady more permissive.
  This largely fixes #21
- Bring WebmExtractor closer to FragmentedMp4Extractor.
  The two will probably be placed under a common interface
  fairly soon, which will allow significant code
  deduplication.
2014-08-01 15:56:26 +01:00
Oliver Woodman
41ff1e4071 Add CacheDataSource.Listener. 2014-08-01 15:54:32 +01:00
Oliver Woodman
b1992c3848 Don't call doSomeWork if we're preparing 2014-08-01 15:53:49 +01:00
Oliver Woodman
2a82ff353b Make DefaultWebmExtractor handle cues and format independently.
* Remove concept of being prepared by simply reporting if format
and/or cues are known.
* Allow replacement of format and/or cues later in the stream.
* Initialization and index segments can be parsed independently
of one another but must be in order due to internal WebM dependencies.
* Let seekTo() work even when cues are unknown.
2014-08-01 15:53:08 +01:00
Oliver Woodman
32464e6de4 Fix integer variant of library version. 2014-08-01 15:51:48 +01:00
Oliver Woodman
ad26085e5c Finish painful bytes/sec -> bits/sec conversion. 2014-08-01 15:51:21 +01:00
Oliver Woodman
ef6be7957d Merge branch 'dev' of https://github.com/google/ExoPlayer into dev 2014-07-28 14:31:20 +01:00
Oliver Woodman
b3277c666b Add language to Format (+other misc fix). 2014-07-28 14:29:21 +01:00
Kentaro Takiguchi
fa83b2fa5e Add jarRelease task 2014-07-18 23:00:44 +09:00
Oliver Woodman
bb5cfd52c5 Add missing files. 2014-07-18 14:55:24 +01:00
Oliver Woodman
edb5446440 Bump version to 1.0.11. 2014-07-18 14:31:55 +01:00
Oliver Woodman
62d17cabf0 Add support for SegmentTemplate and SegmentList mpds.
Misc Notes:
- Removed content type filters because some of third parties
  don't set content type.
2014-07-18 14:30:30 +01:00
Oliver Woodman
87461821fe Define DashSegmentIndex wrapper.
This paves the way for SegmentTemplate and SegmentList based
mpds, which will implement DashSegmentIndex directly rather than
parsing an index from the media stream.

- Define DashSegmentIndex.
- Make use of DashSegmentIndex in chunk sources.
- Define an implementation of DashSegmentIndex that wraps a SegmentIndex.
- Add method that will allow Representations to return a DashSegmentIndex
  directly in the future.
- Add support for non-contiguous index and initialization data in media streams.
  For the Webm case this isn't enabled yet due to extractor limitations.
- Removed ability to fetch multiple chunks. This functionality does not extend
  properly to SegmentList and SegmentTemplate variants of DASH.
2014-07-17 11:28:05 +01:00
Oliver Woodman
d7d14037b8 Add utility classes for SegmentTemplate/SegmentList refactor.
A step towards supporting SegmentTemplate style MPDs.
2014-07-15 18:32:37 +01:00
Oliver Woodman
058333565d Use bits/sec instead of bytes/sec for format bandwidth.
Why: This was a bad initial choice. Manifests typically define bandwidth in
bits/sec. If you divide by 8 then you're throwing away information due to
rounding. Unfortunately it turns out that SegmentTemplate based manifests
require you to be able to recall the bitrate exactly (because it's substituted
in during segment URL construction).

Medium term: We should consider converting all our bandwidth estimation
over to bits/sec as well.

Note1: Also changed Period id to be a string, to match the mpd spec.
Note2: Made small optimization in FormatEvaluator to not consider discarding
the first chunk (durationBeforeThisSegmentUs will always be negative, and even
in the error case where it's not, removing the first thunk should be an error).
2014-07-15 13:55:59 +01:00
Oliver Woodman
4366afc273 Support self-contained media chunks.
- Support parsing of moov atoms contained within each chunk.
- Also do a small cleanup to WebM parser.
2014-07-15 12:47:08 +01:00
Oliver Woodman
16fe6a809e More flexible mimeType handling in mpd parser.
- Allow the content type of an adaptation set to be inferred
from the mimeTypes of the contained representations.
- Ensure the contained mimeTypes are consistent with one
another, and with the adaptation set.

Ref: Issue #2
2014-07-10 12:01:12 +01:00
Oliver Woodman
686ac2a6f5 Refactor WebM extractor. 2014-07-09 23:20:23 +01:00
Oliver Woodman
9e16dec2f8 Add support for relative baseUrls in DASH manifests.
Ref: Issue #2
2014-07-09 23:15:58 +01:00
Oliver Woodman
1b957268a6 Add utility methods for inexact ceil/floor binary searches.
This change also fixes issue #5
2014-07-09 15:34:42 +01:00
Oliver Woodman
f1213a7656 Fix NaN comparison error. 2014-07-07 17:06:01 +01:00
Oliver Woodman
43b7efa986 Widen support for fMP4 streams.
- Add support for parsing avc3 boxes.
- Make workaround for signed sample offsets in trun files always enabled.
- Generalize remaining workaround into a flag, to make it easy to add additional workarounds going forward without changing the API.
- Fix DataSourceStream bug where read wouldn't return -1 having fully read segment whose spec length was unbounded.
2014-07-07 15:55:01 +01:00
Oliver Woodman
e4ae7e08db Small javadoc tweak. 2014-07-04 01:10:52 +01:00
Oliver Woodman
47c0bbd6b5 Propagate erors to ChunkSource implementations.
This can help custom ChunkSource implementations to act on
this information. For example an adaptive implementation may
choose to blacklist a problematic format if loads of that
format keep failing.
2014-07-04 01:06:20 +01:00
Oliver Woodman
4fd4c89518 Refactored ExoPlayer to use String-based format ids. 2014-07-04 01:04:10 +01:00
Oliver Woodman
563b434de2 Keep audio time in sync with arbitrary decodeOnly samples.
AudioTrack time will go out of sync if the decodeOnly flag
is set of arbitrary samples (as opposed to just those following
a seek). It's a pretty obscure case and it would be weird for
anyone to do it, but we should be robust against it anyway.
2014-07-04 00:52:19 +01:00
Oliver Woodman
50b276fe31 Fixed issue in which MediaChunk.seekToStart might not actually seek to the start of the segment. 2014-07-04 00:47:44 +01:00
Oliver Woodman
8cad387393 Fix ChunkSource disable definition. 2014-07-04 00:45:09 +01:00
Oliver Woodman
ea796f916c Enhance Cache/SimpleCache.
1. Fix SimpleCache startReadWrite asymmetry. Allow more concurrency.

- startReadWrite does not have the concept of a read lock. Once
  a cached span is returned, the caller can do whatever it likes
  for as long as it wants to. This allows a read to be performed
  in parallel with a write that starts after it.
- If there's an ongoing write, startReadWrite will block even if
  the return operation will be a read. So there's a weird asymmetry
  where reads can happen in parallel with writes, but only if the
  reads were started first.
- This CL removes the asymmetry, by allowing a read to start even
  if the write lock is held.
- Note that the reader needs to be prepared for the thing it's
  reading to disappear, but this was already the case, and will
  always be the case since the reader will need to handle disk
  read failures anyway.

2. Add isCached method.
2014-07-04 00:29:18 +01:00
Oliver Woodman
27ab5c83a6 Initial drop. 1.0.10. 2014-06-16 12:56:04 +01:00