Commit graph

21 commits

Author SHA1 Message Date
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
Oliver Woodman
2a832fd3c4 Minor stylistic tweaks. 2014-11-20 11:03:47 +00:00
ojw28
d506d7660d Merge pull request #147 from jonasl/dev-gc
MediaCodecTrackRenderer: Avoid excessive garbage generation
2014-11-19 16:08:38 +00:00
Oliver Woodman
127bcd18c3 Bring internal/external branches closer.
- Unredact internal error ids.
- Move images.
2014-11-19 15:58:26 +00:00
Jonas Larsson
255c3b27f6 MediaCodecTrackRenderer: Avoid excessive garbage generation
Looking up a long in a HashSet<Long> auto boxes the long and leaves
it for the GC. As decodeOnly is relatively infrequent it's much
better to do a simple linear search in a List<Long>. That way
we can avoid boxing every incoming time stamp value. In the general
case this will be linear searching in an empty list, a very fast
operation.

Signed-off-by: Jonas Larsson <jonas@hallerud.se>
2014-11-18 15:41:16 -08:00
Oliver Woodman
6a544da2f8 Use new MediaCodecList APIs on L. 2014-11-18 18:58:04 +00:00
Oliver Woodman
f1c646b793 Add diagnostic info to decoder exceptions + minor cleanup 2014-11-13 16:10:21 +00:00
Oliver Woodman
d2e73dd566 Add brackets to make expression clearer. 2014-11-06 19:26:41 +00:00
Oliver Woodman
5f6b197355 Allow direct and indirect buffer replacement.
Also tweak ManifestFetcher.
2014-10-27 10:58:43 +00:00
Oliver Woodman
027d9eefbd Smoother playback #1.
Propagate elapsedRealtimeUs to the video renderer. This allows
the renderer to calculate and adjust for the elapsed time since
the start of the current rendering loop. Typically this is <2ms,
but there situations where it can go higher (normally when the
video renderer ends up processing more than 1 output buffer in
a single loop).

Also made variable naming more consistent throughout the package.
2014-10-09 17:26:01 +01:00
Oliver Woodman
ec90eac301 Support anamorphic video content. 2014-09-11 16:34:35 +01:00
Oliver Woodman
5d35698d8f Make MediaCodecTrackRenderer discard non-keyframes after seek.
This means that after a decoder flush, the renderer will avoid
feeding non-keyframes into the decoder until it has received and
fed the first keyframe. The decoder has no way of correctly
decoding non-keyframes that arrive before a keyframe.
2014-09-08 11:30:20 +01:00
Oliver Woodman
d465ab7029 Call FormatHolder what it really is.
Since we have a Format class as well, it's very confusing that
FormatHolder actually holds a MediaFormat. I think it's quite
likely that Format will need promoting into the root package as
part of the HLS work, which will make this even more confusing
(although it is possible that for HLS we'll define yet another
Format class, if it turns out we need significantly different
fields).

Note - I deliberately avoided renaming the formatHolder
args/params, because they're not particularly ambiguous and
because it introduces some ugly line breaks.
2014-09-08 11:30:16 +01:00
Oliver Woodman
a7b88cd6a9 Tighten isReady() up again.
- Bring back requirement for the first video frame to be rendered
  before isReady returns true, *unless* we've deduced that the
  upstream source is serving multiple renderers.
- Ditto for requiring that the audio track has some buffered data.
2014-09-08 11:30:14 +01:00
Oliver Woodman
58e9e61688 Remove unnecessary SuppressWarning annotations. 2014-08-12 14:13:43 +01:00
Oliver Woodman
8ec8840261 Minor cleanup.
- Add constants class. Currently housing a single lonely variable,
which is used generally throughout the library, and so no longer
nicely fits into a specific class.

- Rename a few other constants to add clear units.

- Made minor tweak to ExoPlayer documentation.
2014-08-11 18:38:39 +01:00
Oliver Woodman
25a532656c Optimize some CodecCounter inefficiency.
1. Use ints rather than longs.
2. Remove some counters that dont seem hugely useful.
3. Replace use of volatile with explicit method calls that
   cause a memory barrier. This is a lot more efficient than
   using volatile because it can be invoked only once per
   doSomeWork.
2014-08-11 17:42:08 +01:00
Oliver Woodman
9a124120ff Changes around renderer readiness and extraction.
- Make MediaCodecTrackRenderer.isReady more permissive.
  This largely fixes #21
- Bring WebmExtractor closer to FragmentedMp4Extractor.
  The two will probably be placed under a common interface
  fairly soon, which will allow significant code
  deduplication.
2014-08-01 15:56:26 +01:00
Oliver Woodman
b3277c666b Add language to Format (+other misc fix). 2014-07-28 14:29:21 +01:00
Oliver Woodman
563b434de2 Keep audio time in sync with arbitrary decodeOnly samples.
AudioTrack time will go out of sync if the decodeOnly flag
is set of arbitrary samples (as opposed to just those following
a seek). It's a pretty obscure case and it would be weird for
anyone to do it, but we should be robust against it anyway.
2014-07-04 00:52:19 +01:00
Oliver Woodman
27ab5c83a6 Initial drop. 1.0.10. 2014-06-16 12:56:04 +01:00