514 Commits

Author SHA1 Message Date
Oliver Woodman
6ae97ced3a Support content:// URIs, and some cleanup/consistency tweaks.
- There's definitely potential for more code sharing in these
classes, but deferring for now.
- Also made no-scheme default to file://, and allowed smoothstreaming
URLs to be specified with or without the /Manifest suffix.
2015-05-19 14:14:53 +01:00
Oliver Woodman
a9c977a79e Fix Mp3Extractor synchronization when loading retries.
Before preparation, and when seeking, Mp3Extractor did not handle retrying:
- synchronizedHeader was set before the header was known to be valid, which
  means that after seeing one valid frame header and then failing to read, the
  synchronization would be treated as complete.
- The input buffer would keep data loaded during synchronization but on the next
  call to synchronize when retrying it was not returned to the mark position to
  re-parse the data.

This change fixes these issues.
2015-05-19 14:13:31 +01:00
Oliver Woodman
675c7738c1 Let DefaultUriDataSource load assets. 2015-05-19 14:12:59 +01:00
Oliver Woodman
f474afbf5e Fix handling of widths/heights when choosing formats.
- Make HlsPlaylistParser treat non-positive dimensions as unknown.
- Make HlsPlaylistParser parse floating point resolutions, because
  technically that's how they're spec'd.
- Make VideoFormatSelectorUtil treat non-position dimensions as unknown.

Issue: #461
2015-05-19 14:06:48 +01:00
Oliver Woodman
059b80c1ab Improve DataSource implementations:
1. Make DefaultUriDataSource robust against exceptions through from close().
2. Make AssetDataSource handle file:///android_asset/ URIs.
2015-05-19 14:05:50 +01:00
Oliver Woodman
672906060c Fix missing ID3 events
When I moved the id3Reader instantiation out of the while
loop (below where it is now) it was no longer guarded by
the streamTypes.get(streamType) deduping check. This brings
back an equivalent check.
2015-05-19 14:05:08 +01:00
Oliver Woodman
cd6c5c3984 Fix CBR seeking when XING header is present.
When a XING header is present but not usable (due to missing fields), CBR
seeking can be used instead. It relies on the bitrate. The bitrate from the
unusable XING header is not correct, which leads to incorrect seeking.

