Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse secure decoder while moving from secured -> clear -> secure content #4867

Closed
mikulbhatt opened this issue Sep 25, 2018 · 25 comments
Closed
Assignees

Comments

@mikulbhatt
Copy link

We observe that the decoder deinit and reinit while moving from secured to plain content and plain to secure content.

Is there a way to signal exoplayer so we can avoid de-init and re-init of decoder and ask MediaCodecRenderer to reuse the secured decoder for clear content?

@ojw28
Copy link
Contributor

ojw28 commented Sep 26, 2018

For your use case, does the secure content before and after the clear content use the same keys (e.g. is this like inserting a clear ad into a VOD stream)? Or would the second piece of secure content need a new license request?

@mikulbhatt
Copy link
Author

mikulbhatt commented Sep 26, 2018

@ojw28 yes they use the same key, yes its inserting a clear ad into a live stream, and the content of live stream has same key before and after the clear ad

@mikulbhatt
Copy link
Author

also since the drm key and license remain same in and out of AD playing secured content. I want to avoid refetching license keys everytime.

@ojw28
Copy link
Contributor

ojw28 commented Oct 3, 2018

A few problems we face here are from the point of view of implementing a general solution are:

  1. Not knowing if the second secure period will use the same keys. In some cases that period might not even be present in the manifest at the point of transitioning into the clear period, so it's unclear whether we should hold the session open or not (and if we do, should we actively refresh the keys, and when should we give up and close it).
  2. If the user joins the stream during ads, it's possible we wont even know any part of the content is secure, and so will (correctly) initialize a non-secure decoder. I can't see much we can do to avoid at least one decoder re-init in this case, when we encounter the first period containing secure content.

Are you aware of any signalling in the DASH manifest to help with this? I'd rather not have the application side-load all this information, since it feels like something the content should be able to tell us directly.

@TheJohnBowers
Copy link
Contributor

The PSSH data for key is unique per key, so if you get new unique PSSH data in the manifest that could be considered a manifest signal that the key has changed. You could keep using the the secure decoder until you see an new unique PSSH element in the manifest.

In the second case I could see being unable to determine that a secure period would come in the future in that case I think you are right, at least one re-init would be required.

@TheJohnBowers
Copy link
Contributor

So what do you think about the idea of detecting the need for a new license by watching PSSH blocks and associating them with licenses? As soon as a new one pops into the live window you could send the license request, but if there isn't a new one for a period because a) The period didn't have one at all or b) because it didn't change -- Then you would keep using the existing license until it expires.

@ojw28
Copy link
Contributor

ojw28 commented Oct 18, 2018

I think this is one thing we're planning to do, except "as soon as a new one pops into the live window" is something more like "as soon as we start to buffer it" / "X seconds before we're going to play it".

@mikulbhatt
Copy link
Author

yes, agreed! thats what we want @ojw28 . Let us know of any updates on this thread! thanks 👍

@mikulbhatt
Copy link
Author

@ojw28 any update on this, is it being prioritized? thanks.

@tonihei tonihei changed the title how to signal exoplayer to reuse secure decoder while moving from secured -> clear -> secure content Reuse secure decoder while moving from secured -> clear -> secure content May 7, 2019
@BetweenTwoBits
Copy link

@tonihei any update on this issue?

@mikulbhatt
Copy link
Author

Is this prioritized ?

@AquilesCanta
Copy link
Contributor

I am working on this.

Any content you can send to us would be valuable. If you don't want to make it public, please send it to dev.exoplayer@gmail.com. If you send an e-mail, please post a message below and I'll check it out.

@mikulbhatt
Copy link
Author

mikulbhatt commented Aug 21, 2019

@AquilesCanta you can use following profile as a test stream:

{  
   "name":"Live - Uplynk DASH Encrypted with UnEncrypted Ads",
   "uri":"https://content.uplynk.com/channel/3c367669a83b4cdab20cceefac253684.mpd?ad=cleardashnew",
   "drm_scheme":"widevine",
   "drm_multi_session":true,
   "drm_license_url":"https://content.uplynk.com/wv",
   "drm_key_request_properties":{  
      "X-DASH-SEND-ALL-KEYS":"1"
   },
   "extension":"mpd"
}

@mikulbhatt
Copy link
Author

mikulbhatt commented Aug 21, 2019

let me know if this stream is sufficient to reproduce the issue and validate your fixes. We can help you get streams with different scenarios! combination of secure/nonsecure content on live/vod streams

@mikulbhatt
Copy link
Author

Hi @AquilesCanta , is the stream provided here useful to you? let me know if you are looking for specific use case and i can try to get you a test stream for that.

@AquilesCanta
Copy link
Contributor

AquilesCanta commented Aug 30, 2019

Super useful. I've started looking into this, we should be able to push it to the dev branch relatively soon.

@mikulbhatt
Copy link
Author

Awesome!

@AquilesCanta
Copy link
Contributor

@mikulbhatt, do you think you can provide a VOD stream with at least one encrypted to clear and one clear to encrypted transition? That would ease the testing process.

@zachmanc
Copy link

zachmanc commented Sep 2, 2019

@AquilesCanta I have some VOD HLS widevine content if that would be helpful for you

@AquilesCanta
Copy link
Contributor

AquilesCanta commented Sep 2, 2019

That'd be useful too. We just need the clear/encrypted transitions.

@TheJohnBowers
Copy link
Contributor

@AquilesCanta
Copy link
Contributor

Thanks!

ojw28 pushed a commit that referenced this issue Sep 10, 2019
…ssion

Will allows to use a DrmSession for clear periods.

Issue:#4867
PiperOrigin-RevId: 267576982
ojw28 pushed a commit that referenced this issue Sep 13, 2019
ojw28 pushed a commit that referenced this issue Sep 13, 2019
Issue:#4867
PiperOrigin-RevId: 268473094
ojw28 pushed a commit that referenced this issue Sep 13, 2019
ojw28 pushed a commit that referenced this issue Sep 13, 2019
ojw28 pushed a commit that referenced this issue Oct 2, 2019
ojw28 pushed a commit that referenced this issue Oct 2, 2019
ojw28 pushed a commit that referenced this issue Oct 2, 2019
Issue:#6334
Issue:#4721
Issue:#6334
Issue:#4867
PiperOrigin-RevId: 271577773
@andrewlewis
Copy link
Collaborator

@AquilesCanta Closing as discussed, but please reopen if something else is needed. Thanks.

@AquilesCanta
Copy link
Contributor

AquilesCanta commented Oct 3, 2019

Please give this a try by setting

DefaultDrmSessionManager.Builder.setAllowPlaceholderSessions(true)

It should cause the reuse of secure decoders for clear periods (when possible).

@ojw28
Copy link
Contributor

ojw28 commented Oct 3, 2019

Should we update our DRM documentation with a section indicating how to do this?

ojw28 pushed a commit that referenced this issue Oct 4, 2019
Issue:#4867
PiperOrigin-RevId: 272698404
ojw28 pushed a commit that referenced this issue Nov 15, 2019
ojw28 pushed a commit that referenced this issue Nov 18, 2019
ojw28 pushed a commit that referenced this issue Nov 19, 2019
@google google locked and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants