125 Commits

Author SHA1 Message Date
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
andrewlewis
af3452d231 Make SampleSources reusable and implement SampleSourceProvider.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126888556
2016-07-08 10:15:14 +01:00
olly
19d65a7a9d Report loading on/off changes via ExoPlayer.
Also attempt to clear up naming a little, using "buffering" to
mean the user visible buffering state, and "loading" to mean a
source being loaded.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126693592
2016-07-07 20:45:53 +01:00
andrewlewis
dd031691b0 Pass an ExtractorsFactory to ExtractorSampleSource.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126672854
2016-07-07 20:44:12 +01:00
andrewlewis
7b673fe432 Fix miscellaneous consistency/formatting things.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=126631393
2016-07-07 20:41:18 +01:00
andrewlewis
2073f3fce3 Expose source indices via ExoPlayer (playlists #5).
ExoPlayer.EventListener.onPositionDiscontinuity is notified during seeking and
transitioning from one source to the next.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=125578976
2016-07-07 20:23:21 +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
olly
f4e4fd51c6 Clean up chunked media source event listeners.
- Event listener is now at the SampleSource level, since the
  individual ChunkTrackStream instances are created internally.
- Event listener receives events corresponding to loads made
  at the SampleSource level (e.g. manifest fetches) in addition
  to those made by the ChunkTrackStream instances.
- Added ability for FormatEvaluators to propagate arbitrary
  information (as an Object) through to the listeners. This was
  a request from YouTube.
- Added significantly more information to each event, for example
  the DataSpec that defines the load being made is now passed, as
  is timing information.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124732984
2016-06-15 19:43:17 +01:00
olly
0978227a84 Create a new CodecCounters on enable
If the same instance is reset then rapidly re-enabling the
renderer after disabling it can prevent an application from
reading the final values at the time when the renderer was
disabled. Hence we now instantiate a new CodecCounters each
time. This is needed to migrate DashTest to V2.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124721106
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
4b3c72c057 FlacExtractorTest
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124357946
2016-06-15 19:42:12 +01:00
eguven
b5a9e4181b FlacJni: Add exceptions to jni methods' definitions.
These methods call read(...) method which may throw these exceptions.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=124332828
2016-06-15 19:42:09 +01:00
andrewlewis
e684e42994 Clean up DefaultDataSources and add factory for okhttp DataSources.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123991352
2016-06-15 19:42:04 +01:00
olly
c622483f79 Enable seamless rejoing for Vp9 extension.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123982330
2016-06-15 19:42:04 +01:00
olly
69bd31f7c2 Fix video renderer rejoining.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123976645
2016-06-15 19:42:03 +01:00
andrewlewis
a100175b72 Rename TrackRenderer.reset to TrackRenderer.onReset.
This allows the TrackRenderer superclass to do things when the renderer is
reset, and makes resetting consistent with other 'events' on renderers.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123974633
2016-06-15 19:42:03 +01:00
olly
ff745ac444 Make ExtractorSampleSource constructor consistent.
The allocator and buffering policy (e.g. how large the buffer
is) is moving to the top level as part of playlist support,
so it no longer makes sense to inject these parameters as
args into ExtractorSampleSource's constructor.

Instantiating the allocator and buffer size inside of the
source is temporary and only until they're moved up.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123968976
2016-06-15 19:42:03 +01:00
olly
14cb76a112 Make ExoPlayer systrace consistent.
Plus remove some unused util methods + make a few
warnings go away.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123888046
2016-06-15 19:42:03 +01:00
andrewlewis
5cf7c2ecf4 Separate enabling/setting TrackStreams in renderers (playlists #1).
This is in preparation for changing the TrackStream while keeping the renderer
enabled, to give seamless transitions for playlists.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123394733
2016-06-15 19:41:52 +01:00
eguven
17f8ac8adf Validate Extractor behavior when load position is reset to 0 following an error.
Added a new method TestUtil.consumeTestData() to emulate
the exact behaviour and modified OggExtractorFileTests to
use it. Rest of the test will be fixed in follow up CLs.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123320538
2016-06-15 19:41:35 +01:00
olly
10329eb111 Allow delivery to multiple messages in a single message.
Where multiple messages are required to be sent in order
to perform a player reconfiguration, it will usually be
desirable to process all messages in a single "transaction"
(i.e. without any rendering happening when only some of
the messages have been applied).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123228334
2016-06-15 19:41:34 +01:00
andrewlewis
da2cfd601d Keep intermediate .so files inside the ffmpeg directory.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123203428
2016-06-15 19:41:34 +01:00
olly
ced7de15a9 Promote DemoPlayer to library as SimpleExoPlayer.
DemoPlayer moves into core library as SimpleExoPlayer, which
implements ExoPlayer.

Issue: #383
Issue: #592
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=123090184
2016-06-15 19:41:34 +01:00
olly
58953d370f Simplify DemoPlayer + misc surrounding components.
1. Properly split out listening responsibilities so that
   DemoPlayer only listens to its own components.
2. Revert StreamingDrmSessionManager UnsupportedDrmScheme
   exceptions back to how they worked in V1, and inject
   a DrmSessionManager rather than a MediaDrmCallback into
   DemoPlayer.

This much better prepares DemoPlayer for promotion into
the core ExoPlayer library, since it removes assumptions
such as what SampleSource and DrmSessionManager impls
might be used with it.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122980952
2016-06-15 19:41:34 +01:00
andrewlewis
ddde6edb92 Add FFmpeg extension.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122978403
2016-06-15 19:41:33 +01:00
aquilescanta
fce17e7ffc Added a trackSelectionFlags field to format.
This field will allow us to flexibly add information provided by the container
or streaming manifests related to the tracks that must be selected.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122559858
2016-06-15 19:41:33 +01:00
olly
a16a333df2 Clean up renderer event listeners.
- Don't report errors to listeners if playback will immediately
  fail. Doing so is redundant, since such errors are immediately
  reported through ExoPlayer's listener as a result of playback
  failure. We were also reporting these errors inconsistently
  across renderers.
- Reduce code duplication through EventDispatcher classes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122519976
2016-06-15 19:41:32 +01:00
aquilescanta
2f4bfc3f5f Add the TrackSelectionPolicy to decouple track "assignment" and selection
Allows the user to provide their own criteria for selecting one of the available tracks
without having to reimplement the track assignment logic, i.e. linking type x tracks with
type x renderer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122422087
2016-06-15 19:41:32 +01:00
olly
efaea81194 Use CodecCounters consistently in all renderers.
- Increment skippedBufferCount for VPX and ADTR.
- Set maxConsecutiveDroppedOutputBufferCount count for VPX.
  Tweak its meaning to ignore skipped frames.
- Remove outputFormat/outputBuffer changed counts. These add
  limited value. Also, MediaCodec is moving toward a model where
  you don't see the output buffers changing because you dequeue
  them one at a time (like how our extension decoders work).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122258530
2016-06-15 19:41:31 +01:00
olly
3760f514a9 Flesh out ExoPlayer extensions.
1. AudioDecoderTrackRenderer now reports decoder initialization
   and AudioTrack underruns.
2. AudioDecoderTrackRenderer can now render more than one output
   buffer per call to doSomeWork, to be consistent with
   MediaCodecAudioTrackRenderer. This may also prevent audio
   underruns in the case that audio is fragmented into many small
   buffers.
3. AudioDecoderTrackRenderer now has an overridable method that
   receives the audio session id, to be consistent with
   MediaCodecAudioTrackRenderer.
4. Fix unsafe event notification in LibvpxVideoTrackRenderer.
5. Vpx and AudioDecoder extensions now increment the CodecCounter
   inputBufferCount field correctly.
6. Decoders now have names :).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122250009
2016-06-15 19:41:31 +01:00
olly
97c633f128 Advertise adaptive support in LibvpxVideoTrackRenderer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122247836
2016-06-15 19:41:31 +01:00
andrewlewis
403f164b75 Pass the sample Format to AudioDecoderTrackRenderer.createDecoder.
The FFmpeg extension can support various different MIME types, so pass the
whole format to configure the decoder.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122246589
2016-06-15 19:41:31 +01:00
andrewlewis
180d10334a Add .cproject for FLAC Eclipse build.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122157285
2016-06-15 19:41:30 +01:00
andrewlewis
1dcd454477 Rename util.extensions package to extensions.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122151232
2016-06-15 19:41:30 +01:00
olly
68d39b5159 Remove DecoderInputBuffer.size
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122146105
2016-06-15 19:41:30 +01:00
olly
f9f95d638b Make ExtractorSampleSource amenable to proguarding.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122085277
2016-06-15 19:41:30 +01:00
olly
356288a018 Fix documentation.
- Merge guide.md updates from GitHub.
- Update Opus repository.
- Fix missing link in Opus README.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=122080285
2016-06-15 19:41:30 +01:00
eguven
9ee3030b79 Opus initialization data should be in native order.
http://developer.android.com/reference/android/media/MediaCodec.html#CSD
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121957004
2016-06-15 19:41:30 +01:00
olly
b61e7cdbc4 Support 8-bit and 24-bit PCM with re-sampling.
This is a cleaned up version of the pull request below,
which will be merged with this change then applied on top.

https://github.com/google/ExoPlayer/pull/1490

Issue: #1246
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121926682
2016-06-15 19:41:09 +01:00
cblay
d2c524d726 Add open/read http exception classes.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121871799
2016-06-15 19:40:39 +01:00
olly
9f2707cfa3 Push DrmInitData into Format.
- This means DrmInitData is propagated through sample queues (i.e.
  is effectively attached to every sample, so we can see when it
  changes when reading from the queue).
- It also allows different DrmInitData per track, which is possible
  in muxed MKV/WebM, and per Representation for DASH, although we
  wont be able to seamlessly adapt in the latter case.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121821928
2016-06-15 19:40:39 +01:00
eguven
642b2009f3 Add extensions to v2 demo app.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121674924
2016-06-15 19:40:39 +01:00
eguven
686816a610 Fix format constructor parameter order.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121468904
2016-06-15 19:40:09 +01:00
aquilescanta
45a46c3e6e Add getTrackType to allow track selection
In order to apply track type specific policies in
the track selection, we need to know the type of
the track renderer, this method returns one of the
constants defined in C.java of the form TRACK_TYPE_*
to allow renderer classification.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=121369021
2016-06-15 19:39:52 +01:00
cdrolle
0bd26b74b2 Remove Eia608TrackRenderer
Functionality is moved into Eia608Parser, so that Eia608Parser
can be used with TextTrackRenderer, similar to all the other
text/subtitle formats. Modified some of the other
text/subtitle-related classes to support the new behaviour.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120755145
2016-06-15 19:39:11 +01:00
eguven
d1eb43ad62 V2 Extension fixes
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120699171
2016-06-15 19:39:11 +01:00
olly
ab615682b5 Fix green screen problem when using VpxRenderer.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120689946
2016-06-15 19:39:11 +01:00
olly
0fc53f6e37 Fix Flac test + bring v2 fully in sync (I think!).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120335929
2016-06-15 19:39:10 +01:00
olly
7638bea016 Bring V2 ogg extractor up to date.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=120332721
2016-06-15 19:39:10 +01:00