Also fix VBRI seeking by setting the correct offset on the frame to parse. Few
people seem to use that format, but I have found two very short truncated
samples which were falling back to the CBR case before but are using VBRI with
this change.
2015-05-19 14:03:39 +01:00
Oliver Woodman
d03fb10516 Remove readBitsLong, use readBits instead 2015-05-19 14:02:40 +01:00
Oliver Woodman
dd7a796883 Make constant public 2015-05-19 14:01:59 +01:00
Oliver Woodman
0dfc1d3bb7 Don't sample the timestamp/latency for AC-3 passthrough playback. 2015-05-19 14:00:49 +01:00
ood_tsen
b340d47165 support content uri (e.q. content://xxx) 2015-05-18 20:24:59 +08:00
Patrik Åkerfeldt
1469f11aa3 Support setting properties on MediaDrm 2015-05-13 10:41:22 +02:00
Oliver Woodman
5ca5df0bb2 Bump to 1.3.1 2015-05-12 18:42:46 +01:00
Oliver Woodman
06cbb4e746 Fix doc image refs 2015-05-12 16:57:39 +01:00
Oliver Woodman
683b67cc19 Correct javadoc header 2015-05-12 16:53:47 +01:00
Oliver Woodman
5ca3378b71 Rm doc dir from dev 2015-05-12 15:22:43 +01:00
Oliver Woodman
8a347d1a5d Use https 2015-05-12 15:21:42 +01:00
Oliver Woodman
cd55fc068f Gradle for Javadoc 2015-05-12 15:10:07 +01:00
Oliver Woodman
166c2f7cc0 Fix two issues related to seeking with AC-3 output.
When a passthrough AudioTrack is replaced (due to seeking) the new one behaves
as if it is still emptying data from the old one, with its playback position
advancing until it runs out of data.

Data written while the 'old' AudioTrack was emptying would be discarded, so
avoid writing to the new AudioTrack while the old one is still emptying.

Also avoid using AudioTrack.getTimestamp with passthrough tracks, as this causes
the playback position to jump to a position that breaks audio/video
synchronization.
2015-05-11 21:16:02 +01:00
Oliver Woodman
79c7798d84 Reorganize BandwidthMeter interface 2015-05-11 21:11:53 +01:00
Oliver Woodman
64cc380fe1 Avoid loading first chunk when preparing HLS for non-zero position.
This also fixes a technical mistake where HlsChunkSource is fed
seekPositionUs=-1 when obtaining the first chunk. This is wrong,
but the usage of this variable within HlsChunkSource enforces that
the seek must stay within bounds, so we get away with it.

Issue: #385
2015-05-11 21:10:20 +01:00
Oliver Woodman
116a18848f Alter default exo buffertime value to 2500ms. 2015-05-11 21:05:37 +01:00
Oliver Woodman
12d05a0917 Bump target API level to 22. 2015-05-11 21:04:51 +01:00
Oliver Woodman
b0abda43ec Ensure we configure a new extractor when we need one.
Issue: #400
2015-05-11 21:03:30 +01:00
Oliver Woodman
770ad7f06f Fix edge case in HlsSampleSource.
1. prepare() needs to load a TsChunk to actually prepare the source.
2. Source is prepared, but no tracks are enabled (this is why it's
   an edge case - no-one is likely to be doing this!).
3. The TsChunk load completes.

We should not load additional chunks in this case.
2015-05-11 21:02:38 +01:00
Oliver Woodman
dd5eabdf4a Signal EoS when seeking ExtractorSampleSource to the end of a track. 2015-05-11 21:01:35 +01:00
ojw28
2ce33c257a Merge pull request #436 from ened/dev
Simple gradle updates
2015-05-11 16:24:17 +01:00
Oliver Woodman
861d6749ef Remove ability to extend the default FormatEvaluator implementations. 2015-05-08 17:09:39 +01:00
Oliver Woodman
9f77c4009e Clip seek position to the inputLength - 1. 2015-05-08 17:08:59 +01:00
Oliver Woodman
d9071710cf Read AC-3 tracks in MPEG TSs only if AC-3 playback is supported.
Partly fixes #434 as the AC-3 stream will now be ignored if the
audio capabilities don't allow it to be played back.
2015-05-08 17:08:13 +01:00
Oliver Woodman
d8af120b98 Fix treating all DVB data as AC-3.
Issue #434
2015-05-08 17:06:59 +01:00
Oliver Woodman
7437ee39d8 Remove deprecated method. 2015-05-08 17:06:27 +01:00
Oliver Woodman
54b71a5743 Allow cross-protocol redirects.
Issue: #423
2015-05-08 17:05:54 +01:00
Oliver Woodman
4527539efe Handle cenc:pssh elements in DASH manifests.
Issue: #407
2015-05-08 17:05:04 +01:00
Oliver Woodman
3360f5eda5 Enable passthrough based on the input MIME type. 2015-05-08 17:04:21 +01:00
Oliver Woodman
a1083d360a Prevent wrapping detection on new passthrough AudioTracks. 2015-05-08 17:03:05 +01:00
Oliver Woodman
de5bce3400 Apply passthrough workarounds only on platform API versions 21/22. 2015-05-08 17:02:23 +01:00
Sebastian Roth
3079bf1d75 gradle updates 2015-05-07 16:35:53 +08:00
Oliver Woodman
9921dfd1ce Deprecate FrameworkSampleSource as a deterrent. 2015-05-05 20:33:25 +01:00
Oliver Woodman
6909c948b9 Remove SuppressLint in AudioTrack. 2015-05-05 20:32:06 +01:00
Oliver Woodman
9dcb17f21a Clean up DataSourceInputStream 2015-05-05 20:30:52 +01:00
Oliver Woodman
a63883a8c8 Fix format equality checking.
For Live SmoothStreaming, referential equality checking
isn't enough (it breaks once the manifest is updated).
Updated other instances too just for consistency.
2015-05-05 20:30:32 +01:00
Tanuj Mittal
2a06c2641c Fix DataSourceInputStream.read() for EOF cases 2015-05-05 16:30:09 +05:30
Oliver Woodman
79cdd03682 Filter unsupported video formats for HLS. 2015-05-01 20:34:57 +01:00
Oliver Woodman
b405d3d9b7 Have Representation, TrackElement and Variant consistently expose Format.
And delete things that we're parsing but don't use from TrackElement.
2015-05-01 20:33:52 +01:00
Oliver Woodman
8673cafce8 Move Allocator to HlsSampleSource (from HlsChunkSource).
- This makes HLS consistent with Chunk/ExtractorSampleSource.
- It needs to be consistent for WebVTT in HLS.
- Also trim the allocator when done.
2015-05-01 20:32:42 +01:00
Oliver Woodman
0c5a1a6c35 Distinguish exceptions caught at top level. 2015-05-01 20:31:49 +01:00
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