Commit Graph

117 Commits

Author SHA1 Message Date
Jeff Tinker
acb47e0f9a Move OEMCrypto_Initialize earlier
Some OEMCrypto calls are happening before OEMCrypto_Initialize.
This change moves initialization earlier so it occurs before
any other calls to OEMCrypto.

bug: 10582250
Change-Id: Ic8992e8f0738dbfeb10074a4e1543bb9931a49d5
2013-10-28 15:53:52 -07:00
Jeff Tinker
ddf957faa5 Removing usage of a deprecated error code
A widevine-specific error should not have been defined in frameworks.
Submit before https://googleplex-android-review.git.corp.google.com/#/c/338406/

Change-Id: Ie47250ef987a028e09ff553881ac166214244927
2013-08-02 23:34:30 -07:00
Edwin Wong
c49fe08576 Fixes GTS crash on Nexus 10.
When the video packets are clear, they are being
combined into a full frame between MediaExtractor or
DecryptCallback (where packets are never > 64k) and
MediaCrypto/DecryptVideo (where we are seeing clear
packets > 64k).

The max block size to be passed to DecryptVideo is
specified as 64K, handling of packets larger than 64K
is undefined and OEM implementation-dependent. In the
Nexus 10 case, it generates a SEG. fault.

Solution:
Add mClearSizes vector to keep track of each clear
packet size for android_media_MediaExtractor_getSampleCryptoInfo()
to process.

In android_media_MediaExtractor_getSampleCryptoInfo(), if it
does not see kKeyEncryptedSizes meta data, it will not
process the clear vector that contains the actual packet
sizes. Add a kKeyEncryptedSizes meta data that contains a zero
length size packet to trick the JNI code to process the
clear packets.

related-to-bug: 9261447

Change-Id: Ib0b655a95e099856babaf649f4a95fc7f9c17d41
2013-06-18 17:26:06 -07:00
Jeff Tinker
47ef6eba62 Fix erroneous "format unsupported " error in Play Movies
Only the first 64K of the movie is pulled when sniffing,
if the widevine version metadata is not present in the
sniff buffer then a "format unsupported" error would occur.

This change increases the sniff buffer size to 128K.

bug: 9351294
Change-Id: If162cbea6915bf2b70122afd30e556e9206e8e43
2013-06-13 14:04:41 -07:00
John "Juce" Bruce
e8cad9485c Cannot Rewind WVM in MediaCodec Mode
The solution previously checked in as 2e0e3 is re-introduced here. However,
the MediaCodec-compatible heuristic is not used unless WVM is in Crypto Plugin
(i.e. Media Codec) mode.

To repeat from last time: The problem here is that WVM cannot independently
seek the audio and video read heads, but the API assumes it can. WVM does the
right thing for AwesomePlayer-based playback (essentially ignoring audio
seeks) but the wrong thing for MediaCodec-based playback. For MediaCodec
mode, we should respect the first seek we get for a given destination and
ignore the second.

In this part, the new heuristic is reintroduced, but the old heuristic is
maintained for use in non-Crypto Plugin mode.

Bug: 6793514
Change-Id: I7ced2bf20af117a57eec27490b0920d906a8a684
2012-10-15 14:22:37 -07:00
John "Juce" Bruce
2ce9ab8e67 [WVDRM] Fix effectively-unlimited memory usage
Change 14f0d to read the maximum buffer size from a device property did not
work correctly on Mako and Prime devices, as they did not have the property
set, and the code to fall back to a default value was not working. An empty
string would be read instead of the default value, resulting in a maximum of
zero. Because Widevine Media Kit would then subtract a few megabytes from this,
it would underflow, giving a maximum buffer size of several gigabytes. This
would lead to the download code trying to pre-buffer the entire, many-gigabyte
movie. As the media server's memory usage grew and grew, other programs would
become starved for memory, leading to most other processes on the phone being
forced to close. Eventually, the playback app, the media server, or some other
crucial piece of functionality would be starved, resulting in a crash.

