Add support to pre-initialize the DRM#725
Conversation
|
awesome work. one thing I noticed after a quick look is no need to make changes to wvdecrypter_android.cpp wvdecrypter_android_jni.cpp is the one used I have a PR open to clean that up #697 oh, and I think you need to bump the ssd version number here too if changes are made to the decrypter: |
each time i did not understand which one was used.. i will move the changes to the other file |
253a7d7 to
e5ccb6a
Compare
|
I have done the suggested changes, now is ready for review, |
|
i have a problem discovered only now (and reported also by others) because i was not aware that was needed reboot kodi every time i update ISA to make libreelec works with the updated binary the problem in my theory after a lot of tests, is that in the challenge data sometimes there are some special chars that i am not able to send to the http headers, results that in the data added in the "challengeB64" header is ignored?! and leaves the value blank i have tried also update the b64_encode helper with new code, with no improvement. and the challenge data there is always, this is the data size reported of I ran out of ideas on how to proceed UPDATE: in the |
|
found a way to keep Ap4CommonEncryption.h unchanged this is an example of the log: |
|
In GetChallengeB64() you're returning a c_str() of a local variable, the local variable is destroyed soon after the function exits so sometimes you're able to read the information in time, other times it's too late and the pointer is junk. |
|
@glennguy it seems to have worked!!! I played 6 videos without any problems, great 🤩 |
73fdaab to
5d61d89
Compare
|
i have done all tests with success |
|
I need to do some changes but can only be done after the freeze fix PR will be merged |
Please post when this is the case and I will review. |
|
Apologies, hit wrong button. No intention to close this. |
5d61d89 to
0488770
Compare
|
@phunkyfish i have rebased and done the last changes |
d0112a9 to
7d8c48a
Compare
7d8c48a to
02b3bb2
Compare
| m_session = std::shared_ptr<Session>(new Session( | ||
| manifest, url.c_str(), mfup, lt, lk, ld, lsc, manh, medh, props.GetProfileFolder(), m_width, | ||
| m_height, ov_audio, m_playTimeshiftBuffer, force_secure_decoder, drmPreInitData)); |
There was a problem hiding this comment.
For a future refactor. This function call makes little to no sense at all.
|
|
||
| int retrycount=0; | ||
| while (session_.empty() && ++retrycount < 100) | ||
| while (!drm.GetCdmAdapter()->IsSessionActive() && ++retrycount < 100) |
There was a problem hiding this comment.
Also not for this PR but this is not a good way to do this. A wait for condition would be much better. Then no need to thread::sleep_for which is expensive.
Allow add-ons to make licensed manifest request via proxy callback
02b3bb2 to
806c6c1
Compare
This PR add the support to pre-initialize the DRM with a PSSH+KID provided by an add-on via ListItem property.
The purpose is to allow add-ons to make licensed manifest requests via ISA manifest proxy callback.
In order to do licensed manifest requests is needed two data:
As discussed previously on #666 and CastagnaIT/plugin.video.netflix#1129 (comment) i have implemented all the things.
In brief:
setProperty('inputstream.adaptive.pre_init_data', 'pssh|kid')by providing the PSSH and the KID values both encoded as base64 and splitted by a
|pre_init_dataproperty data, pre initialize the DRM with the PSSH+KID providedAt this point we have the DRM challenge and the session id generated
challengeB64(encoded as base64) andsessionIdNOTE: This not change in any way the current use of the manifest request
The tests were conducted with ntfx add-on, where if the challenge/sid were wrong, video playback would not take place,
and on ARM devices it is the only way to achieve 1080P resolution.
Tested on: