2514 Commits

Author SHA1 Message Date
aquilescanta
6e69b98517 Avoid throwing an exception when an ID3 header is not found
Issue:#1966

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136836332
2016-10-24 11:44:49 +01:00
aquilescanta
eeb37d73e7 Create the SectionPayloadReader interface
SectionPayloadReaders are provided to a SectionReader to
get whole sections(crc checked). This allows the injection
of custom section readers. E.G: SCTE35 messages.

Issue:#726

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136816612
2016-10-24 11:44:49 +01:00
andrewlewis
a0fe258e8d Fix/suppress some analysis warnings.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136710546
2016-10-24 11:44:49 +01:00
aquilescanta
862552c2ed Convert ElementaryStreamReaderFactory into TsPayloadReaderFactory
In this CL:

* PesReader moves out of TsExtractor and becomes public.
* ElementaryStreamReaderFactory becomes TsPayloadReaderFactory and is
    moved to TsPayloadReader.
* The TsPayloadReaderFactory is in charge of wrapping any
    ElementaryStreamReaders with a PesReader.

Incoming:
* Extract SectionReader supperclass (analog to PesReader, but for
    sections) from Pat and Pmt readers.
* Add a ScteReader, wrapped by a section reader, and include it in
    the DefaultTsPayloadReaderFactory.

Issue:#726

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136707706
2016-10-24 11:44:49 +01:00
olly
0cff74dc70 Clean up okhttp extension Javadoc
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136702598
2016-10-24 11:41:52 +01:00
Santiago Seifert
e4bafd964d Merge pull request #1979 from vitekn/dev-v2
Fix NPE in TsExtractor when ElementaryStreamReaderFactory returns null
2016-10-21 11:45:21 +01:00
vitekn
b2222f8cb7 Null pointer exception fixed
pesPayloadReader can be null here because DefaultStreamReader.init() can return null on unknown streamId. If we have a junk transport stream in our content an exception will be thrown.
2016-10-21 13:07:08 +03:00
ojw28
6673483aca Merge pull request #1971 from google/dev-v2
Update dev-v2-id3
2016-10-20 12:43:38 +01:00
ojw28
d79f8f64de Merge pull request #1970 from google/dev-v2-r2.0.4
r2.0.4
2016-10-20 12:33:44 +01:00
olly
c7824c4660 Bump version to r2.0.4
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136697697
2016-10-20 12:22:46 +01:00
aquilescanta
8e0e0ca0dd Fix NPE when trying to play H265 in Ts files
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136607848
2016-10-20 12:22:25 +01:00
Oliver Woodman
924a041743 Merge branch 'dev-v2' of persistent-https://github.com/google/ExoPlayer into dev-v2 2016-10-20 12:20:45 +01:00
olly
f56b05f0d7 Bump version to r2.0.4
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136697697
2016-10-20 12:20:10 +01:00
aquilescanta
bebbf29a78 Fix NPE when trying to play H265 in Ts files
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136607848
2016-10-20 12:20:10 +01:00
Oliver Woodman
aa660acf03 Fix typo in comments 2016-10-20 12:00:35 +01:00
olly
75b0075340 Add explicit TargetApi annotation to remove lint error
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136597149
2016-10-20 11:43:45 +01:00
olly
0d679dad0d Fix use of API level 19 method
Issue: #1965

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136595233
2016-10-20 11:43:16 +01:00
Oliver Woodman
3e3248d712 Yet more misc ID3 improvements 2016-10-19 17:18:17 +01:00
olly
586e6257cd Add explicit TargetApi annotation to remove lint error
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136597149
2016-10-19 17:00:33 +01:00
olly
3a5cb43541 Fix use of API level 19 method
Issue: #1965

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136595233
2016-10-19 17:00:33 +01:00
olly
aa1002a0d6 Rollback "Add REQUIRE_HTTPS flag"
*** Reason for rollback ***

Flag doesn't enforce what it says it enforces, due to redirects

*** Original change description ***

Add REQUIRE_HTTPS flag

