188 Commits

Author SHA1 Message Date
aquilescanta
6306c26988 Add support for fragmented MP4 in HLS
This CL adds support for initialization segments in HLS. This is required mainly for(but not limited to) usage of fMP4. The fMP4 support only consists in creating the required extractor if the extension is .mp4, provided the initialization segment is correctly
loaded and passed to the extractor.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134997636
2016-10-04 23:38:47 +01:00
cdrolle
040fe3b194 Refactored the text.eia608 package to text.cea.
All of the classes in the text.eia608 package have been moved to
text.cea, and renamed with the "cea" prefix instead of "eia". All of
the buffering logic has been extracted from Cea608Decoder (formerly
Eia608Decoder) into the abstract CeaDecoder, which Cea608Decoder
extends. Cea608Decoder also now expects a 3-byte sample (i.e. the
entire cc_data_pkt instead of just the cc_data_1 and cc_data_2 bytes).
Classes like RawCcExtractor and SeiReader, responsible for creating
these samples, have also been updated accordingly.

This change is a necessary precursor to adding support for multi
-channel CEA-608 and CEA-708 captions.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134537482
2016-09-29 16:28:58 +01:00
aquilescanta
ed5decfafc Add ElementaryStreamReader's factory to inject custom readers in TSExtractor
Issue:#726

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=134433012
2016-09-28 11:26:12 +01:00
andrewlewis
6a099f1c57 Clean up MP3 synchronization and fix handling < 4 frames.
Also add a test MP3 stream with one frame.

Make FakeExtractorInput's end of input detection to apply also for peekFully, and
make its skip and read methods read at least one byte.

Issue: #1732

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133241641
2016-09-16 18:52:42 +01:00
andrewlewis
b1f9798b89 Fix peeking the end of the stream then reading it.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133240502
2016-09-16 18:51:52 +01:00
eguven
5512aae451 Revert CacheSpan EOS changes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=133123235
2016-09-14 16:34:27 +01:00
aquilescanta
3bad28ac91 Fix TsExtractor tests
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132561841
2016-09-13 17:32:55 +01:00
aquilescanta
12b7bbf803 Improve HLS master playlist parsing
Adds a few unused fields to HlsUrl and moves things towards the Hls
reimplementation we are looking for. Also fixes a bug related to
asuming every getNextChunk().loadable == null being related to
reaching the live edge.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132305206
2016-09-08 16:29:48 +01:00
eguven
06a644eccd DataSourceException: Used to specify a DataSource error.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132053698
2016-09-02 16:20:06 +01:00
aquilescanta
fa500791c5 Rename Variant to HlsUrl and move into HlsMasterPlaylist
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=132049545
2016-09-02 16:18:47 +01:00
olly
a779eabdc5 Update SDK / Tools.
- Centralise compileSdkVersion, targetSdkVersion and
  buildToolsVersion in a single place for gradle.
- Bump compileSdkVersion and targetSdkVersion to 24.
- Bump com.android.tools.build version to re-enable
  instant start.
- Bump targetSdkVersion in manifests (needed for
  internal builds).
- Use standard expandable_list_item from Android in
  the demo app, since ours doesn't look right when
  targeting API level 24. We were also setting the
  theme on the wrong element in the manifest, so I'm
  removing that line.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131929216
2016-09-02 16:12:55 +01:00
eguven
bd7be1b5e7 Cache support unbounded requests.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131696858
2016-08-31 15:26:02 +01:00
aquilescanta
09c58004dc Add an AC3 bitstream extractor
Defined in ATSC Standard: Digital Audio Compression (AC-3, E-AC-3).
Link: http://atsc.org/wp-content/uploads/2015/03/A52-201212-17.pdf.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=131294260
2016-08-31 15:25:31 +01:00
aquilescanta
abdb8ddb6e Remove 1 track per type limitation in TsExtractor
Mainly, this allows the extractor to expose multiple audio tracks.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130928152
2016-08-31 15:25:18 +01:00
olly
2c84f016fe Parse and expose proj and st3d/stereo_mode
As described in:
https://github.com/google/spatial-media/blob/master/docs/spherical-video-v2-rfc.md.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130776689
2016-08-31 15:25:18 +01:00
olly
1579b68cf6 Sanitize constants
- Use a single constant for unset/unknown times across
  all time bases. Note also that this moves away from
  use of -1 for unset/unknown times in ms, which was a
  bad choice (it might conflict with real times, such
  as a time representing being just behind the start
  of a live window).
- Add a few other unset constants, and use them.
- Fix some hardcoding of -1 where existing constants
  should have been used.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130775594
2016-08-31 15:25:18 +01:00
eguven
096f85202e Use manifest URL sha1 hash as the content id.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130293908
2016-08-31 15:25:06 +01:00
eguven
c380ba2dc1 CacheSpan.isEOS (is end of stream) field shows whether the {@link CacheSpan} contains the end of the original stream.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130084365
2016-08-31 15:25:05 +01:00
vigneshv
a2dfc62e08 MatroskaExtractor: Implement subsample encryption
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129908648
2016-08-31 13:20:50 +01:00
olly
f6fdcee9b3 Parse stz2 Atoms during mp4 extraction.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129892143
2016-08-10 20:16:05 +01:00
eguven
bd37216902 CacheSpan and Util.un/escapeFileName tests.
Fixed CacheSpan regexp for line breaks characters in key.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=129631446
2016-08-10 20:06:06 +01:00
olly
abd5653dc4 Add Util.getUtf8Bytes to avoid warnings
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128980489
2016-08-08 11:08:11 +01:00
andrewlewis
8d122a101d Use new import ordering.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128967776
2016-08-08 11:06:48 +01:00
cdrolle
1d79c26b34 Added support for RawCC (i.e. out-of-band EIA-608)
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128397367
2016-07-28 20:04:31 +01:00
mishragaurav
1624135c20 Parse widevine tag in manifest for secure decryption.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128345063
2016-07-28 19:37:12 +01:00
olly
9e9634a1a2 Delete disabled tests
The classes these tests are written for have changed
so much we'll have to write them again. We can refer
to V1 if we want to look at what the old tests did, so
there's no need to keep this file in the V2 tree at
the moment.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128189076
2016-07-22 22:41:36 +01:00
olly
ba0a4235a0 Consistent Javadoc for text package
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128160177
2016-07-22 22:41:36 +01:00
olly
722e05b8ba Some brevity/consistency renaming in source package
SmoothStreaming -> Ss
MediaPresentationDescription -> DashManifest
DashSingleSegmentIndex -> SingleSegmentIndex