The fix is to fix how we get the default, so that when the property is not
available, we get a sensible result. We check the return value of property_get.
If it is greater than zero, the property was read successfully, and we parse
the answer. If it is equal to (or less than) zero, we fall back to the default
value.

Bug: 7222769
Change-Id: Ie6186a0533036ab8fa45b1e467611d55f7c345ac
2012-10-03 19:12:35 -07:00
Jeff Tinker
71422e7a2a Merge "[WVDRM] Fix for stuttering on low bandwidth" into jb-mr1-dev 2012-10-02 01:26:13 -07:00
Jeff Tinker
54993c50e9 [WVDRM] Fix for stuttering on low bandwidth
Reintroduces the play/pause rebuffering logic we eliminated
in JB zero day to fix double spins and slow startup - but
activates that logic only based on a comparison of the
current bandwidth measurement and the lowest bitrate track
in the movie.

Needs to be submitted with related changes in /frameworks/av

bug: 7230071
Change-Id: Ib3859a961bd3901a9c4df01eeab2b8b75f49aefe
2012-10-01 15:17:07 -07:00
Edwin Wong
ca21c93f66 Revert "When Running in MediaCodec Mode, Widevine Freezes If You Rewind"
This reverts commit 2e0e32f9f7

Change-Id: I1362839633bca4260d83f470a780d93b8de431ca

related-to-bug: 7216099
related-to-bug: 7223566
2012-09-28 17:47:37 -07:00
John "Juce" Bruce
b092b158d2 Merge "When Running in MediaCodec Mode, Widevine Freezes If You Rewind" into jb-mr1-dev 2012-09-18 14:37:52 -07:00
John "Juce" Bruce
2e0e32f9f7 When Running in MediaCodec Mode, Widevine Freezes If You Rewind
There was a subtle interaction between Widevine's libraries and MediaCodec
mode.  Widevine's code assumed (erroneously) that video seeks would always
happen before audio seeks, and because we can't seek audio and video
independently from each other, we would ignore audio seeks but respect video
seeks.  This led to a problem since MediaCodec mode calls seeks in arbitrary
order.

Fix is to always respect the first request we get to seek and ignore the
second.

Bug: 6793514
Change-Id: Ic9ec60e0e0f606c7a0de6283dd4c30318eebdbad
2012-09-17 15:54:42 -07:00
Jeff Tinker
33b24fba9d [WVDRM] Allow adaptive logging of more than 10 tracks
Change-Id: I9d2f8efcc658532dc2a0b1d69b8551444120f664
related-to-bug: 7173307
2012-09-17 15:08:42 -07:00
Edwin Wong
d72b67cdeb Add getError and setError to propagate error code from WVMMediaExtractor up to player.
Error code from the plugin is not propagated from WVMExtractorImpl.cpp to the MediaPlayer.
The two APIs addresses this issue and provide a path for the player to retrieve the last error.

Change-Id: I60040eaf2d396379eecca46bfe333c44a39c35ec
related-to-bug: 7073630
2012-09-11 17:38:57 -07:00
John "Juce" Bruce
521a13b5d7 Merge "Widevine Delivers Frames "Much Too Late" On Startup" into jb-mr1-dev 2012-08-24 15:03:12 -07:00
Jeffrey Tinker
415ce6714a Merge "Send current bandwidth info event when buffering occurs" into jb-mr1-dev 2012-08-23 17:24:37 -07:00
John "Juce" Bruce
c6c8b6f27b Widevine Delivers Frames "Much Too Late" On Startup
Because Widevine's libraries were not seeking to the start of playback, the
first bitrate track in the video was being selected rather than the most
bandwidth-appropriate.  For low-bandwidth connections, this could lead to a
"locked to group-of-pictures" scenario where Widevine quickly realizes that it
needs to change bitrates but cannot change until the next I-frame, which at the
current bandwidth will not arrive before it runs out of data.  The result is
frames being delivered late, leading to the "Much Too Late" message from
AwesomePlayer reported in the bug.

