467 Commits

Author SHA1 Message Date
Oliver Woodman
efb9ff1fe7 Play standalone MPEG-TS files.
- Have TsExtractor report a SeekMap to the output.
- Implement TsExtractor.reset to reset extractor state.
- Add 1x sample.
2015-05-01 20:31:21 +01:00
Oliver Woodman
cfab852096 Remove pointless references to ElementaryStreamReaders. 2015-05-01 20:30:00 +01:00
Oliver Woodman
d82343d06c Remove MediaFormat.bitrate. 2015-05-01 20:29:32 +01:00
Oliver Woodman
54f97c952e Reintroduce Allocation abstraction.
Play movies has an Allocator that attempts to allocate a single
huge byte[] up front to minimize the risk of GC pauses. This abstraction
will be required to keep that when updating them to the new Exo.
2015-05-01 20:28:49 +01:00
Oliver Woodman
9b112cf94d Video format selection.
Making Representation and TrackElement extend Format will simplify
this further (TBC whether this is a good idea!).

Issue: #393
2015-05-01 20:27:11 +01:00
Oliver Woodman
fafcd79e1b Move AC-3 bitrate calculation into Ac3Util.
This is in preparation for removing bitrate from MediaFormat.
2015-05-01 20:25:19 +01:00
Oliver Woodman
6bf62770bd Make sure that the process dies if a loading task throws Error. 2015-05-01 20:24:50 +01:00
Oliver Woodman
1d528b80ea Move getUserAgent from DemoUtil to library's Util. 2015-05-01 20:24:27 +01:00
Oliver Woodman
6cb46e4549 webm_extractor: Add VP8 to the list of codecs.
VP8 can be decoded by MediaCodec (since very early versions of android). Now that we want WebmExtractor to be general purpose, adding VP8 makes sense as it is a common use case.
2015-05-01 20:23:33 +01:00
Oliver Woodman
5ea7424ee3 Tidy up AssetDataSource. 2015-05-01 20:23:02 +01:00
Oliver Woodman
053e5b9f1c Fix javadoc warning. 2015-05-01 20:22:31 +01:00
Oliver Woodman
ce3d5c9a59 Throw when getMinBufferSize returns an error value. 2015-05-01 20:22:03 +01:00
Oliver Woodman
e6c7defc79 Make ParsableBitArray.data public, like ParsableByteArray. 2015-05-01 20:21:36 +01:00
Oliver Woodman
7ad55dbf2c webm_extractor: Add support for parsing BlockGroup element
This CL adds support for parsing BlockGroup elements for all
codecs (not just opus). It also adds a test to verify the new
behavior.
2015-05-01 20:20:47 +01:00
Oliver Woodman
aed45bb2ca Add support for reading AC-3 audio in HLS. 2015-05-01 20:18:08 +01:00
Oliver Woodman
9b6c30525e webm_extractor_tests: Add tests for multi track Webm Extractor Support
Refactor the extractor tests to enable testing of multi track Webm support.

Github Issue: #363
2015-05-01 20:13:53 +01:00
Oliver Woodman
48fc9635a9 webm_extractor: Add support for Cues present at the end of file
This CL adds support for WebM files which have Cues present at the end of the file (i.e.) after Clusters. The file referenced in the bug can now be played back using the demo app. It adds a new flag to WebmExtractor which should be set to true only when being used through ExtractorSampleSource. All others (e.g. DASH) should not set it.

Reference file: http://demos.webmproject.org/exoplayer/glass_vp9_vorbis_cues_at_end.webm
2015-05-01 20:13:19 +01:00
Oliver Woodman
6cccfc1caa Make Atom.getAtomTypeString public.
I've found myself doing this a couple of times during local
debugging. It's harmless to have it public, and seems pretty
useful for debugging inside of the mp4 package.
2015-05-01 20:12:28 +01:00
Oliver Woodman
b787852e71 Correctly stop previous renderers if prepare is called again. 2015-05-01 20:11:57 +01:00
Oliver Woodman
88daaa882c Fix NPE if source is released having never been prepared. 2015-05-01 20:11:27 +01:00
Oliver Woodman
837090e8f9 Move AC-3 header parsing into a new Ac3Util class.
This is in preparation for adding support for AC-3 in HLS.

Also parse E-AC-3 boxes.
2015-05-01 20:10:47 +01:00
ojw28
26c5461b10 Merge pull request #408 from dnutcracker/dev
fix for issue #403
2015-04-24 11:51:11 +01:00
Nati Dykstein
a43dd6ba68 Update AssetDataSource.java 2015-04-22 22:25:44 +03:00
Oliver Woodman
f273c73123 Support NALUnitLengthFieldLength != 4.
Seems a little hacky to define this in Track, but there doesn't seem to
be a particularly nice alternative.

Issue: #406
2015-04-22 16:24:12 +01:00
Oliver Woodman
afb1a93059 Refine ExtractorSampleSource retry.
I was hoping not to avoid this, but in the case of a parsing
failure during preparation we keep retrying forever!
2015-04-22 16:23:33 +01:00
Oliver Woodman
1a01dcc55a Separate UriDataSource from HttpDataSource.
Using a file:// URL for loading an HLS stream (for testing) would fail due to
casting the connection to an HttpURLConnection in DefaultHttpDataSource.