Moved DASH and Ss manifest classes to matching
manifest packages for consistency. For Hls the
package is called playlist still, since that's
what they're widely known as.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127925961
2016-07-22 22:41:35 +01:00
olly
74b43e26bd Allow injection of custom ChunkSources
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127737169
2016-07-22 22:21:06 +01:00
olly
f758082d40 Big (and hopefully near-final) rename.
1. Rename "extensions" package to "decoder". It's used by both
   text and (should be used by) metadata, so it's no longer just
   for extensions.
2. Move Buffer objects move into the decoder package.
3. Rename SubtitleParser and MetadataParser to SubtitleDecoder
   and MetadataDecoder respectively, since they extend Decoder.
   Ditto for all subclasses.
4. Subtitle and Metadata decoders now throw their own exception
   types rather than ParserException.
5. Move MediaCodec classes into a mediacodec package, with the
   exception of the concrete audio and video renderers.
6. Create an audio package to hold the two audio renderer classes
   plus related util classes.
7. Create a video package to hold the one video renderer class
   plus related util classes.

After this change the following nice properties hold:

1. Want a video renderer? Look in the video package. Ditto for
   audio, text and metadata.
2. All TrackRenderer implementations use a decoder of some kind
   to decode buffers received from the source, so we have
   consistent terminology there.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127326805
2016-07-15 18:14:55 +01:00
olly
62ebcaf853 Remove unnecessary res placeholder files
I think these were needed for Eclipse only.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127232262
2016-07-15 18:11:05 +01:00
olly
4e86c55361 Introduce source package for sources
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=127073630
2016-07-15 18:02:31 +01:00
olly
dbb43567a3 Finalize v2 directory + package name
- The package is renamed to avoid conflicts with v1, should any
app wish to include both v1 and v2 for a period of time. This is
similar to the approach used by some other open source projects
(e.g. okhttp).
- Copyright year is updated everywhere for completeness.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126895326
2016-07-08 12:12:09 +01:00
olly
85741ff2d3 TTML: Parse and use frameRate/Multiplier + tickRate
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126792535
2016-07-07 20:48:17 +01:00
eguven
adc7ecec09 Support MPEG-TS streams that start/end with an incomplete TS packet or lost sync.
Issue: #1332
Issue: #1101
Issue: #1083
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125659191
2016-07-07 20:25:59 +01:00
olly
4c434005d4 Remove/simplify some extractor tests.
We have our snazzy new file-based extractor tests now,
and the other ones have historically proven way more
hassle than they're worth (e.g. I spent a good few hours
once just trying to work out how to fix the Mp4 extractor
test, having established it was the test and not the
code that was broken!).

I think some more can go from the ogg package, but leaving
in place for now because it's a bit less clear what to
get rid of.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125330072
2016-07-07 20:11:18 +01:00
olly
ec4c7d3acf Remove Eclipse support. Simplify manifests.
It looks like the manifests are essentially pointless,
but various tools are unhappy if I delete them.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124976509
2016-06-15 20:26:37 +01:00
eguven
172bc4e8d8 Increase mkv test sample file seek granularity to have better seek results.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124724113
2016-06-15 19:43:17 +01:00
andrewlewis
7ae9bf409b Play a sequence of sources (playlists #3).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124713796
2016-06-15 19:42:58 +01:00
eguven
4279e22138 TestUtil.assertOutput() also tests seeking.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124556278
2016-06-15 19:42:58 +01:00
aquilescanta
461751b194 Add codec profiles for video container/sample formats.
This allows better decoding support checking.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124550351
2016-06-15 19:42:58 +01:00
eguven
544d88ca56 PsExtractorTest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124355441
2016-06-15 19:42:12 +01:00
eguven
110c819939 FragmentedMp4ExtractorTest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124346810
2016-06-15 19:42:12 +01:00
eguven
98b7e7f4e2 AdtsExtractorTest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124335597
2016-06-15 19:42:09 +01:00
eguven
57d6c49e73 TsExtractorTest: Speed up the test with a smaller test sample file.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124333753
2016-06-15 19:42:09 +01:00
olly
cb9a64da33 Merge ID3 parsing improvements from GitHub.
- Parse APIC and TextInformation frames.
- In MPEG-TS, don't mind if packets contain end padding.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124079930
2016-06-15 19:42:04 +01:00
eguven
ebd37cfb8e Moved testutils package to a seperate module so it can be accessed by the tests in other modules.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123964784
2016-06-15 19:42:03 +01:00
eguven
94fa2ecfe5 WavExtractorTest and TsExtractorTest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123848524
2016-06-15 19:42:02 +01:00
eguven
ecad3bb396 MatroskaExtractorTest: removed unused local variables.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123847017
2016-06-15 19:42:02 +01:00
eguven
d99679a960 flv, mkv and mp4 extractor sample tests.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123845660
2016-06-15 19:42:02 +01:00