The solution is to start playback slightly differently, allowing us to use our
adaptive streaming logic to select the initial bitrate for the video.  By
specifying a start point at the beginning of the movie instead of just "now,"
we cause a seek internally, which allows us to adapt bitrates immediately at
the start of playback rather than after it has begun.  This is the common way
of starting playback on other Widevine platforms.  Android has been an
exception until now.

Bug: 6621556
Change-Id: Iaf98106f7f597ae3f0375129ac3a93aa3cb04a2c
2012-08-23 16:49:46 -07:00
Jeffrey Tinker
326dde3b28 Send current bandwidth info event when buffering occurs
There is a dependent change in frameworks/av

Change-Id: Ic189654486936a501a1b45c5acb442753303d362
related-to-bug: 5883234
2012-08-23 02:01:21 -07:00
Jeffrey Tinker
14f0deafac Configure the Widevine cache buffer size via a property
The property ro.com.widevine.cachesize may be set on a device to override the
default stream buffer cache size.

related-to-bug: 6819880

Change-Id: I27da154e38289c5d1f5f2f5f424202253d0721cc
2012-08-22 09:37:36 -07:00
Edwin Wong
e9f5431e78 Revert Widevine 6.0.0 -> 4.5.0 libraries
Includes Widevine libraries Version 4.5.0.7809

Also fixed samplePlayer's MediaCodec mode not running and
WVDrmInfoRequestStatusKey returning incorrect value.

Change-Id: Ibcc6d313790670a908ada93be80d6bf55a67b4ed
related-to-bug: 6929628
related-to-bug: 6833718
related-to-bug: 6889322
2012-08-03 13:33:58 -07:00
Jeff Tinker
2c8bb4721b am d734bc25: Increase Widevine stream buffer size from 10MB to 16MB for Q
* commit 'd734bc25b01b5df40b026e658a0053cc63b8bcbd':
  Increase Widevine stream buffer size from 10MB to 16MB for Q
2012-07-13 13:40:42 -07:00
Jeff Tinker
d734bc25b0 Increase Widevine stream buffer size from 10MB to 16MB for Q
Provide better support for 1080p video streaming.

Change-Id: I3d17f7bdc631ee82b9062445dca8ebd42eaf8d8a
related-to-bug: 6818319
2012-07-13 10:20:24 -07:00
Ying Wang
e36b59b8d3 Use board config variable BOARD_WIDEVINE_OEMCRYPTO_LEVEL
Instead of grepping out the oemcrypto level from PRODUCT_PACKAGES, which
is very fragile.

Change-Id: I1ac5b8ace25dd4798d3383304f01496f12193526
2012-06-05 14:29:27 -07:00
Jeff Tinker
e01879128b am 1024b041: Part of fix for double spins & faster startup
* commit '1024b041e824bb6eb232971fc4a2984d63f7e079':
  Part of fix for double spins & faster startup
2012-06-01 11:25:55 -07:00
Jeff Tinker
1024b041e8 Part of fix for double spins & faster startup
This change alters the way that the media player
interacts with the Widevine adaptive streaming buffer
logic.  It eliminates the reliance on cached buffer
duration to determine pause/play states and instead
only generates buffering events when the widevine
library is not producing data (i.e. when it is
buffering).  This eliminates unnecessary pause and
rebuffer cycles, reducing startup time and the
frequency and duration of spinners.

Multi-repo commit, depends on related changes in frameworks/av

Change-Id: I5b71f954268fbd390eed7f27db98a1bb470d5cfb
related-to-bug:6503294
related-to-bug:6463780
2012-05-31 23:26:14 -07:00
Fred Gylys-Colwell
5b88678ad7 am b83e7ca1: Merge "Fix pause at end of movie." into jb-dev
* commit 'b83e7ca14ab7241c1bbfb50dd6d97edf160f2b74':
  Fix pause at end of movie.
