977 Commits

Author SHA1 Message Date
olly
d45f0b8b6d Reflow comments in Util.java
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112163984
2016-01-15 18:46:15 +00:00
olly
df7a96a7c4 Map SDK_INT for dev devices.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112162208
2016-01-14 18:14:00 +00:00
olly
e3da2cfb40 Treat .vtt as Webvtt as well as .webvtt.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112161960
2016-01-14 18:13:21 +00:00
olly
949317a41a Minor tweaks to merged pull requests.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112161860
2016-01-14 18:12:28 +00:00
olly
be2aedbd53 Don't consider switching tracks as "joining".
I'm not really sure how best to document this in TrackRenderer;
it's a bit of a weird feature. For now, I've gone with the vague
approach.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112150939
2016-01-14 17:13:32 +00:00
olly
2690f569af Enable track selection + WebVTT for HLS.
See the documentation of buildTracks for the gory details.

Issue: #151
Issue: #676
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112149293
2016-01-14 17:13:32 +00:00
aquilescanta
b6b97a8683 Expose cue settings parser
This CL exposes the cue settings parser in order to allow its usage from the MP4Webvtt extractor. Also fixes a few mistakes from the previous related CL.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112145806
2016-01-14 17:13:32 +00:00
olly
6b9a1b16f1 Fix issues playing FLV content.
* AudioTagPayloadReader was strangely parsing an audioSpecificConfig
  itself, using the parsed values to build a new audioSpecificConfig,
  then passing the newly constructed instance to be parsed by
  CodecSpecificDataUtil. Unfortunately the translation was lossy ;).
* Treat Duration=0 as an unknown duration.

Issue #1137
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112143569
2016-01-14 17:13:32 +00:00
olly
bc1d76a3eb Fix ParsableByteArray.readLine + discard BOM at start of line.
- I think \r and \n are handled the wrong way around?
- We only expect to encounter a BOM sequence at the start of a
  file, but it feels fine to automatically discard it in all
  cases for simplicity. A BOM sequence doesn't mean anything in
  UTF-8. See https://en.wikipedia.org/wiki/Byte_order_mark. Note
  that I think the advice not to remove it on that page relates
  only to the case where the file is being edited + saved.

Issue #1136
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112143407
2016-01-14 17:13:32 +00:00
andrewlewis
5ef1123391 Clarify @param bufferSizeContribution documentation.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112127698
2016-01-14 17:13:32 +00:00
olly
59cf3e02f5 HlsChunkSource: Expose stuff for WebVtt/Variant selection.
Issue: #151
Issue: #676
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111945466
2016-01-14 17:13:32 +00:00
olly
2a9eeaa893 Fix HlsSampleSource use of LoadControl.
There are multiple issues with HlsSampleSource's use of
LoadControl that become apparent when you attempt to use
the same LoadControl for loads by another source.

* In the "limbo" state HlsSampleSource doesn't start any
  new loads, but doesn't update the LoadControl to tell
  it that it doesn't want to load anything either. This
  can prevent another source from starting the loads that
  it needs to make to complete preparation, causing
  playback to become stuck.
* The LoadControl isn't updated properly when the EOS is
  reached. This can cause playback to become stuck near
  the end of the media.
* If HlsSampleSource is released from being in the "limbo"
  state, it doesn't unregister itself with the control.

Issue: #151
Issue: #676
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111942009
2016-01-14 17:13:32 +00:00
olly
43fcb36924 Use APPLICATION_M3U8 as the mimeType for media playlists.
Given we need to do this in HlsPlaylistParser in the normal
case (i.e. not MEDIA_TAG), we may as well just be consistent
and do it everywhere.

