59 Commits

Author SHA1 Message Date
olly
d804446b34 Implement seeking via a single code path.
When a seek is performed, renderers currently perform the
actions that they need to take in two places: Some changes
are performed in seekTo implementations. Other changes are
performed when discontinuities are read from the source.

In HLS we need to perform what is effectively a seek
originating in the source. To support this, this CL allows
discontinuities read from the source to modify the playback
position. All actions that renderers perform as a result
of a seek are moved to be performed when a discontinuity is
received.

Best way to understand CL:
- Look at SampleSource interface change and then at the
  concrete implementations, to make sure they've been
  changed properly.
- Look at SampleSourceTrackRenderer change.
- Look at concrete renderers. The general pattern is that
  code previously performed in seekTo and READ_DISCONTINUITY
  is merged into onDiscontinuity().

Note: This will be further untangled in V2.

Issue #676
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=112720746
2016-01-22 12:11:16 +00:00
Oliver Woodman
00068c8954 Add vpx extension playback test. 2016-01-22 11:36: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
vigneshv
bb55fd8e47 opus: Add CodecCounters support
Fixes Issue #1047
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=111708934
2016-01-14 17:08:25 +00:00
Yu-Hsuan Lin
9cdd246a55 support okhttp3 2016-01-07 19:50:15 +00:00
andrewlewis
f4c10dc560 Don't hold a lock while rendering in VpxRenderer. 2015-12-17 12:15:48 +00:00
andrewlewis
8d6c4b8eb5 Only allow one input buffer to be dequeued at a time.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=110238340
2015-12-16 20:41:51 +00:00
andrewlewis
3a958ed522 Only return true from isReady after rendering.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=110231626
2015-12-16 20:41:51 +00:00
anjalibh
0b0baa28be Expose and support colorspaces in LibVpx.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=109851975
2015-12-14 10:39:42 +00:00
anjalibh
e487fe6fa7 Allow custom VPX output buffer renderers.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=109832096
2015-12-14 10:39:38 +00:00
vigneshv
00f84fc85f Move APP_PLATFORM to Application.mk
Fixes github Issue #944
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=109563981
2015-12-07 19:55:17 +00:00
vigneshv
e4cf93d04c Fix libyuv clone URL
Fixes Github issue #1015
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=109559497
2015-12-07 19:55:13 +00:00
vigneshv
42984653fb Update libyuv URL in vp9 extension instructions
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=109559103
2015-12-07 19:55:02 +00:00
andrewlewis
c685e27972 Fix {Opus,Vpx}DecoderWrapper flush() buffer handling.
Currently, input/output buffers can 'leak' if they are dequeued then the decoder
is flush()ed. This happens if an input buffer is dequeued then a discontinuity
is read, or an output buffer is dequeued and is early. If this happens several
times, no more buffers are available.

This change makes flush() work like MediaCodec: it returns all dequeued
input/output buffers to the codec. Keeping the behavior in line with MediaCodec
might make it easier to factor out a common decoder interface in the future.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=109054178
2015-12-02 17:01:48 +00:00
Oliver Woodman
9925f8f9b8 Add proguard config for VP9 extension 2015-11-27 18:09:56 +00:00
Oliver Woodman
81040e8d23 Remove stray author tag 2015-11-27 15:56:46 +00:00
Oliver Woodman
0236831e48 Remove author tags. 2015-11-25 17:07:09 +00:00
Oliver Woodman
dc94e44b1f Make output mode a tri-state flag instead of binary
This CL fixes the case when a surface is attached *after* playback
has started.
2015-11-25 17:03:11 +00:00
Oliver Woodman
57ee90a96c Clean up AudioTrack. 2015-11-17 16:29:42 +00:00
Oliver Woodman
80d699920c If we have an output buffer, we're ready. 2015-11-17 16:21:03 +00:00
Oliver Woodman
830229c821 Fix Libopus renderer's isReady to take into account outputBuffer avail. 2015-11-17 15:45:42 +00:00
Oliver Woodman
62a89ae90c tweak javadoc 2015-10-27 18:57:26 +00:00
Oliver Woodman
dd4d4e8f7e Add libopus/libvpx availability checks 2015-10-27 18:36:24 +00:00
Oliver Woodman
c0f0cbcb7a Move to target API level 23 2015-10-26 15:02:32 +00:00
Oliver Woodman
d8b1f9efcc Add API to get the version of native decoders
Add API to get the version of underlying libvpx and libopus
decoders. Also update the demo app to show the version in the UI.
2015-10-26 14:53:27 +00:00
Oliver Woodman
5b81612c3b Tweak okhttp package name 2015-10-01 17:33:02 +01:00
Oliver Woodman
ba6cb05e0a Update ReadMe files. 2015-09-29 21:55:51 +01:00
Oliver Woodman
0ff03e40bd Okhttp extension - Update gradle build 2015-09-29 21:27:37 +01:00
Oliver Woodman
af1ffeccc7 OkHttp extension - Add eclipse project 2015-09-29 21:24:45 +01:00
Oliver Woodman
434a2733a3 OkHttp extension modifications.
1. Change package name (rm "datasource")
2. Require injection of OkHttpClient through all constructors, and
   remove allowCrossProtocolRedirect/connectTimeout/readTimeout
   constructor arguments. The client should be configured with these
   prior to injection.
