130 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
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
1d528b80ea Move getUserAgent from DemoUtil to library's Util. 2015-05-01 20:24:27 +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
21e69f3154 Add more loading info (including chunk loading times) to
BaseChunkSampleSourceEventListener.onLoadCompleted.
2015-04-22 16:13:19 +01:00
Oliver Woodman
c4eee71fa2 Support AAC without platform MediaExtractor.
Issue: #231
Issue: #227
2015-04-17 20:07:04 +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
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
31552b8cdf Handle play/pause button in the Demo app on Android TV. 2015-04-17 19:57:56 +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
Oliver Woodman
d9b3582baa Use OMX.google.raw.decoder for passthrough playback.
The OMX component needs to be configured with a format that has a
MIME type of audio/raw. Remove Ac3PassthroughAudioTrackRenderer,
which is no longer used.
2015-04-14 16:42:24 +01:00
Oliver Woodman
0d69a2eae8 Implement event reporting from HlsSampleSource.
Issue: #275
2015-04-13 19:03:04 +01:00
Oliver Woodman
e21f7801b5 Major surgery to move all playback modes to the new Extractor model. 2015-04-13 18:57:31 +01:00
Oliver Woodman
4c8f9a8c6f Remove source package, and restore original FrameworkSampleSource. 2015-04-11 02:00:47 +01:00
Oliver Woodman
587edf8e2b Add new style mp4/fmp4 extractors. 2015-04-11 01:58:34 +01:00
Oliver Woodman
6bf52dd69c Report decoder initialization information out of track renderer. 2015-04-10 23:06:57 +01:00
Oliver Woodman
c901025643 Don't attempt license request when keys expire.
- Keys should not expire during normal playbacks of correctly configured content.
- Attempting to refresh on expiration causes a race condition, that may result
  in either failure or brief re-buffer, for the 30s license test video.
- This change provides deterministic behavior, which is to always fail.
2015-04-10 22:38:06 +01:00
Andrew Lewis
5e4a35fa7e Add Mp4SampleExtractor, for reading unfragmented MP4 files. 2015-03-13 18:10:37 +00:00
Oliver Woodman
b9addf28b2 Formatting tweaks for enhanced ID3 support + support in demo app. 2015-03-03 17:16:13 +00:00
J. Oliva
ebbd022a52 Added new ID3 frames
- Added support for ID3 frames of types GEOB and PRIV.

 - GEOB type is commonly used by dynamic ads provider to include in the
stream information about the ads to be played.
 - PRIV type is commonly used for time synchronization (example:
synchronizing playback of a live stream and its webvtt captions) and
also by analytics companies to include tracking information in the
stream.

- Added a sample stream from Apple that contains ID3 metadata.
2015-02-26 16:49:05 +01:00
Oliver Woodman
006986cc58 Make NetworkLoadable use an injected HttpDataSource.
Note: I'm fairly confident that NetworkLoadable.Parser implementations
can live without the inputEncoding being specified. But not completely
100%...

Issue: #311
Issue: #56
2015-02-25 13:39:15 +00:00
Oliver Woodman
d2da3bbf8a Simplify NetworkLoader/Parser/ManifestParser
The only downside of this change is that MediaPresentationDescriptionParser
is no longer stateless.
2015-02-25 12:09:06 +00:00
Oliver Woodman
6d14fc3330 Implement UTC time synchronization for DASH Live.
Support is provided for the following schemes:

urn:mpeg:dash:utc:direct:2012
urn:mpeg:dash:utc:http-iso:2014
urn:mpeg:dash:utc:http-xsdate:2012
urn:mpeg:dash:utc:http-xsdate:2014
2015-02-20 15:10:25 +00:00
Oliver Woodman
a1e196fe20 Add support for elementary AAC/ADTS streams.
- This change:

1. Extracts HlsExtractor interface from TsExtractor.
2. Adds AdtsExtractor for AAC/ADTS streams, which turned out to be
   really easy.

Selection of the ADTS extractor relies on seeing the .aac extension.
This is at least guaranteed not to break anything that works already
(since no-one is going to be using .aac as the extension for something
that's not elementary AAC/ADTS).

Issue: #209
2015-02-17 15:42:38 +00:00
Oliver Woodman
b46d1fc7cc Bump dev version to 1.3.x 2015-02-16 22:30:28 +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
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
147bbe6d55 Simplify demo application.
- Remove simple variant. Maintaining both simple + full is
  unnecessary effort.
- Remove need to specify content id in Sample definition,
  except where it's actually required (for DRM requests in
  the Widevine GTS samples)
2015-02-06 11:52:14 +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
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
ojw28
c6c6f2d83e Merge pull request #266 from google/dev
dev -> dev-hls
2015-01-27 15:10:34 +00:00
Oliver Woodman
ce2f681bd3 Add directories for extensions + additional demos 2015-01-26 16:18:41 +00:00
Oliver Woodman
db5cc21c33 Revert test 2015-01-26 15:18:27 +00:00
Oliver Woodman
fda8f6d35a Test 2015-01-26 15:12:17 +00:00
Oliver Woodman
7b41741db0 Revert test. 2015-01-26 15:01:25 +00:00
Oliver Woodman
76f44eeb13 Test. 2015-01-26 15:01:00 +00: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
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
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
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
Oliver Woodman
ea21eba87e Allow re-enabling video track without transition through buffering state. 2014-12-19 12:10:16 +00:00
ojw28
83e80f98fb Merge pull request #207 from google/dev
dev -> dev-hls
2014-12-17 19:25:12 +00:00
Oliver Woodman
ee823a95fc Add launcher icon source. 2014-12-17 19:22:52 +00:00
Oliver Woodman
48540c2ba0 Add icon for demo app. 2014-12-17 19:19:39 +00:00
Oliver Woodman
39c07d570c Adapt HLS on non-adaptive devices.
This just brings HLS treatment in the demo app in line with
DASH and SmoothStreaming.
2014-12-15 15:30:21 +00:00