Note that it's not possible for the library to enforce that
the flag is adhered to, since it's possible for applications
to inject custom implementations of DataSource (there's no
requirement they even extend HttpDataSource for network
requesting implementations). It's possible for applications
to replace pretty much anything in the library, so there's
no other place we could put the flag where we could make
this guarantee. Hence this is a best-effort that will work
when...

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136583459
2016-10-19 17:00:03 +01:00
aquilescanta
aecbbdd36c Replace IndexOutOfBounds Exception for BehindLiveWindowException
This is a problem when two invocations of getNextChunk that retrieve
chunks (i.e. not playlists) occur too apart in time. In that case
the last loaded chunk has a media sequence that is behind the current
playlist.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136501291
2016-10-19 17:00:03 +01:00
olly
1cfc432bb8 Add REQUIRE_HTTPS flag
Note that it's not possible for the library to enforce that
the flag is adhered to, since it's possible for applications
to inject custom implementations of DataSource (there's no
requirement they even extend HttpDataSource for network
requesting implementations). It's possible for applications
to replace pretty much anything in the library, so there's
no other place we could put the flag where we could make
this guarantee. Hence this is a best-effort that will work
when using HttpDataSource implementations that we provide.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136500947
2016-10-19 17:00:03 +01:00
kapishnikov
d3f78e4808 Deprecate call to new UrlRequest.Builder(...)
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136399474
2016-10-19 16:59:38 +01:00
eguven
06fb29c939 Support caching of multi segment DASH, HLS and Smooth Streaming.
Use sha1 of content uri if a custom cache key or content id isn't provided.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136351830
2016-10-19 16:58:09 +01:00
Oliver Woodman
7e352295d7 Propagate ID3 data for MP3 2016-10-18 15:17:01 +01:00
Oliver Woodman
7594f5b78b Further enhance ID3 decoder + support 2016-10-18 15:02:35 +01:00
ojw28
e2ff401ea1 Merge pull request #1958 from google/dev-v2
Merge dev-v2 into dev-v2-id3
2016-10-17 22:52:12 +01:00
Oliver Woodman
66652f65bb Make Id3Util final 2016-10-17 22:47:03 +01:00
Oliver Woodman
4391014a7a Split genres into separate util class 2016-10-17 22:45:09 +01:00
Oliver Woodman
110c8f6f1f Improvements to ID3 decoder 2016-10-17 22:35:21 +01:00
ojw28
08256eee32 Merge pull request #1955 from google/dev-v2
r2.0.3
2016-10-17 15:55:12 +01:00
olly
cecb1f5f76 Bump version + update release notes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136339035
2016-10-17 15:43:57 +01:00
aquilescanta
e873b4b6ab Change prepare() for maybePrepare() in HlsSampleStreamWrapper
This will allow asynchronous preparation.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136176854
2016-10-17 15:43:57 +01:00
Oliver Woodman
50aeb20cc2 Make Id3Decoder stateless again
One issue with the previous implementation was that
isUnsynchronized would not be set back to false if
previously set to true and if the next header has
majorVersion >= 4. In general, having the decoder be
stateless is clearer (and thread safe, albeit that
this property is not required).
2016-10-17 14:38:56 +01:00
klampert
dca4d16bef Release surfaces created to wrap SurfaceTextures
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136163292
2016-10-14 18:57:30 +01:00
olly
6acf59c4fc Fix Widevine L3 provisioning in V2
1. HttpMediaDrmCallback.executeProvisionRequest needs to specify
   an empty byte[], else we do a GET instead of a POST.
2. Content-Type should not be set when making the provision
   request, since there's no body.
3. DataSource implementations must correctly handle a non-null
   body with zero length. CronetDataSource was not handling this
   case. DefaultHttpDataSource was, but made a code modification
   to make it a little clearer. OkHttpDataSource seems to handle
   the case correctly, and it doens't look like the code can be
   made clearer.

Issue #1925

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136042641
2016-10-14 10:42:43 +01:00
olly
a22390c29b Parse CEA-708 codec for rawCC
Note that actually handling CEA-708 is not yet implemented,
and so this is a no-op change from a behavior point of view.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136038439
2016-10-14 10:42:43 +01:00
aquilescanta
e685edc179 Make interface implementation consistent among ExtractorOutputs
The method track(int id) currently has different behaviours across
implementations. This CL maps ids to track outputs, which means
that successive calls with the same id will return the same
TrackOutput instance. Also fixes TsExtractor inconsistent behavior
after a seek.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136026721
2016-10-14 10:42:43 +01:00
aquilescanta
ff712aead5 Try not adapting before failing with BehindLiveWindowException in Hls
Issue:#1782

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136025847
2016-10-14 10:42:43 +01:00
olly
64262085a7 Block when surface being replaced is non-null
A blocking call is necessary where we want to guarantee that
the player wont access the surface after the method call has
returned. We currently only do this for the case:

Surface->Null

But we should also do it for the case:

SurfaceA->SurfaceB

Since the caller may reasonably do something like destroy
SurfaceA immediately after it's been replaced.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135921296
2016-10-14 10:42:43 +01:00
aquilescanta
f18373eeb2 Decouple TsExtractor's readers from TrackOutputs
This allows the injectable reader factory to be a stateless factory, allows
the seeking to be consistent and will allow multiple CC channel support later
on.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135909712
2016-10-14 10:42:43 +01:00
olly
94c7ee7252 Cronet - Skip if server doesn't support range requests
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135819142
2016-10-14 10:42:43 +01:00
Oliver Woodman
bffffb0fac Minor ID3 tweaks 2016-10-12 17:27:54 +01:00
ojw28
f4b8d9490a Merge pull request #1935 from google/dev-v2
Update dev-v2-id3 with dev-v2
2016-10-12 17:05:09 +01:00
olly
996fe47f8c Fix NPE releasing HlsMediaPeriod
Issue: #1907

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135798950
2016-10-11 18:16:28 +01:00
olly
29f3eb5e5a Fixes for retries
- Fix issue in ExoPlayerImpl where the timeline was null'd
  but onTimelineChanged was not fired.
- Add the ability to not reset the timeline. This is useful
  for retries where you know the timeline will be the same
  as it was previously.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135797577
2016-10-11 18:16:28 +01:00
olly
83107cc25d Fix missing release calls on loadingPeriodHolder
playingPeriodHolder can be null in the case that the first
period is still being prepared. We need to make sure we
release the period that's being prepared in such cases,
which is loadingPeriodHolder.

Issue: #1914

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135793472
2016-10-11 18:16:28 +01:00
olly
907b9bf4f6 Sanitize threading in CronetDataSource
- Move nearly all logic onto the calling thread (i.e. the thread
  calling open/read/close), to make threading correctness more
  obvious.
- Document which variables are read/written from which thread, and
  why the call sequences are safe.
- Fix thread safety issue that I think could probably cause data
  corruption in the case of a read timeout followed by another
  request into the DataSource.

Also:

- Relaxed content length checking to be consistent with the other
  http DataSource implementations, and avoided parsing the headers
  where they're not used.
- Fixed missing generics in CronetDataSourceFactory.
- Added TODO to work with servers that don't support partial range
  requests.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135702217
2016-10-11 18:16:28 +01:00
olly
4fab402274 Fix missing generics
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135700280
2016-10-11 18:16:28 +01:00