2012-05-31 16:38:21 -07:00
Fred Gylys-Colwell
b83e7ca14a Merge "Fix pause at end of movie." into jb-dev 2012-05-31 16:34:29 -07:00
Fred Gylys-Colwell
0b7d0f3fe3 Fix pause at end of movie.
The function WVMExtractorImpl::getCachedDurationUs returns the cached buffer
size in microseconds, and sets a status to ERROR_END_OF_STREAM at the end of
the movie.  The AwesomePlayer will pause if the cache is too small and the
status is not EOS.  In bug 6277231, the player would pause just before the EOS
marker would have been seen by the Widevine library.

This change checks the current play time against the total movie duration.  If
there is less than 10 seconds left in the movie, the EOS flag is set.

related-to-bug: 6277231

Change-Id: I8dbf60c82c41df485185f85e72452aab0a6a9686
2012-05-31 16:01:42 -07:00
James Dong
7a5da70046 am 0fb73729: Added some debugging log messages for tracking down ANR related issue.
* commit '0fb73729164f2d8fc294aa49888153b88944c312':
  Added some debugging log messages for tracking down ANR related issue.
2012-05-29 16:33:40 -07:00
James Dong
0fb7372916 Added some debugging log messages for tracking down ANR related issue.
Change-Id: I2d338b5e4efbc13acdb3ed8f592d405052ecad9d
related-to-bug: 6565826
2012-05-29 14:08:36 -07:00
James Dong
fdbb5fa10d am f7ce4a9b: Merge "Add bandwidth to adaptive log" into jb-dev
* commit 'f7ce4a9b9aacd01b0a47439a1c33f4e9ace24c5c':
  Add bandwidth to adaptive log
2012-05-21 12:39:33 -07:00
Fred Gylys-Colwell
9cb8f2b91b am 382a5286: Merge "Fix HLS Live Playback with Widevine DRM." into jb-dev
* commit '382a5286b5c8ccfd6fe501ed5bd53cc8630b9de4':
  Fix HLS Live Playback with Widevine DRM.
2012-05-21 11:51:38 -07:00
Jeff Tinker
5658b8dc13 resolved conflicts for merge of 98c35aa4 to master
Change-Id: I32de004b575729f9b1852517ad5df71395e0ae69
2012-05-18 05:17:44 -07:00
Jeff Tinker
1c084694fe Add bandwidth to adaptive log
Change-Id: I79bf860db76bbdc6020d617f918cafb1f73d54de
related-to-bug: 6500173
2012-05-17 06:41:27 -07:00
Fred Gylys-Colwell
382a5286b5 Merge "Fix HLS Live Playback with Widevine DRM." into jb-dev 2012-05-16 20:29:08 -07:00
Fred Gylys-Colwell
ff793bcaf0 Fix HLS Live Playback with Widevine DRM.
In WVMExtractorImpl.cpp, a structure of type WVCallbacks was not initialized.
In version 4.5.0 of the Widevine library, this is just a struct (not a class)
so it does not have a constructor method.  This record was being set with
garbage default values and was causing problems setting up playback.  This may
have caused other stability issues after we reverted to 4.5.0.  In the future,
when we push forward to version 6.0 of the Widevine library, this change should
be removed.

In WVMediaSource.cpp, a flag was set to strip off the ATDS headers.  This was
redundent, and causing seg faults, for live stream.

related-to-bug: 6454710

Change-Id: I3edeb40c731021b2f31f639416188d4a1c002cc5
2012-05-16 20:12:28 -07:00
Jeff Tinker
e9c40a625c Fix native fault in WVMMediaSource::DecryptCallback
This change resolves a lifetime issue between the media extractor
and media sources.  The extractor was being passed as a context
object to a callout in the WV libs.  In some cases, a pointer to
the extractor would be delivered to the callout after the extractor
had been released.  This change assigns the responsibility of the
lifetime of the context object to the media source, to ensure that
a ref is always held on the context object during the lifetime of
the media source.

Change-Id: Ic7a57a1c8496a4798fe590ec356b8a19a4f69967
related-to-bug: 6502322
2012-05-16 19:08:25 -07:00
James Dong
c477bb957f am 79e250e9: If number of audio channels returned is 0, report an error
* commit '79e250e999b7002dc39fa8ee31630fabde6132a8':
  If number of audio channels returned is 0, report an error