3. Fix code style to be consistent with the project.
4. Simplify call to get contentLength. I'm pretty sure okhttp returns
   the correct value when gzip is enabled, so there's no need to check
   this in the data source.
5. Misc cleanups.
2015-09-29 21:10:34 +01:00
ojw28
2112bc24e3 Merge pull request #735 from b95505017/okhttp_http_data_source
Add an extension that provide DataSource using OkHttp
2015-09-29 21:06:46 +01:00
Oliver Woodman
e96e618046 Clean up expansion of sample buffers.
- The old approach was technically incorrect, because the checks
were "capacity < sampleSize" and hence neglected the fact that
the buffer position may be greater than 0 (e.g. if the caller
wants to prefix the sample with some additional data).

- Also proactively throw an exception if the buffer is too small,
rather than wait for the failure when we actually do the write.
2015-09-28 20:23:45 +01:00
Oliver Woodman
ee80be9217 Fix comment typo 2015-09-28 12:15:53 +01:00
Oliver Woodman
820433de06 Call stop() to fully play out remaining audio!
Issue: #707
2015-09-10 18:19:09 +01:00
Oliver Woodman
8c3f93d6bf Start to fix media mime types.
- Admit we don't know the mime type (using unknown mime types) rather
  than passing the container mime type.
- Pass the correct mime type for opus, vp9 and vp8, and remove the incorrect
  container checks in the corresponding extensions.
2015-09-07 13:56:54 +01:00
Oliver Woodman
e6a93a08de Update instructions for building with latest libvpx.
- Fix building with APP_ABI=all by configuring for all architectures.
- Keep vpx_dsp which is required for building successfully.
- Use perl -pi -e not sed, for building on Macs.
2015-09-01 14:24:46 +01:00
Oliver Woodman
4a9ff7b094 Correctly propagate END_OF_STREAM through Opus decoder. 2015-09-01 14:16:36 +01:00
Oliver Woodman
35a744a5d4 Use perl for in-place substitution. 2015-09-01 14:11:01 +01:00
Yu-Hsuan Lin
0df29a6497 Add an extension that provide DataSource using OkHttp 2015-08-24 00:49:41 +08:00
Oliver Woodman
cde1c27e2b Make Opus codec-specific data match the platform.
Issue: #690
2015-08-19 16:34:59 +01:00
Oliver Woodman
87457d5042 Add CodecCounters to LibvpxVideoTrackRenderer. 2015-08-13 11:19:34 +01:00
Oliver Woodman
8db1331021 Propagate MediaFormat instead of TrackInfo.
Issue #514.
2015-08-11 18:23:22 +01:00
Oliver Woodman
b2206866f0 Use audio passthrough if possible, falling back to on-device codecs.
Remove MPEG TS stream filtering based on AudioCapabilities.

Pass AudioCapabilities to MediaCodecAudioTrackRenderer so it can choose between
passthrough/raw and decoding for AC-3 tracks.
2015-08-11 18:08:23 +01:00
Oliver Woodman
6085d185fa Internal plumbing for multi-track support.
- Generalize rendererEnabledFlags to be selected track indices through
  ExoPlayerImpl/ExoPlayerImplInternal.
- Selecting an out-of-bound track index (e.g. -1) is equivalent to
  disabling a renderer prior to the generalization.
- A prepared TrackRenderer that exposes 0 tracks is equivalent to a
  TrackRenderer in the STATE_IGNORE state prior to the generalization.

Issue #514.
2015-08-11 18:06:21 +01:00
Oliver Woodman
13f4a3e3bd Common base class for SampleSource based TrackRenderers.
This will allow multi-track support when consuming from a SampleSource to
be added in a single class, rather than in 6. Prep for Issue #514.
2015-08-11 18:04:00 +01:00
Oliver Woodman
a2f10399e7 Improve error propagation 2015-07-21 10:07:49 +01:00
Oliver Woodman
ebe9ae6b13 In continueBuffering, return whether a particular track has samples.
Issue: #595
2015-07-16 19:30:14 +01:00
Oliver Woodman
31e5e0edaf Clear outputBuffer.flags in VpxDecoderWrapper.decodeBuffer()
This ensures FLAG_END_OF_STREAM doesn't get permanently stuck.
2015-07-15 11:14:37 +01:00
Oliver Woodman
c1e1497d13 Change how subtitles are laid out in the demo app.
The SubtitleLayout is now properly aligned with the surface.
This means the subtitles remain on top of the video in portrait
mode, rather than being huge and below it.
2015-07-15 11:09:20 +01:00
Oliver Woodman
194b4ae081 Fix link to be https 2015-06-26 14:23:34 +01:00