Issue: #151
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111941335
2016-01-14 17:13:32 +00:00
eguven
8c8794878d Fixed demo-misc-vp9-opus-sw DASH check
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111839055
2016-01-14 17:13:32 +00:00
andrewlewis
b7d5ce366a Add a comment to explain the input size calculation.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111833857
2016-01-14 17:13:31 +00:00
rileya
c6cdf7e083 Add limited support for edit lists in fragmented MP4s.
Currently only supports a single offset to the full media timeline
(indicated by a duration of 0). This is most often used to fix the
non-zero starting presentation timestamp introduced when B-frames
are present.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111816916
2016-01-14 17:13:31 +00:00
cblay
aec9657c76 Internal refactor.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111746825
2016-01-14 17:13:08 +00:00
olly
ab9e3bac46 Introduce HlsTrackSelector.
This is equivalent to DashTrackSelector and SmoothStreamingTrackSelector.
This is a step toward allowing HlsChunkSource to expose multiple tracks,
which is a requirement for supporting WebVtt.

This change also enables WebVtt extractor instantiation.

Issue: #151
Issue: #676
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111698833
2016-01-14 17:08:25 +00:00
olly
00f8deda3d Introduce PtsTimestampAdjusterProvider for HLS WebVTT.
This allows the same adjusters to be used by multiple
HlsChunkSource instances. This is necessary because
WebVTT chunks will be loaded by a second chunk source
to the one loading audio/video. In both cases the same
timestamp adjustments will need to be applied.

Each source may transition from one discontinuity sequence
to the next at a slightly different time, so it's necessary
to maintain a separate adjuster for each sequence.