This change makes UriDataSource an interface for objects that are DataSources
with URIs. That allows for reading manifests for HLS using just a UriDataSource
rather than an HttpDataSource (URLs in the playlist are relative to the data
source's URL so the getUri method is needed).
2015-04-22 16:22:48 +01:00
Oliver Woodman
d43d55edeb Add minSdkVersion note to build.gradle. 2015-04-22 16:20:12 +01:00
Oliver Woodman
a1336978ad Fix DataSpec toString formatting. 2015-04-22 16:19:48 +01:00
Oliver Woodman
c807c69a93 webm_extractor: Support for multiple tracks
Github Issue: #363
2015-04-22 16:18:23 +01:00
Oliver Woodman
f637fde962 Allow overriding of codec buffer dequeue block time. 2015-04-22 16:17:36 +01:00
Oliver Woodman
1a9bf018a4 Add frame rate to Format for use in format selection (when known). 2015-04-22 16:16:42 +01:00
Oliver Woodman
a7e2b719c5 Call init() on the extractor only once for each chunk.
On retrying loading a chunk, the state of the extractor was reset due to a call
to seek(). Prevent this call by only calling init() if no bytes were loaded.

Also make the DefaultExtractorInput use the loading position not the original
stream position so that its getPosition() method returns offsets relative to
the start of the stream, which fixes a bug where the chunk index offsets would
be relative to the wrong position if there was a retry while loading the chunk.
2015-04-22 16:14:46 +01:00
Oliver Woodman
21e69f3154 Add more loading info (including chunk loading times) to
BaseChunkSampleSourceEventListener.onLoadCompleted.
2015-04-22 16:13:19 +01:00
Oliver Woodman
3a1325b0af Make TsExtractor consistent with AdtsExtractor. 2015-04-22 16:11:23 +01:00
Nati Dykstein
647d9bedb8 fix for issue #403 2015-04-22 14:51:05 +03:00
Oliver Woodman
55e08ff712 Avoid time discontinuity when retrying a live stream.
Issue: #227
Issue: #389
2015-04-17 20:12:11 +01:00
Oliver Woodman
faf0e2c147 Improve retry logic.
1. Reset retry count to 0 if a Loadable makes progress.
2. Handle resume correctly in the case of live streams.

Issue: #227
Issue: #389
2015-04-17 20:10:31 +01:00
Oliver Woodman
4c94a846d5 webm_extractor: Fix issue in vorbis extraction.
Vorbis decoder in android MediaCodec [1] expects the last 4 bytes of the sample to be the number of samples in the current page. This definition holds good only for Ogg and is irrelevant for WebM. So we always set this to -1 (the decoder will ignore this value if we set it to -1). The android platform media extractor [2] does the same.
2015-04-17 20:09:45 +01:00
Oliver Woodman
b1aac839e6 Don't feed AC-3 input when the audio track is paused.
This works around an issue the audio track continues to play audio data written
after calling AudioTrack.pause(), which breaks rebuffering behavior (as video
can never catch up if audio continues to be consumed, in some circumstances).

Also don't increment the timestamp wrap count if the track is paused, to work
around an issue where the playback head position jumps back to zero after the
AudioTrack position jumps back to zero.
2015-04-17 20:08:54 +01:00
Oliver Woodman
c4eee71fa2 Support AAC without platform MediaExtractor.
Issue: #231
Issue: #227
2015-04-17 20:07:04 +01:00
Oliver Woodman
fb97fca04e Handle dynamic appearance/disappearance of ID3 track in HLS. 2015-04-17 20:04:52 +01:00
Oliver Woodman
5f74226d67 Make the audio track session workaround flag non-final. 2015-04-17 20:04:18 +01:00
Oliver Woodman
508e13e0bd Clean up + optimize ParsableByteArray. 2015-04-17 20:03:24 +01:00
Oliver Woodman
9092fad8e8 Fix subtitles. 2015-04-17 20:02:20 +01:00
Oliver Woodman
0523717841 Fix crash. 2015-04-17 20:01:59 +01:00
Oliver Woodman
e84c852169 Select E-AC-3 in preference to AC-3, and remove other tracks. 2015-04-17 20:01:06 +01:00
Oliver Woodman
3f1638de95 Use ENCODING_PCM_16BIT for keepSessionIdAudioTrack.
ENCODING_PCM_8BIT support is not required.
2015-04-17 19:59:58 +01:00
Oliver Woodman
e4e6a1caf0 Switch from AudioFormat.ENCODING_DEFAULT to .ENCODING_PCM_16BIT.
AudioTrack.getMinBufferSize does not handle ENCODING_DEFAULT so
switch back to ENCODING_PCM_16BIT.
2015-04-17 19:59:03 +01:00
Oliver Woodman
c3bf60b1a9 Add JavaDoc to remove lint warning about unused variable. 2015-04-14 16:45:46 +01:00
Oliver Woodman
7cf6aa86d2 Properly document in code how to pass CustomData to PlayReady DRM.
Issue: #339
2015-04-14 16:44:01 +01:00