2012-05-15 18:14:16 -07:00
James Dong
79e250e999 If number of audio channels returned is 0, report an error
related-to-bug: 6500580

Change-Id: I55cab0bde30841c31f671d03f99c59d337fea564
2012-05-15 17:54:59 -07:00
Jeff Tinker
35064be9c6 Revert Widevine 6.0.0 -> 4.5.0 libraries
DO NOT MERGE

Source and library changes to roll back to 4.5.0, including
maintaining the DRM HAL support.

Includes Widevine libraries 4.5.0-7111

Change-Id: I420c6990748e95ad7516ecb2397ebf7707a157f4
related-to-bug: 6492434
2012-05-14 15:06:13 -07:00
Jeff Tinker
1eaccb6669 Fix intermittent native fault in Widevine
Change-Id: I19e0b19eb9e53ca19dea10a46cf286fb091d7542
related-to-bug: 6432496
2012-05-02 13:10:29 -07:00
Jeff Tinker
3397e72468 Fix offline license requests and error events
Corrected a regression in error event reporting and a
mismatch in asset paths during rights acquisition.

Also requires https://android-git.corp.google.com/g/#/c/185898/

Contains Widevine libraries version 6.0.0-6957

Change-Id: I4a7603a86feaf437673fc73f0cccb6065dbcce67
related-to-bug: 6414503
2012-05-01 15:46:14 -07:00
Jeff Tinker
ec2d703970 Fix ERROR_IO due to timeout on video stream and corrupt samples
This change applies to the wv extractor when used in conjunction
with new MediaCodec model.

Change-Id: I999990ff41d35641110a58472f1cdb8c4c7db02e
related-to-bug: 5986621
2012-05-01 13:10:42 -07:00
Jeff Tinker
a9f82e979f Add CryptoPluginMode to WV extractor
Allows the WV extractor to run in a mode that is compatible with
the DRM CryptoPlugin HAL API, where decryption is deferred
until the encrypted data is sent through the CryptoPlugin to
the codec.

This patch does:
 (1) Adds a flag mCryptoPluginMode that controls this behavior
     [Note: need framework support to enable/disable this]
 (2) Accumulates information in track metadata to delineate
     crypto unit boundaries for the CryptoPlugin

related-to-bug: 5986621

Change-Id: I3318d5cde38c7b02a7bdb56aca9aece852c9781c
2012-04-26 14:50:28 -07:00
Jeff Tinker
e91ac5af7a Merge "Remove the annoying WVStreamControl version prints from command line test apps" 2012-04-12 09:24:13 -07:00
Jeff Tinker
86ecba13ef Remove the annoying WVStreamControl version prints from command line test apps
Change-Id: I946c4e62a68b2bf9a10ad957feb9424aa606755e
2012-04-11 20:30:23 -07:00
Jeff Tinker
300d172ba4 [WVDRM] Reorg of binary libs into proc-specific folders
Rahul's changes in preparation for adding x86 support

Change-Id: Ib51dfa72291857c44be37595be2205dd040fc0dd
related-to-bug: 6276794
2012-04-10 17:26:58 -07:00
Jeff Tinker
176a13e8cc Merge "Fix for HLS live streaming" into ics-mr1 2012-04-09 22:56:36 -07:00
Jeff Tinker
9a7a7879f1 Merge "Upgrade of Widevine libraries from 4.5.0 to 6.0.0" 2012-04-06 18:11:18 -07:00
Jeff Tinker
462dc030f8 Upgrade of Widevine libraries from 4.5.0 to 6.0.0
Upload for Dave Parsons

6.0.0 Widevine libraries contain the features required
to support multiple audio tracks and subtitles.  This
is establishing the baseline for those features.

Change-Id: If12074bb2e4364c8107339e2f69453c40698e91f
related-to-bug: 5880566
2012-04-05 15:49:32 -07:00
Jeff Tinker
83be76c303 Merge "Fix an intermittent issue with HLS live streaming" 2012-04-05 12:02:45 -07:00