An adjuster can only be initialized correctly using audio/video
and not WebVTT, because the start time in a WebVTT file in
HLS doesn't necessarily correspond to the chunk start time,
which means the timestamp offset calculated by the adjuster
could end up being incorrect. Hence sources providing WebVTT
chunks will set isMasterSource to false. Lovely, right :(?

Issue: #151
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111693126
2016-01-14 17:08:25 +00:00
olly
b9ec51dbed SmoothStreaming track selector feature parity with DASH.
This gives DefaultSmoothStreamingTrackSelector feature parity
with DefaultDashTrackSelector. Note that the code duplication
across these classes will go away eventually, when we rework
track selection as described in Github Issue #1121.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111688784
2016-01-14 17:08:25 +00:00
olly
00e903b32e Don't pass maxWidth/Height for non-video streams.
This is a no-op change for clarity only. maxWidth/maxHeight
don't mean anything for AAC/MP3, so it makes sense to pass
MediaFormat.NO_VALUE in all cases.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111619832
2016-01-07 22:52:51 +00:00
aquilescanta
651996983b Refactored the Webvtt parsing classes
Moved the behaviors related to Cue's to the WebvttCueParser class.
This way, the parsing methods will be more easily accessible to
other classes, such as the MP4Webvtt parser. This class also has
some methods that require state to avoid repetitive avoidable
allocations. The method visibility is subject to changes in
further CLs.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111616824
2016-01-07 22:52:34 +00:00
olly
0aa4d3d209 Remove dead code.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111613354
2016-01-07 22:47:58 +00:00
andrewlewis
664c80da15 Set a max input size for VP8 and VP9.
Issue: #1090
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111607802
2016-01-07 22:47:58 +00:00
olly
cc1f3e5cac Clean up parser exception a little + add descriptions.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111515406
2016-01-06 17:43:02 +00:00
olly
27e11f1f1a Workaround flushing issues on S-3 JB MR2.
Targeting to all API level 19 devices using the OMX.SEC.avc.dec
decoder is probably the right thing to do. It shouldn't have
negative implications if we apply the workaround on devices that
don't really need it, except to slow down seeking slightly due
to decoder re-allocation. Given we're talking about JB, I think
the priority should be to "make sure it works".

Issue: #951
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111514406
2016-01-06 17:43:02 +00:00
olly
9e3e61901e Remove stray line break (ineffectively busy).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111507159
2016-01-06 17:43:02 +00:00
olly
1892779535 Increment frame timestamps (TS/H.262).
We normally expect each frame to come in its own PES packet,
but it seems that this is not always the case. This change
uses the frame rate in the stream to increment the frame
timestamp in the case of multiple frames contained within
a single PES.

Note that since we don't expect 100s of frames in a single
PES, or anything close to that really, the rounding errors
that may accumulate due to use of a frame duration should be
fine.

Issue: #1112
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111499052
2016-01-06 17:43:02 +00:00
andrewlewis
d740bf9f23 Handle edit lists with one 0 duration edit.
Issue: #1102
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111497855
2016-01-06 17:43:02 +00:00
eguven
69a42b60f8 Implement ID3 Metadata support for audio only HLS.
Issue: #862
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111403855
2016-01-05 14:52:51 +00:00
aquilescanta
1e4f2f6a1f Refactored WebvttCueParser methods to be static
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111402555
2016-01-05 14:52:44 +00:00
andrewlewis
7c103ca5f8 Using ExtractorInput.peek* instead of BufferingInput.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111394118
2016-01-05 14:52:39 +00:00
aquilescanta
681df4e4aa Refactored the SubtitleParser's parse() signature
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111326567
2016-01-05 14:52:30 +00:00
olly
9bcd1069b1 Blacklist CIPVorbisDecoder.
Issue: #1111
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111326378
2016-01-04 20:59:22 +00:00
olly
18a39f3350 Add ability to not offset in PtsTimestampAdjuster.
Issue: #1078
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111325745
2016-01-04 20:59:15 +00:00
andrewlewis
890dd5afb5 Add a peekFully overload with allowEndOfInput.
This is in preparation for removing BufferingInput,
and using peeking instead.

Also add tests for peeking with allowEndOfInput and
resetPeekPosition.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111318236
2016-01-04 20:59:06 +00:00
olly
030f26fd2d Fix an unsafe check in FragmentedMp4Extractor.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111315463
2016-01-04 20:58:58 +00:00
aquilescanta
c31473c596 Work around for the Choreographer's resource leak.
This CL adds a class responsible for managing the lifecycle
of a single Choreographer to be shared among all
VideoFrameReleaseTimeHelper instances.

Issue: #1066
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=110839824
2016-01-04 20:58:39 +00:00
aquilescanta
33a2b2d0c5 Added test cases to the MP4Webvtt parser
This CL is prepares the ground for refactoring the Webvtt parser,
so as to use the common parsing algorithms in both parsers. In order
to do this, the Webvtt Parser will be refactored. As a side note, many
more test cases will be added once the new subtitle features are
implemented. Some useful test cases have also been left for a following
CL, to allow an easy code review.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=110466914
2016-01-04 20:58:04 +00:00
olly
dd497b1259 Don't check a framerate if we don't have one.
Seems (marginally) nicer than making one up :). I didn't
realize there was a method that didn't require a framerate
to be passed!
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=110456874
2016-01-04 20:57:58 +00:00
Ian Bird
2b1816c1f2 Skip substream id field when parsing EAC3 sync frame format 2016-01-04 08:59:36 +00:00
Ian Bird
e33345e5b8 Add support to identify (E)AC3 streams via TS descriptor tag 2016-01-04 08:58:57 +00:00
Oliver Woodman
b9607321fe Simplify DefaultExtractorInput 2015-12-17 12:15:09 +00:00
Oliver Woodman
cf13280590 Allow onOutputFormatChanged to throw ExoPlaybackException 2015-12-17 12:14:26 +00:00
olly
7fbffc873c Expose control over decoder selection.
This allows implementation and injection of custom MediaCodecSelector
instances. By injecting a custom selector, it's possible for applications
to exert more control over which decoder(s) they instantiate. For example,
applications can force use of a software decoder.

GitHub Issue #938
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=110369810
2015-12-16 20:41:51 +00:00
eguven
f16b8baf75 ExtractorInput new skip methods to make skip methods analogous to the three read methods.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=110155932
2015-12-16 20:41:51 +00:00
Oliver Woodman
009b454b69 Add InputStream to byte[] method to Util. 2015-12-16 20:33:50 +00:00
Oliver Woodman
7f8ddeac39 Added little endian methods to ParsableByteArray. 2015-12-16 20:33:04 +00:00
Oliver Woodman
50d5cbea70 Don't treat network_PID as program_map_PID.
Issue: #1068
Issue: #1001
2015-12-16 19:57:14 +00:00
yauhen
7fce590db2 blacklisted broken mp3 decoder on api lower than 20 2015-12-14 17:50:54 +03:00